The Slope Formula
Computing steepness from two points without a graph.
The explanation
Given two points, slope is the change in y divided by the change in x.
For (2, 3) and (6, 11): m = (11 − 3)/(6 − 2) = 8/4 = 2.
Pick a point to be "first" and stay consistent. Both subtractions must go in the same order, or the sign comes out wrong.
Special cases:
- Horizontal line: y never changes, so m = 0.
- Vertical line: x never changes, so you would divide by zero. The slope is undefined.
"Zero slope" and "undefined slope" are opposite situations, and swapping them is a common exam error.
The formula m = (y₂ − y₁)/(x₂ − x₁) is well defined for a line because the ratio is invariant across point choices, by similar triangles. Reversing both differences leaves the quotient unchanged, so the point order is free — but mixing the orders negates only the numerator and produces the wrong sign.
Slope is the constant rate of change of a linear function, Δy/Δx, and the discrete analogue of the derivative. For nonlinear functions the same formula computes the average rate of change between two points, which is the slope of the secant line.
Sign and magnitude both carry meaning: positive slope rises, negative falls, and larger absolute value is steeper. Parallel lines share a slope; perpendicular lines have slopes with product −1.
A vertical line has x₂ = x₁, so the slope is undefined and no y = mx + b form exists — vertical lines are written x = c and are the one family the slope-intercept form cannot express.
Worked example
Find the slope through (−3, 7) and (5, −1), then state the slope of any line perpendicular to it.
- m = (−1 − 7)/(5 − (−3)) = −8/8.
- m = −1.
- Perpendicular slope is the negative reciprocal of −1.
Answer: m = −1; a perpendicular line has slope 1.
Common mistakes
- Computing (y₂ − y₁)/(x₁ − x₂), mixing the subtraction order.
- Calling a vertical line's slope zero.