Math 8 · 8.EE.B.6 · 8.F.B.4

Slope-intercept form

A straight line crosses the y-axis at one height and climbs at one steady rate. Are those two numbers enough to say exactly which points are on it, and can you see them in its equation?

Where you are 11 in Linear relationships

When you reach for it

A straight line is pinned down by two facts: where it crosses the y-axis, and how steeply it climbs. Written in the form

y = mx + b

its equation shows both at a glance. The number m is the Slope, and b is the y-intercept, the value of y where the line crosses the y-axis. This way of writing a line is called slope-intercept form.

Reach for it whenever you want to read a line rather than just own an equation for it: to say how fast one quantity changes with another and where it starts, to draw the line, to compare two lines, or to turn “an opening deposit of 50 dollars, then 20 dollars a week” into an equation. When the quantities carry units, m is a rate of change, such as dollars per week, and b is the starting value, the amount when the input is 0.

The lesson takes two days. Part 1 (Examples 1 to 4) shows why every line that is not vertical has an equation of this form, then reads and writes such equations. Part 2 (Examples 5 to 7) rewrites other equations into this form, reads m and b off a graph or a table, and gives both numbers their units.

The procedure

Part 1: why a line is y = mx + b

The y-intercept. A line that is not vertical is not parallel to the y-axis, so it crosses the y-axis at exactly one point. Every point of the y-axis has x-coordinate 0, so the crossing point is (0, b) for some number b, and that number is the y-intercept. Some books give the name to the point (0, b) rather than to the number b; both carry the same information.

The equation. Suppose the line has slope m, and let (x, y) be any point on it other than (0, b), so that x \neq 0. Every pair of points on a line gives the same slope, so the pair (0, b) and (x, y) gives m as well. By the slope formula,

\frac{y - b}{x - 0} = m

Figure 1 shows this as a slope triangle: from (0, b) the run is x and the rise is y - b. Multiplying both sides by x is allowed because x \neq 0, and it gives

y - b = mx

Adding b to both sides gives

y = mx + b

The point (0, b) fits the equation too, because m \cdot 0 + b = b. So every point of the line satisfies y = mx + b.

x y
(0,\,b)
(x,\,y)
x
y-b
Figure 1From (0, b) to any other point (x, y) of the line, the run is x and the rise is y - b, and rise over run is the slope m.

The reverse is also true. Take any pair (x, y) with y = mx + b. If x = 0, then y = b and the point is (0, b), which is on the line. If x \neq 0, the same steps run backwards to \displaystyle \frac{y - b}{x} = m, so the line through (0, b) and (x, y) has slope m. Two lines through the same point with the same slope are the same line, so (x, y) is on our line. That is what lets the equation stand in for the line: a point lies on the line exactly when its coordinates make the equation true.

Reading m and b. Once y stands alone on one side and the other side is a number times x plus a number, the number multiplying x is the slope and the number added on is the y-intercept. A minus sign belongs to the number after it, since subtracting is adding the opposite. A term that is not written is a zero.

Writing the equation. The derivation used nothing but m and b, so a line with slope m and y-intercept b is y = mx + b, with the two numbers put in their places.

The starting value. When x counts something that begins at zero, such as hours since a start or climbs made, the moment x = 0 is the start, and b is the value of y then. The slope is the change in y for each one unit of x. “Start at b, then change by m for each step” is exactly y = mx + b: after x steps the change is m added x times, which is mx, on top of the starting b.

Part 2: getting to y = mx + b, and reading it off a picture

Rewriting. An equation of a line often arrives in another shape, such as Ax + By = C (standard form) or with a bracket on one side, as in Example 5(b). Its slope and intercept are hidden until y is alone. Rewriting is solving the equation for y: treat x as if it were a number, use the distributive property to clear any brackets, add or subtract the same thing on both sides to leave only the y term on one side, and divide every term on both sides by the number in front of y. Each of these steps gives an equation with exactly the same solutions as the one before, so the rewritten equation describes the same line.

From a graph. The y-intercept is the height at which the line crosses the y-axis. The slope is rise over run between two points of the line, read as in Slope from a graph or a table, from grid corners where you can. If a square does not stand for 1 unit on each axis, turn the counts of squares into the axis units before dividing.

From a table. If a row has x = 0, its y is b. The slope is the change in y over the change in x between two rows, once neighboring rows have been checked to give the same slope, so that the rows do lie on one line. If no row has x = 0, use the equation itself: every row satisfies y = mx + b, so

b = y - mx

for any row.

Units. The slope carries units of y per unit of x, such as dollars per climb or centimeters per hour. The intercept carries the units of y alone.

Worked examples

Example 1

Reading the slope and the intercept

Give the slope and the y-intercept of each line: (a) y = 6x - 7, (b) \displaystyle y = 6 - \frac{2}{5}x, (c) y = 9x, (d) y = -4.

Solution

(a) Subtracting 7 is adding -7, so the equation is y = 6x + (-7). Matching it with y = mx + b gives m = 6 and b = -7. The line climbs 6 for every 1 across and crosses the y-axis at (0, -7).

(b) The terms come in the other order. Since \displaystyle 6 - \frac{2}{5}x = 6 + \left(-\frac{2}{5}x\right) and addition is commutative, this is \displaystyle y = -\frac{2}{5}x + 6, so \displaystyle m = -\frac{2}{5} and b = 6. The minus sign belongs to the slope, and the line falls from left to right.

(c) Nothing is added on, so the equation is y = 9x + 0, and m = 9 and b = 0. The line passes through the origin: it is a direct variation, the proportional case of slope-intercept form.

(d) There is no x term, so the equation is y = 0x + (-4), and m = 0 and b = -4. Every point of the line has height -4 whatever its x: the line is horizontal.

Example 2

Writing a line from its slope and intercept

(a) Write the equation of the line with slope \displaystyle -\frac{2}{3} and y-intercept 4. Do the points (3, 2) and (-6, 9) lie on it?

(b) Write the equation of the line with slope 5 that crosses the y-axis at (0, -1.5).

Solution

(a) Put \displaystyle m = -\frac{2}{3} and b = 4 in their places in y = mx + b:

y = -\frac{2}{3}x + 4

Test each point in the equation. For (3, 2), the right-hand side is \displaystyle -\frac{2}{3}(3) + 4 = -2 + 4 = 2, which is the point’s y, so (3, 2) is on the line. For (-6, 9), the right-hand side is \displaystyle -\frac{2}{3}(-6) + 4 = 4 + 4 = 8, not 9, so (-6, 9) is not on the line.

(b) The y-intercept is the y-coordinate of the crossing point, so b = -1.5, and adding -1.5 is subtracting 1.5:

y = 5x - 1.5
Example 3

A climbing-wall card

Hollis loads 60 dollars onto a gym’s climbing-wall card. Each climb takes 7.50 dollars off the card. (a) Write the balance B, in dollars, after n climbs, in slope-intercept form. (b) Say what the slope and the intercept mean. (c) What is the balance after 5 climbs, and how many climbs does the card pay for?

Solution

(a) Before any climb, when n = 0, the balance is 60 dollars, so b = 60. Each climb changes the balance by the same -7.50 dollars, so the balance is linear in n with slope m = -7.5 dollars per climb:

B = -7.5n + 60

(b) The balance goes down 7.50 dollars with every climb, which is why the slope is negative. The intercept, 60 dollars, is the balance on the new card before the first climb.

(c) After 5 climbs, B = -7.5(5) + 60 = -37.5 + 60 = 22.5, so 22.50 dollars is left. The card is empty when B = 0:

-7.5n + 60 = 0

Adding 7.5n to both sides gives 7.5n = 60, and dividing by 7.5 gives n = 8. The card pays for exactly 8 climbs. Since n can only be a whole number from 0 to 8, the graph of this situation is nine separate dots lying on the line B = -7.5n + 60, not the whole line.

Example 4

A line through a point on the y-axis

A line passes through (0, -3) and (4, 3). Write its equation in slope-intercept form, and decide whether (-6, -12) and (10, 11) lie on it.

Solution

The point (0, -3) has x = 0, so it is where the line crosses the y-axis, and b = -3. The slope comes from the slope formula with the two given points:

m = \frac{3 - (-3)}{4 - 0} = \frac{6}{4} = \frac{3}{2}

So the line is

y = \frac{3}{2}x - 3

Check with the point that was not used for b: \displaystyle \frac{3}{2}(4) - 3 = 6 - 3 = 3, which is right. For (-6, -12): \displaystyle \frac{3}{2}(-6) - 3 = -9 - 3 = -12, so it is on the line. For (10, 11): \displaystyle \frac{3}{2}(10) - 3 = 15 - 3 = 12, not 11, so it is not.

When neither given point is on the y-axis, Point-slope form and the line through two points takes over.

Example 5

Rewriting into slope-intercept form

Rewrite each equation in slope-intercept form, and give its slope and y-intercept: (a) 8x + 2y = 10, (b) y - 3 = 2(x + 1), (c) 5x - 3y = 9.

Solution

(a) Subtract 8x from both sides, which leaves the y term alone on the left: 2y = -8x + 10. Now divide both sides by 2. Dividing a sum by 2 divides each term by 2 (the distributive property), so

y = -4x + 5

and m = -4, b = 5.

(b) Clear the brackets with the distributive property: 2(x + 1) = 2x + 2, so y - 3 = 2x + 2. Add 3 to both sides:

y = 2x + 5

so m = 2 and b = 5. Check: at x = 0 the original equation says y - 3 = 2(0 + 1) = 2, so y = 5, which is b.

(c) Subtract 5x from both sides: -3y = -5x + 9. Divide every term on both sides by -3. Dividing by a negative number changes the sign of every term: \displaystyle \frac{-5x}{-3} = \frac{5}{3}x and \displaystyle \frac{9}{-3} = -3. So

y = \frac{5}{3}x - 3

and \displaystyle m = \frac{5}{3}, b = -3. Check with a point: x = 3 gives y = 5 - 3 = 2, and in the original equation 5(3) - 3(2) = 15 - 6 = 9.

Example 6

Reading the pool’s graph

Figure 2 shows the depth d of the water in a pool, in centimeters, t hours after filling began. Find the slope and the intercept with their units, write the equation, and say what each number means. If the filling stays steady, how deep is the water after 6.5 hours, and when does it reach 175 centimeters?

0 1 2 3 4 5 6 7 8 0 40 80 120 160 time (hours) depth (cm) 4 hours 60 cm (4, 100) (8, 160)
Figure 2The pool in Example 6. Each square is 1 hour across but 20 centimeters up, so the squares must be turned into hours and centimeters before dividing.
Solution

The line meets the depth axis at 40, so b = 40 centimeters: the pool already held 40 centimeters of water when filling began.

For the slope, use two grid corners on the line, (0, 40) and (4, 100). Each square across is 1 hour and each square up is 20 centimeters, so the run is 4 hours and the rise is 3 \times 20 = 60 centimeters:

m = \frac{60 \text{ cm}}{4 \text{ h}} = 15 \text{ centimeters per hour}

Counting squares alone would give \displaystyle \frac{3}{4}, which is wrong because the two axes have different scales. Check with the corners (0, 40) and (8, 160): a rise of 120 centimeters over 8 hours is again 15 centimeters per hour. The equation is

d = 15t + 40

The water rises 15 centimeters each hour, from a starting depth of 40 centimeters. After 6.5 hours, d = 15(6.5) + 40 = 97.5 + 40 = 137.5 centimeters. For a depth of 175 centimeters, 15t + 40 = 175, so 15t = 135 and t = 9 hours. That is beyond the right edge of the graph, so it rests on the filling staying steady for another hour.

Example 7

An odometer with no starting row

On a road trip Fergus reads his car’s odometer, which shows the total kilometers the car has ever driven, at three times. Take the car to drive at one steady speed from the moment he sets off. t hours after setting off it reads:

t (hours)134.5
reading R (km)124701263012750

Show that the rows lie on one line, write R in slope-intercept form, and say what the slope and intercept mean. What will the odometer read after 6 hours?

Solution

The slopes between neighboring rows are

\begin{aligned} \frac{12630 - 12470}{3 - 1} &= \frac{160}{2} = 80 \\ \frac{12750 - 12630}{4.5 - 3} &= \frac{120}{1.5} = 80 \end{aligned}

They agree, so the three rows lie on one line with slope m = 80 kilometers per hour.

There is no row with t = 0. Because the speed was steady from the start, the same line runs back to t = 0, so every row satisfies R = 80t + b, and b = R - 80t. With the first row, b = 12470 - 80(1) = 12390. Check with the last row: 12750 - 80(4.5) = 12750 - 360 = 12390. So

R = 80t + 12390

The slope says the car covers 80 kilometers each hour. The intercept, 12390 kilometers, is the odometer reading when Fergus set off, not the length of the trip; the trip so far is R - 12390 = 80t kilometers. After 6 hours the reading is 80(6) + 12390 = 480 + 12390 = 12870 kilometers.

Boundaries

Vertical lines have no slope-intercept form. A vertical line such as x = 3 has no slope, and it never crosses the y-axis (the line x = 0 is the y-axis itself). An equation with no y in it, like 2x = 7, cannot be solved for y. Every other line can be written as y = mx + b.

y must stand alone, with nothing multiplying it. In 2y = 6x + 4 the 4 is not the intercept; dividing by 2 gives y = 3x + 2, so b = 2. The same goes for brackets: in y = 3(x + 1) the intercept is 3, not 1.

The intercept is the value at x = 0, which a picture may not show. On a graph whose horizontal axis starts at some other number, the place where the line meets the left edge is not the y-intercept. A table with no row at x = 0 needs b = y - mx.

In a situation, x = 0 may be outside what makes sense. The intercept is still a number, but it describes the start only when x = 0 is the start. When the inputs can only be whole numbers, as with climbs, the situation is a set of dots on the line, not the whole line.

Straight lines only. The form describes lines. An equation like y = x^2 + 3 still crosses the y-axis at 3, but it has no single slope, so it has no m.

Where this goes next

Graphing a line from its equation draws a line straight from its equation: plot (0, b), then step by the slope. Point-slope form and the line through two points writes the equation when the given point is not on the y-axis, or when only two points are known. Two lines with the same m and different b never meet, which Parallel and perpendicular lines turns into a test for parallel lines. Putting y = 0 finds where a line crosses the other axis, as Standard form of a line does for lines and Intercepts and zeros of a function does for any function. Written as f(x) = mx + b, the same equation is a linear function, read off a picture in Reading a linear function from its graph and used for predictions in Modeling with linear relationships. The terms of an arithmetic sequence follow a rule of exactly this shape, and in statistics the slope and intercept of a fitted line are read with their units just as in Examples 6 and 7.

Exercises

Part 1: reading the slope and intercept

Give the slope and the y-intercept of each line.

  1. y = 7x + 2
  2. y = -x - 9
  3. \displaystyle y = \frac{3}{8}x
  4. y = 11 - 5x
  5. y = 6

Part 1: writing the equation

Write the equation of each line in slope-intercept form.

  1. Slope 2, y-intercept -8.
  2. Slope \displaystyle -\frac{3}{4}, crossing the y-axis at (0, 5).
  3. Slope 0, y-intercept 2.5.
  4. Slope -2 and y-intercept 7. Then decide whether (5, -3) lies on the line, and find y when x = -4.
  5. The line through (0, -2) and (5, 6).

Part 1: the starting value

  1. Kalani buys a climbing-wall card at a gym. The card itself costs 15 dollars, and each climb then costs 4 dollars. Write the total C, in dollars, that Kalani has spent after n climbs, say what the slope and intercept mean, and find the total after 9 climbs.
  2. Gulnara opens a savings account with an opening deposit of 35 dollars and adds 12 dollars at the end of every week. The account pays no interest. Write the balance B, in dollars, after w weeks, and find the first week at whose end the balance is at least 200 dollars.
  3. The depth of the water in a pool, in centimeters, t minutes after a hose is turned on is d = 0.8t + 55. Say what 0.8 and 55 mean, with their units, and find the depth after an hour and a half.

Part 2: rewriting

Rewrite each equation in slope-intercept form, and give the slope and the y-intercept.

  1. 6x + 3y = 24
  2. x - 4y = 8
  3. y + 5 = -3(x - 2)
  4. 2y = 7x
  5. 9x + 6y - 12 = 0
  6. \displaystyle y - 4 = \frac{1}{2}(x + 6)

Part 2: from a graph or a table

Write the equation of each line in Figure 3 in slope-intercept form.

x y −4 −2 2 4 −4 −2 2 4 (a) x y −4 −2 2 4 −4 −2 2 4 (b)
Figure 3The lines for Exercises 20 and 21. Each square is 1 unit on both axes.
  1. Line (a).
  2. Line (b).
  3. A table of a line has x: -2, 0, 4, 6 and y: 7, 4, -2, -5. Check that the rows lie on one line, and write its equation.
  4. On a road trip at a steady speed, Jericho’s odometer reads 48215, 48305 and 48395 km at 2, 3.5 and 5 hours after setting off. Write the reading R in slope-intercept form, and say what the slope and intercept mean.

Reasoning

  1. Fergus looks at the line y = 3(x - 4) and says its y-intercept is -4. Explain why that is not right, and find the y-intercept.
  2. Explain why the vertical line x = 3 cannot be written in the form y = mx + b, whatever numbers m and b are.
Answers
  1. m = 7, b = 2.
  2. m = -1, b = -9. The term -x is -1 \cdot x.
  3. \displaystyle m = \frac{3}{8}, b = 0. Nothing is added, so the line passes through the origin.
  4. m = -5, b = 11. Reordered, the equation is y = -5x + 11.
  5. m = 0, b = 6. The equation is y = 0x + 6, a horizontal line.
  6. y = 2x - 8.
  7. \displaystyle y = -\frac{3}{4}x + 5. The crossing point (0, 5) gives b = 5.
  8. y = 2.5. With m = 0 the x term is 0x = 0, so the line is horizontal.
  9. y = -2x + 7; (5, -3) is on it; y = 15 when x = -4. Since -2(5) + 7 = -3 the point fits, and -2(-4) + 7 = 8 + 7 = 15.
  10. \displaystyle y = \frac{8}{5}x - 2. The point (0, -2) gives b = -2, and \displaystyle m = \frac{6 - (-2)}{5 - 0} = \frac{8}{5}.
  11. C = 4n + 15, and 51 dollars after 9 climbs. The slope, 4 dollars per climb, is the cost of each climb; the intercept, 15 dollars, is the cost of the card before any climb. 4(9) + 15 = 36 + 15 = 51.
  12. B = 12w + 35; the end of week 14. The slope is 12 dollars per week and the intercept is the 35 dollar deposit. After 13 weeks B = 156 + 35 = 191, short of 200; after 14 weeks B = 168 + 35 = 203.
  13. 127 centimeters. The slope, 0.8 centimeters per minute, is how fast the water rises; the intercept, 55 centimeters, is the depth when the hose was turned on. An hour and a half is 90 minutes, and 0.8(90) + 55 = 72 + 55 = 127.
  14. y = -2x + 8, so m = -2, b = 8. Subtract 6x: 3y = -6x + 24; divide each term by 3.
  15. \displaystyle y = \frac{1}{4}x - 2, so \displaystyle m = \frac{1}{4}, b = -2. Subtract x: -4y = -x + 8; divide each term by -4.
  16. y = -3x + 1, so m = -3, b = 1. Distribute: y + 5 = -3x + 6; subtract 5.
  17. \displaystyle y = \frac{7}{2}x, so \displaystyle m = \frac{7}{2}, b = 0. Divide both sides by 2.
  18. \displaystyle y = -\frac{3}{2}x + 2, so \displaystyle m = -\frac{3}{2}, b = 2. Subtract 9x and add 12: 6y = -9x + 12; divide each term by 6.
  19. \displaystyle y = \frac{1}{2}x + 7, so \displaystyle m = \frac{1}{2}, b = 7. Distribute: \displaystyle y - 4 = \frac{1}{2}x + 3; add 4.
  20. \displaystyle y = \frac{5}{2}x + 1. The line crosses the y-axis at the grid corner (0, 1), so b = 1; from the corner (-2, -4) to (0, 1) the run is 2 and the rise is 5.
  21. \displaystyle y = -\frac{1}{3}x - 2. The line crosses the y-axis at the grid corner (0, -2); from (0, -2) to (3, -3) the run is 3 and the rise is -1.
  22. \displaystyle y = -\frac{3}{2}x + 4. The slopes between neighboring rows are \displaystyle \frac{-3}{2}, \displaystyle \frac{-6}{4} and \displaystyle \frac{-3}{2}, all \displaystyle -\frac{3}{2}; the row with x = 0 gives b = 4.
  23. R = 60t + 48095. The slopes between rows are \displaystyle \frac{90}{1.5} = 60 both times, so the car covers 60 kilometers each hour. Stepping back from the first row, b = 48215 - 60(2) = 48095: the odometer reading, in kilometers, when Jericho set off.
  24. The y-intercept is -12. The -4 sits inside the brackets, so it is not the number added on. Distributing gives y = 3x - 12, and at x = 0, y = 3(0 - 4) = -12.
  25. For any numbers m and b, the equation y = mx + b gives exactly one y when x = 3, namely 3m + b, so its line holds only one point with x = 3. The line x = 3 holds infinitely many, (3, 0), (3, 1), (3, 2) and so on, so the two cannot be the same line.
kg1128 · updated 2026-10-09 · CC-BY-SA-4.0