Finding the Equation of a Line
Finding the equation of a line means working out its gradient \(m\) and \(y\)-intercept \(c\) from the information given. This NSW Year 9 Core maths subtopic is Stage 5 Core content under NESA outcome MA5‑LIN‑C‑02, including parallel and perpendicular lines.
You will write equations from a gradient and intercept, read \(m\) and \(c\) off a graph, find \(c\) by substituting a point into \(y = mx + c\), and find the line through two points such as \((-1,7)\) and \((3,4)\). You will recognise horizontal lines like \(y = 3\) and vertical lines like \(x = 6\), find a line parallel to another by copying its gradient and one perpendicular to it with the negative reciprocal gradient, and model an electrician's charges from two jobs. It is part of Year 9 Core Straight Line.
Every question with a fully worked solution.
- Finding the Equation of a Line - Video - Slope-intercept equation from a graph 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, and for lines that are parallel or perpendicular to a given line.
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. Perpendicular lines meet at right angles, and their gradients multiply to \(-1\).
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 parallel and perpendicular 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 from a parallel (same) or perpendicular (negative reciprocal) 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}\) |
Turn the gradient upside down and change its sign: \(\dfrac{1}{2}\) becomes \(-2\). Check: \(\dfrac{1}{2} \times (-2) = -1\).
| \(1\) | \(=\) | \(-2 \times 4 + c\) |
| \(1\) | \(=\) | \(-8 + c\) |
| \(c\) | \(=\) | \(9\) |
| \(y\) | \(=\) | \(\mathbf{-2x + 9}\) |
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.
What is the gradient of a perpendicular line?
It is the negative reciprocal: flip the gradient upside down and change its sign. The two gradients multiply to \(-1\). A line perpendicular to one with gradient \(\dfrac{1}{2}\) has gradient \(-2\).
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.