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.
Work out the coordinates of the midpoint of \((-4, 3)\) and \((6, 9)\).
Mark scheme — 2 marks available
- One coordinate correct — M1
- \((1, 6)\) — A1
Model answer
\(\left(\dfrac{-4 + 6}{2}, \dfrac{3 + 9}{2}\right) = (1, 6)\).
The diagram shows a straight line through the points \(A\) and \(B\). (a) Work out the gradient of \(AB\). [2 marks] (b) Find the equation of \(AB\). [2 marks] (c) Work out the coordinates of the midpoint of \(AB\). [2 marks]
Mark scheme — 6 marks available
- (a) \(\dfrac{-1 - 5}{4 - (-2)}\) — M1
- (a) \(-1\) — A1
- (b) \(y = -x + c\) with a point substituted — M1
- (b) \(y = -x + 3\) — A1
- (c) One coordinate correct — M1
- (c) \((1, 2)\) — A1
Model answer
(a) \(\dfrac{-1 - 5}{4 - (-2)} = \dfrac{-6}{6} = -1\). (b) \(y = -x + c\) with \((4, -1)\) gives \(-1 = -4 + c\), so \(c = 3\) and \(y = -x + 3\). (c) \(\left(\dfrac{-2 + 4}{2}, \dfrac{5 + (-1)}{2}\right) = (1, 2)\).
A line has gradient \(-2\) and passes through the point \((3, 1)\). Find the equation of the line.
Mark scheme — 3 marks available
- \(y = -2x + c\) — M1
- \(1 = -2 \times 3 + c\) — M1
- \(y = -2x + 7\) — A1
Model answer
\(y = -2x + c\). Putting in \((3, 1)\) gives \(1 = -6 + c\), so \(c = 7\) and \(y = -2x + 7\).
Show that the lines \(2y = 4x + 5\) and \(y = 2x - 3\) are parallel.
Mark scheme — 2 marks available
- \(y = 2x + 2.5\) or gradient 2 found — M1
- Both gradients are 2, so they are parallel — Q1
Model answer
Dividing the first equation by 2 gives \(y = 2x + 2.5\), which has gradient 2. The second line also has gradient 2, so they are parallel.
The line \(P\) has equation \(y = \dfrac{1}{2}x + 1\). The line \(Q\) is perpendicular to \(P\) and passes through \((0, 4)\). Find an equation of \(Q\).
Mark scheme — 3 marks available
- Gradient \(-2\) seen — M1
- \(y = -2x + c\) or \(c = 4\) seen — M1
- \(y = -2x + 4\) — A1
Model answer
The gradient of \(Q\) is \(-2\), because \(\dfrac{1}{2} \times (-2) = -1\). It crosses the \(y\)-axis at 4, so \(y = -2x + 4\).
\(A\) is the point \((-1, 2)\) and \(B\) is the point \((5, 10)\). (a) Work out the length of \(AB\). [3 marks] (b) Work out the midpoint of \(AB\). [1 mark]
Mark scheme — 4 marks available
- (a) Differences 6 and 8 — M1
- (a) \(\sqrt{6^2 + 8^2}\) — M1
- (a) 10 — A1
- (b) \((2, 6)\) — B1
Model answer
(a) The differences are 6 and 8, so \(AB = \sqrt{6^2 + 8^2} = \sqrt{100} = 10\). (b) The midpoint is \(\left(\dfrac{-1 + 5}{2}, \dfrac{2 + 10}{2}\right) = (2, 6)\).
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\).