Finding the Equation of a Line
Finding the equation of a line means writing the rule that every point on a straight-line graph obeys, such as \(y = 2x + 1\). In NSW Year 8 maths this is done by reading points into a table, while gradient and \(y = mx + c\) wait until Stage 5 (NESA outcome MA4‑LIN‑C‑01).
You will read coordinates from a graph, find how much \(y\) changes for each step across and the value of \(y\) when \(x = 0\), then write and check the rule. You will recognise horizontal lines like \(y = 3\) and vertical lines like \(x = 3\), handle decreasing lines and points that are unevenly spaced, and use the rule to extend a line, for example to model a pool being filled or the distance left in a kayak race. It is part of Year 8 Graphing Linear Equations.
Every question with a fully worked solution.
- Finding the Equation of a Line - Video - Finding the rule of a line from graph or table Watch
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\).
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\).
Finding the equation of a line
- Read two or three points off the line.
- Find the step \(m\): change in \(y\) \(\div\) change in \(x\).
- Find \(b\): the \(y\)-value at \(x = 0\) (or substitute a point into \(y = mx + b\)).
- Write \(y = mx + b\) and check it in another point.
(i) The red line in the first graph.
(ii) The red line in the second graph.
(i) Every \(x\)-value is \(1\): \(x = 1\).
(ii) Every \(y\)-value is \(2\): \(y = 2\).
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\). Check \((3, -2)\): \(-3 + 1 = -2\).
(i) Write its rule.
(ii) Find \(y\) when \(x = 12\).
Each time \(x\) goes up \(1\), \(y\) goes up \(1\), and \(y\) is always \(4\) less than \(x\).
| \(y\) | \(=\) | \(x - 4\) |
| \(12 - 4\) | \(=\) | \(8\) |
(i) \(y = x - 4\)
(ii) \(y = 8\)
(i) Write its rule.
(ii) Find \(y\) when \(x = -5\).
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\) |
(i) \(y = 3x - 1\)
(ii) \(y = -16\)
(i) Write the rule.
(ii) Find the charge for \(5\) hours.
(iii) How long is a \(\$200\) booking?
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\) |
(i) \(C = 30h + 20\)
(ii) \(\$170\)
(iii) \(6\) hours
(ii) Find \(y\) when \(x = 10\).
(iii) Where does the line cross the \(x\)-axis?
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\) |
(i) \(y = 3 - \dfrac{x}{2}\)
(ii) \(y = -2\)
(iii) At \((6, 0)\)
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 = 3x - 1\). Check \((3, 8)\): \(9 - 1 = 8\).
Common pitfalls
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.