Resources For Teachers For Tutors For Students & Parents AI New Pricing
Year 8 Maths Graphing Linear Equations

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 - Finding the rule of a line from graph or table Watch
Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

Every straight line has one rule \(y = mx + b\). Read points off the graph, find the step \(m\) (how much \(y\) changes when \(x\) goes up \(1\)), then the number to add \(b\) (the \(y\)-value at \(x = 0\)). A line through \((0, 1)\) and \((1, 0)\) has \(b = 1\) and \(m = -1\): \(y = -x + 1\). This Year 8 maths page shows how.

Read the points into a table. Take the marked points off the graph and set them out as \(x\)-values and \(y\)-values.

Find the step \(m\). How much \(y\) changes each time \(x\) goes up by \(1\). If the points are further apart, divide: \(y\) up \(6\) across \(3\) is a step of \(2\); \(y\) up \(1\) across \(2\) is a step of \(\dfrac{1}{2}\). A falling line has a negative step.

Find the number to add \(b\). It is the \(y\)-value where the line crosses the \(y\)-axis (\(x = 0\)). Or multiply each \(x\) by the step and compare with \(y\): the difference is the same in every column.

Write the rule, then check it in a point you have not used. A step of \(-2\) with \(6\) to add can be written \(y = -2x + 6\) or \(y = 6 - 2x\).

Lines with no step. Every \(y\)-value the same gives a horizontal line such as \(y = -1\); every \(x\)-value the same gives a vertical line such as \(x = 5\).

Use the rule both ways. Substitute an \(x\)-value to find \(y\). To find \(x\) from \(y\), make the rule equal it and solve. Making the rule equal \(0\) gives the \(x\)-axis crossing.

Real-life graphs. Use the letters on the axes. The number to add is the amount at the start, when the across-value is \(0\).

Step and number to add A number plane with the line y = 2x - 2 through (0, -2), (1, 0), (2, 2) and (3, 4). A step triangle shows 1 across and 2 up. xy −2−11234−3−2−1123450 1 across 2 up y = 2x βˆ’ 2
One across, two up: the step is \(2\). The line crosses the \(y\)-axis at \(-2\), so \(y = 2x - 2\). Check \((3, 4)\): \(6 - 2 = 4\).

Comparing \(y\) with \(2x\) for the line in the diagram:

\(x\)\(0\)\(1\)\(2\)\(3\)
\(2x\)\(0\)\(2\)\(4\)\(6\)
\(y\)\(-2\)\(0\)\(2\)\(4\)

Every \(y\)-value is \(2\) less than \(2x\), so \(y = 2x - 2\).

The step is for 1 across. If the points are \(2\) apart and \(y\) goes up \(3\), the step is \(3 \div 2 = 1.5\), not \(3\).
Keep the sign. If \(-2x\) gives \(-4\) but \(y\) is \(-3\), then \(y\) is \(1\) more: \(y = -2x + 1\).

Finding the equation of a line

  1. Read two or three points off the line.
  2. Find the step \(m\): change in \(y\) \(\div\) change in \(x\).
  3. Find \(b\): the \(y\)-value at \(x = 0\) (or substitute a point into \(y = mx + b\)).
  4. Write \(y = mx + b\) and check it in another point.
Example 1 — Vertical and horizontal
Find the equation of each line.
(i) The red line in the first graph.
(ii) The red line in the second graph.
x = 1 A vertical line through x = 1 on a number plane from -3 to 3. xy −3−2−1123−3−2−11230 y = 2 A horizontal line through y = 2 on a number plane from -3 to 3. xy −3−2−1123−3−2−11230
Solution

(i) Every \(x\)-value is \(1\): \(x = 1\).
(ii) Every \(y\)-value is \(2\): \(y = 2\).

Example 2 — A falling line
Find the equation of the line.
A falling line A number plane from -3 to 3 with a line through (-2, 3), (0, 1), (1, 0) and (3, -2). xy −3−2−1123−3−2−11230
Solution

Use \(y = mx + b\). When \(x = 0\), \(y = 1\), so \(b = 1\). When \(x = 1\), \(y = 0\), so \(0 = m + 1\).

\(b\)\(=\)\(1\)
\(m\)\(=\)\(-1\)
y =− x +1

\(y = -x + 1\). Check \((3, -2)\): \(-3 + 1 = -2\).

Example 3 — A step of one
A line passes through \((0, -4)\), \((1, -3)\), \((2, -2)\) and \((3, -1)\).
(i) Write its rule.
(ii) Find \(y\) when \(x = 12\).
Solution

Each time \(x\) goes up \(1\), \(y\) goes up \(1\), and \(y\) is always \(4\) less than \(x\).

\(y\)\(=\)\(x - 4\)
\(12 - 4\)\(=\)\(8\)
y = x −48

(i) \(y = x - 4\)
(ii) \(y = 8\)

Example 4 — A bigger step
A line passes through \((0, -1)\), \((1, 2)\) and \((2, 5)\).
(i) Write its rule.
(ii) Find \(y\) when \(x = -5\).
Solution

The step is \(3\). Compare \(y\) with \(3x\): \(0 \to -1\), \(3 \to 2\), \(6 \to 5\): always \(1\) less.

\(y\)\(=\)\(3x - 1\)
\(3 \times (-5) - 1\)\(=\)\(-16\)
y =3 x −1−16

(i) \(y = 3x - 1\)
(ii) \(y = -16\)

Example 5 — A real-life graph
The graph shows a tutor’s charge \(C\) dollars for \(h\) hours.
(i) Write the rule.
(ii) Find the charge for \(5\) hours.
(iii) How long is a \(\$200\) booking?
A tutor charge A straight-line graph of charge C dollars against hours h: 20 at 0 hours, 50 at 1, 80 at 2 and 110 at 3. 0 20 40 60 80 100 120 140 0 1 2 3 4 h (hours) C (dollars)
Solution

Points \((0, 20)\), \((1, 50)\), \((2, 80)\), \((3, 110)\): each hour adds \(\$30\), and the charge at \(h = 0\) is the \(\$20\) booking fee.

\(C\)\(=\)\(30h + 20\)
\(30 \times 5 + 20\)\(=\)\(170\)
\(30h\)\(=\)\(200 - 20 = 180\)
\(h\)\(=\)\(6\)
C =30 h +20$1706 hours

(i) \(C = 30h + 20\)
(ii) \(\$170\)
(iii) \(6\) hours

Example 6 — A half step
(i) Write the rule for the line.
(ii) Find \(y\) when \(x = 10\).
(iii) Where does the line cross the \(x\)-axis?
A half step A line through (-2, 4), (0, 3), (2, 2) and (4, 1): y goes down 1 for every 2 across. xy −3−2−112345−3−2−1123450
Solution

Each time \(x\) goes up \(2\), \(y\) goes down \(1\), so the step is \(-\dfrac{1}{2}\). At \(x = 0\), \(y = 3\).

\(y\)\(=\)\(3 - \dfrac{x}{2}\)
\(3 - \dfrac{10}{2}\)\(=\)\(-2\)
\(\dfrac{x}{2}\)\(=\)\(3\)
\(x\)\(=\)\(6\)
y =3− x /2−2(6,0)

(i) \(y = 3 - \dfrac{x}{2}\)
(ii) \(y = -2\)
(iii) At \((6, 0)\)

Example 7 — Points that are not evenly spaced
The points \((-2, -7)\), \((1, 2)\) and \((3, 8)\) lie on a line. Find its rule.
Solution

From \(x = -2\) to \(x = 1\) is \(3\) across, and \(y\) goes up \(2 - (-7) = 9\), so the step is \(9 \div 3 = 3\). Substitute \((1, 2)\) into \(y = 3x + b\).

\(2\)\(=\)\(3 + b\)
\(b\)\(=\)\(-1\)
y =3 x −1

\(y = 3x - 1\). Check \((3, 8)\): \(9 - 1 = 8\).

Common pitfalls

Not dividing by the distance across. Up \(6\) over \(3\) across is a step of \(2\), not \(6\).
Losing the minus sign of a falling line. A line going down from left to right has a negative step.
Writing y = 2 for a vertical line. A vertical line through \(x = 2\) is \(x = 2\).
Not checking. Substitute a point you did not use; it must fit the rule.

Frequently asked questions

How do I find the equation of a straight line from a graph?

Find the step (change in y for each 1 across) and the y-value where the line crosses the y-axis, then write y = (step)x + (that value).

What if the points are 2 units apart?

Divide the change in y by 2 to get the step for 1 across.

What is the equation of a horizontal line?

y = c, where c is the y-value of every point, such as y = βˆ’1.

What is the equation of a vertical line?

x = c, where c is the x-value of every point, such as x = 5.

How do I find where the line crosses the x-axis?

Make the rule equal 0 and solve for x.