4C

Finding the equation of a line

Finding the equation of a line from the gradient and a point, from two points, and from a graph, using y = mx + c or y − y₁ = m(x − x₁).

In the last section you started with an equation and drew the line. Now reverse it: given some facts about a line, write its equation. It is how you turn two measurements, like a taxi fare for two trip lengths, into a rule that predicts the rest.

Gradient and one point

Every non-vertical line can be written $y = mx + c$. If you know $m$, only $c$ is missing, and the point gives you one equation to find it.

Example 1●

Find the equation of the line with gradient $3$ that passes through $(2, 1)$.

$y = 3x + c$
Write y = mx + c with the gradient filled in.
$1 = 3(2) + c$, so $c = -5$
(2, 1) is on the line, so x = 2, y = 1 must make it true.
$y = 3x - 5$

There is also a formula that does the same job in one line:

Point-gradient form
$$y - y_1 = m(x - x_1)$$

For Example 1: $y - 1 = 3(x - 2)$, so $y = 3x - 6 + 1 = 3x - 5$. Same answer. It works because for any point $(x, y)$ on the line, the gradient from $(x_1, y_1)$ to $(x, y)$ is $m$: $\dfrac{y - y_1}{x - x_1} = m$. Multiply both sides by $(x - x_1)$ and you have the formula.

Two points

Two points fix a line. Use them to find the gradient first, then use either point to find $c$.

Example 2●●

Find the equation of the line through $(1, 5)$ and $(4, -1)$.

$m = \dfrac{-1 - 5}{4 - 1} = \dfrac{-6}{3} = -2$
Gradient from the two points.
$5 = -2(1) + c$, so $c = 7$
Substitute either point into y = −2x + c. Using (1, 5).
$y = -2x + 7$
Check with the other point: −2(4) + 7 = −1. Correct.

From a graph

Read the $y$-intercept straight off the graph. For the gradient, pick two points where the line crosses grid corners exactly, and count the rise and run between them.

Example 3●●

A line crosses the $y$-axis at $2$ and the $x$-axis at $3$. Find its equation.

$c = 2$
The y-intercept is given.
$m = \dfrac{0 - 2}{3 - 0} = -\dfrac23$
From (0, 2) to (3, 0): run 3 to the right, rise −2.
$y = -\dfrac23 x + 2$

Your turn

A water tank is draining at a steady rate. After $3$ minutes it holds $340$ L, and after $8$ minutes it holds $240$ L. Find a rule for the volume $V$ after $t$ minutes, and how much was in the tank at the start.

Show the working

Gradient: $m = \dfrac{240 - 340}{8 - 3} = \dfrac{-100}{5} = -20$ L per minute. Then $340 = -20(3) + c$, so $c = 400$. The rule is $V = -20t + 400$, and the tank started with $400$ L.

Practice
  1. A line has gradient $2$ and passes through $(0, -3)$. Its equation is $y = 2x + c$. Find $c$.

  2. A line has gradient $4$ and passes through $(1, 7)$. Find $c$ in $y = 4x + c$.

  3. A line has gradient $-2$ and passes through $(3, 1)$. Find $c$ in $y = -2x + c$.

  4. The line through $(2, 5)$ and $(4, 9)$ is:

  5. Find the $y$-intercept of the line through $(-1, 6)$ and $(3, -2)$.

  6. A line has $x$-intercept $4$ and $y$-intercept $8$. Find its gradient.

  7. The line with gradient $3$ through $(5, -2)$ in point-gradient form is:

  8. The horizontal line through $(3, -4)$ has equation $y = k$. Find $k$.

  9. Challenge: Find the $x$-intercept of the line through $(-2, 1)$ and $(4, 4)$.

  10. Challenge: A plumber charges a fixed call-out fee plus an hourly rate. A $2$ hour job costs $\$203.60$ and a $5$ hour job costs $\$443.60$. Find the call-out fee in dollars.

Formula sheet