Finding an Equation of a Line
Every question with a fully worked solution.
- Finding an Equation of a Line - Video - The Equation of a Line Watch
Theory
The equation of a straight line can be written in gradient–intercept form \(y = mx + c\), point–gradient form \(y - y_1 = m(x - x_1)\) or general form \(ax + by + c = 0\). This Year 10A maths page revises and extends the work from Years 7 to 9: finding the equation from a point and a gradient, from two points or from a graph, changing between forms, and solving problems with intercepts, parallel and perpendicular lines.
The equation of a line is a rule that every point on the line satisfies, and no other point does. To test a point, substitute its coordinates.
In gradient–intercept form \(y = mx + c\), \(m\) is the gradient and \(c\) is the \(y\)-intercept, where the line cuts the \(y\)-axis.
Point–gradient form \(y - y_1 = m(x - x_1)\) gives the equation straight away from one point \((x_1,\ y_1)\) and the gradient \(m\).
General form \(ax + by + c = 0\) has every term on one side, usually with whole numbers and \(a\) positive. The \(x\)-intercept is where \(y = 0\) and the \(y\)-intercept is where \(x = 0\).
Gradient from two points, and from general form:
How to find the equation of a line
- Find the gradient: given, from two points, from a parallel line (same) or a perpendicular line (negative reciprocal).
- Find a point on the line: given, an intercept, a midpoint, or an intersection of two other lines.
- Substitute into \(y - y_1 = m(x - x_1)\).
- Rearrange to the form asked for. For general form, multiply out fractions and move everything to one side.
- Check that a second known point satisfies your equation.
Common problem types
- Is a point on the line? Substitute its \(x\) and compare the \(y\). The difference tells you how far above or below the line it is.
- Perpendicular bisector (the line that cuts an interval in half at right angles): it goes through the midpoint, with the negative reciprocal gradient.
- Unknown in the equation: if a line such as \(kx + (k + 2)y = 4\) passes through a point, substitute the point and solve for \(k\).
- Through an intersection: solve the two equations simultaneously to get the point, then use it.
- Altitudes and medians: an altitude goes through a vertex perpendicular to the opposite side; a median goes through a vertex and the midpoint of the opposite side. Two of them meet where you solve their equations together.
- Missing vertex of a parallelogram: draw lines through the known vertices parallel to the opposite sides; the vertex is where they meet.
- Area with the axes: write the intercepts in terms of the unknown and use area \(= \dfrac{1}{2} \times\) base \(\times\) height (Example 4).
Use the point–gradient form, then multiply by \(4\) to clear the fraction and move every term to one side.
| \(y - y_1\) | \(=\) | \(m(x - x_1)\) |
| \(y - (-5)\) | \(=\) | \(-\dfrac{3}{4}(x - 2)\) |
| \(4(y + 5)\) | \(=\) | \(-3(x - 2)\) |
| \(4y + 20\) | \(=\) | \(-3x + 6\) |
| \(3x + 4y + 14\) | \(=\) | \(0\) |
The equation is \(\boldsymbol{3x + 4y + 14 = 0}\). For the intercepts, put one variable equal to \(0\):
Put \(y = 0\):
| \(3x + 14\) | \(=\) | \(0\) |
| \(x\) | \(=\) | \(-\dfrac{14}{3}\) |
Put \(x = 0\):
| \(4y + 14\) | \(=\) | \(0\) |
| \(y\) | \(=\) | \(-\dfrac{7}{2}\) |
General form \(ax + by + c = 0\) usually has whole numbers and a positive \(x\) term.
(i) Find the equation of the line through \((-1,\ 4)\) and \((3,\ -4)\) in the form \(y = mx + c\).
(ii) Does the point \((5,\ -8)\) lie on this line?
(i) Find the gradient, then substitute either point.
| \(m\) | \(=\) | \(\dfrac{-4 - 4}{3 - (-1)} = \dfrac{-8}{4} = -2\) |
| \(y - 4\) | \(=\) | \(-2(x - (-1))\) |
| \(y - 4\) | \(=\) | \(-2x - 2\) |
| \(y\) | \(=\) | \(-2x + 2\) |
The line is \(\boldsymbol{y = -2x + 2}\). Check with the other point: \(-2(3) + 2 = -4\ \checkmark\)
(ii) A point lies on a line if its coordinates satisfy the equation.
| \(x = 5:\quad y\) | \(=\) | \(-2(5) + 2 = -8\) |
This matches, so yes, \((5,\ -8)\) lies on the line.
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\)
Every line parallel to \(2x + 3y - 1 = 0\) can be written \(2x + 3y = k\): same \(x\) and \(y\) terms, different constant. Find its intercepts in terms of \(k\).
| \(y = 0:\) | \(\) | \(x = \dfrac{k}{2}\) |
| \(x = 0:\) | \(\) | \(y = \dfrac{k}{3}\) |
The triangle is right-angled at the origin, with the intercepts as its base and height.
| \(\dfrac{1}{2} \times \dfrac{k}{2} \times \dfrac{k}{3}\) | \(=\) | \(12\) |
| \(\dfrac{k^2}{12}\) | \(=\) | \(12\) |
| \(k^2\) | \(=\) | \(144\) |
| \(k\) | \(=\) | \(12\) |
Take \(k \gt 0\), because the triangle is on the positive axes.
The line is \(\boldsymbol{2x + 3y - 12 = 0}\). Check: intercepts \(6\) and \(4\), and \(\dfrac{1}{2} \times 6 \times 4 = 12\ \checkmark\)
Common pitfalls
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 the gradient and either point into \(y - y_1 = m(x - x_1)\), and rearrange.
What is the point-gradient formula?
\(y - y_1 = m(x - x_1)\), where \(m\) is the gradient and \((x_1,\ y_1)\) is a point on the line. It gives the equation directly from one point and the gradient.
How do you write a line in general form?
Move every term to one side so the other side is \(0\), clear any fractions by multiplying, and usually make the \(x\) term positive. For example, \(y = \dfrac{2}{3}x - 1\) becomes \(2x - 3y - 3 = 0\).
How do you find the x-intercept of a line?
Substitute \(y = 0\) into the equation and solve for \(x\). For the \(y\)-intercept substitute \(x = 0\).
How do you find the equation of a line from a graph?
Read the \(y\)-intercept, then use a second exact grid point to find the gradient as rise over run. Write \(y = mx + c\) and check with another point on the line.