Finding the Equation of a Line
A line's equation can be found from its gradient and one point, or from two points. This NSW Year 9 Advanced maths subtopic finds equations in gradient-intercept form and in general form (NESA outcome MA5‑LIN‑C‑02).
You will find equations of horizontal and vertical lines, lines from graphs, lines from a gradient and a point, and lines through two points. You will find lines that are parallel or perpendicular to another line, the perpendicular bisector of an interval, linear rules for an electrician's charges and for Celsius and Fahrenheit, and show that the diagonals of a quadrilateral are perpendicular. It is part of Year 9 Advanced Coordinate Geometry and Graphs.
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 you need its gradient and one point on it. Substitute into \(y=mx+c\) to find \(c\), or use the point–gradient form \(y-y_1=m(x-x_1)\). This Year 9 Advanced maths page covers lines through two points, parallel and perpendicular lines, the general form, perpendicular bisectors and linear models.
A straight line is fixed by its gradient and any one point on it, or by any two points (which give the gradient).
The gradient–intercept form is \(y=mx+c\). If you know \(m\) and a point, substitute the point to find \(c\).
The point–gradient form \(y-y_1=m(x-x_1)\) uses the point \((x_1,y_1)\) directly. Expand it to get \(y=mx+c\).
The general form is \(ax+by+c=0\), usually with integers \(a\), \(b\), \(c\) that have no common factor and \(a>0\).
Horizontal lines are \(y=c\) and vertical lines are \(x=k\); they have no \(x\)-term or no \(y\)-term.
| You know | Gradient to use |
|---|---|
| a parallel line | the same \(m\) |
| a perpendicular line with gradient \(m_1\) | \(-\dfrac{1}{m_1}\) |
| two points | \(\dfrac{y_2-y_1}{x_2-x_1}\) |
| the \(x\)-intercept \(a\) and \(y\)-intercept \(b\) | \(-\dfrac{b}{a}\), with \(c=b\) |
How to find the equation of a line
- Find the gradient: given, read from a graph, from two points, or from a parallel or perpendicular line.
- Choose a point on the line.
- Substitute into \(y=mx+c\) and solve for \(c\), or use \(y-y_1=m(x-x_1)\) and expand.
- Write the equation in the form asked for, and check it with a second point.
Special cases and harder problems
- Same \(y\)-coordinates: the line is horizontal, \(y=c\). Same \(x\)-coordinates: the line is vertical, \(x=k\).
- From a graph: read \(c\) where the line crosses the \(y\)-axis, and \(m\) from two clear grid points.
- Given an \(x\)-intercept: it is the point \((a,0)\); substitute it like any other point.
- Perpendicular bisector: midpoint for the point, negative reciprocal for the gradient (Example 4).
- Unknown coordinate on a parallel line: copy the gradient, then set rise over run equal to it.
- Intercept conditions: name an intercept with a pronumeral, write both intercepts as points, find the gradient in terms of the pronumeral, then use the given point.
- Models: two readings of a steady change are two points. The gradient is the rate and \(c\) is the starting value (Example 3). Two scales that match up, such as temperature scales, work the same way.
Find the gradient first, then substitute one point to find \(c\).
| \(m\) | \(=\) | \(\dfrac{3-(-5)}{4-(-2)} = \dfrac{8}{6} = \dfrac{4}{3}\) |
| \(3\) | \(=\) | \(\dfrac{4}{3}(4)+c\) |
| \(c\) | \(=\) | \(3-\dfrac{16}{3} = -\dfrac{7}{3}\) |
So \(\boldsymbol{y=\dfrac{4}{3}x-\dfrac{7}{3}}\). Multiply every term by \(3\) and move everything to one side:
| \(3y\) | \(=\) | \(4x-7\) |
| \(0\) | \(=\) | \(4x-3y-7\) |
General form: \(\boldsymbol{4x-3y-7=0}\). Check \((-2,-5)\): \(-8+15-7=0\) ✓
Parallel lines have the same gradient. Rearrange the given line to read it.
| \(-5y\) | \(=\) | \(-2x+3\) |
| \(y\) | \(=\) | \(\dfrac{2}{5}x-\dfrac{3}{5}\) |
So \(m=\dfrac{2}{5}\). Use the point–gradient form with \((5,-1)\):
| \(y-(-1)\) | \(=\) | \(\dfrac{2}{5}(x-5)\) |
| \(y+1\) | \(=\) | \(\dfrac{2}{5}x-2\) |
| \(y\) | \(=\) | \(\dfrac{2}{5}x-3\) |
So \(\boldsymbol{y=\dfrac{2}{5}x-3}\), or \(2x-5y-15=0\). Same gradient, different intercept: the lines never meet.
(i) Find a rule for the length \(L\) cm in terms of the mass \(w\) kg.
(ii) What is the length with no mass?
(iii) Predict the length for \(7\) kg.
(i) Steady stretching is linear, so treat the readings as points \((2,18)\) and \((5,27)\).
| \(\text{gradient}\) | \(=\) | \(\dfrac{27-18}{5-2} = 3\) |
| \(18\) | \(=\) | \(3\times 2+c\) |
| \(c\) | \(=\) | \(12\) |
So \(\boldsymbol{L=3w+12}\). The gradient is \(3\) cm per kg: each kilogram stretches the spring \(3\) cm.
(ii) With no mass, \(w=0\), so \(L=12\) cm, the intercept. (iii) \(L=3\times 7+12=\mathbf{33}\) cm.
The perpendicular bisector passes through the midpoint of \(AB\) and is perpendicular to \(AB\).
| \(M\) | \(=\) | \(\left(\dfrac{-1+5}{2},\ \dfrac{-3+1}{2}\right) = (2,-1)\) |
| \(m_{AB}\) | \(=\) | \(\dfrac{1-(-3)}{5-(-1)} = \dfrac{2}{3}\) |
| \(m_{\perp}\) | \(=\) | \(-\dfrac{3}{2}\) |
| \(y-(-1)\) | \(=\) | \(-\dfrac{3}{2}(x-2)\) |
| \(y+1\) | \(=\) | \(-\dfrac{3}{2}x+3\) |
| \(y\) | \(=\) | \(-\dfrac{3}{2}x+2\) |
So \(\boldsymbol{y=-\dfrac{3}{2}x+2}\), or \(3x+2y-4=0\). Check: \((0,2)\) is on it, and its distances squared to \(A\) and \(B\) are both \(26\).
Common pitfalls
Frequently asked questions
How do you find the equation of a line from two points?
Find the gradient with rise over run between the points. Substitute the gradient and one of the points into \(y=mx+c\) and solve for \(c\). Then write \(y=mx+c\) with both values.
What is the point-gradient form of a line?
\(y-y_1=m(x-x_1)\), where \(m\) is the gradient and \((x_1,y_1)\) is a point on the line. Expanding it gives \(y=mx+c\).
How do you find the equation of a parallel line?
Use the same gradient as the given line, then substitute the point the new line must pass through to find its \(y\)-intercept.
How do you find the equation of a perpendicular line?
Take the negative reciprocal of the given gradient: flip the fraction and change its sign. Then use that gradient with the point the line passes through.
What is the general form of a straight line?
\(ax+by+c=0\), with every term on one side. Usually \(a\), \(b\) and \(c\) are integers with no common factor and \(a\) is positive.