Skip to main content
Daily Math Minute

Slope of a Line: Formula, Meaning, and Examples

What slope means, how to calculate it from two points or from an equation, and how to tell positive, negative, zero, and undefined slope apart, with worked examples and practice.

Algebra IBeginnerDaily Math Minute5 min read

What you'll learn

  • What the slope of a line measures
  • How to calculate slope from any two points using the slope formula
  • How to read slope from an equation in slope-intercept or standard form
  • How to tell positive, negative, zero, and undefined slope apart
  • How to interpret slope as a rate of change in a real situation

Introduction

The slope of a line measures how steep it is: how much the line goes up or down for every step it takes to the right. A slope of 3 means the line rises 3 units for every 1 unit you move right. A slope of −12-\tfrac{1}{2} means it falls half a unit for every 1 unit right.

Why this matters

Slope is a rate of change, and rates of change are everywhere: speed in miles per hour, cost in dollars per item, or the grade of a road. When a road sign warns of a "6% grade," it means the road drops 6 feet for every 100 feet of horizontal distance, which is a slope of −0.06-0.06. Slope is also the idea that calculus generalizes. The derivative is the slope of a curve at a single point.

The concept

Rise over run

Definition — Slope

The slope mm of a non-vertical line through the points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is the change in yy divided by the change in xx, as shown in equation (1).

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

The vertical change y2−y1y_2 - y_1 is the rise, and the horizontal change x2−x1x_2 - x_1 is the run. A line has the same slope everywhere, so any two points on it give the same answer.

Example — Slope between two points

For the points (1,2)(1, 2) and (4,11)(4, 11), the rise is 11−2=911 - 2 = 9 and the run is 4−1=34 - 1 = 3:

m=11−24−1=93=3m = \frac{11 - 2}{4 - 1} = \frac{9}{3} = 3

The order of the points doesn't matter, as long as you use the same order on top and bottom:

m=2−111−4=−9−3=3m = \frac{2 - 11}{1 - 4} = \frac{-9}{-3} = 3

The four kinds of slope

SlopeWhat the line does (reading left to right)Example
PositiveRisesm=3m = 3
NegativeFallsm=−2m = -2
ZeroStays flat (horizontal line)y=7y = 7
UndefinedGoes straight up and down (vertical line)x=3x = 3

A horizontal line has a rise of 0, so its slope is 0run=0\tfrac{0}{\text{run}} = 0. A vertical line has a run of 0, and division by zero is undefined, so a vertical line has no slope. That's different from a slope of zero.

Reading slope from an equation

When a line's equation is in slope-intercept form, y=mx+by = mx + b, the slope is the coefficient mm of xx, and bb is the yy-intercept. If the equation is in another form, solve it for yy first.

Example — From standard form to slope

Find the slope of 2x+5y=102x + 5y = 10.

Subtract 2x2x from both sides to get 5y=−2x+105y = -2x + 10. Then divide every term by 5:

y=−25x+2y = -\frac{2}{5}x + 2

The slope is −25-\tfrac{2}{5}.

Worked examples

Example — Worked example 1: negative coordinates

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

Step 1: Label the points: (x1,y1)=(−2,5)(x_1, y_1) = (-2, 5) and (x2,y2)=(3,−5)(x_2, y_2) = (3, -5).

Step 2: Substitute into equation (1), using parentheses around negative numbers:

m=−5−53−(−2)=−105=−2m = \frac{-5 - 5}{3 - (-2)} = \frac{-10}{5} = -2

Answer: m=−2m = -2. The line falls 2 units for every 1 unit to the right.

Example — Worked example 2: zero and undefined

Problem: Find the slope of the line through (2,7)(2, 7) and (6,7)(6, 7), and of the line through (3,1)(3, 1) and (3,8)(3, 8).

First line: m=7−76−2=04=0m = \frac{7 - 7}{6 - 2} = \frac{0}{4} = 0. Both points have the same yy-value, so the line is horizontal.

Second line: The run is 3−3=03 - 3 = 0, so the slope formula gives 70\tfrac{7}{0}, which is undefined. Both points have the same xx-value, so the line is vertical. Its equation is x=3x = 3.

Example — Worked example 3: slope as a rate of change

Problem: A candle is 30 cm tall after burning for 2 hours and 21 cm tall after burning for 5 hours. Assuming it burns at a constant rate, what is the slope, and what does it mean?

Step 1: Treat each measurement as a point (hours, centimeters): (2,30)(2, 30) and (5,21)(5, 21).

Step 2:

m=21−305−2=−93=−3m = \frac{21 - 30}{5 - 2} = \frac{-9}{3} = -3

Answer: The slope is −3-3 centimeters per hour. The candle gets 3 cm shorter every hour. The units of a slope are always (units of yy) per (units of xx).

Common mistakes

Warning — Putting the run on top

Slope is rise over run, so the change in yy goes on top. For (1,2)(1, 2) and (4,11)(4, 11), writing 4−111−2=13\tfrac{4 - 1}{11 - 2} = \tfrac{1}{3} is wrong. The correct slope is 93=3\tfrac{9}{3} = 3.

Warning — Mixing up the order of the points

y2−y1x1−x2\frac{y_2 - y_1}{x_1 - x_2} subtracts in opposite orders on top and bottom, which flips the sign of the answer. Whichever point you start with in the numerator, start with the same point in the denominator.

Warning — Confusing zero slope with undefined slope

A horizontal line has slope 0. A vertical line has undefined slope. A helpful memory aid: you can walk along a horizontal line (zero effort, zero slope), but you can't walk up a vertical wall (it's not possible, so there's no slope).

Warning — Subtracting a negative

3−(−2)=53 - (-2) = 5, not 1. Wrap negative coordinates in parentheses when you substitute them so the double negative is visible.

Practice questions

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

    Show answer

    m=4m = 4. The rise is 5−(−3)=85 - (-3) = 8 and the run is 2−0=22 - 0 = 2, so m=82=4m = \tfrac{8}{2} = 4.

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

    Show answer

    m=−12m = -\tfrac{1}{2}. The rise is 3−6=−33 - 6 = -3 and the run is 2−(−4)=62 - (-4) = 6, so m=−36=−12m = \tfrac{-3}{6} = -\tfrac{1}{2}.

  3. Find the slope of the line through (−1,−1)(-1, -1) and (−1,4)(-1, 4).

    Show answer

    Undefined. The run is −1−(−1)=0-1 - (-1) = 0, so the line is vertical. Its equation is x=−1x = -1.

  4. Find the slope of the line 3x−4y=123x - 4y = 12.

    Show answer

    m=34m = \tfrac{3}{4}. Subtract 3x3x to get −4y=−3x+12-4y = -3x + 12, then divide every term by −4-4 to get y=34x−3y = \tfrac{3}{4}x - 3.

Summary

  • Slope measures steepness as rise over run: m=y2−y1x2−x1m = \tfrac{y_2 - y_1}{x_2 - x_1}.
  • Positive slope rises, negative slope falls, zero slope is horizontal, and a vertical line's slope is undefined.
  • In y=mx+by = mx + b, the slope is mm. Solve other forms for yy to find it.
  • Slope is a rate of change, measured in units of yy per unit of xx.

For more practice, work through the slope of a line lesson and then the slope-intercept form lesson in the Algebra I curriculum.