Equation of a Line Through Two Points GCSE Maths
Equation of a line through two points GCSE maths explained with clear steps, worked examples, common mistakes and exam-style practice questions.

A student can understand gradients, know that a straight-line equation looks like y=mx+cy=mx+cy=mx+c, and still feel stuck when the question gives two coordinates instead of a graph. That is exactly where our imaginary student, Sam, keeps losing marks.
The good news is that finding the equation of a line through two points GCSE maths questions follow one reliable method: calculate the gradient, substitute one point to find the intercept, then write the complete equation. Once Sam stops treating each question as a puzzle and starts following those steps in order, the topic clicks.
The method at a glance
If a straight line passes through (x1,y1)(x_1,y_1)(x1,y1) and (x2,y2)(x_2,y_2)(x2,y2):
- calculate the gradient using m=y2−y1x2−x1m=\frac{y_2-y_1}{x_2-x_1}m=x2−x1y2−y1
- substitute the gradient and either point into y=mx+cy=mx+cy=mx+c
- solve the resulting equation to find ccc
- write the final answer as y=mx+cy=mx+cy=mx+c
- check that both given points satisfy your equation
The letters have specific meanings. The value mmm is the gradient, which measures how steep the line is. The value ccc is the yyy-intercept, where the line crosses the yyy-axis.
For a broader review of this topic, use the Maths Genie GCSE revision lessons alongside the method below.
Why two points are enough
One point alone does not identify a unique straight line. Imagine placing a pencil tip on that coordinate and rotating the pencil. Infinitely many lines could pass through the same point.
A second point fixes the direction. The two coordinates now tell us both where the line is and how steep it must be. That is why the first calculation is the gradient:
m=change in ychange in xm=\frac{\text{change in }y}{\text{change in }x}m=change in xchange in yor, using coordinates,
m=y2−y1x2−x1.m=\frac{y_2-y_1}{x_2-x_1}.m=x2−x1y2−y1.The order matters less than consistency. If you calculate y2−y1y_2-y_1y2−y1 on top, you must calculate x2−x1x_2-x_1x2−x1 underneath. Sam's early mistake is to reverse only one of the subtractions. That changes the sign and gives the wrong gradient.
Equation of a line through two points worked examples
Worked example with a positive gradient
Find the equation of the straight line passing through (2,5)(2,5)(2,5) and (6,13)(6,13)(6,13).
First, find the gradient:
m=13−56−2=84=2.m=\frac{13-5}{6-2}=\frac{8}{4}=2.m=6−213−5=48=2.The equation must therefore have the form
y=2x+c.y=2x+c.y=2x+c.Now substitute one of the points. Using (2,5)(2,5)(2,5) means x=2x=2x=2 and y=5y=5y=5:
5=2(2)+c.5=2(2)+c.5=2(2)+c. 5=4+c.5=4+c.5=4+c. c=1.c=1.c=1.The equation is
y=2x+1.\boxed{y=2x+1}.y=2x+1.Check it with the other point, (6,13)(6,13)(6,13):
2(6)+1=13.2(6)+1=13.2(6)+1=13.It works. This final check is quick and catches many substitution errors.
Sam's breakthrough is small but important: the coordinates do not go straight into the final answer. They are evidence used to discover mmm and ccc.
You now have the full method; use the Maths Genie lessons and GCSE question bank to practise applying it without having to create a set of questions yourself.
Worked example with a negative gradient
Find the equation of the line passing through (−1,7)(-1,7)(−1,7) and (3,−1)(3,-1)(3,−1).
Calculate the gradient carefully:
m=−1−73−(−1)=−84=−2.m=\frac{-1-7}{3-(-1)}=\frac{-8}{4}=-2.m=3−(−1)−1−7=4−8=−2.So the equation has the form
y=−2x+c.y=-2x+c.y=−2x+c.Substitute (−1,7)(-1,7)(−1,7):
7=−2(−1)+c.7=-2(-1)+c.7=−2(−1)+c. 7=2+c.7=2+c.7=2+c. c=5.c=5.c=5.Therefore,
y=−2x+5.\boxed{y=-2x+5}.y=−2x+5.Check the second coordinate:
−2(3)+5=−1.-2(3)+5=-1.−2(3)+5=−1.The negative gradient makes sense because yyy decreases as xxx increases. A reasonableness check like this can reveal a sign error before you move on.
Worked example with a fractional gradient
Find the equation of the line through (2,4)(2,4)(2,4) and (8,7)(8,7)(8,7).
The gradient is
m=7−48−2=36=12.m=\frac{7-4}{8-2}=\frac{3}{6}=\frac{1}{2}.m=8−27−4=63=21.Substitute the point (2,4)(2,4)(2,4) into y=12x+cy=\frac{1}{2}x+cy=21x+c:
4=12(2)+c.4=\frac{1}{2}(2)+c.4=21(2)+c. 4=1+c.4=1+c.4=1+c. c=3.c=3.c=3.The equation is
y=12x+3.\boxed{y=\frac{1}{2}x+3}.y=21x+3.Do not turn the fraction into an awkward decimal unless the question requires it. Exact fractions are usually clearer and reduce rounding errors.
A useful alternative: point-gradient form
You may also build the equation directly from a point and the gradient:
y−y1=m(x−x1).y-y_1=m(x-x_1).y−y1=m(x−x1).For the points (2,5)(2,5)(2,5) and (6,13)(6,13)(6,13), we found m=2m=2m=2. Using (2,5)(2,5)(2,5) gives
y−5=2(x−2).y-5=2(x-2).y−5=2(x−2).Expanding and rearranging:
y−5=2x−4,y-5=2x-4,y−5=2x−4, y=2x+1.y=2x+1.y=2x+1.This approach is mathematically efficient, especially when the intercept is fractional. However, if you find it harder to remember, the substitution method using y=mx+cy=mx+cy=mx+c is completely dependable.
Common mistakes that cost marks
Mixing the subtraction order
This is incorrect:
m=y2−y1x1−x2.m=\frac{y_2-y_1}{x_1-x_2}.m=x1−x2y2−y1.The two differences must follow the same coordinate order. Label the points before calculating if negative numbers are involved.
Using the gradient as the intercept
After finding m=2m=2m=2, Sam sometimes writes y=x+2y=x+2y=x+2. But the gradient is the coefficient of xxx, so the correct starting form is
y=2x+c.y=2x+c.y=2x+c.You still need to calculate ccc.
Substituting coordinates the wrong way round
For the point (2,5)(2,5)(2,5), x=2x=2x=2 and y=5y=5y=5. Writing x=5x=5x=5 and y=2y=2y=2 changes the line completely.
Losing negative signs
With a point such as (−1,7)(-1,7)(−1,7), use brackets during substitution:
7=−2(−1)+c.7=-2(-1)+c.7=−2(−1)+c.The brackets make the sign calculation visible.
Forgetting the final equation
A calculation ending with c=5c=5c=5 has not fully answered the question. Write the complete result, such as
y=−2x+5.y=-2x+5.y=−2x+5.Equation of a line through two points questions
Try these without looking back at the examples. Show the gradient calculation and the substitution used to find ccc.
- Find the equation of the line through (1,4)(1,4)(1,4) and (5,12)(5,12)(5,12).
- Find the equation of the line through (−2,9)(-2,9)(−2,9) and (2,1)(2,1)(2,1).
- Find the equation of the line through (0,−3)(0,-3)(0,−3) and (4,5)(4,5)(4,5).
- Find the equation of the line through (2,6)(2,6)(2,6) and (5,7)(5,7)(5,7).
- A line passes through (3,10)(3,10)(3,10) and (7,22)(7,22)(7,22). Find its equation.
Answers:
- y=2x+2y=2x+2y=2x+2
- y=−2x+5y=-2x+5y=−2x+5
- y=2x−3y=2x-3y=2x−3
- y=13x+163y=\frac{1}{3}x+\frac{16}{3}y=31x+316
- y=3x+1y=3x+1y=3x+1
For realistic exam preparation, complete related questions and compare every line of working with the mark scheme. The Maths Genie GCSE past papers can help you practise recognising the method when it appears among other topics.
Make the method stick
Sam does not improve by memorising five separate examples. The improvement comes from using the same short routine every time:
two points⟶m⟶c⟶y=mx+c⟶check.\text{two points}\longrightarrow m\longrightarrow c\longrightarrow y=mx+c\longrightarrow\text{check}.two points⟶m⟶c⟶y=mx+c⟶check.That sequence reduces the amount you need to hold in your head. It also makes your working easier for an examiner to follow. If an arithmetic slip occurs near the end, clear earlier steps may still show valid method.
Turn understanding into reliable marks
Knowing the steps once is not the same as recognising them under exam pressure. Sam's next move is to stop improvising and practise the same sequence across straightforward, negative-gradient and fractional-gradient questions. Your turn: Start the matching Maths Genie lessons and question bank, and use the five-step method on every equation-of-a-line question.



