01 · Learn the idea
What y = mx + b says
Every straight line that is not vertical has an equation of the form y = mx + b. This is called slope-intercept form, because its two numbers are the slope and the y-intercept.
The number m is the slope: how much y changes each time x goes up by 1. The number b is the y-intercept: the value of y when x is 0. On a graph, the line crosses the y-axis at the point (0, b).
Look at y = 2x + 1. The slope is 2 and the y-intercept is 1. Put in x = 0 and you get y = 2 × 0 + 1 = 1, so the line crosses the y-axis at (0, 1). Put in x = 1 and you get y = 3, which is 2 more.
So writing the equation of a line always comes down to two jobs. Find the slope, m. Then find the y-intercept, b. Sometimes you can read b straight off. Sometimes you have to work back to it from a point you know.
- y = 2x + 1
y = mx + b
02 · Build understanding
Worked example: from a graph
A line crosses the y-axis at (0, 4) and passes through (4, −2), as in the graph. Write its equation.
Step 1: Find the slope from the two points. The change in y is −2 − 4 = −6 and the change in x is 4 − 0 = 4. The slope is −6/4 = −3/2.
Step 2: Find the y-intercept. The line crosses the y-axis at (0, 4), so you can read it directly: b = 4.
Step 3: Put m and b into y = mx + b. The equation is y = −(3/2)x + 4.
Step 4: Check with another point on the graph. The line also passes through (2, 1). Put in x = 2: −(3/2) × 2 + 4 = −3 + 4 = 1. That matches.
03 · Build understanding
Worked example: from a table with no x = 0
A table shows a linear relationship with x: 3, 5, 9 and y: 2, 6, 14. Write its equation.
Step 1: Find the slope. From (3, 2) to (5, 6), the change in y is 6 − 2 = 4 and the change in x is 5 − 3 = 2. The slope is 4/2 = 2. So far the equation is y = 2x + b.
Step 2: The table has no column for x = 0, so work back from a point. Put (3, 2) into y = 2x + b: 2 = 2 × 3 + b, which is 2 = 6 + b.
Step 3: Solve for b. Subtract 6 from both sides: b = 2 − 6 = −4.
Step 4: Write the equation: y = 2x − 4.
Step 5: Check with a point you did not use. For x = 9: 2 × 9 − 4 = 18 − 4 = 14, which is the table's value.
You can also picture Step 2 as walking back along the line. From x = 3 to x = 0 is 3 steps left, and each step lowers y by 2, so y drops by 6, from 2 to −4.
04 · Build understanding
Reading m and b from words
In a description, the slope is the amount that repeats: per hour, each week, for every mile. The y-intercept is the amount at the start, when x is 0: a fee, a deposit, a starting level.
A plumber charges $45 to come to the house plus $60 an hour. The $60 repeats, so m = 60. The $45 is charged at 0 hours, so b = 45. The cost for x hours is y = 60x + 45.
A phone starts at 80 percent charge and loses 12 percent each hour. The amount goes down, so the slope is negative: m = −12. The starting level is b = 80. The charge after x hours is y = −12x + 80.
05 · Build understanding
Worked example: a description that hides the start
A pool is being filled at a steady rate. After 2 hours it holds 1,300 gallons. After 5 hours it holds 2,500 gallons. Write an equation for the gallons, y, after x hours.
Step 1: Turn the facts into points: (2, 1,300) and (5, 2,500).
Step 2: Find the slope. The change in y is 2,500 − 1,300 = 1,200 gallons and the change in x is 5 − 2 = 3 hours. The slope is 1,200/3 = 400 gallons per hour.
Step 3: Work back to the y-intercept with (2, 1,300): 1,300 = 400 × 2 + b, so 1,300 = 800 + b and b = 500.
Step 4: Write the equation: y = 400x + 500. The 500 means the pool already held 500 gallons when the filling started.
Step 5: Check with the other point. For x = 5: 400 × 5 + 500 = 2,000 + 500 = 2,500 gallons, as given.
06 · Build understanding
Mistakes to watch for
Swapping m and b. For the plumber, writing y = 45x + 60 charges $45 an hour and a $60 visit fee. The number that repeats goes with x.
Using the first y in a table as b. In the table x: 3, 5, 9 and y: 2, 6, 14, the first y is 2, but that belongs to x = 3. The y-intercept belongs to x = 0, and it is −4.
Losing a sign when working back. From 2 = 6 + b, some students write b = 4. Subtract 6 from both sides: b = 2 − 6 = −4. A quick check catches it, since 2 × 3 + 4 = 10, and the table says 2.
Apply and explain
Your turn
A table shows a linear relationship with x: 2, 4, 8 and y: 11, 17, 29. Explain how to write its equation in slope-intercept form, and how you can check your equation.
Use paper or explain your thinking aloud before opening the solution.
Check your reasoning
First find the slope from two points: from (2, 11) to (4, 17) the change in y is 6 and the change in x is 2, so m = 6/2 = 3. The table has no x = 0, so work back from a point: 11 = 3 × 2 + b gives 11 = 6 + b, so b = 5. The equation is y = 3x + 5. Check with the point not used: 3 × 8 + 5 = 29, which matches the table.
- Finds a slope of 3 from two points of the table.
- Substitutes a point to find b = 5, or steps back to x = 0.
- Writes y = 3x + 5 and checks it with a point from the table.
Ready to practice?
Try the questions, get feedback, and review your reasoning.
Write an equation in slope-intercept form: practice →