Maths · Graphs
Viewing as
Teacher view: every answer and mark scheme set out in full.
Equations of Straight Lines
Finding the equation of a line from two points, midpoints, and parallel and perpendicular lines.
Learning Objectives
- 1Find the equation of a straight line from its gradient and a point, or from two points.
- 2Find the midpoint of a line segment, and its length (Higher tier).
- 3Write the equation of a line parallel to a given line.
- 4Use the fact that perpendicular lines have gradients with product \(-1\) (Higher tier).
From a picture to an equation
The last lesson went from an equation to a graph. This one goes the other way: given a gradient and a point, or two points, write down the equation of the line. The method is always the same three steps, find the gradient, put a point in to find \(c\), then write \(y = mx + c\), so it is worth learning as a routine. Exam questions often add a second part, such as the midpoint, a parallel line or a perpendicular line, so each of those gets a short method here too.
The equation of a line through two points
Follow the same three steps every time and you will not need to remember a formula.
-
Step 1: gradient
Work out \(m = \dfrac{y_2 - y_1}{x_2 - x_1}\).
-
Step 2: find c
Substitute \(m\) and one point into \(y = mx + c\), and solve for \(c\).
-
Step 3: write it
Put \(m\) and \(c\) back into \(y = mx + c\).
-
Check
Put the other point in. If it does not fit, there is a slip.
Through two points
Find the equation of the line through \((2, 1)\) and \((6, 9)\).
Show the solutionHide the solution
- 1 Gradient \(\dfrac{9 - 1}{6 - 2} = \dfrac{8}{4} = 2\).
- 2 Substitute a point \(y = 2x + c\) with \((2, 1)\) gives \(1 = 4 + c\), so \(c = -3\).
- 3 Write the equation \(y = 2x - 3\).
- 4 Check with the other point \(2 \times 6 - 3 = 9\). Correct.
Answer\(y = 2x - 3\)
Midpoints
The midpoint of a line segment is halfway along it, so its coordinates are the averages of the end points.
-
Formula
The midpoint of \((x_1, y_1)\) and \((x_2, y_2)\) is \(\left(\dfrac{x_1 + x_2}{2}, \dfrac{y_1 + y_2}{2}\right)\).
-
Example
The midpoint of \((2, 1)\) and \((6, 9)\) is \(\left(\dfrac{2 + 6}{2}, \dfrac{1 + 9}{2}\right) = (4, 5)\).
-
Finding an end point
If the midpoint and one end are known, double the midpoint and subtract the end you know.
-
Length
The length of the segment uses Pythagoras: \(\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}\) (Higher tier).
Parallel lines
Parallel lines have the same gradient, so you can copy it.
-
Same m, different c
A line parallel to \(y = 3x + 1\) has the form \(y = 3x + c\).
-
Through a point
Put the point in to find \(c\). Through \((2, 9)\): \(9 = 6 + c\), so \(c = 3\), and the line is \(y = 3x + 3\).
-
Rearranging first
\(2y - 4x = 6\) becomes \(y = 2x + 3\), so its gradient is 2. Lines with different-looking equations can still be parallel.
-
Same line?
If \(m\) and \(c\) are both the same, it is the same line, not a parallel one.
Perpendicular lines
When two lines meet at a right angle, one gradient is the negative reciprocal of the other. Turn the fraction upside down and change the sign.
Perpendicular gradients (Higher tier)
- The rule If two lines are perpendicular, \(m_1 \times m_2 = -1\).
- Negative reciprocal The perpendicular to gradient 2 has gradient \(-\dfrac{1}{2}\). The perpendicular to gradient \(-\dfrac{3}{4}\) has gradient \(\dfrac{4}{3}\).
- Horizontal and vertical A horizontal line and a vertical line are perpendicular, but the rule does not apply to them.
A perpendicular line
(Higher tier) Find the equation of the line perpendicular to \(y = 2x + 3\) that passes through \((4, 1)\).
Show the solutionHide the solution
- 1 Perpendicular gradient The gradient of \(y = 2x + 3\) is 2, so the new gradient is \(-\dfrac{1}{2}\).
- 2 Find c \(1 = -\dfrac{1}{2} \times 4 + c\), so \(1 = -2 + c\) and \(c = 3\).
- 3 Write the equation \(y = -\dfrac{1}{2}x + 3\).
- 4 Check At \(x = 4\), \(y = -2 + 3 = 1\). Correct.
Answer\(y = -\dfrac{1}{2}x + 3\)
Awkward forms
Lines are not always given as \(y = mx + c\), so you may need to rearrange.
-
Form ax + by = c
\(3x + 2y = 12\) rearranges to \(2y = -3x + 12\) and then \(y = -\dfrac{3}{2}x + 6\), so the gradient is \(-\dfrac{3}{2}\).
-
Where it crosses the axes
Put \(x = 0\) to find the \(y\)-intercept and \(y = 0\) to find the \(x\)-intercept. For \(3x + 2y = 12\) these are \((0, 6)\) and \((4, 0)\).
-
Equal gradients
To check two lines are parallel, rearrange both and compare \(m\).
-
Fractions
Keep gradients as fractions, not decimals, unless the question asks.
Test yourself
-
1
What are the three steps for the equation of a line through two points?
Show answerHide answer
Find the gradient, find \(c\) with one point, then write \(y = mx + c\).
-
2
What is the midpoint of \((0, 4)\) and \((6, 10)\)?
Show answerHide answer
\((3, 7)\).
-
3
What gradient does a line parallel to \(y = 5x - 2\) have?
Show answerHide answer
5.
-
4
What is the gradient of a line perpendicular to \(y = 4x\) (Higher tier)?
Show answerHide answer
\(-\dfrac{1}{4}\).
-
5
What is the gradient of \(2y = 6x + 8\)?
Show answerHide answer
3.
Exam technique: equations of lines
Show every step, because the answer has several parts that can each earn a mark.
-
Write the gradient calculation
Show the change in \(y\) over the change in \(x\).
-
Substitute a point
Write "\(1 = 2 \times 2 + c\)", not just \(c = -3\).
-
Finish with a full equation
The answer is \(y = 2x - 3\), not just "\(m = 2\)".
-
Check with the second point
It takes ten seconds and catches most slips.
Summary and exam focus
- For the line through two points, find \(m\), then find \(c\), then write \(y = mx + c\).
- The midpoint is the average of the \(x\)-coordinates and the average of the \(y\)-coordinates.
- Parallel lines have the same gradient.
- Perpendicular lines have gradients that multiply to \(-1\) (Higher tier).
Exam focus
Find an equation of the line that passes through \((0, 5)\) and \((4, 13)\). (3 marks) (3 marks)
The point \((0, 5)\) is on the \(y\)-axis, so \(c = 5\) straight away. The gradient is \(\dfrac{13 - 5}{4 - 0} = 2\), so \(y = 2x + 5\). Spotting a point with \(x = 0\) saves a step.
Key terms
The words this lesson expects you to use. Each one is linked from the first place it appears above.
- Equation of a line
- A rule such as \(y = 2x + 1\) that is true for every point on the line.
- Midpoint
- The point halfway along a line segment.
- Line segment
- The part of a line between two end points.
- Perpendicular
- At a right angle to each other.
- Negative reciprocal
- A number turned upside down with its sign changed, such as \(-\dfrac{1}{2}\) for 2.
- Substitute
- Replace letters in an equation with numbers.
- Gradient-intercept form
- The form \(y = mx + c\).
- Parallel
- Lines with the same gradient.
- Reciprocal
- One divided by a number, such as \(\dfrac{1}{4}\) for 4.
Questions and answers
15 questions set on this lesson, with the mark schemes and model answers open.
\(A\) is the point \((2, 6)\) and \(B\) is the point \((8, 10)\). Find the coordinates of the midpoint of \(AB\).
Mark scheme — 2 marks available
- One coordinate correct — M1
- \((5, 8)\) — A1
Model answer
\(\left(\dfrac{2 + 8}{2}, \dfrac{6 + 10}{2}\right) = (5, 8)\).
The diagram shows a straight line through the points \(A\) and \(B\). (a) Work out the gradient of the line. (2 marks) (b) Find an equation of the line. (2 marks) (c) Work out the coordinates of the midpoint of \(AB\). (2 marks)
Mark scheme — 6 marks available
- (a) \(\dfrac{11 - 3}{5 - 1}\) — M1
- (a) 2 — A1
- (b) \(y = 2x + c\) and a point substituted — M1
- (b) \(y = 2x + 1\) — A1
- (c) One coordinate correct — M1
- (c) \((3, 7)\) — A1
Model answer
(a) \(\dfrac{11 - 3}{5 - 1} = 2\). (b) \(y = 2x + c\) with \((1, 3)\) gives \(3 = 2 + c\), so \(c = 1\) and \(y = 2x + 1\). (c) \(\left(\dfrac{1 + 5}{2}, \dfrac{3 + 11}{2}\right) = (3, 7)\).
Find an equation of the line that is parallel to \(y = 3x - 1\) and passes through the point \((2, 9)\).
Mark scheme — 3 marks available
- \(y = 3x + c\) or gradient 3 stated — M1
- \(9 = 3 \times 2 + c\) — M1
- \(y = 3x + 3\) — A1
Model answer
The gradient is 3, so \(y = 3x + c\). Substituting \((2, 9)\) gives \(9 = 6 + c\), so \(c = 3\) and \(y = 3x + 3\).
A line has equation \(3x + 2y = 12\). (a) Work out the gradient of the line. (2 marks) (b) Does the point \((2, 3)\) lie on the line? You must show your working. (1 mark)
Mark scheme — 3 marks available
- (a) \(2y = -3x + 12\) or \(y = \ldots\) — M1
- (a) \(-\dfrac{3}{2}\) — A1
- (b) Yes, with \(6 + 6 = 12\) — B1
Model answer
(a) Rearrange to \(2y = -3x + 12\), so \(y = -\dfrac{3}{2}x + 6\). The gradient is \(-\dfrac{3}{2}\). (b) \(3 \times 2 + 2 \times 3 = 12\), so yes.
Line \(L_1\) has equation \(y = 2x + 3\). Line \(L_2\) is perpendicular to \(L_1\) and passes through the point \((4, 1)\). Find an equation of \(L_2\).
Mark scheme — 3 marks available
- Gradient \(-\dfrac{1}{2}\) seen — M1
- \(1 = -\dfrac{1}{2} \times 4 + c\) — M1
- \(y = -\dfrac{1}{2}x + 3\) — A1
Model answer
The gradient of \(L_2\) is \(-\dfrac{1}{2}\). Then \(1 = -\dfrac{1}{2} \times 4 + c\), so \(c = 3\) and \(y = -\dfrac{1}{2}x + 3\).
\(A\) is the point \((-2, 1)\) and \(B\) is the point \((6, 7)\). (a) Find the coordinates of the midpoint of \(AB\). (2 marks) (b) Work out the length of \(AB\). (2 marks)
Mark scheme — 4 marks available
- (a) One coordinate correct — M1
- (a) \((2, 4)\) — A1
- (b) \(\sqrt{8^2 + 6^2}\) — M1
- (b) 10 — A1
Model answer
(a) \(\left(\dfrac{-2 + 6}{2}, \dfrac{1 + 7}{2}\right) = (2, 4)\). (b) The differences are 8 and 6, so \(AB = \sqrt{8^2 + 6^2} = \sqrt{100} = 10\).
What is the equation of the line through \((2, 1)\) and \((6, 9)\)?
Why: The gradient is \(\dfrac{8}{4} = 2\). Then \(1 = 2 \times 2 + c\) gives \(c = -3\).
What is the midpoint of \((2, 1)\) and \((6, 9)\)?
Why: \(\left(\dfrac{2 + 6}{2}, \dfrac{1 + 9}{2}\right) = (4, 5)\).
A line is parallel to \(y = 5x - 2\). What is its gradient?
Why: Parallel lines have equal gradients.
A line has gradient 3 and passes through \((2, 9)\). What is its equation?
Why: \(9 = 3 \times 2 + c\) gives \(c = 3\).
What is the gradient of the line \(2y - 4x = 6\)?
Why: Rearranged, \(2y = 4x + 6\), so \(y = 2x + 3\).
What is the midpoint of \((0, 4)\) and \((6, 10)\)?
Why: \(\left(\dfrac{0 + 6}{2}, \dfrac{4 + 10}{2}\right) = (3, 7)\).
Where does the line \(3x + 2y = 12\) cross the axes?
Why: Put \(x = 0\) to get \(y = 6\), and \(y = 0\) to get \(x = 4\).
What is the gradient of a line perpendicular to a line with gradient 4?
Why: Perpendicular gradients multiply to \(-1\), so the new gradient is \(-\dfrac{1}{4}\).
What is the equation of the line perpendicular to \(y = 2x + 3\) through \((4, 1)\)?
Why: The gradient is \(-\dfrac{1}{2}\). Then \(1 = -2 + c\), so \(c = 3\).