
Math Education
Equation of a Straight Line: Gradient, Formulas and Examples

Dewi Lestari
Mathematics Specialist

The equation of a straight line is one whose graph is a straight line, written y = mx + c. Here m is the gradient (slope) and c is the y-intercept. It is taught in Year 8 and underpins linear functions and simultaneous equations.
What a Gradient Is
The gradient says how steeply the line rises or falls.
Read it as: how far up, divided by how far along.
| Gradient | Shape of the line |
|---|---|
| Positive | Rises left to right |
| Negative | Falls left to right |
| Zero | Horizontal |
| Undefined | Vertical |
A real example: a road sign reading 8% means a gradient of 0.08 — rising 8 metres for every 100 metres along. Gradient is not only a school idea.
Three Forms of the Equation
| Form | Formula | Use when |
|---|---|---|
| Slope-intercept | y = mx + c | The gradient and y-intercept are known |
| Standard | ax + by + c = 0 | The exam gives it this way |
| Point-slope | y − y₁ = m(x − x₁) | One point and the gradient are known |
Building the Equation
Through One Point with a Known Gradient
Example: through (2, 5) with m = 3
y − 5 = 3(x − 2) → y − 5 = 3x − 6 → y = 3x − 1
Through Two Points
Example: through (1, 2) and (3, 8)
- Find the gradient: m = (8 − 2) ÷ (3 − 1) = 6 ÷ 2 = 3
- Use either point: y − 2 = 3(x − 1) → y = 3x − 1
Either point works in the second step and the result is the same. This is asked often and the answer saves exam time.
Parallel and Perpendicular
Two conditions that always appear in tests:
- Parallel → the gradients are equal: m₁ = m₂
- Perpendicular → the gradients multiply to −1: m₁ × m₂ = −1
Example: a line perpendicular to y = 2x + 3 has gradient −1/2, since 2 × (−1/2) = −1.
A memory hook for perpendicular: flip the fraction, then flip the sign. Gradient 3 becomes −1/3; gradient −2/5 becomes 5/2.
Sketching the Graph
The fastest route for y = 2x − 4:
- The y-intercept is c = −4, giving the point (0, −4).
- From there use the gradient: up 2, along 1 → the point (1, −2).
- Draw the line through both points.
Two points determine a line. Building a table of five values just wastes time.
The Mistakes That Actually Cost Marks
1. Computing the gradient upside down. Writing (x₂ − x₁) ÷ (y₂ − y₁). Remember: y goes on top.
2. Inconsistent point order. If the numerator starts with the second point's y, the denominator must start with the second point's x. Mixing the order flips the sign of the gradient.
3. Not expanding the whole bracket. y − 5 = 3(x − 2) becoming 3x − 2 instead of 3x − 6. That is an algebra slip, not a straight-line one.
4. Thinking perpendicular just means negating the gradient. The perpendicular gradient to 2 is −1/2, not −2.
5. Swapping m and c. In y = 4 + 2x the gradient is 2 and the intercept is 4, not the other way round. Rearrange into standard form before reading them off.