Gradient of a Line - Definition & Formula
Gradient of a Line - Definition & Formula
What Is The Gradient Of A Line?
The gradient of a line is a number that tells you two things at once: how steep the line is and which way it slants. It is defined as the change in the y-coordinate divided by the change in the x-coordinate between any two points on the line:
m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\Delta y}{\Delta x}
The letter m stands for the gradient. "Gradient" is simply the British and Commonwealth name for what is called the "slope" in the United States - the two words describe the identical idea. So the slope of a line and the gradient of a line are the same quantity, computed the same way.
The gradient's most useful home is inside the equation of a straight line:
y = mx + c
Here m is the gradient and c is the y-intercept (where the line crosses the vertical axis). Read off the number multiplying x, and you have the gradient without any calculation.
A gradient can be positive, negative, zero, or undefined. A positive gradient rises left to right; a negative gradient falls; a horizontal line has gradient 0; a vertical line has an undefined gradient (its run is zero, so you would divide by zero).
Examples Of Gradient Of A Line
These examples build from reading m off an equation to finding it from two points and from a graph. Each problem statement is bold; the steps are plain.
Example 1
What is the gradient of the line y = 3x + 5?
The equation is already in the form y = mx + c. The gradient is the coefficient of x.
Here that coefficient is 3.
Final answer: the gradient is m = 3.
Example 2
Find the gradient of the line through the points (2,3) and (6,11).
Your first instinct might be to divide the run by the rise - "x over y" - because x is usually named first. Let's see where that leads.
Writing ( \frac{x_2 - x_1}{y_2 - y_1} = \frac{6 - 2}{11 - 3} = \frac{4}{8} = \frac{1}{2} ) gives a gentle-looking gradient. But the line rises 8 for a run of only 4, so it is clearly steep - a gradient under 1 cannot be right.
The gradient is rise over run, y on top:
m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{11 - 3}{6 - 2} = \frac{8}{4} = 2
Final answer: the gradient is m = 2.
Example 3
A line passes through (1,5) and (4,-4). Find its gradient.
m = \frac{-4 - 5}{4 - 1} = \frac{-9}{3} = -3
Final answer: the gradient is m = -3, so the line falls three units for every one unit right.
Example 4
Rewrite 2y = 6x + 10 in the form y = mx + c and state the gradient.
The equation is not yet solved for y, so divide every term by 2:
y = 3x + 5
Now it is in y = mx + c form, and the coefficient of x is 3.
Final answer: the gradient is m = 3. (Reading m before rearranging would have wrongly given 6.)
Example 5
A road rises 3 m over a horizontal distance of 12 m. What is its gradient?
Gradient is rise over run:
m = \frac{\text{rise}}{\text{run}} = \frac{3}{12} = \frac{1}{4} = 0.25
Final answer: the gradient is ( \frac{1}{4} ), often written as "1 in 4" on road and railway signs.
Example 6
What is the gradient of a horizontal line, and of a vertical line? A horizontal line has no vertical change: ( \Delta y = 0 ), so m = 0.( \Delta x ) can be any non-zero number. So the gradient is 0.
A vertical line has no horizontal change: ( \Delta x = 0 ), which is undefined (you cannot divide by zero).
Final answer: horizontal gradient = 0; vertical gradient is undefined.
Why The Gradient Matters: "A Single Number For Steepness and Direction"
The gradient began as a practical measurement long before it became algebra: the grade of a road, the pitch of a roof, the rise of a railway. Engineers needed one number that said how hard a climb was, and "rise over run" delivered it. That is the substance behind y = mx + c - the m is a real physical steepness, not just a letter.
Safety limits. Wheelchair-access ramps are capped near a gradient of 1 in 12; roads and railways post maximum gradients so vehicles can brake and climb safely. The number sets the rule.
Rates of change. In any straight-line graph - distance against time, cost against quantity - the gradient is the rate: speed, price per unit, litres per minute. Reading m reads the rate directly.
Comparing lines instantly. Two lines with gradients 2 and 5 can be ranked for steepness at a glance; the larger |m| is the steeper line, whichever way it points.
When a railway is surveyed, the ruling gradient decides everything from how long a train needs to brake to whether a locomotive can haul its load up the incline at all. A miscalculated gradient is not a rounding error - it can mean a train that cannot make the hill. The gradient turns "how steep?" from a vague impression into a number a rule can be written around.
Common Mistakes With the Gradient of a Line
These errors show up the moment the equation is not already tidy, or the points are given out of order.
Mistake 1: Reading m before rearranging the equation
Where it slips in: Grabbing the number in front of x while the equation is not yet in y = mx + c form.
Don't do this: Looking at 2y = 6x + 10 and calling the gradient 6.
The correct way: Solve for y first. Dividing by 2 gives y = 3x + 5, so the true gradient is 3.
Mistake 2: Dividing run by rise (flipping the fraction)
Where it slips in: Putting ( \Delta x ) on top and ( \Delta y ) on the bottom.
Don't do this: Computing x2−x1y2−y1, which is the reciprocal of the gradient.
The correct way: Gradient is rise over run, ( \frac{\Delta y}{\Delta x} ), with the y-change on top. The second-guesser who is unsure which goes on top can sanity-check against the graph: a steep line must give a gradient bigger than 1.
Mistake 3: Treating gradient and slope as different things
Where it slips in: Meeting "gradient" in a British textbook and "slope" in an American one and assuming they are separate topics. Don't do this: Learning two formulas for what you think are two ideas. The correct way: They are the same quantity with two names. "Gradient" is the UK term, "slope" the US term; both equal ( \frac{\Delta y}{\Delta x} ) and both are the m in y = mx + c.
Conclusion
- The gradient of a line is ( \frac{\Delta y}{\Delta x} ) - its steepness and direction in one number.
- It is exactly the m in y = mx + c; read off the coefficient of x once the equation is in that form.
- Gradient (UK) and slope (US) are the same thing, computed identically.
- A gradient can be positive (rising), negative (falling), zero (horizontal), or undefined (vertical).
- Rise goes on top, run on the bottom - flipping the fraction gives the reciprocal, not the gradient.
Practise What You Have Learned
Work through these to test your understanding: state the gradient of y = −4x + 7 (Answer to Question 1: −4); find the gradient through (0,1) and (5,16) (Answer to Question 2: 3); and rewrite 3y = 9x − 6 as y = mx + c and give its gradient.