Resources For Teachers For Tutors For Students & Parents AI New Pricing
Year 9 Maths Core Straight Line

Finding the Equation of a Line

20 practice questions 1 video lesson Theory + worked examples

Finding the equation of a line means working out its gradient \(m\) and \(y\)-intercept \(c\) from the information given. This NSW Year 9 Core maths subtopic is Stage 5 Core content under NESA outcome MA5‑LIN‑C‑02, including parallel and perpendicular lines.

You will write equations from a gradient and intercept, read \(m\) and \(c\) off a graph, find \(c\) by substituting a point into \(y = mx + c\), and find the line through two points such as \((-1,7)\) and \((3,4)\). You will recognise horizontal lines like \(y = 3\) and vertical lines like \(x = 6\), find a line parallel to another by copying its gradient and one perpendicular to it with the negative reciprocal gradient, and model an electrician's charges from two jobs. It is part of Year 9 Core Straight Line.

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 in the form \(y = mx + c\), first get the gradient \(m\), then use a point to get \(c\). This Year 9 maths page shows how to do it from a graph, from two points, and for lines that are parallel or perpendicular to a given line.

The equation of a straight line can be written as \(y = mx + c\), where \(m\) is the gradient and \(c\) is the \(y\)-intercept. Finding the equation means finding those two numbers.

The gradient may be given, found from two points, read from a graph, or taken from another line. A point on the line then gives \(c\): substitute its coordinates and solve.

Parallel lines have equal gradients. Perpendicular lines meet at right angles, and their gradients multiply to \(-1\).

Two special cases do not need \(y = mx + c\). If two points have the same \(y\)-coordinate, the line is horizontal: \(y = b\). If they have the same \(x\)-coordinate, it is vertical: \(x = a\).

Two parallel linesTwo parallel lines, y = one half x + 3 and y = one half x - 1. They have the same gradient and different y-intercepts. x y βˆ’4 βˆ’3 βˆ’2 βˆ’1 1 2 3 4 5 βˆ’3 βˆ’2 βˆ’1 1 2 3 4 5 y = Β½x + 3 y = Β½x βˆ’ 1
Parallel lines have equal gradients. Only the \(y\)-intercept changes.
Two perpendicular linesThe line with gradient 2 and the line with gradient negative one half cross at right angles at (1, 2). The right angle is marked. x y βˆ’4 βˆ’3 βˆ’2 βˆ’1 2 3 4 βˆ’3 βˆ’2 βˆ’1 1 3 4 5 m = 2 m = βˆ’Β½
Perpendicular lines meet at \(90^\circ\). Their gradients multiply to \(-1\): \(2 \times \left(-\dfrac{1}{2}\right) = -1\).
\[y = mx + c \qquad m = \dfrac{y_2 - y_1}{x_2 - x_1}\]
y=mx+c

For parallel and perpendicular lines with gradients \(m_1\) and \(m_2\):

\[\text{parallel: } m_2 = m_1 \qquad \text{perpendicular: } m_1 \times m_2 = -1, \text{ so } m_2 = -\dfrac{1}{m_1}\]
m1×m2=−1
An intercept is just a point. An \(x\)-intercept of \(3\) means the point \((3, 0)\) is on the line. Substitute it like any other point. A \(y\)-intercept of \(-1\) is the point \((0, -1)\): with one more point, such as \((4, 7)\), substitute to find \(m\): \(7 = 4m - 1\), so \(m = 2\) and \(y = 2x - 1\).
Real-life lines from two facts. If a gardener charges $150 for \(3\) hours and $270 for \(6\) hours, the rate is \(m = \dfrac{270 - 150}{6 - 3} = 40\) dollars per hour. Then \(150 = 40 \times 3 + c\) gives a fixed fee of \(c = 30\), so \(C = 40t + 30\).
A missing coordinate. If the gradient is known, write rise over run with the unknown and solve. For \(P(1, 2)\), \(Q(5, k)\) and \(m = 3\): \(\dfrac{k - 2}{5 - 1} = 3\), so \(k - 2 = 12\) and \(k = 14\).

How to find the equation of a line

  1. Check for a horizontal (\(y = b\)) or vertical (\(x = a\)) line first.
  2. Get the gradient: given, from two points, from a graph, or from a parallel (same) or perpendicular (negative reciprocal) line.
  3. Get \(c\): if you know the \(y\)-intercept, \(c\) is its \(y\)-value. Otherwise substitute \(m\) and one point into \(y = mx + c\) and solve.
  4. Write the equation \(y = mx + c\) with both numbers in place.
  5. Check by substituting a second point.
Example 1 β€” Reading a line off a graph
A straight line crosses the \(y\)-axis at \((0, 2)\) and passes through the grid point \((2, -1)\). Find its equation.
Solution
A line through (0, 2) and (2, -1)A falling line crossing the y-axis at (0, 2) and passing through the grid point (2, -1). From (0, 2), 2 across and 3 down reaches (2, -1). x y βˆ’3 βˆ’2 βˆ’1 1 3 4 βˆ’4 βˆ’3 βˆ’2 1 4 run 2 down 3 (0, 2) (2, βˆ’1)

The \(y\)-intercept gives \(c\) straight away. Count the run and the rise to the other grid point for \(m\). The line goes down, so the rise is negative.

\(c\)\(=\)\(2\)
\(m\)\(=\)\(\dfrac{\text{rise}}{\text{run}} = \dfrac{-3}{2}\)
\(y\)\(=\)\(\mathbf{-\dfrac{3}{2}x + 2}\)
y=−32x+2
Example 2 β€” Through two points
Find the equation of the line through \((-2, 1)\) and \((2, 9)\).
Solution

Step 1: find \(m\) from the two points. Step 2: substitute \(m\) and one point into \(y = mx + c\) to find \(c\).

\(m\)\(=\)\(\dfrac{9 - 1}{2 - (-2)} = \dfrac{8}{4} = 2\)
\(9\)\(=\)\(2 \times 2 + c\)
\(c\)\(=\)\(5\)
\(y\)\(=\)\(\mathbf{2x + 5}\)
y=2x+5
The line through (-2, 1) and (2, 9)The line y = 2x + 5 through the red points (-2, 1) and (2, 9), crossing the y-axis at 5. x y βˆ’5 βˆ’3 βˆ’1 1 3 βˆ’1 3 5 7 (βˆ’2, 1) (2, 9) c = 5

Check with the other point: \(2 \times (-2) + 5 = 1\).

Example 3 β€” A parallel line
Find the equation of the line parallel to \(y = -3x + 2\) that passes through \((1, 4)\).
Solution

Parallel lines share their gradient, so \(m = -3\). Substitute the point to find \(c\).

\(4\)\(=\)\(-3 \times 1 + c\)
\(4\)\(=\)\(-3 + c\)
\(c\)\(=\)\(7\)
\(y\)\(=\)\(\mathbf{-3x + 7}\)
y=−3x+7
A line parallel to y = -3x + 2The dashed line y = -3x + 2 and, in red, the parallel line through (1, 4). x y βˆ’2 4 βˆ’3 βˆ’1 1 3 5 7 dashed: y = βˆ’3x + 2 (1, 4)
Example 4 β€” A perpendicular line
Find the equation of the line perpendicular to \(y = \dfrac{1}{2}x - 3\) that passes through \((4, 1)\).
Solution

Turn the gradient upside down and change its sign: \(\dfrac{1}{2}\) becomes \(-2\). Check: \(\dfrac{1}{2} \times (-2) = -1\).

\(1\)\(=\)\(-2 \times 4 + c\)
\(1\)\(=\)\(-8 + c\)
\(c\)\(=\)\(9\)
\(y\)\(=\)\(\mathbf{-2x + 9}\)
y=−2x+9
A line perpendicular to y = one half x - 3The dashed line y = one half x - 3 and, in red, the perpendicular line through (4, 1). The two lines meet at right angles just below and to the right of (4, 1). x y βˆ’1 1 2 3 5 6 7 βˆ’3 βˆ’2 βˆ’1 2 3 4 5 y = Β½x βˆ’ 3 (4, 1)

Common pitfalls

Perpendicular is not just a sign change. The perpendicular gradient to \(\dfrac{1}{2}\) is \(-2\), not \(-\dfrac{1}{2}\). Flip the fraction and change the sign.
Watch out for a falling line on a graph. If the line goes down from left to right, the rise is negative, so the gradient is negative.
Substitute x and y into the right places. In \(y = mx + c\), the point's \(y\)-value goes on the left and its \(x\)-value multiplies \(m\).
A vertical line is x = a. Two points with the same \(x\)-coordinate give a vertical line. Its gradient is undefined, so it has no \(y = mx + c\) form.

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 \(m\) and one of the points into \(y = mx + c\) to find \(c\), and write the equation.

How do you find the equation of a line from a graph?

Read \(c\) where the line crosses the \(y\)-axis. Then pick another point where the line passes exactly through a grid corner, and find the gradient as rise over run.

What is the gradient of a perpendicular line?

It is the negative reciprocal: flip the gradient upside down and change its sign. The two gradients multiply to \(-1\). A line perpendicular to one with gradient \(\dfrac{1}{2}\) has gradient \(-2\).

How do you find the equation of a parallel line?

Copy the gradient of the given line, then substitute the point the new line passes through into \(y = mx + c\) to find \(c\).

What is the equation of a vertical line?

A vertical line has the equation \(x = a\), where \(a\) is the \(x\)-coordinate of every point on it. Its gradient is undefined.