Resources For Teachers For Tutors For Students & Parents AI New Pricing
Year 9 Maths Linear Relations

Finding the Equation of a Line

20 practice questions 1 video lesson Theory + worked examples
Practice 20 questions
Practice questions

Every question with a fully worked solution.

Start practising
Watch 1 video(s)
  • Finding the Equation of a Line - Video - Equation of a line Watch
Create a free accountTrack your progress and save your work as you go.
Create free account

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\).

Two parallel linesTwo parallel lines, y = one half x + 3 and y = one half x - 1. They have the same gradient and different y-intercepts. x y βˆ’4 βˆ’3 βˆ’2 βˆ’1 1 2 3 4 5 βˆ’3 βˆ’2 βˆ’1 1 2 3 4 5 y = Β½x + 3 y = Β½x βˆ’ 1
Parallel lines have equal gradients. Only the \(y\)-intercept changes.
A horizontal line and a vertical line through two pointsThe points (-3, 2) and (1, 2) have the same y-coordinate and lie on the horizontal line y = 2. The points (3, -3) and (3, 1) have the same x-coordinate and lie on the vertical line x = 3. x y βˆ’4 βˆ’3 βˆ’2 βˆ’1 1 2 4 5 βˆ’4 βˆ’3 βˆ’2 βˆ’1 1 3 4 (βˆ’3, 2) (1, 2) (3, βˆ’3) (3, 1) y = 2 x = 3
Two points with the same \(y\)-coordinate give a horizontal line, \(y = 2\). Two points with the same \(x\)-coordinate give a vertical line, \(x = 3\).
\[y = mx + c \qquad m = \dfrac{y_2 - y_1}{x_2 - x_1}\]
y=mx+c

For two parallel lines with gradients \(m_1\) and \(m_2\):

\[m_2 = m_1\]
m2=m1
An intercept is just a point. An \(x\)-intercept of \(3\) means the point \((3, 0)\) is on the line. Substitute it like any other point. A \(y\)-intercept of \(-1\) is the point \((0, -1)\): with one more point, such as \((4, 7)\), substitute to find \(m\): \(7 = 4m - 1\), so \(m = 2\) and \(y = 2x - 1\).
Real-life lines from two facts. If a gardener charges $150 for \(3\) hours and $270 for \(6\) hours, the rate is \(m = \dfrac{270 - 150}{6 - 3} = 40\) dollars per hour. Then \(150 = 40 \times 3 + c\) gives a fixed fee of \(c = 30\), so \(C = 40t + 30\).
A missing coordinate. If the gradient is known, write rise over run with the unknown and solve. For \(P(1, 2)\), \(Q(5, k)\) and \(m = 3\): \(\dfrac{k - 2}{5 - 1} = 3\), so \(k - 2 = 12\) and \(k = 14\).

How to find the equation of a line

  1. Check for a horizontal (\(y = b\)) or vertical (\(x = a\)) line first.
  2. Get the gradient: given, from two points, from a graph, or copied from a parallel line.
  3. 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.
  4. Write the equation \(y = mx + c\) with both numbers in place.
  5. Check by substituting a second point.
Example 1 β€” Reading a line off a graph
A straight line crosses the \(y\)-axis at \((0, 2)\) and passes through the grid point \((2, -1)\). Find its equation.
Solution
A line through (0, 2) and (2, -1)A falling line crossing the y-axis at (0, 2) and passing through the grid point (2, -1). From (0, 2), 2 across and 3 down reaches (2, -1). x y βˆ’3 βˆ’2 βˆ’1 1 3 4 βˆ’4 βˆ’3 βˆ’2 1 4 run 2 down 3 (0, 2) (2, βˆ’1)

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}\)
y=−32x+2
Example 2 β€” Through two points
Find the equation of the line through \((-2, 1)\) and \((2, 9)\).
Solution

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}\)
y=2x+5
The line through (-2, 1) and (2, 9)The line y = 2x + 5 through the red points (-2, 1) and (2, 9), crossing the y-axis at 5. x y βˆ’5 βˆ’3 βˆ’1 1 3 3 5 7 (βˆ’2, 1) (2, 9) c = 5

Check with the other point: \(2 \times (-2) + 5 = 1\).

Example 3 β€” A parallel line
Find the equation of the line parallel to \(y = -3x + 2\) that passes through \((1, 4)\).
Solution

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}\)
y=−3x+7
A line parallel to y = -3x + 2The dashed line y = -3x + 2 and, in red, the parallel line through (1, 4). x y βˆ’2 4 βˆ’3 βˆ’1 1 3 5 7 dashed: y = βˆ’3x + 2 (1, 4)
Example 4 β€” From an x-intercept and a point
Find the equation of the line that has an \(x\)-intercept of \(3\) and passes through \((1, 4)\).
Solution

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}\)
y=−2x+6
The line through (3, 0) and (1, 4)A falling straight line through the x-intercept (3, 0) and the point (1, 4), both marked in red. It crosses the y-axis at (0, 6). x y βˆ’1 1 2 4 5 βˆ’1 1 2 3 5 7 (3, 0) (1, 4) (0, 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

An x-intercept is not c. An \(x\)-intercept of \(3\) is the point \((3, 0)\). Use it to find \(m\) or substitute it; do not write \(c = 3\).
Watch out for a falling line on a graph. If the line goes down from left to right, the rise is negative, so the gradient is negative.
Substitute x and y into the right places. In \(y = mx + c\), the point's \(y\)-value goes on the left and its \(x\)-value multiplies \(m\).
A vertical line is x = a. Two points with the same \(x\)-coordinate give a vertical line. Its gradient is undefined, so it has no \(y = mx + c\) form.

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.