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.
Calculate the midpoint of \((-3, -2)\) and \((5, 4)\).
Mark scheme — 2 marks available
- One coordinate correct — M1
- \((1, 1)\) — A1
Model answer
\(\left(\dfrac{-3 + 5}{2}, \dfrac{-2 + 4}{2}\right) = (1, 1)\).
The diagram shows a straight line through the points \(A\) and \(B\). (a) Calculate the gradient of \(AB\). [2 marks] (b) Find the equation of \(AB\). [2 marks] (c) Find the coordinates of the midpoint of \(AB\). [1 mark]
Mark scheme — 5 marks available
- (a) \(\dfrac{0 - 6}{4 - 0}\) — M1
- (a) \(-\dfrac{3}{2}\) — A1
- (b) \(y = -\dfrac{3}{2}x + c\) or \(y = mx + 6\) — M1
- (b) \(y = -\dfrac{3}{2}x + 6\) — A1
- (c) \((2, 3)\) — B1
Model answer
(a) \(\dfrac{0 - 6}{4 - 0} = -\dfrac{3}{2}\). (b) The line crosses the \(y\)-axis at 6, so \(y = -\dfrac{3}{2}x + 6\). (c) \(\left(\dfrac{0 + 4}{2}, \dfrac{6 + 0}{2}\right) = (2, 3)\).
Find the equation of the line that is parallel to \(y = 4x + 1\) and passes through \((1, 9)\).
Mark scheme — 3 marks available
- \(y = 4x + c\) — M1
- \(9 = 4 \times 1 + c\) — M1
- \(y = 4x + 5\) — A1
Model answer
The gradient is 4, so \(y = 4x + c\). Putting in \((1, 9)\) gives \(9 = 4 + c\), so \(c = 5\) and \(y = 4x + 5\).
A line has equation \(2x - 3y = 12\). Find the coordinates of the points where the line crosses the \(x\)-axis and the \(y\)-axis.
Mark scheme — 3 marks available
- \(y = 0\) or \(x = 0\) used — M1
- \((6, 0)\) — A1
- \((0, -4)\) — A1
Model answer
When \(y = 0\), \(2x = 12\) and \(x = 6\), so the point is \((6, 0)\). When \(x = 0\), \(-3y = 12\) and \(y = -4\), so the point is \((0, -4)\).
A line has equation \(3y + x = 6\). Find the gradient of a line that is perpendicular to it.
Mark scheme — 3 marks available
- \(y = -\dfrac{1}{3}x + 2\) or the gradient \(-\dfrac{1}{3}\) — M1
- Negative reciprocal used — M1
- 3 — A1
Model answer
Rearranging, \(3y = -x + 6\), so \(y = -\dfrac{1}{3}x + 2\) and the gradient is \(-\dfrac{1}{3}\). The perpendicular gradient is 3.
\(A\) is the point \((3, -2)\) and \(B\) is the point \((-2, 10)\). (a) Calculate the coordinates of the midpoint of \(AB\). [2 marks] (b) Calculate the length of \(AB\). [2 marks]
Mark scheme — 4 marks available
- (a) One coordinate correct — M1
- (a) \((0.5, 4)\) — A1
- (b) \(\sqrt{5^2 + 12^2}\) — M1
- (b) 13 — A1
Model answer
(a) \(\left(\dfrac{3 + (-2)}{2}, \dfrac{-2 + 10}{2}\right) = (0.5, 4)\). (b) The differences are 5 and 12, so \(AB = \sqrt{5^2 + 12^2} = \sqrt{169} = 13\).
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\).