Finding the Equation of a Straight Line
The equation of a straight line is y = mx + c. The gradient m shows how steep the line is, found from two points using m = (y₂ − y₁) ÷ (x₂ − x₁). The y-intercept c is where the line crosses the y-axis, when x = 0.

Video Lesson
Watch and learn the basics

🎬 Did this video explain it clearly?
Flashcards
Review key concepts visually
%20Linear%20Equations.webp)
%20Determining%20Linear%20Equations.webp)
%20Checking%20whether%20point%20on%20Line.webp)
The Straight Line Formula: y = mx + c
- m is the gradient and tells you how steep the line is.
- c is the y-intercept and shows where the line crosses the y-axis.
Finding a Linear Equation Using Two Points
- The gradient is found using ₂ − y₁) ÷ (x₂ − x₁).
- For example, with points (2,3) and (4,7), the gradient is .
Checking If a Point Lies on a Line
- Substitute (3,5) into to check if .
- Because , the point lies on the line.
Practice Questions
Test your understanding
What does the y-intercept (c) represent in the equation ?
Correct! 🎉 +10 pointsCorrect! 🎉 Worth 10 XPNot quite right
In , the number is the y-intercept: the point where the line crosses the y-axis.
Substituting gives , so the crossing point is .
The x-axis crossing is a different point: that is where , not where . The gradient is different again: it measures how steep the line is. And a line only passes through the origin when .
What is the formula for calculating the slope (m) of a line?
Correct! 🎉 +10 pointsCorrect! 🎉 Worth 10 XPNot quite right
The gradient tells you how much changes for each unit change in , so .
For two points and this is .
Two things to watch: it uses the changes (the differences), not the coordinates themselves, and it is the change in on top, not the change in .
Given the equation , does the point (−2, −4) lie on the line?
Correct! 🎉 +20 pointsCorrect! 🎉 Worth 20 XPNot quite right
Substitute into .
Multiply first: . Then subtract 1: .
So the point on the line with is . Since , the point does not lie on the line.
Given the points (2, 3) and (4, 7), what is the slope (m) of the line?
Correct! 🎉 +20 pointsCorrect! 🎉 Worth 20 XPNot quite right
The gradient is .
Change in and change in .
So .
The change in on its own (4) is not the gradient. You must divide by the change in , and the ratio must stay this way up.
What is the equation of the line that passes through the points (0, 5) and (2, 9)?
Correct! 🎉 +20 pointsCorrect! 🎉 Worth 20 XPNot quite right
First find the gradient: .
The point has , so it is where the line crosses the y-axis. That makes the y-intercept . The other point, , is not on the y-axis, so 9 is not the intercept.
The equation is .
What is the equation of the line that passes through the points (1, 2) and (3, 8)?
Correct! 🎉 +30 pointsCorrect! 🎉 Worth 30 XPNot quite right
First find the gradient: .
Neither point is on the y-axis, so substitute one of them into . Using : , so .
The equation is .
Take care with the order of that subtraction: , not .
Want to see the full working?
Interactive Activity
Finding the equation of a straight line using 2 points
Loading interactive widget...
Frequently asked questions
The questions students bump into most on this topic
Every straight line can be written as y = mx + c, where m is the gradient, how steep the line is, and c is the y-intercept, where it crosses the y-axis. Once you know those two numbers the equation is fixed: y = 2x − 1 is the line with gradient 2 that crosses the y-axis at −1.
Divide the change in y by the change in x: m = (y₂ − y₁) ÷ (x₂ − x₁). For the points (2, 3) and (4, 7), the change in y is 7 − 3 = 4 and the change in x is 4 − 2 = 2, so the gradient is 4 ÷ 2 = 2. American sites call it the slope and say “rise over run”; it is the same calculation.
Find the gradient first, then the y-intercept. For (2, 3) and (4, 7), m = (7 − 3) ÷ (4 − 2) = 2. Then rearrange y = mx + c to c = y − mx and put in either point: using (4, 7), c = 7 − 2 × 4 = −1. So the equation is y = 2x − 1. Check it with the other point: 3 = 2 × 2 − 1.
Rearrange the equation to c = y − mx, then substitute the gradient and any point on the line: with m = 2 and the point (4, 7), c = 7 − 2 × 4 = −1. If you can see where the line crosses the y-axis, you can skip the working: at the y-intercept x is 0, so y equals c, and a line crossing at −1 has c = −1.
No. Either point can be P1, as long as you keep the same order on the top and the bottom of the fraction. With (4, 7) as P1 and (2, 3) as P2, the gradient is (3 − 7) ÷ (2 − 4) = −4 ÷ −2 = 2, the same answer as before. Mixing the order gives the wrong sign.
Substitute the point’s x and y into the equation and see whether it is true. For (3, 5) in y = 2x − 1: 5 = 2 × 3 − 1 = 5, true, so the point is on the line. For (−2, −4): −4 = 2 × (−2) − 1 = −5, false, so it is not. No graph is needed.
What's next?
Found this one hard? Go one step back first. Feeling confident? Carry on to the next lesson.

