math.wiki
Algebra › Linear relationships › Slope › Slope from a graph or a table
Open on the map
Math 8 · 8.EE.B.5 · 8.EE.B.6

Slope from a graph or a table

A straight line climbs across a grid, or a table lists pairs of numbers that change together. How do you put one number on how fast the second climbs as the first moves on?

Where you are 4 in Slope

When you reach for it

Two lines on the same grid can both go up from left to right and still look nothing alike: one creeps, the other shoots up. “Steep” and “gentle” are words. The slope is the number: how many units a straight line goes up for every one unit it goes across, with a sign that says whether it climbs or falls.

Reach for it whenever a straight line or a list of pairs is in front of you and the question is “how fast?”. On a graph you count squares; in a table you subtract. Either way the slope is the rate of change of the second quantity as the first moves on.

The lesson takes two days. Part 1 reads slope off a graph. Part 2 reads it from a table, checks first that the table describes a straight line at all, and says what the number means once the quantities carry units.

The procedure

Part 1: slope from a graph

Rise and run. Pick two points on a straight line on a coordinate grid. Walk from the left-hand point to the right-hand one in two straight moves: first across, then up or down. The move across is the run, the number of units traveled to the right. The move up or down is the rise, counted positive going up and negative going down. The slope of the line, written m, is

m = \frac{\text{rise}}{\text{run}}
x y −4 −2 2 4 6 −4 −2 2 4 6 8 3 4 3 4 (−2, −1) (4, 7)
Figure 1Walk right along the bottom leg (the run), then up the side leg (the rise). Both triangles have run 3 and rise 4.

The two moves and the stretch of line between the points make a right triangle, with the run along the bottom and the rise up the side. Figure 1 draws two such triangles under one line.

Why divide. The rise alone does not measure steepness: walk far enough along a gentle line and it rises a lot. What stays fixed is how much the line rises for each unit across, and dividing the rise by the run gives exactly that. A slope of \displaystyle \frac{2}{5} means each step of 1 to the right takes the line \displaystyle \frac{2}{5} of a unit up; a slope of 2 means 2 up for each 1 across. The larger the number, the steeper the climb.

Any two points give the same answer. The right triangles that fit under a straight line are all scaled copies of one another, so their legs are always in the same ratio; Slope triangles: why a line has one slope everywhere proves it. That is why we may speak of the slope of a line, and why you may pick whichever two points are easiest to read.

The sign. Walking left to right, the run is always positive, so the sign of the slope is the sign of the rise. A line that rises from left to right has a positive slope; a line that falls has a negative rise and a negative slope. The size still measures steepness: a slope of -3 falls more steeply than one of \displaystyle -\frac{1}{2}. Flat and vertical lines, and a formula that counts with coordinates, belong to The slope formula and the four kinds of slope.

Choosing the points. Where the line passes exactly through the crossing of two grid lines, a grid corner, the point has whole-number coordinates you can read without guessing. Anywhere else the point is an estimate, and a small misreading in a short rise or run makes a large error in the slope. So use two grid corners on the line, as far apart as convenient. On some lines only every second or third column has one (Example 3).

When a square is not worth 1. Graphs of real quantities seldom use the same scale on both axes: one square across might be 2 minutes and one square up 10 liters. Then turn the squares across into the run, in the units of the horizontal axis, and the squares up into the rise, in the units of the vertical axis, before dividing. The slope carries units, units of the vertical quantity per unit of the horizontal one, such as liters per minute. How steep a line looks depends on the scales someone chose; its slope does not (Example 4).

Part 2: slope from a table

Changes instead of squares. Each row of a table of values is a point (x, y). Between two rows, the run is the change in x and the rise is the change in y, each found by subtracting the earlier row’s value from the later row’s:

m = \frac{\text{change in } y}{\text{change in } x}

From the row (2, 7) to the row (5, 16), y changes by 16 - 7 = 9 while x changes by 5 - 2 = 3, so the slope is \displaystyle \frac{9}{3} = 3. Both changes come from the same two rows, in the same direction.

Uneven steps. A table need not step its inputs by the same amount each time. That does no harm, because each change in y is divided by the change in x it went with: a rise of 6 over a run of 2 and a rise of 15 over a run of 5 are the same slope, 3.

Check that the table is linear first. A table can be any list of pairs. With the rows in order of x, work out the slope from each row to the next: each change in y divided by its own change in x. If every one of these ratios is the same number m, the points lie on one line of slope m, and that is the slope of the table. If any two differ, the points do not lie on one line and the table has no single slope; each pair of rows has its own average rate of change. Both halves come from Slope triangles: why a line has one slope everywhere: three points with equal slopes from the first to the second and from the second to the third lie on one line, and three points on one line always give equal slopes. Applied to each three neighboring rows in turn, that settles the whole table.

The test is equal ratios, not equal changes in y. When the inputs are evenly spaced, equal changes in y do give equal ratios, since each is divided by the same change in x. When they are not, equal changes in y prove nothing (Example 6).

Slope as a rate. Once the quantities carry units, the slope reads as a rate: for every one unit of the input, the output changes by m of its units. A tank that loses 3 liters every minute has slope -3 liters per minute. Write the units with the number, and say in one sentence what it means. When the line passes through the origin, the slope is also the constant of proportionality that Recognizing a proportional relationship in a graph reads off a graph; most lines miss the origin, and their slope is read in the same way.

Worked examples

Example 1

Reading a slope off a rising line

Find the slope of the line in Figure 1 twice: (a) from the points (-2, -1) and (1, 3), and (b) from the points (-2, -1) and (4, 7). What does the slope say about the line?

Solution

All three points are grid corners, so their coordinates are exact.

(a) From (-2, -1), walk right until you are directly below (1, 3): from x = -2 to x = 1 is 3 squares, so the run is 3. Then walk up from y = -1 to y = 3, which is 4 squares, so the rise is 4.

m = \frac{\text{rise}}{\text{run}} = \frac{4}{3}

(b) From (-2, -1) to (4, 7) the run is 6 squares and the rise is 8 squares, so

m = \frac{8}{6} = \frac{4}{3}

The answers agree, as they must on a straight line; the second triangle is the first with both legs doubled. The slope is positive, matching a line that rises from left to right, and each unit across takes the line \displaystyle \frac{4}{3} of a unit up.

Example 2

A line that falls

Find the slope of the line in Figure 2, which passes through the grid corners (-4, 3) and (1, -1).

x y −4 −2 2 4 6 −6 −4 −2 2 4 5 −4 5 −4 (−4, 3) (6, −5)
Figure 2The line in Example 2. Going right 5 takes it down 4, so every rise is -4.
Solution

Start at the left-hand point, (-4, 3), and walk right to x = 1: the run is 5. To reach (1, -1) you must now go down, from y = 3 to y = -1, which is 4 squares. Down counts as negative, so the rise is -4.

m = \frac{-4}{5} = -\frac{4}{5}

The minus sign is the line falling from left to right; the size says it drops \displaystyle \frac{4}{5} of a unit for every unit across. Check with another pair of corners: the line also passes through (6, -5), and from (1, -1) to (6, -5) the run is again 5 and the rise again -4.

Example 3

Using points that sit on grid corners

The line in Figure 3 crosses the y-axis somewhere between 1 and 2. Find its slope.

x y −4 −2 2 4 −4 −2 2 4 6 2 3
Figure 3The line in Example 3 meets a grid corner only in every second column.
Solution

The crossing on the y-axis is not a grid corner, so its height can only be guessed. Look along the line for places where it passes exactly through a corner: (-3, -3), (-1, 0), (1, 3) and (3, 6), in every second column and never in between. From (1, 3) to (3, 6) the run is 3 - 1 = 2 and the rise is 6 - 3 = 3, so

m = \frac{3}{2}

The two corners furthest apart, (-3, -3) and (3, 6), give a run of 6 and a rise of 9, and \displaystyle \frac{9}{6} = \frac{3}{2} again.

The line in fact crosses the y-axis at \displaystyle \frac{3}{2}. Someone who rounds that to (0, 2) and pairs it with (1, 3) gets a rise of 1 over a run of 1, a slope of 1, which is a third too small. Corners remove the guess.

Example 4

Scales that are not 1 per square

Ulrike draws the side view of a wheelchair ramp as a graph, Figure 4. Across, each square is 2 meters of horizontal distance; up, each square is 10 centimeters of height. The ramp is the straight line from (0, 0) to (8, 40).

(a) What do you get by counting squares, and why is that not the slope of the ramp?

(b) Find the slope in centimeters per meter.

(c) Find the slope as a plain number, with the rise and the run in the same unit.

0 2 4 6 8 0 10 20 30 40 horizontal distance (m) height (cm) (8, 40)
Figure 4Ulrike’s ramp in Example 4. On the page it climbs one square for each square across, but the squares do not stand for the same amounts.
Solution

(a) The line goes 4 squares across and 4 squares up, and \displaystyle \frac{4}{4} = 1. But a square across and a square up stand for different amounts, 2 meters and 10 centimeters, so the 1 describes the drawing, not the ramp.

(b) The run is 4 squares of 2 meters, which is 8 meters. The rise is 4 squares of 10 centimeters, which is 40 centimeters. So

m = \frac{40 \text{ cm}}{8 \text{ m}} = 5 \text{ centimeters per meter}

For each meter of horizontal distance, the ramp lifts you 5 centimeters.

(c) Write the run in centimeters too: 8 meters is 800 centimeters. Then

m = \frac{40}{800} = \frac{1}{20}

with no units left, since centimeters divided by centimeters cancel. The ramp climbs 1 for every 20 across, in any unit: gentle, nothing like the line on the page. The scales made the picture steep.

Example 5

A table with uneven steps

Wanjiru cycles away from home at a steady pace, and her distance from home is noted at a few moments:

time (minutes)distance from home (km)
02
43.2
105
125.6
208

Find the slope, say what it means, and give it in kilometers per hour.

Solution

The times jump by 4, 6, 2 and 8 minutes, so divide each change in distance by the change in time it went with, row to row:

\begin{aligned} \frac{3.2 - 2}{4 - 0} &= \frac{1.2}{4} = 0.3 \\ \frac{5 - 3.2}{10 - 4} &= \frac{1.8}{6} = 0.3 \\ \frac{5.6 - 5}{12 - 10} &= \frac{0.6}{2} = 0.3 \\ \frac{8 - 5.6}{20 - 12} &= \frac{2.4}{8} = 0.3 \end{aligned}

The changes in distance are all different, yet every ratio is 0.3. So the points lie on one line, and its slope is 0.3 kilometers per minute: each minute, Wanjiru gets 0.3 km further from home. An hour is 60 minutes, and 60 \times 0.3 = 18, so the same slope is 18 kilometers per hour.

The slope is a ratio of changes, not of the two numbers in one row. At 4 minutes she is 3.2 km from home, and \displaystyle \frac{3.2}{4} = 0.8, which is not her speed: it also counts the 2 km she was already from home when the timing began.

Example 6

Is the table linear?

Decide whether each table describes a straight line. If it does, find its slope.

(a) The water in a tank as it fills:

time (minutes)water (liters)
040
264
5100
6112
10160

(b)

xy
05
18
311
414
617
Solution

(a) The slopes between neighboring rows are

\begin{aligned} \frac{64 - 40}{2 - 0} &= \frac{24}{2} = 12 \\ \frac{100 - 64}{5 - 2} &= \frac{36}{3} = 12 \\ \frac{112 - 100}{6 - 5} &= \frac{12}{1} = 12 \\ \frac{160 - 112}{10 - 6} &= \frac{48}{4} = 12 \end{aligned}

All four are 12, so the table is linear with slope 12 liters per minute: the tank gains 12 liters every minute.

(b) Here y goes up by 3 every row, which looks steady. But x goes up by 1, 2, 1, 2, so the slopes are

\frac{3}{1} = 3, \qquad \frac{3}{2}, \qquad \frac{3}{1} = 3, \qquad \frac{3}{2}

They are not all equal, so the points do not lie on one straight line and the table has no single slope. Figure 5 shows both tables plotted: the tank’s points on one line, and the path of table (b) bending at every row.

0 2 4 6 8 10 0 40 80 120 160 time (minutes) water (liters) (a) the tank 0 1 2 3 4 5 6 0 5 10 15 x y (b)
Figure 5The two tables of Example 6, plotted. Uneven steps do not stop the tank’s points lying on one line; equal steps in y do not make table (b) straight.
Example 7

A road’s grade

A road runs down a long straight hill. A map gives its height above sea level at a few places, measured by horizontal distance from the top:

distance from the top (m)height (m)
0312
250294.5
400284
1000242

(a) Show that the road’s profile is a straight line, and find its slope with units.

(b) A road sign gives the grade: the rise over the horizontal run (not the distance along the road surface), written as a percentage and without its sign. What does the sign at the top say?

(c) How far does the road drop over the first 1.2 km of horizontal distance? At what horizontal distance from the top is the road 200 m above sea level, if the hill keeps the same slope?

Solution

(a) The slopes between neighboring rows are

\begin{aligned} \frac{294.5 - 312}{250 - 0} &= \frac{-17.5}{250} = -0.07 \\ \frac{284 - 294.5}{400 - 250} &= \frac{-10.5}{150} = -0.07 \\ \frac{242 - 284}{1000 - 400} &= \frac{-42}{600} = -0.07 \end{aligned}

All three are equal, so the profile is a straight line with slope -0.07 meters of height per meter of horizontal distance. The minus sign is the road going down as the distance from the top grows. Meters over meters cancel, so the slope is also the plain number -0.07: the road drops 7 m for every 100 m of horizontal distance.

(b) \displaystyle 0.07 = \frac{7}{100}, which is 7\%. The grade states the size only; whether the road climbs or falls depends on which way you travel, and that is what the sign of the slope records.

(c) The height falls 0.07 m for every meter across, so over 1200 m it falls 0.07 \times 1200 = 84 meters. To be 200 m above sea level the road must fall 312 - 200 = 112 m from the top, which takes \displaystyle \frac{112}{0.07} = 1600 meters of horizontal distance, or 1.6 km. That answer goes beyond the table: it assumes the hill keeps its slope past the last row.

Boundaries

Straight lines only. Rise over run between two points of a curve depends on which two points you pick, so a curve has no single slope. That number is the average rate of change between those points.

The run cannot be zero. Two points straight above one another have run 0, and division by zero has no answer. A vertical line has no slope; The slope formula and the four kinds of slope takes up that case.

Exact points give exact slopes. A slope read from points off the grid corners is an estimate.

Squares are not units unless the scale says so. A count of squares is the slope only when one square stands for 1 unit on both axes.

A table shows only its rows. Equal slopes between neighboring rows prove that the listed points lie on one line. They cannot prove that the quantity changes steadily between the rows or beyond the last one; that comes from the situation, such as a pump running at a steady rate.

Where this goes next

The slope formula and the four kinds of slope does the counting with coordinates alone and settles the flat and vertical cases. In y = mx + b the m is this lesson’s number, and Slope-intercept form and Graphing a line from its equation read and draw lines from it. Comparing slopes decides whether two lines are parallel or perpendicular. The table test of Part 2 starts telling linear functions from nonlinear ones, and slope as a rate runs through linear functions in context and comparing a graph with a table. Much later, calculus asks for the slope of a curve at a single point, and finds it by letting the two points of this lesson slide together.

Exercises

Part 1: lines on a grid

Find the slope of each line in Figure 6, using two grid corners the line passes through.

x y −4 −2 2 4 −4 −2 2 4 (a) x y −4 −2 2 4 −4 −2 2 4 (b) x y −4 −2 2 4 −4 −2 2 4 (c) x y −4 −2 2 4 −4 −2 2 4 (d)
Figure 6The lines for Exercises 1 to 4. Each square is 1 unit on both axes.
  1. Line (a).
  2. Line (b).
  3. Line (c).
  4. Line (d).

Part 1: scales and settings

  1. On a graph of the distance a train has traveled, each square across is 5 minutes and each square up is 20 kilometers. Between two grid corners the line goes 6 squares right and 3 squares up. Find the slope with its units, and say what it means.
  2. Each step of a staircase is 28 cm deep and 17.5 cm high. What is the slope of a straight line that touches the front edge of every step?
  3. One wheelchair ramp rises 0.45 m over a horizontal run of 5.4 m. Another rises 0.3 m over a horizontal run of 4 m. Find both slopes as fractions, and say which ramp is steeper.
  4. On a grid where each square is 1 on both axes, a line passes through the grid corners (-6, 4) and (9, -3). Find its slope by working out how far right and how far up or down you go from one to the other.

Part 2: slope from a table

Each table is linear. Find its slope.

  1. x: 1, 2, 3, 4; y: 7, 4, 1, -2.
  2. x: -2, 0, 3, 7; y: -5, -4, -2.5, -0.5.

Part 2: linear or not

Decide whether each table is linear. If it is, give its slope.

  1. x: 0, 2, 4, 6; y: 3, 7, 11, 16.
  2. x: 1, 2, 4, 5, 8; y: 10, 13, 19, 22, 31.
  3. x: 0, 1, 3, 6; y: 2, 4, 6, 8.
  4. x: -3, -1, 0, 4; y: 11, 7, 5, -3.

Part 2: slope as a rate

  1. Zubair rides a window cleaners’ platform that climbs a tower steadily. At 0, 3, 8 and 10 minutes it is 55, 97, 167 and 195 m above the ground. Find the slope with its units and say what it means. If the climb stays steady, how high is the platform after 15 minutes, and when is it 300 m up?
  2. Xiomara is on a ferry. Its distance left to the port is 88, 77, 44 and 11 km at 0, 0.5, 2 and 3.5 hours. Find the slope with its units and say what it means. When does the ferry arrive, if it keeps the same pace?
  3. A road’s height above sea level is 140, 160, 195 and 215 m at horizontal distances of 0, 400, 1100 and 1500 m from the bottom of a hill. Show the profile is straight, give the grade, and say how much the road climbs over 1 km of horizontal distance.

Reasoning

  1. Explain why a line that falls from left to right has a negative slope whichever two of its points you use.
  2. A line passes through the grid corners (-2, -1) and (2, 4) and crosses the y-axis between grid lines. Valentin estimates that crossing as (0, 1) and works out the slope from (0, 1) and (2, 4). Saoirse uses (-2, -1) and (2, 4). They get different answers. Whose do you trust, and why?
  3. The same table is plotted twice, once with 1 unit per square on both axes and once with 5 units per square across. The line looks much steeper on the second graph. Explain why its slope is the same on both.
  4. Explain why, in a table whose x values are evenly spaced, equal changes in y are enough to show the table is linear, and why that test fails when the x values are unevenly spaced.
  5. In a table, the slope from the first row to the second is m, and the slope from the second row to the third is also m. Show that the slope from the first row straight to the third is m as well.
Answers
  1. \displaystyle \frac{1}{3}. Through the corners (-3, -2) and (3, 0): run 6, rise 2.
  2. -3. Through (-1, 3) and (1, -3): run 2, rise -6.
  3. \displaystyle \frac{3}{5}. Through (-4, -2) and (1, 1), the only grid corners it meets here: run 5, rise 3.
  4. \displaystyle -\frac{3}{7}. Through (-3, 2) and (4, -1), the only grid corners it meets here: run 7, rise -3.
  5. 2 kilometers per minute: the train covers 2 km each minute. Run 6 \times 5 = 30 minutes, rise 3 \times 20 = 60 km.
  6. \displaystyle \frac{5}{8}, or 0.625. Each step is a run of 28 and a rise of 17.5, and \displaystyle \frac{17.5}{28} = \frac{35}{56} = \frac{5}{8}.
  7. \displaystyle \frac{1}{12} and \displaystyle \frac{3}{40}; the first ramp is steeper, since over a common denominator these are \displaystyle \frac{10}{120} and \displaystyle \frac{9}{120}.
  8. \displaystyle -\frac{7}{15}. Right 15 and down 7: \displaystyle \frac{-7}{15}.
  9. -3. Each step of 1 in x changes y by -3.
  10. \displaystyle \frac{1}{2}. The row slopes are \displaystyle \frac{1}{2}, \displaystyle \frac{1.5}{3} and \displaystyle \frac{2}{4}.
  11. Not linear. The row slopes are 2, 2 and \displaystyle \frac{5}{2}.
  12. Linear, with slope 3. The row slopes are \displaystyle \frac{3}{1}, \displaystyle \frac{6}{2}, \displaystyle \frac{3}{1} and \displaystyle \frac{9}{3}.
  13. Not linear. The row slopes are 2, 1 and \displaystyle \frac{2}{3}: y steps evenly, x does not.
  14. Linear, with slope -2. The row slopes are \displaystyle \frac{-4}{2}, \displaystyle \frac{-2}{1} and \displaystyle \frac{-8}{4}.
  15. 14 meters per minute: the platform rises 14 m each minute. The row slopes are \displaystyle \frac{42}{3}, \displaystyle \frac{70}{5} and \displaystyle \frac{28}{2}. After 15 minutes it is 55 + 14 \times 15 = 265 m up, and 55 + 14t = 300 gives t = 17.5 minutes.
  16. -22 kilometers per hour: the distance left shrinks by 22 km every hour. The row slopes are \displaystyle \frac{-11}{0.5}, \displaystyle \frac{-33}{1.5} and \displaystyle \frac{-33}{1.5}. The ferry arrives after 4 hours, since 88 \div 22 = 4.
  17. Slope 0.05, a 5\% grade, uphill. The row slopes \displaystyle \frac{20}{400}, \displaystyle \frac{35}{700} and \displaystyle \frac{20}{400} are equal, so the profile is straight. Over 1000 m the road climbs 0.05 \times 1000 = 50 m.
  18. Walking from the left-hand point to the right-hand one, the run is positive. The line falls, so the right-hand point is lower and the rise is negative. A negative over a positive is negative, for every pair of points.
  19. Trust Saoirse. Both her points are grid corners, so her run of 4 and rise of 5 are exact, giving \displaystyle \frac{5}{4}. Valentin’s (0, 1) is a wrong guess: halfway between (-2, -1) and (2, 4) the line is at height \displaystyle \frac{3}{2}, so his point is off the line and his slope, \displaystyle \frac{3}{2}, is not the line’s.
  20. Between the same two points, both graphs show the same rise in units of y and the same run in units of x, so the slope is the same. Only the number of squares changes: on the second graph the run takes a fifth as many squares, which makes the line look steeper.
  21. If every step in x has the same size h, each row slope is a change in y divided by h, so equal changes in y give equal slopes. If the steps differ, equal changes in y are divided by different runs and give different slopes, as in Example 6(b).
  22. Call the two runs a and b. A slope of m means the rises are ma and mb. From the first row to the third the run is a + b and the rise is ma + mb = m(a + b), by the distributive property, so the slope is \displaystyle \frac{m(a + b)}{a + b} = m. The division is allowed because the runs are positive, so a + b is not 0.
kg1128 · updated 2026-10-09 · CC-BY-SA-4.0