Resources For Teachers For Tutors For Students & Parents AI New Pricing
Year 9 Maths Advanced Coordinate Geometry and Graphs

Finding the Equation of a Line

20 practice questions 1 video lesson Theory + worked examples

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.

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 - Slope-intercept equation from a graph Watch
Create a free accountTrack your progress and save your work as you go.
Create free account

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.

A horizontal and a vertical linePoints with the same y-coordinate, -2, lie on the horizontal line y = -2. Points with the same x-coordinate, 4, lie on the vertical line x = 4. x y −3 −2 −1 1 2 3 5 6 −4 −3 −1 1 2 3 4 0 x = 4 y = −2
Two points with the same \(y\)-coordinate give a horizontal line \(y=c\). Two with the same \(x\)-coordinate give a vertical line \(x=k\).
The point-gradient formA fixed point (x1, y1) and any other point (x, y) on the line. The run is x - x1 and the rise is y - y1, and their ratio is the gradient m. x y x − x₁ y − y₁ O (x1, y1) (x, y)
For any point \((x,y)\) on the line, \(\dfrac{y-y_1}{x-x_1}=m\). Multiplying out gives the point–gradient form \(y-y_1=m(x-x_1)\).
\[y = mx + c \qquad y - y_1 = m(x - x_1)\]
y−y1=m(x−x1)
\[m = \dfrac{y_2-y_1}{x_2-x_1} \qquad ax + by + c = 0\]
ax+by+c=0
You knowGradient to use
a parallel linethe 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\)
General form. Multiply by the denominators to clear fractions, move every term to one side, and make the \(x\)-coefficient positive.

How to find the equation of a line

  1. Find the gradient: given, read from a graph, from two points, or from a parallel or perpendicular line.
  2. Choose a point on the line.
  3. Substitute into \(y=mx+c\) and solve for \(c\), or use \(y-y_1=m(x-x_1)\) and expand.
  4. Write the equation in the form asked for, and check it with a second point.

Special cases and harder problems

  1. Same \(y\)-coordinates: the line is horizontal, \(y=c\). Same \(x\)-coordinates: the line is vertical, \(x=k\).
  2. From a graph: read \(c\) where the line crosses the \(y\)-axis, and \(m\) from two clear grid points.
  3. Given an \(x\)-intercept: it is the point \((a,0)\); substitute it like any other point.
  4. Perpendicular bisector: midpoint for the point, negative reciprocal for the gradient (Example 4).
  5. Unknown coordinate on a parallel line: copy the gradient, then set rise over run equal to it.
  6. 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.
  7. 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.
Example 1 — Through two points
Find the equation of the line through \((-2,-5)\) and \((4,3)\). Give it in the form \(y=mx+c\) and in the general form \(ax+by+c=0\) with integer coefficients.
Solution

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}\)
m=86=43

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\)
4x−3y−7=0

General form: \(\boldsymbol{4x-3y-7=0}\). Check \((-2,-5)\): \(-8+15-7=0\) ✓

Line through (-2, -5) and (4, 3)The line through (-2, -5) and (4, 3) crosses the y-axis at -7/3. x y O (−2, −5) (4, 3) (0, −7⁄3)
Example 2 — Parallel, through a point
Find the equation of the line parallel to \(2x-5y=3\) that passes through \((5,-1)\).
Solution

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\)
y=25x−3

So \(\boldsymbol{y=\dfrac{2}{5}x-3}\), or \(2x-5y-15=0\). Same gradient, different intercept: the lines never meet.

Parallel line through (5, -1)The dashed line 2x - 5y = 3 and the red parallel line through (5, -1). x y O (5, −1) 2x − 5y = 3
Example 3 — A linear model from two readings
A spring stretches steadily. With a \(2\) kg mass it is \(18\) cm long, and with a \(5\) kg mass it is \(27\) cm long.
(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.
Solution

(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.

Spring length against massA straight line through (2, 18) and (5, 27), crossing the vertical axis at 12 cm. w (kg) L (cm) 1 2 3 4 5 6 7 8 10 20 30 40 0 (2, 18) (5, 27) (0, 12)
Example 4 — Perpendicular bisector
Find the equation of the perpendicular bisector of the interval joining \(A(-1,-3)\) and \(B(5,1)\).
Solution

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\)
y=−32x+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\).

Perpendicular bisector of ABInterval AB with its midpoint M(2, -1). The red line through M is perpendicular to AB. x y O A(−1, −3) B(5, 1) M(2, −1)

Common pitfalls

Subtract in the same order. \(\dfrac{3-(-5)}{4-(-2)}\), both from the second point. Mixing the order flips the sign of \(m\).
Negative coordinates in brackets. With the point \((5,-1)\), \(y-y_1\) is \(y-(-1)=y+1\). Writing \(y-1\) moves the line.
Perpendicular means flip and change sign. The perpendicular to \(m=\dfrac{2}{3}\) is \(-\dfrac{3}{2}\), not \(-\dfrac{2}{3}\) and not \(\dfrac{3}{2}\).
Finish the general form. \(y=\dfrac{4}{3}x-\dfrac{7}{3}\) is not general form. Clear the fractions and move every term to one side: \(4x-3y-7=0\).

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.