Algebra 1

How to find the slope of a line

Slope tells you how steep a line is and which way it goes. It is the change in y divided by the change in x between any two points on the line, often called rise over run. A positive slope rises from left to right, a negative slope falls, a horizontal line has slope 0, and a vertical line has an undefined slope. Parallel lines share a slope.

Updated

The key idea

Pick any two points on a line, (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2). The slope mm is how far you go up or down (the rise) for each step you go across (the run):

m=riserun=y2−y1x2−x1m = \frac{\text{rise}}{\text{run}} = \frac{y_2 - y_1}{x_2 - x_1}

A slope of 3 means: move 1 to the right, go up 3. A slope of −12-\frac{1}{2} means: move 2 to the right, go down 1. In a word problem, slope is a rate, like dollars per hour or centimeters per day.

The four kinds of slope
LineSlopeExample
Rises left to rightpositivey=2x+1y = 2x + 1 has slope 2
Falls left to rightnegativey=−3x+4y = -3x + 4 has slope −3-3
Horizontal0 (no rise at all)y=5y = 5
Verticalundefined (the run is 0, and you cannot divide by 0)x=−2x = -2

Parallel lines have the same slope. Perpendicular lines have slopes that are negative reciprocals, so they multiply to −1-1: a line with slope 23\frac{2}{3} is perpendicular to one with slope −32-\frac{3}{2}.

Worked examples

Example 1: slope from two points

Problem Find the slope of the line through (2,−1)(2, -1) and (6,7)(6, 7).

  1. Call (2,−1)(2, -1) the first point and (6,7)(6, 7) the second. Put the y values on top and the x values on the bottom, in the same order.
    m=7−(−1)6−2m = \frac{7 - (-1)}{6 - 2}
  2. Subtracting a negative is adding.
    m=84=2m = \frac{8}{4} = 2
  3. Sense check: the second point is to the right and higher, so the slope should be positive. It is.

Answer m=2m = 2

Example 2: a negative fraction slope

Problem Find the slope of the line through (−3,4)(-3, 4) and (5,−2)(5, -2).

  1. Same order on top and bottom.
    m=−2−45−(−3)m = \frac{-2 - 4}{5 - (-3)}
  2. Simplify the top and the bottom, then reduce the fraction.
    m=−68=−34m = \frac{-6}{8} = -\frac{3}{4}
  3. Sense check: the line goes down 3 for every 4 to the right.

Answer m=−34m = -\frac{3}{4}

Example 3: slope from an equation, then a perpendicular slope

Problem Find the slope of 4x−6y=124x - 6y = 12, and the slope of any line perpendicular to it.

  1. Solve for y. First subtract 4x4x from both sides.
    −6y=−4x+12-6y = -4x + 12
  2. Divide every term by −6-6. The number in front of x is the slope.
    y=23x−2y = \frac{2}{3}x - 2
  3. A perpendicular slope is the negative reciprocal: flip 23\frac{2}{3} and change its sign. Check that the two slopes multiply to −1-1.
    23⋅(−32)=−1\frac{2}{3} \cdot \left(-\frac{3}{2}\right) = -1

Answer The slope is 23\frac{2}{3}. A perpendicular line has slope −32-\frac{3}{2}.

Example 4 (test-hard): a missing coordinate

Problem The line through (k,9)(k, 9) and (2,−3)(2, -3) has slope 3. What is kk?

  1. Write the slope formula with the unknown and set it equal to 3.
    −3−92−k=3\frac{-3 - 9}{2 - k} = 3
  2. Multiply both sides by 2−k2 - k.
    −12=3(2−k)-12 = 3(2 - k)
  3. Distribute.
    −12=6−3k-12 = 6 - 3k
  4. Add 3k3k and add 12 to both sides.
    3k=183k = 18
  5. Divide by 3, then check: −3−92−6=−12−4=3\frac{-3 - 9}{2 - 6} = \frac{-12}{-4} = 3.
    k=6k = 6

Answer k=6k = 6

Common mistakes

  • Mixing the order. y2−y1x1−x2\frac{y_2 - y_1}{x_1 - x_2} gives the right size with the wrong sign. Fix: whichever point you start with on top, start with it on the bottom too.
  • Putting x on top. Run over rise gives the reciprocal, like 12\frac{1}{2} instead of 2. Fix: y goes up and down, and "up" is on top.
  • Dropping the sign when subtracting a negative. 7−(−1)7 - (-1) is 8, not 6.
  • Mixing up zero and undefined. A flat line like y=5y = 5 has slope 0. A straight-up line like x=−2x = -2 has no slope at all (undefined).
  • Reading the slope from the wrong form. In 4x−6y=124x - 6y = 12, the slope is not 4. Fix: solve for y first, or use the shortcut below.

Quick methods

Practice

5 practice questions

  1. What is the slope of the line through (1,5)(1, 5) and (4,−1)(4, -1)?

    1. −2-2
    2. −12-\frac{1}{2}
    3. 22
    4. 43\frac{4}{3}
    Show answer

    Answer: −2-2

    −1−54−1=−63=−2\frac{-1 - 5}{4 - 1} = \frac{-6}{3} = -2. The choice −12-\frac{1}{2} is run over rise, and 2 loses the sign (the line falls, so the slope must be negative).

  2. Which line has an undefined slope?

    1. y=5y = 5
    2. x=−2x = -2
    3. y=xy = x
    4. y=−2xy = -2x
    Show answer

    Answer: x=−2x = -2

    x=−2x = -2 is a vertical line. Any two points on it have the same x, so the run is 0 and the slope would mean dividing by 0. y=5y = 5 is horizontal, with slope 0.

  3. What is the slope of 3x+5y=103x + 5y = 10?

    1. 33
    2. −35-\frac{3}{5}
    3. 35\frac{3}{5}
    4. 22
    Show answer

    Answer: −35-\frac{3}{5}

    Solve for y: 5y=−3x+105y = -3x + 10, so y=−35x+2y = -\frac{3}{5}x + 2. The slope is −35-\frac{3}{5}. The 2 is the y-intercept, and 3 is just the x coefficient before solving for y.

  4. What is the slope of a line perpendicular to y=−4x+1y = -4x + 1?

    1. 44
    2. −4-4
    3. 14\frac{1}{4}
    4. −14-\frac{1}{4}
    Show answer

    Answer: 14\frac{1}{4}

    Flip −4-4 to get −14-\frac{1}{4}, then change the sign: 14\frac{1}{4}. Check: −4⋅14=−1-4 \cdot \frac{1}{4} = -1. The choice −4-4 is the parallel slope.

  5. A plant was 4 cm tall on day 2 and 13 cm tall on day 8. If it grew at a steady rate, what is the slope of its height graph, and what does it mean?

    1. 1.5: the plant grows 1.5 cm per day
    2. 1.5: the plant was 1.5 cm tall on day 0
    3. 0.67: the plant grows 0.67 cm per day
    4. 9: the plant grows 9 cm per day
    Show answer

    Answer: 1.5: the plant grows 1.5 cm per day

    Slope is change in height over change in days: 13−48−2=96=1.5\frac{13 - 4}{8 - 2} = \frac{9}{6} = 1.5 cm per day. A slope is always a rate, never a starting value. 0.67 is days over centimeters (upside down), and 9 forgets to divide by the 6 days.

Frequently asked questions

What is the slope formula?

For two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2), the slope is m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}. It is the change in y divided by the change in x. It works for any two points on a straight line and always gives the same answer.

What is the difference between zero slope and undefined slope?

Zero slope means the line is flat (horizontal), like y=5y = 5: there is no rise. Undefined slope means the line is straight up and down (vertical), like x=−2x = -2: there is no run, and you cannot divide by zero.

Does it matter which point I call the first point?

No. You get the same slope either way, as long as you use the same order on the top and the bottom. Swapping both just multiplies the top and the bottom by −1-1, which cancels.

How do I find the slope of a parallel or perpendicular line?

A parallel line has exactly the same slope. A perpendicular line has the negative reciprocal: flip the fraction and change the sign. So for slope 23\frac{2}{3}, the perpendicular slope is −32-\frac{3}{2}. A slope of 0 is perpendicular to an undefined slope.

Try asking Ducky

  • “I got 2 but the answer is -2. Did I subtract in the wrong order?”
  • “How do I find the slope from this graph on my screen?”
  • “What does the slope mean in this word problem?”

Free to start. The web app works in any browser, Chromebooks included; the Mac app can also draw on your real screen.