• Foundation
  • About 16 min
  • 5 practice questions

Slope and the slope-intercept form y = mx + d

Find the slope of a line from two points as rise over run, explain why it is the same everywhere on the line, and read the slope and y-intercept from y = mx + d or from ax + by + c = 0.

If something looks wrong, please tell us.

By the end of this lesson you can

  • Calculate the slope of a line through two points using rise ÷ run.
  • Explain why m in y = mx + d is the slope, and convert ax + by + c = 0 to slope-intercept form.
  • Describe lines with positive, negative, zero and undefined slope, and use slope in real situations such as ramps.

Cycling up a gentle road is easy; cycling up a steep one is hard. Mathematics measures this steepness with a number called the slope (or gradient) of a line.

Rise over run

Take two points on a line, A(x₁, y₁) and B(x₂, y₂). Going from A to B, the run is the horizontal change x₂ − x₁ and the rise is the vertical change y₂ − y₁. Moving right is a positive run; moving up is a positive rise, moving down a negative rise.

Slope m = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁), for any two points (x₁, y₁) and (x₂, y₂) on the line with x₁ ≠ x₂.

Worked example 1: slope from two points

Find the slope of the line through (1, 2) and (5, 10).

Working: rise = 10 − 2 = 8, run = 5 − 1 = 4, so m = 8 ÷ 4 = 2. Taking the points the other way round: (2 − 10) ÷ (1 − 5) = (−8) ÷ (−4) = 2. The order does not matter, as long as you use the same order on top and bottom.

Worked example 2: a negative slope

Find the slope of the line through (−3, 4) and (3, 1).

Working: m = (1 − 4) ÷ (3 − (−3)) = (−3) ÷ 6 = −½. The line goes down 1 unit for every 2 units to the right.

Why m in y = mx + d is the slope

Suppose (x₁, y₁) and (x₂, y₂) are on the line y = mx + d, so y₁ = mx₁ + d and y₂ = mx₂ + d. Then:

(y₂ − y₁) ÷ (x₂ − x₁) = [(mx₂ + d) − (mx₁ + d)] ÷ (x₂ − x₁) = m(x₂ − x₁) ÷ (x₂ − x₁) = m

So whichever two points we choose, the slope is m: the slope is the same all along a straight line. The number d is the y-intercept: putting x = 0 gives y = d, so the line crosses the y-axis at (0, d). That is why y = mx + d is called the slope-intercept form.

From standard form to slope-intercept form

If b ≠ 0, the equation ax + by + c = 0 can be rearranged: by = −ax − c, so y = (−a/b)x + (−c/b). Hence m = −a/b and d = −c/b.

Worked example 3: reading slope and intercept

Find the slope and y-intercept of 3x + 4y − 12 = 0, and describe the line.

Working: 4y = −3x + 12, so y = −¾x + 3. Slope m = −¾, y-intercept d = 3. The line crosses the y-axis at (0, 3), and for every 4 units to the right it goes down 3 units. Check with the formula: −a/b = −3/4 and −c/b = 12/4 = 3.

Four kinds of slope

What the slope tells you

  • Positive (m > 0)
    • Line rises from left to right
    • y increases as x increases
    • Example: y = 2x + 1
  • Negative (m < 0)
    • Line falls from left to right
    • y decreases as x increases
    • Example: y = −3x + 4
  • Zero (m = 0)
    • Horizontal line
    • y stays the same
    • Example: y = 5
  • Undefined
    • Vertical line
    • x stays the same; run is 0
    • Example: x = 2

For a vertical line such as x = 2, any two points have the same x, so the run is 0. Division by 0 is not defined, so the slope is undefined, and the equation cannot be written as y = mx + d.

Worked example 4: a wheelchair ramp

A ramp must rise at most 1 cm for every 12 cm of horizontal length. A doorway is 45 cm above the ground. What is the least horizontal length of the ramp?

Working: the slope must be 1/12, so run = rise ÷ slope = 45 ÷ (1/12) = 45 × 12 = 540 cm, that is, 5.4 m. A shorter ramp would be steeper than allowed.

Key takeaways: slope = rise ÷ run and is the same for any two points on a line. In y = mx + d, m is the slope and the line crosses the y-axis at (0, d). For ax + by + c = 0 with b ≠ 0, the slope is −a/b. Positive slopes rise, negative slopes fall, horizontal lines have slope 0 and vertical lines have no defined slope.

Check your understanding

  1. 1. What is the slope of the line through (2, 3) and (6, 11)?

    1. ½
    2. 4
    3. 2
    4. −2
    Show answer

    Answer: C. Slope = (11 − 3) ÷ (6 − 2) = 8 ÷ 4 = 2.

  2. 2. What is the slope of the line 2x + 5y = 10?

    1. −2/5
    2. 2/5
    3. −5/2
    4. 2
    Show answer

    Answer: A. 5y = −2x + 10, so y = −(2/5)x + 2. The slope is −2/5 (and the y-intercept is 2). Using the formula, −a/b = −2/5.

  3. 3. For the line y = −4x + 7, which statement is correct?

    1. As x increases by 1, y increases by 4; it crosses the y-axis at (0, 7)
    2. As x increases by 1, y decreases by 7; it crosses the y-axis at (0, −4)
    3. As x increases by 1, y decreases by 4; it crosses the y-axis at (7, 0)
    4. As x increases by 1, y decreases by 4; it crosses the y-axis at (0, 7)
    Show answer

    Answer: D. In y = mx + d, m = −4 is the slope (y goes down 4 for each step of 1 to the right) and d = 7 means the line meets the y-axis at (0, 7).

  4. 4. What is the slope of the line x = 6?

    1. 0
    2. 6
    3. Undefined
    4. 1
    Show answer

    Answer: C. x = 6 is a vertical line. Any two points on it have the same x-coordinate, so the run is 0 and rise ÷ run would mean dividing by 0. The slope is undefined.

  5. 5. A straight road rises 15 m over a horizontal distance of 300 m. What is its slope?

    1. 20
    2. 0.05
    3. 0.5
    4. 285
    Show answer

    Answer: B. Slope = rise ÷ run = 15 ÷ 300 = 1/20 = 0.05. The road rises 5 m for every 100 m horizontally.

Privacy · Terms · Refunds · Delivery