The gradient (or slope) of a straight line measures how steep it is — how much y changes for each unit that x increases. It is found from any two points on the line.
The gradient formula
Take two points (x₁, y₁) and (x₂, y₂). The gradient is the change in y divided by the change in x.
Key idea
m = (y₂ − y₁) / (x₂ − x₁)
= vertical change / horizontal change
Worked example
Find the gradient of the line through (0, 2) and (3, 8).
m = (8 − 2)/(3 − 0) = 6/3 = 2.
So y rises 2 units for every 1 unit across.
Reading the sign
A positive gradient means the line rises from left to right; a negative gradient means it falls. A horizontal line has gradient 0, and a vertical line has an undefined gradient.
It does not matter which point you call the first and which the second, as long as you subtract the y-values and the x-values in the same order. For the line through (0, 2) and (3, 8), doing it the other way gives (2 − 8)/(0 − 3) = (−6)/(−3) = 2 — the same answer. The size of the gradient tells you how steep the line is: a gradient of 4 is steeper than a gradient of 2.
Remember
- m = (y₂ − y₁)/(x₂ − x₁) — subtract in the same order top and bottom.
- Positive m rises, negative m falls.
- Horizontal line → m = 0; vertical line → m undefined.
- The steeper the line, the larger the size of m.