Slope

Learning goals

  • Measure slope as rise over run
  • Compute m=y2−y1x2−x1m = \dfrac{y_2 - y_1}{x_2 - x_1} in a consistent order
  • Explain why every pair of points on a nonvertical line agrees
  • Classify a slope as positive, negative, zero, or undefined, and say why a vertical line has none
  • Read a slope from a graph, and use it to find another point on the line

Rise over run

To measure how a line tilts, follow it from one point to another. Then split the trip into two moves: how far across, and how far up or down.

The run is the horizontal change: right is positive and left is negative. The rise is the vertical change: up is positive and down is negative. A big rise over a small run makes a steep line.

For example, a move 33 units right and 22 units up gives a rise-to-run ratio of 23\tfrac{2}{3}. This ratio is the line’s slope, written mm:

m=riserun=change in ychange in x.m=\frac{\text{rise}}{\text{run}}=\frac{\text{change in }y}{\text{change in }x}.

The run must be nonzero. This is why we set vertical lines aside for now.

A slope triangle: rise 2 over run 3A line rising to the right, with a right triangle marking a run of 3 units across and a rise of 2 units up between two of its points.xy110(-2, -1)(1, 1)run = 3rise = 2m = 2/3
A slope triangle under a line. Going from the lower point to the upper one, you run 3 units across and rise 2 units up, so the slope is the ratio rise over run, which is 2/3. This line rises 2 units for every 3 it runs.

A slope of 23\tfrac{2}{3} also means a rise of 23\tfrac{2}{3} for a run of 11. Slope is the fixed change in yy for each unit increase in xx. In the previous lesson, y=2x−1y=2x-1 rose 22 for each unit step right, so its slope is 22.

When the coordinates measure quantities, slope measures a rate of change. If a water level rises 66 centimeters in 33 minutes at a steady rate, its height-versus-time graph has slope 6÷3=26\div3=2 centimeters per minute. The units come from height divided by time. For a physical ramp, measure rise and run in the same length unit before comparing its steepness.

The slope formula

Reading rise and run off a picture is fine when a graph is in front of you. But usually you are handed two points as numbers and want the slope without drawing anything. The rise and run are just differences of coordinates, so the slope becomes a short formula.

Take two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) on the line. Moving from the first to the second, the vertical change (the rise) is y2−y1y_2 - y_1, and the horizontal change (the run) is x2−x1x_2 - x_1. Dividing gives the slope, provided x2≠x1x_2 \ne x_1:

m=y2−y1x2−x1.m = \frac{y_2 - y_1}{x_2 - x_1}.

The subscripts are just labels that keep the two points apart: (x1,y1)(x_1, y_1) is “point one” and (x2,y2)(x_2, y_2) is “point two.” The one rule to respect is order. Subtract the coordinates in the same order on the top and the bottom. If y2−y1y_2 - y_1 sits on top, then x2−x1x_2 - x_1 must sit on the bottom, never x1−x2x_1 - x_2.

Worked example 1 Find the slope through (2,3)(2, 3) and (6,11)(6, 11)

Label the points (x1,y1)=(2,3)(x_1, y_1) = (2, 3) and (x2,y2)=(6,11)(x_2, y_2) = (6, 11), then substitute into the formula, keeping the same order on top and bottom.

m=y2−y1x2−x1=11−36−2=84=2.m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{11 - 3}{6 - 2} = \frac{8}{4} = 2.

The slope is 22. The line rises 22 units for every 11 unit it runs, so it climbs fairly steeply from left to right.

Worked example 2 Find the slope through (−1,5)(-1, 5) and (2,−1)(2, -1)

Take (x1,y1)=(−1,5)(x_1, y_1) = (-1, 5) and (x2,y2)=(2,−1)(x_2, y_2) = (2, -1). Substitute carefully, watching the signs of the negative coordinates.

m=−1−52−(−1)=−63=−2.m = \frac{-1 - 5}{2 - (-1)} = \frac{-6}{3} = -2.

The slope is −2-2. It is negative, so the line falls as you move to the right. To see that the order does not matter, swap the labels and put (2,−1)(2, -1) first:

m=5−(−1)−1−2=6−3=−2,m = \frac{5 - (-1)}{-1 - 2} = \frac{6}{-3} = -2,

the same answer.

It never matters which point you call first. If you swap them, both the top and the bottom change sign, and a fraction with both signs flipped keeps its value, since −a−b=ab\frac{-a}{-b} = \frac{a}{b}. So pick either point as “point one” and simply stay consistent all the way through.

Check your understanding

What is the slope of the line through (1,2)(1, 2) and (4,8)(4, 8)?

Answer choices

Why every pair of points gives the same slope

A line has infinitely many points. To call a number the slope of the line, we need to know that choosing a different pair gives the same result.

Why the slope does not depend on which two points you choose#

On the line y=12x+1y=\tfrac12x+1, take the points (0,1)(0,1), (2,2)(2,2) and (4,3)(4,3). The first pair gives

2−12−0=12,\frac{2-1}{2-0}=\frac12,

while using the first and last points gives

3−14−0=24=12.\frac{3-1}{4-0}=\frac24=\frac12.

The larger triangle has twice the rise and twice the run, so their ratio stays the same. Geometrically, slope triangles along one slanted line are scaled copies: their corresponding angles agree, and scaling multiplies both legs by the same amount.

Algebra shows why this works for any pair. The previous lesson showed that a nonvertical linear equation can be written y=kx+dy=kx+d, where kk and dd are fixed numbers. Two points on it therefore obey y1=kx1+dy_1=kx_1+d and y2=kx2+dy_2=kx_2+d. Subtract:

y2−y1=(kx2+d)−(kx1+d)=k(x2−x1).\begin{aligned} y_2-y_1&=(kx_2+d)-(kx_1+d)\\ &=k(x_2-x_1). \end{aligned}

The points are distinct and the line is nonvertical, so x2−x1≠0x_2-x_1\ne0. Dividing gives

m=y2−y1x2−x1=k(x2−x1)x2−x1=k.m=\frac{y_2-y_1}{x_2-x_1}=\frac{k(x_2-x_1)}{x_2-x_1}=k.

The answer depends only on the line, not the chosen points. For a horizontal line, k=0k=0: every pair has zero rise and therefore slope 00.

The figure below shows the same comparison on another line of slope 12\tfrac12. Its triangles sit end to end: one has run 22 and rise 11, and the other has run 44 and rise 22.

Two similar slope triangles giving the same slopeOne straight line with a small slope triangle (run 2, rise 1) and a larger slope triangle (run 4, rise 2), both giving a slope of one half.xy310run = 2rise = 1run = 4rise = 2m = 1/2
Two slope triangles on one line. The small triangle gives a rise of 1 over a run of 2, and the large triangle gives a rise of 2 over a run of 4. These are the same ratio, since 1/2 = 2/4, so both triangles report the same slope of 1/2.

Drag any of the four points along the line, even BB to the left of AA, and watch every triangle you make give a slope of 23\tfrac{2}{3}. Moving BB to the left of AA changes both the rise and run signs, leaving their ratio unchanged. Keep the two points in each pair distinct; if they coincide, the run is zero and that pair cannot measure a slope.

Every pair of points on this line gives the same slope

From A to B: rise 2, run 3, slope 2/3. From C to D: rise 4, run 6, slope 4/6 = 2/3. Both pairs give 2/3: every rise-and-run triangle on one line is the same shape, a scaled copy of any other.A coordinate plane with one fixed straight line through the origin and four marked points on it, A, B, C and D. Whenever the two points of a pair (A and B, or C and D) differ, a right triangle is drawn on them with the run along one leg and the rise along the other, both labeled. Each of the four points can be dragged along the line.-8-6-4-22468-6-4-2246run = 3rise = 2run = 6rise = 4ABCD

From A to B: rise 2, run 3, slope 2/3. From C to D: rise 4, run 6, slope 4/6 = 2/3. Both pairs give 2/3: every rise-and-run triangle on one line is the same shape, a scaled copy of any other.

One fixed line with four points on it, A, B, C and D. Whenever the two points of a pair (A and B, or C and D) differ, a right triangle drawn on them shows the run along one leg and the rise along the other. Every such triangle on one line is the same shape, so every pair gives the same slope.

The next figure lets you change the rise and run separately. Start with rise 22 and run 33, then change them to 44 and 66. The rise and run both double, but 4/6=2/34/6=2/3, so the line stays put.

Now hold the run at 33 and change the rise through 11, 00 and −1-1. At 00 the upright leg vanishes and the line is horizontal. Below 00 the line falls to the right.

How rise and run set a line's slope

y = (2/3)x + 1. Rise 2 over run 3 is a slope of 2/3, so from any point on the line, 3 to the right and 2 up lands back on it. And it crosses the vertical axis at 1. A coordinate plane with a straight line drawn across it, and a staircase from the line's crossing point showing its run across and its rise up or down. Use the controls below the figure to change the rise, the run, where the line crosses the vertical axis. -8 -6 -4 -2 2 4 6 8 -8 -6 -4 -2 2 4 6 8
Rise Run Crosses at

y = (2/3)x + 1. Rise 2 over run 3 is a slope of 2/3, so from any point on the line, 3 to the right and 2 up lands back on it. And it crosses the vertical axis at 1.

A line on a coordinate plane, with a staircase from its crossing point showing the run across and the rise up or down. The rise and the run are set separately, so pairs of them that reduce to the same fraction can be compared against the line they produce.

Check your understanding

Two points on a line give a slope triangle with rise 55 and run 33. Which rise-and-run pair could come from a different pair of points on that same line?

Answer choices

Positive, negative, zero, and undefined slope

The sign of the slope tells you the line’s direction. Horizontal and vertical lines are two special cases.

A positive slope means the rise and run have the same sign: as you move to the right, with xx increasing, yy increases too. So the line climbs from lower left to upper right. A negative slope means the rise and run have opposite signs: moving right, yy decreases, so the line falls from upper left to lower right. The larger the slope in size, the steeper the climb or fall. A slope of 33 rises three units per step across, much steeper than a slope of 14\tfrac{1}{4}.

A zero slope is the flat case. A horizontal line never changes height, so between any two of its points the rise is 00 while the run is some nonzero number, and

m=0run=0.m = \frac{0}{\text{run}} = 0.

This matches the horizontal lines y=cy = c from the last lesson: their height is locked, so they never rise, and their slope is 00.

An undefined slope is the vertical case, the one case where the formula gives no number. A vertical line never changes its xx-coordinate, so between any two of its points the run is 00:

m=rise0.m = \frac{\text{rise}}{0}.

No number multiplied by 00 can give the nonzero rise between two distinct points on a vertical line. So division by zero has no value: the slope is undefined, not infinite or zero. Compare this with a horizontal line, whose zero rise divided by a nonzero run gives exactly 00.

Positive, negative, zero, and undefined slopeFour mini coordinate frames: a rising line labeled positive, a falling line labeled negative, a horizontal line labeled zero, and a vertical line labeled undefined.Positivem > 0Negativem < 0Zerom = 0Undefinedvertical
The four kinds of slope. A line climbing to the right has positive slope; a line falling to the right has negative slope; a flat line has slope 0; and an upright line has undefined slope, because its run is 0 and you cannot divide by zero.

Worked example 3 Slopes of a horizontal and a vertical line

First find the slope through (−2,4)(-2, 4) and (3,4)(3, 4). Both points have the same height, y=4y = 4, so the rise is zero:

m=4−43−(−2)=05=0.m = \frac{4 - 4}{3 - (-2)} = \frac{0}{5} = 0.

The slope is 00: these points sit on the horizontal line y=4y = 4.

Now find the slope through (5,−1)(5, -1) and (5,7)(5, 7). Both points have the same xx-coordinate, x=5x = 5, so the run is zero:

m=7−(−1)5−5=80.m = \frac{7 - (-1)}{5 - 5} = \frac{8}{0}.

Division by zero has no value, so this slope is undefined. These points sit on the vertical line x=5x = 5.

Check your understanding

Which pair of points lies on a line with an undefined slope?

Answer choices

Reading slope from a graph

When a line is already drawn for you, you can read its slope straight off the grid without being given the points’ coordinates, by building a slope triangle. Pick two points where the line crosses grid corners, then count coordinate units. Check the axis labels: one grid space may stand for several units.

Count the run first: how many units you move right to get from the left point across to under the right point. Then count the rise: how many units up or down you move to reach the line, counting down as negative. The slope is the rise you counted over the run you counted. Reading from left to right keeps the run positive, so the sign comes entirely from the rise. Count upward and the slope is positive; count downward and it is negative.

Reading a negative slope from a graphA falling line through (0, 1) and (2, 0), with a slope triangle showing a run of 2 to the right and a drop of 1, giving slope negative one half.xy10(0, 1)(2, 0)run = 2rise = -1m = -1/2
Reading a slope off the grid. From the left point (0, 1), run 2 units to the right, then drop 1 unit down to land back on the line, a rise of -1. The slope is -1/2, negative because the line falls to the right.

Worked example 4 Read the slope of the graphed line

In the diagram above, the run from (0,1)(0, 1) to (2,0)(2, 0) is 22 and the rise is −1-1, giving a slope of −12-\tfrac{1}{2}. As a check, plug the same two points into the slope formula instead of counting:

m=0−12−0=−12.m = \frac{0 - 1}{2 - 0} = \frac{-1}{2}.

The two methods agree, because the run and the rise you count on the grid are the same differences the formula computes from the coordinates.

A new line to read the slope fromA line falling gently to the right, crossing grid corners at negative 2, 1 and 2, 0.xy10(-2, 1)(2, 0)
A line through two grid corners. Count the run from the left point across to under the right point, then count the rise up or down back to the line. The ratio of rise to run gives this line's slope.

Check your understanding

In the graph above, start at the left point and count the run, then the rise, over to the right point. What is the slope of this line?

Answer choices

Stepping along a line from its slope

You can also use slope the other way around. If you know a line’s slope and one point on it, you can walk to as many other points as you like, with no equation at all. Read the slope as rise over run, then step. From the known point, move right by the run and up or down by the rise, and you land on another point of the line.

For a slope of 34\tfrac{3}{4} starting at (1,2)(1, 2), step 44 to the right and 33 up to reach (5,5)(5, 5), which is also on the line. You can step the other way too: 44 left and 33 down reaches (−3,−1)(-3, -1). A whole number slope like 22 is really 21\tfrac{2}{1}, a run of 11 and a rise of 22. So from (0,1)(0, 1) you step to (1,3)(1, 3), then (2,5)(2, 5), and onward.

Worked example 5 Step to another point using the slope

A line has slope −23-\tfrac{2}{3} and passes through (3,4)(3, 4). Read the slope as a run of 33 and a rise of −2-2 (down 22). Stepping right from (3,4)(3, 4):

(3,4)  ⟶  (3+3,  4−2)=(6,2).(3, 4) \;\longrightarrow\; (3 + 3,\; 4 - 2) = (6, 2).

So (6,2)(6, 2) is on the line. Stepping the opposite way, left 33 and up 22:

(3,4)  ⟶  (3−3,  4+2)=(0,6).(3, 4) \;\longrightarrow\; (3 - 3,\; 4 + 2) = (0, 6).

So (0,6)(0, 6) is on the line as well. Reversing both parts of the step keeps the same slope.

Check your understanding

A line has slope 33 and passes through (2,1)(2, 1). Which of these points is also on the line?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (optional)

People measured steepness long before coordinate graphs. An Egyptian mathematical manual from about 1550 BC describes a pyramid face’s seked: its horizontal movement, measured in palms, for a rise of one cubit. That is a run for a fixed rise, whereas our slope compares rise to run. University College London’s account explains the surviving measurement.

Why does an English-language algebra book usually write mm for slope? The letter’s origin is still uncertain. A popular story links it to the French verb monter, meaning “to climb,” but there is no known evidence that this was the reason for choosing it.

There are records of the symbol itself. The Italian mathematician Vincenzo Riccati used mm in y=mx+ny=mx+n in 1757. Nineteenth-century English-language textbooks by Matthew O’Brien and George Salmon used mm too, though they used different letters for the constant term. Those surviving pages show where the notation appeared, but not why its authors chose that letter. MacTutor traces the documented uses and the unresolved origin.

Your progress

See all your progress →