The Gradient of a Line
You are cycling up a hill and you spot a road sign: a red triangle with
1 in 5 printed inside. Your legs already know what it means — this is going
to hurt. That little number is a gradient: it says the road climbs
1 metre upward for every 5 metres you
travel along. A "1 in 20" sign would be a gentle slope you'd barely notice; "1 in 3" is a wall
you'd struggle to walk up.
The gradient (or slope) of a straight line is exactly this
idea, made precise: a single number that measures how steep the line is — how far it
climbs for every step you take across it. It's the steepness of a wheelchair ramp, the pitch of
a roof, the tilt of a ski run… and, as you'll see, the speed hidden inside a graph.
Rise over run
To pin down the steepness, take any two points on the line,
(x_1, y_1) and (x_2, y_2). Walk from the
first to the second. How far did you climb? That's the rise. How far did you
move across? That's the run. The gradient m is the
rise divided by the run:
m = \frac{\text{rise}}{\text{run}} = \frac{\text{change in } y}{\text{change in } x} = \frac{y_2 - y_1}{x_2 - x_1}
A positive gradient means the line climbs as you read it from left to
right; a negative gradient means it falls; and a gradient of
zero means the line is perfectly flat. The bigger the number (ignoring
its sign), the steeper the line.
The gradient in a nutshell
-
The gradient is m = \dfrac{\text{rise}}{\text{run}} — vertical
change over horizontal change.
-
Positive m climbs left to right;
negative m falls.
- A horizontal line has gradient m = 0.
- A vertical line has an undefined gradient (its run is zero, and you cannot divide by zero).
- Parallel lines have equal gradients.
Reading the rise and the run
Here is the line through (1, 1) and
(5, 4). Step the figure to see the run (how far you move
across) and the rise (how far you climb). Going from the first point to the second,
you move 4 across and 3 up, so
m = \frac{\text{rise}}{\text{run}} = \frac{3}{4}.
Worked example 1 — a clean positive gradient
Find the gradient of the line through (2, 1) and
(6, 9).
Label the points: (x_1, y_1) = (2, 1) and
(x_2, y_2) = (6, 9). Now subtract, keeping the
y's on top and the x's on the bottom:
m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{9 - 1}{6 - 2} = \frac{8}{4} = 2.
The gradient is 2: the line climbs 2 up
for every 1 across. Positive, so it rises left to right — just as we
expect, since the second point is higher and further right than the first.
Worked example 2 — a negative gradient
Find the gradient of the line through (1, 5) and
(4, -1).
m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{-1 - 5}{4 - 1} = \frac{-6}{3} = -2.
The gradient is -2. The minus sign is telling you
something real: as you move to the right the line goes down, not up — it's a downhill
slope, like a ski run or a slide. A negative gradient is not a mistake; it's a line that falls.
Check: it doesn't matter which point you call "first". Swap them and you get
\frac{5 - (-1)}{1 - 4} = \frac{6}{-3} = -2 — the same answer, as long
as the x's and y's are subtracted in the
same order.
Worked example 3 — gradient is a rate of change
Here's where the gradient earns its keep. Draw a graph of distance (up the
side) against time (across the bottom) for a runner. If she is at
20\text{ m} after 4\text{ s} and at
80\text{ m} after 16\text{ s}, the
gradient of her distance–time line is
m = \frac{80 - 20}{16 - 4} = \frac{60}{12} = 5.
Look at the units: metres on top, seconds on the bottom — 5 metres
per second. The gradient is her speed. That's the deep idea: whenever you plot one
thing against another, the gradient tells you the rate at which one changes as
the other does — metres per second, pounds per mile, litres per minute. Steepness and speed are
the same measurement wearing different clothes.
Slide the gradient and watch
Pull the slider to change the gradient m of a line through the
origin. Push it positive and the line climbs; push it negative and the line falls; slide it to
0 and the line lies flat. The further from zero, the steeper.
The number-one gradient mistake is flipping the fraction. It is always
m = \frac{\text{rise}}{\text{run}} = \frac{\text{change in } y}{\text{change in } x},
the up-change on top and the across-change on the bottom — never the other way
round. A memory hook: you rise before you run, and the letters
run down the page just like a fraction. Two more traps in the same family:
-
Keep the order the same top and bottom. If you do
y_2 - y_1 on top, you must do x_2 - x_1
(same points, same order) on the bottom — mixing them up flips the sign.
-
Mind the four cases. Positive m rises left to
right; negative falls; a horizontal line has m = 0
(no rise); and a vertical line has an undefined gradient —
its run is 0, and dividing by zero has no answer. "Zero gradient"
and "no gradient" are not the same thing.
Straight lines are easy — their steepness is the same everywhere. But most things in the world
curve: a car speeds up, a population balloons, a cup of coffee cools. How steep is a
curve? It has a different steepness at every point!
The trick is beautiful: zoom in on a curve far enough and any smooth curve looks like a straight
line. The gradient of that line — the line that just grazes the curve at a single point,
called the tangent — is the curve's steepness right there. This is the
derivative, one of the
most powerful ideas in all of mathematics, and it is nothing more than rise-over-run taken to its
limit. Master this humble school-graph gradient now, and you have already taken the first step
toward measuring the rate of change of anything — speeding cars, growing crowds, cooling
coffee.