The gradient of a straight line measures its steepness. It equals the change in y divided by the change in x between any two points on the line.
How do you calculate it?
Pick two points (x1, y1) and (x2, y2). The gradient is (y2 − y1) ÷ (x2 − x1).
Use the points in the same order on top and bottom. It does not matter which point you call first, only that you keep the order.
Worked example
A line passes through P(2, 5) and Q(6, 13). This is a worked example.
Change in y: 13 − 5 = 8. Change in x: 6 − 2 = 4. Gradient = 8 ÷ 4 = 2.
The direction check agrees. Going from P to Q, x rises and y rises, so the line goes uphill and the gradient is positive.
Now a downhill line through R(−1, 7) and S(3, −1). Change in y: −1 − 7 = −8. Change in x: 3 − (−1) = 4. Gradient = −8 ÷ 4 = −2.
As x increases from −1 to 3, y drops from 7 to −1, so the line goes downhill and a negative gradient is correct.
What does the common mistake look like?
A student calculates the gradient through P and Q as (5 − 13) ÷ (6 − 2) = −8 ÷ 4 = −2. The top used P first and the bottom used Q first, so the order was mixed. The uphill line was given a downhill gradient.
The direction check catches it in seconds: the line rises from left to right, so a negative answer cannot be right. The fix is to write the points as (x1, y1) and (x2, y2) first, then fill both the top and bottom from the same labels.
Steps to follow
- Label your two points as (x1, y1) and (x2, y2).
- Work out y2 − y1 for the top and x2 − x1 for the bottom, in that order.
- Divide, then check the sign: uphill is positive and downhill is negative.
Self-check
Find the gradient of the line through T(−2, 1) and U(4, 10), and say whether it slopes uphill or downhill.
Answer
Change in y: 10 − 1 = 9. Change in x: 4 − (−2) = 6.
Gradient = 9 ÷ 6 = 1.5. As x increases from −2 to 4, y increases from 1 to 10, so the line slopes uphill, and a positive gradient is correct. Note that subtracting −2 becomes adding 2.
Where to go next
Once you can find a gradient, learn to say what it means with reading an intercept in context. Signs matter here, so revisit adding and subtracting negative numbers if they slip. The motion-graph explorer shows gradients as speed, and the hub lists the other skills.