01 / 20

Writing Linear Equations
\( y = mx + b \)

Learn to write the equation of a line from a graph, table, or real-world context using slope-intercept form.

Pre-Algebra

What Is a Linear Equation?

A linear equation describes a relationship between two variables that forms a straight line when graphed. Every point on the line is a solution to the equation.

\(0\)
\(1\)
\(2\)
\(3\)
\(1\)
\(2\)
\(3\)
\(x\)
\(y\)
\(b = 1\)
\((1, 3)\)

The Two Key Ingredients

\( m \) : Slope
The rate of change: how much \( y \) increases for every 1-unit increase in \( x \). Computed as \( m = \frac{\text{rise}}{\text{run}} \).
\( b \) : Y-Intercept
The point where the line crosses the y-axis: the value of \( y \) when \( x = 0 \).

Why Does This Matter?

Linear equations model countless real-world situations: earning money over time, tracking distance traveled, measuring growth, or comparing phone plans. Writing the equation lets you predict values you haven't observed yet.

★ Predict
Find future or missing values by plugging in \( x \).
★ Compare
See which option grows faster by comparing slopes.
★ Communicate
Express a pattern in one concise equation.

The Slope-Intercept Form

\(y = mx + b\)
slope
y-intercept

Reading \( m \) and \( b \) from a Graph

run = 2
rise = 3
\(0\)
\(1\)
\(2\)
\(3\)
\(4\)
\(1\)
\(2\)
\(3\)
\(4\)
\(x\)
\(y\)
\(b = 1\)
\((2, 4)\)

Positive vs Negative Slope

Positive Slope
Line goes up from left to right. \( m > 0 \). Example: \( y = 2x + 3 \).
Negative Slope
Line goes down from left to right. \( m < 0 \). Example: \( y = -x + 5 \).
\(m > 0\) (uphill)
\(m < 0\) (downhill)

Writing from a Table

\( x \) 0 1 2 3 4
\( y \) 5 8 11 14 17
1
Find the y-intercept: when \( x = 0 \), \( y = \) 5, so \( b = 5 \).
2
Find the slope: each time \( x \) goes up by 1, \( y \) goes up by 3. So \( m = \frac{3}{1} = 3 \).
3
Write the equation: \( y = 3x + 5 \).

Writing from a Real-World Context

1
Identify the rate (slope): $12 per pizza means \( m = 12 \).
2
Identify the starting value (y-intercept): $8 delivery fee is paid even with 0 pizzas, so \( b = 8 \).
3
Write the equation: \( y = 12x + 8 \).

How to Apply the Method

1
Identify the source: Are you given a graph, a table, or a word problem?
2
Find \( b \) (y-intercept): Look for the value of \( y \) when \( x = 0 \). On a graph, it's where the line crosses the y-axis.
3
Find \( m \) (slope): Pick two points and calculate \( m = \frac{y_2 - y_1}{x_2 - x_1} \). In a context, identify the "per" rate.
4
Substitute into \( y = mx + b \): Plug in your values of \( m \) and \( b \).
5
Verify: Test a known point from the original data to make sure it satisfies your equation.

Example 1: From a Graph

\(0\)
\(1\)
\(2\)
\(3\)
\(4\)
\(5\)
\(0\)
\(1\)
\(2\)
\(3\)
\(4\)
\(5\)
\(x\)
\(y\)
\((0, 4)\)
\((2, 2)\)

Example 2: From a Table

\( x \) 2 4 6 8
\( y \) 1 5 9 13
1
Find the slope: \( m = \frac{5 - 1}{4 - 2} = \frac{4}{2} = 2 \).
2
Find \( b \): \( x = 0 \) isn't in the table, so use a known point. Plug \((2, 1)\) into \( y = 2x + b \): \( 1 = 2(2) + b \), so \( b = -3 \).
3
Write the equation: \( y = 2x - 3 \).
4
Verify: Check \((6, 9)\): \( 2(6) - 3 = 9 \). ✓

Example 3: Word Problem

1
Starting amount (y-intercept): 200 gallons at time 0, so \( b = 200 \).
2
Rate of change (slope): 25 gallons per minute, so \( m = 25 \).
3
Equation: \( y = 25x + 200 \).
4
Verify: After 4 minutes: \( y = 25(4) + 200 = 300 \) gallons. ✓

Common Mistakes to Avoid

✕ Swapping Rise and Run
Computing \( \frac{x_2 - x_1}{y_2 - y_1} \) instead of \( \frac{y_2 - y_1}{x_2 - x_1} \). Remember: rise (y) over run (x).
✕ Forgetting the Sign
A line going downhill has a negative slope. If you get a positive number for a downhill line, check your subtraction order.
✕ Wrong Y-Intercept
Reading the x-intercept (where the line crosses the x-axis) instead of the y-intercept (where it crosses the y-axis).

Summary: Three Sources

Source How to find \( m \) How to find \( b \)
Graph Count \(\frac{\text{rise}}{\text{run}}\) between two points Read where line crosses y-axis
Table Compute \( \frac{\Delta y}{\Delta x} \) from two rows Find \( y \) when \( x = 0 \), or solve for \( b \)
Context Identify the "per" rate Identify the starting/fixed amount

Question 1 of 5

A line passes through \((0, 3)\) and \((2, 7)\). What is the equation of the line?

Question 2 of 5

A table shows: when \( x = 1 \), \( y = 10 \); when \( x = 3 \), \( y = 4 \). What is the slope?

Question 3 of 5

A gym charges a $30 sign-up fee plus $15 per month. Which equation represents the total cost \( y \) after \( x \) months?

Question 4 of 5

The equation of a line is \( y = -4x + 12 \). What is the y-intercept?

Question 5 of 5

A line has slope \( \frac{1}{2} \) and passes through the point \((4, 5)\). What is the equation?