Finding the Equation of a Line Graphically
Finding the equation of a line graphically means reading two points from its graph, working out the gradient, then writing the equation. When the \(y\)-intercept can be read, \(y=mx+c\) follows straight away. In NSW Year 10 Advanced maths answers are given in gradient–intercept form or in general form with integer coefficients (NESA outcome MA5‑LIN‑C‑02).
You will find equations of lines drawn on grids, including lines whose intercepts are fractions and grids where each square is 0.5 units. You will find the equations of the three sides of a triangle, the area enclosed by a line and the axes, where two lines cross, and an unknown point that lies beyond the edge of the grid. You will also prove that three marked points are collinear. It is part of Year 10 Advanced Straight Line Graphs.
Every question with a fully worked solution.
- Finding the Equation of a Line Graphically - Video - Finding the Equation of a Line from a Graph (y = mx+b) Watch
Theory
To find the equation of a line from its graph, read two exact points, work out the gradient as rise over run, then find the \(y\)-intercept, by reading it if it is on a grid point or by calculating it if not. This Year 10 Advanced maths page covers general form, unequal scales and lines meeting off the grid.
A straight line is fixed by its gradient \(m\) and one point. On a graph, the clearest information is where the line passes exactly through a grid point, a place where grid lines cross.
The \(y\)-intercept \(c\) can be read straight off the graph only if the line crosses the \(y\)-axis at a grid point. Otherwise, substitute a known point into \(y = mx + c\) and solve.
Always check the scale on each axis. A square might be \(0.5\) units, or a different number of units on the two axes.
In general form \(ax + by + c = 0\) the coefficients are usually whole numbers with no common factor and \(a \gt 0\).
From the two axis intercepts \((p,\ 0)\) and \((0,\ q)\):
How to find the equation from a graph
- Read the scales on both axes.
- Pick two points where the line passes exactly through grid points, as far apart as possible.
- Find the gradient: run across, rise up (negative if the line falls). Check the sign against the picture.
- Find \(c\): read it if the line crosses the \(y\)-axis at a grid point; otherwise substitute a point into \(y = mx + c\).
- Write the equation in the form asked for, and check it with your second point.
Using the equation
- A point beyond the grid: substitute its known coordinate into the equation to find the other, e.g. \(P(a,\ 5)\) gives \(5 = ma + c\).
- Intercepts off the grid: put \(y = 0\) or \(x = 0\) in the equation; the answer may be a fraction.
- Two lines: find both equations, then solve simultaneously for the exact intersection (Example 4).
- Sides of a triangle: find each side's equation from its two vertices.
- Collinear points: equal gradients \(m_{PQ} = m_{QR}\) with a shared point mean one line.
- Areas: the triangle a line makes with the axes has area \(\dfrac{1}{2} \times |p| \times |q|\).
The line falls from left to right, so expect a negative gradient. From \((0,\ 3)\) to \((2,\ -2)\) it runs \(2\) and falls \(5\).
| \(m\) | \(=\) | \(\dfrac{-2 - 3}{2 - 0} = -\dfrac{5}{2}\) |
| \(c\) | \(=\) | \(3\) |
| \(y\) | \(=\) | \(-\dfrac{5}{2}x + 3\) |
Multiply by \(2\) and collect on one side:
| \(2y\) | \(=\) | \(-5x + 6\) |
| \(5x + 2y - 6\) | \(=\) | \(0\) |
So \(\boldsymbol{y = -\dfrac{5}{2}x + 3}\), or \(\boldsymbol{5x + 2y - 6 = 0}\).
Reading \(c\) from the graph would only be a guess, so calculate it.
| \(m\) | \(=\) | \(\dfrac{1 - (-3)}{2 - (-3)} = \dfrac{4}{5}\) |
| \(1\) | \(=\) | \(\dfrac{4}{5}(2) + c\) |
| \(c\) | \(=\) | \(1 - \dfrac{8}{5} = -\dfrac{3}{5}\) |
So \(y = \dfrac{4}{5}x - \dfrac{3}{5}\). Multiply by \(5\):
| \(5y\) | \(=\) | \(4x - 3\) |
| \(4x - 5y - 3\) | \(=\) | \(0\) |
The equation is \(\boldsymbol{4x - 5y - 3 = 0}\). Check \((-3,\ -3)\): \(-12 + 15 - 3 = 0\ \checkmark\)
Read values, not squares. The line passes through \((0,\ 40)\) and \((5,\ -10)\).
| \(m\) | \(=\) | \(\dfrac{-10 - 40}{5 - 0} = \dfrac{-50}{5} = -10\) |
| \(c\) | \(=\) | \(40\) |
The equation is \(\boldsymbol{y = -10x + 40}\). Counting squares would give a gradient of \(-1\), which is wrong by a factor of \(10\).
| \(m_A\) | \(=\) | \(\dfrac{2 - (-1)}{2 - (-4)} = \dfrac{1}{2},\) \(2 = \dfrac{1}{2}(2) + c\) \(\Rightarrow c = 1\) |
| \(m_B\) | \(=\) | \(\dfrac{-1 - 5}{3 - 0} = -2,\) \(c = 5\) |
Line A is \(y = \dfrac{1}{2}x + 1\) and line B is \(y = -2x + 5\). Since \(\dfrac{1}{2} \times (-2) = -1\), they are perpendicular.
| \(\dfrac{1}{2}x + 1\) | \(=\) | \(-2x + 5\) |
| \(x + 2\) | \(=\) | \(-4x + 10\) |
| \(5x\) | \(=\) | \(8\) |
| \(x\) | \(=\) | \(\dfrac{8}{5},\quad y = -2\left(\dfrac{8}{5}\right) + 5 = \dfrac{9}{5}\) |
They meet at \(\boldsymbol{\left(\dfrac{8}{5},\ \dfrac{9}{5}\right)}\), which is \((1.6,\ 1.8)\). The graph alone could not give this exactly.
Common pitfalls
Frequently asked questions
How do you find the equation of a line from a graph?
Find two points the line passes through exactly. Work out the gradient as rise over run, find the \(y\)-intercept, and write \(y = mx + c\). Check with a second point.
What if the y-intercept is not a whole number?
Calculate it. Substitute the gradient and the coordinates of a grid point on the line into \(y = mx + c\), and solve for \(c\).
How do you write the equation of a line in general form?
Start from \(y = mx + c\), multiply by the denominator to clear fractions, move every term to one side, divide out any common factor and make the \(x\) coefficient positive.
How do you find the gradient from a graph?
Choose two exact points. Count how far the line goes across (the run) and how far up or down (the rise), using the axis scales, and divide rise by run.
How do you find where two lines on a graph meet exactly?
Find the equation of each line from the graph, then solve the two equations simultaneously. The graph shows roughly where they meet; the algebra gives the exact point.