Finding the Equation of a Line
Every question with a fully worked solution.
- Finding the Equation of a Line - Video - Equation of a line Watch
Theory
To find the equation of a line in the form \(y = mx + c\), first get the gradient \(m\), then use a point to get \(c\). This Year 9 maths page shows how to do it from a graph, from two points, from an intercept and a point, for a line parallel to a given line, and for horizontal and vertical lines.
The equation of a straight line can be written as \(y = mx + c\), where \(m\) is the gradient and \(c\) is the \(y\)-intercept. Finding the equation means finding those two numbers.
The gradient may be given, found from two points, read from a graph, or taken from another line. A point on the line then gives \(c\): substitute its coordinates and solve.
Parallel lines have equal gradients, so a line parallel to \(y = 3x - 1\) also has \(m = 3\). An intercept is just a point on the line: an \(x\)-intercept of \(5\) is the point \((5, 0)\).
Two special cases do not need \(y = mx + c\). If two points have the same \(y\)-coordinate, the line is horizontal: \(y = b\). If they have the same \(x\)-coordinate, it is vertical: \(x = a\).
For two parallel lines with gradients \(m_1\) and \(m_2\):
How to find the equation of a line
- Check for a horizontal (\(y = b\)) or vertical (\(x = a\)) line first.
- Get the gradient: given, from two points, from a graph, or copied from a parallel line.
- Get \(c\): if you know the \(y\)-intercept, \(c\) is its \(y\)-value. Otherwise substitute \(m\) and one point into \(y = mx + c\) and solve.
- Write the equation \(y = mx + c\) with both numbers in place.
- Check by substituting a second point.
The \(y\)-intercept gives \(c\) straight away. Count the run and the rise to the other grid point for \(m\). The line goes down, so the rise is negative.
| \(c\) | \(=\) | \(2\) |
| \(m\) | \(=\) | \(\dfrac{\text{rise}}{\text{run}} = \dfrac{-3}{2}\) |
| \(y\) | \(=\) | \(\mathbf{-\dfrac{3}{2}x + 2}\) |
Step 1: find \(m\) from the two points. Step 2: substitute \(m\) and one point into \(y = mx + c\) to find \(c\).
| \(m\) | \(=\) | \(\dfrac{9 - 1}{2 - (-2)} = \dfrac{8}{4} = 2\) |
| \(9\) | \(=\) | \(2 \times 2 + c\) |
| \(c\) | \(=\) | \(5\) |
| \(y\) | \(=\) | \(\mathbf{2x + 5}\) |
Check with the other point: \(2 \times (-2) + 5 = 1\).
Parallel lines share their gradient, so \(m = -3\). Substitute the point to find \(c\).
| \(4\) | \(=\) | \(-3 \times 1 + c\) |
| \(4\) | \(=\) | \(-3 + c\) |
| \(c\) | \(=\) | \(7\) |
| \(y\) | \(=\) | \(\mathbf{-3x + 7}\) |
The \(x\)-intercept is the point \((3, 0)\). Find \(m\) from the two points, then substitute one point to find \(c\).
| \(m\) | \(=\) | \(\dfrac{4 - 0}{1 - 3} = \dfrac{4}{-2} = -2\) |
| \(0\) | \(=\) | \(-2 \times 3 + c\) |
| \(0\) | \(=\) | \(-6 + c\) |
| \(c\) | \(=\) | \(6\) |
| \(y\) | \(=\) | \(\mathbf{-2x + 6}\) |
Check with the other point: \(-2 \times 1 + 6 = 4\ \checkmark\). The \(x\)-intercept \(3\) is not \(c\); \(c\) is where the line meets the \(y\)-axis.
Common pitfalls
Frequently asked questions
How do you find the equation of a line from two points?
Find the gradient with \(m = \dfrac{y_2 - y_1}{x_2 - x_1}\). Then substitute \(m\) and one of the points into \(y = mx + c\) to find \(c\), and write the equation.
How do you find the equation of a line from a graph?
Read \(c\) where the line crosses the \(y\)-axis. Then pick another point where the line passes exactly through a grid corner, and find the gradient as rise over run.
How do you use an x-intercept to find the equation of a line?
Write the intercept as a point: an \(x\)-intercept of \(3\) is \((3, 0)\). Use it with the gradient, or with a second point to find the gradient, then substitute into \(y = mx + c\) to find \(c\).
How do you find the equation of a parallel line?
Copy the gradient of the given line, then substitute the point the new line passes through into \(y = mx + c\) to find \(c\).
What is the equation of a vertical line?
A vertical line has the equation \(x = a\), where \(a\) is the \(x\)-coordinate of every point on it. Its gradient is undefined.