A straight line is fixed by its gradient and any one point on it. The equation y = mx + c connects them: m is the gradient and c is where the line crosses the y-axis. This lesson turns either a gradient and a point, or two points, into that equation.
How do you build the equation?
Start from the gradient m, from a question or from two points. Then use one known point (x₁, y₁) in the point-gradient form:
y − y₁ = m(x − x₁)
Expand the bracket and tidy up to reach y = mx + c. The point-gradient form works because any point (x, y) on the line has the same gradient to (x₁, y₁), and that gradient is m.
How do you work it out, step by step?
- Get the gradient. If the question gives two points, calculate m first.
- Choose one of the points and write it inside brackets: (x₁, y₁).
- Write y − y₁ = m(x − x₁), keeping the signs exactly as they are.
- Expand and rearrange into y = mx + c.
- Test the other point in your final equation.
Worked example
Find the equation of the line through (−1, 7) and (3, −1).
Step 1, gradient: m = (−1 − 7)/(3 − (−1)) = −8/4 = −2.
Step 2, choose a point: use (−1, 7), so x₁ = −1 and y₁ = 7.
Step 3, point-gradient form: y − 7 = −2(x − (−1)), which is y − 7 = −2(x + 1).
Step 4, expand: y − 7 = −2x − 2, so y = −2x + 5.
Step 5, test the other point: at x = 3, y = −2(3) + 5 = −6 + 5 = −1. This matches (3, −1).
Second check: at x = −1, y = 2 + 5 = 7, which matches the first point. The equation is y = −2x + 5, with gradient −2 and y-intercept 5.
The mistake to watch for
The common slip is a sign error when the x-coordinate of the point is negative.
Mistaken working: y − 7 = −2(x − 1), which gives y = −2x + 9.
The student wrote x − 1 instead of x − (−1) = x + 1, losing the negative sign of the point.
The wrong equation fails the test immediately: at x = −1 it gives y = 2 + 9 = 11, not 7. The correction is to write the substitution with brackets first, y − 7 = −2(x − (−1)), and only then simplify.
A second slip is forgetting to multiply the constant inside the bracket, so −2(x + 1) becomes −2x + 1 instead of −2x − 2.
Check yourself
Try these without a calculator, then open each answer.
1. Find the equation of the line with gradient 4 through (1, 3).
Show answer
y − 3 = 4(x − 1), so y − 3 = 4x − 4, giving y = 4x − 1. Check: at x = 1, y = 3. ✓
2. Find the equation of the line through (0, −2) and (4, 6).
Show answer
Gradient = (6 − (−2))/(4 − 0) = 8/4 = 2. The point (0, −2) is the y-intercept, so y = 2x − 2. Check: at x = 4, y = 8 − 2 = 6. ✓
3. Find the equation of the line with gradient 1/2 through (−2, 1).
Show answer
y − 1 = 1/2(x + 2), so y − 1 = x/2 + 1, giving y = x/2 + 2. Check: at x = −2, y = −1 + 2 = 1. ✓
Where this leads next
Next, see how gradients help you identify parallel and perpendicular lines, and later check whether three points are collinear. If the gradient step still feels uncertain, revisit calculating a gradient from two points. The coordinate geometry practice set has similar questions in mixed order.
Some students can follow every line of a worked example but stall on a blank question. A teacher in online one-to-one Mathematics tuition can watch where the first step goes wrong and adjust from there.