The slope formula and the four kinds of slope
You know two points on a line by their coordinates, and there is no graph to count on. How steep is the line?
Where you are 4 in Slope
When you reach for it
Finding slope from a graph means counting squares up and squares across, and that needs a graph with the points on its grid. The points (-140, 35) and (260, -65) are far off any sheet of squared paper, and \displaystyle \left(-\frac{1}{2}, \frac{1}{3}\right) does not sit on a grid corner at all.
But the coordinates already contain the rise and the run. The rise is how far y changes between the two points, the run is how far x changes, and a change is found by subtracting. So the slope can be worked out from two points written as numbers, with no picture drawn.
Reach for this whenever a line is known by two of its points: to say how steep it is, whether it rises or falls, whether three points lie on one line, or to find a missing coordinate.
Day 1 is the formula: where it comes from, why the order of the points does not matter, and how it handles negative and fractional coordinates. Day 2 is what the slope tells you: the four kinds of slope, including the vertical line that has none, and two uses of the formula.
The procedure
Day 1: the slope formula
Naming the two points. With two points in play, x and y alone cannot say which point is meant. So each point gets a small number written below and to the right, a subscript:
read “x sub 1, y sub 1” and “x sub 2, y sub 2”. The subscript is a name tag: x_2 means “the x-coordinate of the second point”. It does not mean x times 2, and it is not a power.
Rise and run are differences. Walk from the first point to the second in two straight legs: first across, to the corner (x_2, y_1), then up or down to (x_2, y_2).
The across leg changes only x, from x_1 to x_2. On a number line, the change from a start to a finish is finish minus start, so the run is x_2 - x_1: positive if the walk went right, negative if it went left. The second leg changes only y, so the rise is y_2 - y_1: positive if the walk went up, negative if it went down. These are the numbers you would count on a grid, signs included, but now they are computed.
Slope is rise over run, and the letter usually used for it is m. So the slope formula is
and it holds whenever x_2 \neq x_1. (When the two x-coordinates are equal the bottom is 0, and Day 2 says what that means.) For the two points in the figure, (2, 1) and (6, 4), the slope is \displaystyle \frac{4 - 1}{6 - 2} = \frac{3}{4}: the line climbs 3 for every 4 across.
Why the order of the points does not matter. Nothing says which point must be called the first. Swap them, and every difference changes sign, because a - b is the opposite of b - a:
The last step multiplies top and bottom by -1, and multiplying the top and bottom of a fraction by the same non-zero number does not change its value. In the picture, swapping the points means walking the same two legs backwards. Both signs reverse, and the two reversals cancel.
What does matter is that top and bottom match: whichever point’s y-coordinate comes first on top, that same point’s x-coordinate comes first underneath. Mixed up, the top measures the change one way and the bottom the change the other way, and the result is the slope with its sign flipped:
Negative coordinates. Put each coordinate in brackets as you substitute it, so the minus sign of the formula and the minus sign of the number stay separate. Subtracting a negative number is adding its opposite, so 5 - (-3) = 5 + 3 = 8.
Writing the answer. A slope is a single number: an integer or a fraction in lowest terms, with the sign in front, as in \displaystyle \frac{-6}{8} = -\frac{3}{4}. A negative over a negative is positive. Leave an improper fraction as it is, \displaystyle \frac{5}{2} rather than \displaystyle 2\frac{1}{2}, since it reads straight back as a rise of 5 for a run of 2. With decimal coordinates, a decimal slope is fine.
Day 2: what the slope says about the line
The sign of the slope. Since the order does not matter, take the point further left first. Then the run is positive, and the slope has the same sign as the rise. That gives four kinds of slope, read from left to right along the line.
- Positive slope. y increases as you move right, and the line rises.
- Negative slope. y decreases as you move right, and the line falls.
- Zero slope. The rise is 0 and the run is not, and \displaystyle \frac{0}{\text{run}} = 0. All points of a horizontal line have the same y-coordinate, so the line y = b has slope 0.
- Undefined slope. The run is 0. All points of a vertical line have the same x-coordinate, so the line x = a has no slope.
How steep a line is shows in the size of the slope, ignoring its sign: a slope of -2 is steeper than a slope of \displaystyle \frac{1}{2}, though one falls and the other rises.
Why a vertical line has no slope. Take (5, -6) and (5, 3). The formula gives \displaystyle \frac{3 - (-6)}{5 - 5} = \frac{9}{0}. A quotient \displaystyle \frac{9}{0} would be a number q with q \times 0 = 9, because that is what division means: \displaystyle \frac{12}{3} = 4 because 4 \times 3 = 12. But any number times 0 is 0, never 9. Dividing by zero gives no number at all, so the slope is undefined and the line has no slope. It is not slope 0, which is a real number belonging to the flat, horizontal line. Nor is it an “infinite slope”: infinity is not a number. Tilting a line toward vertical makes the size of its slope grow past 10, 100, 1000 without end, so no number is left over for the vertical line itself.
Do three points lie on one line? For points A, B and C, find the slope from A to B and the slope from B to C. The two pairs share the point B, and that is what makes the test work. If the slopes differ, the points are not on one line, because a straight line has one slope between any two of its points; slope triangles show why. If both slopes are m, then starting from B the line of slope m and the point C both change height by m \times r for a run of r, so C is on that line, and so is A by the same argument. When one slope is undefined, the points are on one line only if all three share an x-coordinate.
Finding a missing coordinate. Substitute everything known into the formula, set it equal to the given slope, and solve the equation for the one unknown. If the unknown lands on the bottom, multiplying both sides by the bottom is allowed: it cannot be 0, since a line with a slope is not vertical. Recompute the slope with the answer in place as a check.
Worked examples
Day 1: the formula, and the points swapped
Find the slope of the line through (1, -3) and (5, 9). Then find it again with the points the other way round.
SolutionCall (1, -3) the first point, so x_1 = 1 and y_1 = -3, and (5, 9) the second. Substitute, keeping the negative coordinate in brackets:
On top, subtracting -3 is adding 3, which gives 12.
Now call (5, 9) the first point. Every difference changes sign:
The same slope, as it must be. The line rises 3 for every 1 across. Check by walking: from (1, -3), a run of 4 should bring a rise of 3 \times 4 = 12, and -3 + 12 = 9, which is the second point.
Day 1: a negative slope that simplifies
Find the slope of the line through (-6, 1) and (2, -5).
SolutionTake (-6, 1) first.
The bottom is 2 + 6 = 8, which is the distance from -6 to 2 along the number line. The top is negative and the bottom positive, so the slope is negative: the line falls 3 for every 4 across. The fraction \displaystyle \frac{6}{8} is written in lowest terms by dividing top and bottom by 2.
Check: from (-6, 1), going 8 right means going \displaystyle \frac{3}{4} \times 8 = 6 down, to (2, 1 - 6) = (2, -5).
Day 1: decimal and fraction coordinates
Find the slope of the line through each pair of points.
(a) (-1.5, 2.4) and (0.5, 3.4) \qquad (b) \displaystyle \left(-\frac{1}{2}, \frac{1}{3}\right) and \displaystyle \left(\frac{3}{2}, -\frac{5}{3}\right)
SolutionNeither pair could be counted on a grid, but the formula does not care.
(a)
(b) With fractions, work out the top and the bottom as single numbers first, and only then divide. That avoids a fraction stacked on a fraction.
So \displaystyle m = \frac{-2}{2} = -1. Here both differences came out whole. When they do not, divide by multiplying by the reciprocal of the bottom, as in \displaystyle \frac{3/4}{1/2} = \frac{3}{4} \times 2 = \frac{3}{2}.
Day 1: a zip line
A plan of a zip line uses x for the distance across the ground, in meters, from the foot of the starting tower, and y for the height above the ground, in meters. The cable leaves the tower at (0, 18) and reaches the landing point at (64, 2). Treat the cable as a straight line (a real cable sags a little).
(a) Find the slope of the cable and say what it means.
(b) How high is the cable 20 meters across from the tower?
Solution(a)
The top is meters of height and the bottom is meters across, so the units cancel and the slope is a plain number. It is negative because the cable runs downhill: it drops 1 meter for every 4 meters across.
(b) A straight cable has the same slope between any two of its points, so the slope from the tower to the point 20 meters across is also \displaystyle -\frac{1}{4}. Over a run of 20 the rise is \displaystyle -\frac{1}{4} \times 20 = -5, so the height is 18 - 5 = 13 meters. Check with the formula: from (0, 18) to (20, 13) the slope is \displaystyle \frac{13 - 18}{20 - 0} = \frac{-5}{20} = -\frac{1}{4}.
Day 2: the four kinds of slope
Find the slope of the line through each pair of points, and describe the line.
(a) (-8, -5) and (4, 1) \qquad (b) (-4, -1) and (-1, -7) \qquad (c) (-7, 4) and (3, 4) \qquad (d) (5, -6) and (5, 3)
SolutionIn each part the point further left is taken first, so the run is positive and the sign of the slope is the sign of the rise.
(a) m = \dfrac{1 - (-5)}{4 - (-8)} = \dfrac{6}{12} = \dfrac{1}{2}. Positive: the line rises.
(b) m = \dfrac{-7 - (-1)}{-1 - (-4)} = \dfrac{-6}{3} = -2. Negative: the line falls. Moving right, from x = -4 to x = -1, the height drops from -1 to -7. This line is also steeper than the one in (a), since 2 is larger than \displaystyle \frac{1}{2}.
(c) m = \dfrac{4 - 4}{3 - (-7)} = \dfrac{0}{10} = 0. Zero: the line is horizontal. Both points have y = 4, so the line is y = 4.
(d) \dfrac{3 - (-6)}{5 - 5} = \dfrac{9}{0}, which is undefined, since no number times 0 gives 9. The slope is undefined and the line is vertical: both points have x = 5, so the line is x = 5. Its slope is not 0; it has no slope at all.
Day 2: are three points on one line?
Decide whether each set of three points lies on one line.
(a) A(-3, -8), B(1, 0), C(4, 6) \qquad (b) P(-5, 6), Q(1, 2), R(7, -3)
SolutionIn each case find the two slopes that share the middle point.
(a)
The slopes are equal and the pairs share B, so A, B and C lie on one line. As a check, the third pair gives the same slope, as it must on one line: \displaystyle \frac{6 - (-8)}{4 - (-3)} = \frac{14}{7} = 2.
(b)
The slopes differ, so the three points are not on one line. The slopes also say how far off R is. Continuing the line through P and Q for 6 more across from Q drops it by \displaystyle \frac{2}{3} \times 6 = 4, to (7, -2). The point R is at (7, -3), one unit below.
Day 2: finding a missing coordinate
(a) The line through (3, -1) and (7, k) has slope \displaystyle -\frac{3}{2}. Find k.
(b) The line through (a, 2) and (4, 8) has slope \displaystyle \frac{3}{4}. Find a.
(c) For which value of c is the line through (c, -2) and (6, 9) vertical? For which value is its slope 2? Can it ever be horizontal?
Solution(a) Substitute everything known into the formula and set it equal to the slope:
that is, \displaystyle \frac{k + 1}{4} = -\frac{3}{2}.
Multiply both sides by 4: k + 1 = -6, so k = -7. Check: \displaystyle \frac{-7 - (-1)}{7 - 3} = \frac{-6}{4} = -\frac{3}{2}.
(b) This time the unknown lands on the bottom:
that is, \displaystyle \frac{6}{4 - a} = \frac{3}{4}.
The bottom 4 - a is not 0, because a line with slope \displaystyle \frac{3}{4} is not vertical, so both sides may be multiplied by 4(4 - a):
Divide both sides by 3: 8 = 4 - a, so a = -4. Check: \displaystyle \frac{6}{4 - (-4)} = \frac{6}{8} = \frac{3}{4}.
(c) The line is vertical exactly when the run is 0, that is, when the two x-coordinates are equal: c = 6.
For slope 2, the rise is 9 - (-2) = 11 and the run is 6 - c:
Check: \displaystyle 6 - \frac{1}{2} = \frac{11}{2}, and \displaystyle 11 \div \frac{11}{2} = 2.
It can never be horizontal. A horizontal line needs a rise of 0, and the rise is 11 whatever c is, because c only moves the first point sideways.
Boundaries
The two x-coordinates must differ. If x_1 = x_2 the bottom of the formula is 0, the quotient is undefined, and the line through the points is vertical. The formula gives no slope because there is none.
The two points must be different points. If x_1 = x_2 and y_1 = y_2 as well, the formula gives \displaystyle \frac{0}{0}. One point does not fix a line: lines of every steepness pass through it, so no slope is determined.
Top and bottom must be taken in the same order. Either point may come first, but the same point comes first on top and underneath. Mixing them gives -m instead of m.
Slope belongs to a straight line. For two points on a curve, the formula gives the slope of the straight segment joining them, not a slope of the curve itself.
The three-point test needs a shared point. Equal slopes for AB and CD, with no point in common, say only that the two lines are parallel or the same line.
In a context, slope carries units. On the zip line both coordinates were in meters, so the units canceled. If y is in dollars and x in hours, the slope is in dollars per hour.
Where this goes next
The formula quietly assumed that it does not matter which two points of a line are used, and the zip line relied on it. Slope triangles prove that, by showing that any two right triangles drawn along the same line are scaled copies of each other.
Once a slope is known, the next step is the equation of the line. In slope-intercept form, y = mx + b, the m is the slope found here and b is where the line crosses the y-axis. Given a context with units, the same number is a rate of change: dollars per hour, meters per second.
Parallel lines have equal slopes, and perpendicular lines have slopes whose product is -1, with the horizontal and vertical pair as the exception, since one of them has no slope. The same two differences, x_2 - x_1 and y_2 - y_1, are the legs of the right triangle in the distance formula. Later, when graphs curve, the slope between two of their points is called the average rate of change.
Exercises
Day 1: the slope formula
Find the slope of the line through each pair of points.
- (2, 1) and (5, 13)
- (-4, 7) and (2, -2)
- (-7, -2) and (-1, 2)
- (0, -5) and (-8, 5)
- (-3, -9) and (-6, -3)
- (1.5, -2) and (4, 3)
- \displaystyle \left(-\frac{2}{3}, \frac{1}{2}\right) and \displaystyle \left(\frac{4}{3}, 3\right)
Day 1: order and context
- Find the slope of the line through (6, -1) and (-2, 7) twice, once with each point taken first.
- For the points (3, 9) and (7, 1), work out \displaystyle \frac{1 - 9}{7 - 3} and \displaystyle \frac{1 - 9}{3 - 7}. Which one is the slope of the line through the two points, and why is the other one not?
- On Caoimhe’s map grid, a straight footpath runs from a well at (-4, 5) to a gate at (6, 0). Find the slope of the footpath.
- A second zip line runs straight from (0, 15) to (60, 3), with coordinates in meters as in Example 4. Find its slope, say what it means, and find how far the cable drops over the first 25 meters across.
Day 2: the four kinds of slope
Find the slope of the line through each pair of points, and say whether the line rises, falls, is horizontal or is vertical.
- (-9, 2) and (3, 2)
- (4, -5) and (4, 6)
- (-2, -8) and (1, 4)
- (-6, 7) and (2, 3)
- What is the slope of the line x = -2? What is the slope of the line y = 6?
Day 2: three points on one line
Decide whether the three points lie on one line.
- (-1, 8), (3, 2), (7, -4)
- (-6, -2), (2, 4), (6, 6)
- (5, -2), (5, 4), (5, 9)
Day 2: missing coordinates
- The line through (2, k) and (6, 9) has slope \displaystyle \frac{5}{2}. Find k.
- The line through (a, -3) and (1, 5) has slope -4. Find a.
- Caoimhe’s footpath from Exercise 10 carries on in the same straight line to a bridge at (10, b). Find b.
- Find k so that (-3, 4), (1, 6) and (7, k) lie on one line.
Reasoning
- Explain why a horizontal line has slope 0, but a vertical line has no slope rather than slope 0.
- Show that \displaystyle \frac{y_1 - y_2}{x_1 - x_2} = \frac{y_2 - y_1}{x_2 - x_1}, and explain what this means for which point you call the first.
Answers
- m = 4. \displaystyle \frac{13 - 1}{5 - 2} = \frac{12}{3}.
- \displaystyle m = -\frac{3}{2}. \displaystyle \frac{-2 - 7}{2 - (-4)} = \frac{-9}{6}.
- \displaystyle m = \frac{2}{3}. \displaystyle \frac{2 - (-2)}{-1 - (-7)} = \frac{4}{6}.
- \displaystyle m = -\frac{5}{4}. \displaystyle \frac{5 - (-5)}{-8 - 0} = \frac{10}{-8}.
- m = -2. \displaystyle \frac{-3 - (-9)}{-6 - (-3)} = \frac{6}{-3}.
- m = 2. \displaystyle \frac{3 - (-2)}{4 - 1.5} = \frac{5}{2.5}.
- \displaystyle m = \frac{5}{4}. Top: \displaystyle 3 - \frac{1}{2} = \frac{5}{2}. Bottom: \displaystyle \frac{4}{3} - \left(-\frac{2}{3}\right) = \frac{6}{3} = 2. Then \displaystyle \frac{5}{2} \div 2 = \frac{5}{4}.
- m = -1 both times. \displaystyle \frac{7 - (-1)}{-2 - 6} = \frac{8}{-8} = -1, and \displaystyle \frac{-1 - 7}{6 - (-2)} = \frac{-8}{8} = -1.
- \displaystyle \frac{1 - 9}{7 - 3} = -2 is the slope; \displaystyle \frac{1 - 9}{3 - 7} = 2 is not. In the first, top and bottom are both “the point (7, 1) minus the point (3, 9)”. In the second, the top goes from (3, 9) to (7, 1) and the bottom goes the other way, so the sign is flipped. The line really falls, since y drops from 9 to 1 while x increases from 3 to 7, so a positive slope cannot be right.
- \displaystyle m = -\frac{1}{2}. \displaystyle \frac{0 - 5}{6 - (-4)} = \frac{-5}{10}. The path drops 1 for every 2 across.
- \displaystyle m = -\frac{1}{5}: the cable drops 1 meter for every 5 meters across. \displaystyle \frac{3 - 15}{60 - 0} = \frac{-12}{60}. Over 25 meters across it drops \displaystyle \frac{1}{5} \times 25 = 5 meters.
- m = 0, horizontal. \displaystyle \frac{2 - 2}{3 - (-9)} = \frac{0}{12}.
- Undefined, vertical. \displaystyle \frac{6 - (-5)}{4 - 4} = \frac{11}{0}, and no number times 0 gives 11.
- m = 4, rises. \displaystyle \frac{4 - (-8)}{1 - (-2)} = \frac{12}{3}.
- \displaystyle m = -\frac{1}{2}, falls. \displaystyle \frac{3 - 7}{2 - (-6)} = \frac{-4}{8}.
- The line x = -2 has undefined slope: it is vertical, and any two of its points have the same x-coordinate, so the run is 0. The line y = 6 has slope 0: it is horizontal, so the rise between any two of its points is 0.
- Yes. \displaystyle \frac{2 - 8}{3 - (-1)} = -\frac{3}{2} and \displaystyle \frac{-4 - 2}{7 - 3} = -\frac{3}{2}. The slopes are equal and the two pairs share (3, 2).
- No. \displaystyle \frac{4 - (-2)}{2 - (-6)} = \frac{3}{4} but \displaystyle \frac{6 - 4}{6 - 2} = \frac{1}{2}.
- Yes. All three have x-coordinate 5, so all three lie on the vertical line x = 5. The slope formula divides by 0 here, so the test is the shared x-coordinate.
- k = -1. \displaystyle \frac{9 - k}{6 - 2} = \frac{5}{2}, so 9 - k = 10.
- a = 3. \displaystyle \frac{5 - (-3)}{1 - a} = -4, so 8 = -4(1 - a), which gives 1 - a = -2.
- b = -2. The slope is \displaystyle -\frac{1}{2} from Exercise 10, so \displaystyle \frac{b - 5}{10 - (-4)} = -\frac{1}{2}, which gives b - 5 = -7. Check with the gate: \displaystyle \frac{-2 - 0}{10 - 6} = -\frac{1}{2}.
- k = 9. The first two points give \displaystyle \frac{6 - 4}{1 - (-3)} = \frac{1}{2}. The third must give the same slope with (1, 6): \displaystyle \frac{k - 6}{7 - 1} = \frac{1}{2}, so k - 6 = 3.
- Two points on a horizontal line have the same y-coordinate and different x-coordinates, so the slope is \displaystyle \frac{0}{\text{run}} with a run that is not 0, and that is the number 0. Two points on a vertical line have the same x-coordinate, so the formula gives \displaystyle \frac{\text{rise}}{0} with a rise that is not 0. That would be a number which, times 0, gives the rise; every number times 0 is 0, so there is none. Dividing by zero gives no number, so the vertical line has no slope, not slope 0.
- Since y_1 - y_2 = -(y_2 - y_1) and x_1 - x_2 = -(x_2 - x_1), the left side is \displaystyle \frac{-(y_2 - y_1)}{-(x_2 - x_1)}. Multiplying top and bottom of a fraction by the same non-zero number, here -1, leaves its value unchanged, so it equals \displaystyle \frac{y_2 - y_1}{x_2 - x_1}. So either point may be called the first: the answer is the same, as long as the same point comes first on top and underneath.