Skip to content
Tutorials Center
My learning

Topics

Lesson 30 of 38 ยท The Coordinate Plane and Graphs

Slope and Rate of Change

Learn slope as rise over run, calculate it from two points or a table, understand positive, negative, zero and undefined slopes, and link it to rates.

How steep is a hill? How fast is a car going? How quickly is a phone battery draining? All three questions ask for a rate of change: how much one quantity changes when another changes by one unit. On a graph, the steepness of a line has a name: its slope. Slope turns the idea of "steepness" into a single number you can calculate and compare.

Rise over run

Pick two points on a line. Going from the first to the second, the line moves up or down by the rise and sideways by the run. The slope is the ratio:

Text
slope = rise / run = (yโ‚‚ - yโ‚) / (xโ‚‚ - xโ‚)

Often slope is written with the letter m.

Example 1. Points (1, 2) and (4, 8).

Text
rise = 8 - 2 = 6
run  = 4 - 1 = 3
m = 6 / 3 = 2

For every 1 step right, the line goes up 2.

Example 2. Points (-2, 5) and (2, -3).

Text
rise = -3 - 5 = -8
run  = 2 - (-2) = 4
m = -8 / 4 = -2

A negative slope means the line goes down as you move right.

The order of the points does not matter, as long as you subtract in the same order on top and bottom. Swapping both gives (5 - (-3)) / (-2 - 2) = 8 / -4 = -2, the same.

flowchart LR
  A["Choose two points"] --> B["rise = yโ‚‚ โˆ’ yโ‚"]
  A --> C["run = xโ‚‚ โˆ’ xโ‚"]
  B --> D["slope = rise รท run"]
  C --> D

Slope is the vertical change divided by the horizontal change.

Python Slope calculator

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Four kinds of slope

Picture Slope Example
Rises from left to right positive m = 2
Falls from left to right negative m = -2
Perfectly flat zero m = 0 (horizontal line)
Perfectly vertical undefined no m (you would divide by zero)

A bigger number without the sign means a steeper line: m = 5 is steeper than m = 2, and m = -5 is as steep as m = 5 but slopes down.

Python Compare slopes visually

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Slope from a table

For a table of values, pick two rows and divide the change in y by the change in x. If the table is linear, any two rows give the same answer.

x 0 2 4 6
y 5 11 17 23

From x = 0 to 2: (11 - 5) / 2 = 3. From 2 to 4: (17 - 11) / 2 = 3. The slope is 3, so the equation is y = 3x + 5: the slope is the coefficient of x, and the y-intercept is the +5.

Slope as a rate

When the axes have meaning, slope has a unit: the unit of y per unit of x.

  • Distance (km) against time (h): slope is speed in km/h.
  • Cost ($) against quantity (kg): slope is price in $/kg.
  • Water in a tank (L) against time (min): a negative slope means the tank is emptying, in L/min.

Example 3. A cyclist is 10 km from home after 1 hour and 40 km after 3 hours. Slope = (40 - 10) / (3 - 1) = 15 km/h.

Example 4. A tank holds 120 L at time 0 and 30 L at time 15 min. Slope = (30 - 120) / 15 = -6 L/min. The negative sign says the water level is dropping, 6 liters every minute.

Python Rates from data

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Slope and the equation y = mx + b

Every non-vertical line can be written as y = mx + b, where m is the slope and b is the y-intercept. This is the link to earlier lessons: the arithmetic sequence aโ‚™ = aโ‚ + (n-1)d is a line with slope d, and the taxi fare 2d + 3 has slope 2 ($ per km) and intercept 3 (the starting charge).

To find the equation from two points, compute m, then substitute one point to find b. For (1, 2) and (4, 8): m = 2; then 2 = 2(1) + b gives b = 0, so y = 2x.

Common mistakes

  • Subtracting in different orders on top and bottom. (yโ‚‚ - yโ‚) / (xโ‚ - xโ‚‚) gives the wrong sign.
  • Writing run over rise by accident.
  • Saying a horizontal line has "no slope". Its slope is 0. A vertical line's slope is undefined.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

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

    rise = 11 - 3 = 8, run = 6 - 2 = 4, slope = 8 / 4 = 2.
  2. 2. A line goes from (0, 8) to (4, 0). What is its slope?

    rise = 0 - 8 = -8, run = 4 - 0 = 4, slope = -8 / 4 = -2.
  3. 3. What is the slope of a horizontal line?

    A horizontal line has no rise, so rise / run = 0 / run = 0.
  4. 4. A graph of distance (m) against time (s) has slope 5. What does that mean?

    Slope is change in distance per change in time: 5 m/s.

Summary

  • Slope = rise / run = (yโ‚‚ - yโ‚) / (xโ‚‚ - xโ‚).
  • Positive slopes rise, negative slopes fall, horizontal lines have slope 0, vertical lines have undefined slope.
  • For a linear table, the change in y divided by the change in x is constant.
  • In y = mx + b, m is the slope and b is the y-intercept.
  • Slope is a rate of change and carries units like km/h or $/kg.

Next: Reading and Interpreting Graphs