Skip to content
mathlab
0
0
0 XP
Lvl 1
KJ
Lesson 12 ~30 min Unit 2 · Linear Relationships +95 XP

Finding the Equation from a Graph

Every straight-line graph has a hidden equation. Learn to find it in two steps: read the y-intercept, calculate the gradient, then write $y = mx + c$.

Think about it: Look at a straight-line graph. Can you figure out its equation without being told? What two things do you need to find?
0/5QUESTS
Think First
warm-up

Look at the line on the graph below. Can you figure out its equation without being told? What two things do you need to find?

x y 0 1 2 3 4 5 2 4 6 c run=1 rise=2 y=2x+1
Record your answer in your workbook.
1
The Two-Step Method
+5 XP

Finding the equation of a straight line from its graph always follows the same process:

Step 1 — Read $c$
Find where the line crosses the y-axis. The y-coordinate at that point is $c$.
Step 2 — Calculate $m$
Draw a gradient triangle on the line. Compute $\frac{\text{rise}}{\text{run}}$. Downhill = negative $m$.
Step 3 — Substitute
Put your values of $m$ and $c$ into $y = mx + c$. Verify with another point.
$$m = \frac{\text{rise}}{\text{run}} = \frac{y_2 - y_1}{x_2 - x_1} \qquad \Rightarrow \qquad y = mx + c$$
2
Worked Example — Positive Gradient
+5 XP
Worked Example 1 — Find the Equation
Find the equation of the straight line shown.
x y 0 1 2 3 4 2 4 6 8 (0,2) (3,8) run=2 rise=4
  1. Find $c$: the line crosses the y-axis at $(0, 2)$, so $c = 2$.
  2. Calculate $m$: gradient triangle gives run $= 2$, rise $= 4$. $m = \frac{4}{2} = 2$.
  3. Substitute: $y = 2x + 2$.
  4. Verify with $(3, 8)$: $y = 2(3) + 2 = 8$. ✓ Answer: $y = 2x + 2$.
3
Worked Example — Negative Gradient
+5 XP
Worked Example 2 — Downhill Line
Find the equation of the line crossing the y-axis at $(0, 5)$ and passing through $(4, 1)$.
x y 0 1 2 3 4 1 3 5 (0,5) (4,1) run=3 rise=-3
  1. Find $c$: crosses at $(0, 5)$, so $c = 5$.
  2. Calculate $m$: using $(0, 5)$ and $(4, 1)$: $m = \frac{1-5}{4-0} = \frac{-4}{4} = -1$.
  3. Substitute: $y = -x + 5$.
  4. Verify: $(4, 1)$: $y = -(4) + 5 = 1$. ✓
Downhill = negative $m$
If the line goes from top-left to bottom-right, the rise is negative, so $m$ is negative.
4
Worked Example — Line Through the Origin
+5 XP
Worked Example 3 — Origin Crossing
Find the equation of the line through the origin and $(3, 6)$.
x y 0 1 2 3 4 2 4 6 (0,0) (3,6) run=2 rise=4
  1. Find $c$: the line passes through the origin $(0, 0)$, so $c = 0$.
  2. Calculate $m$: using $(0, 0)$ and $(3, 6)$: $m = \frac{6-0}{3-0} = 2$.
  3. Substitute: $y = 2x + 0$, so $y = 2x$.
  4. Verify: $(3, 6)$: $y = 2(3) = 6$. ✓
Through origin: $c = 0$
When a line passes through the origin, $c = 0$ and the equation simplifies to $y = mx$.
5
Checking Your Answer
+5 XP

After finding an equation, always verify by substituting another point from the graph.

Check works
I found $y = 2x + 1$. Point $(2, 5)$ is on the line. $2(2)+1 = 5$. ✓ Correct!
Check fails
If I wrote $y = 3x + 1$: $3(2)+1 = 7 \neq 5$. The gradient is wrong — recalculate $m$.
Pro tip
Always verify with a point that is not the y-intercept — that way you test both $m$ and $c$.
6
Common Graph Types
+5 XP

Four common straight-line graph types — learn to recognise them at a glance:

Type 1: $m > 0$, $c > 0$ — e.g. $y = 2x + 3$

c>0

Type 2: $m < 0$, $c > 0$ — e.g. $y = -x + 4$

c>0

Type 3: $m > 0$, $c = 0$ — e.g. $y = 3x$

c=0

Type 4: $m < 0$, $c < 0$ — e.g. $y = -2x - 1$

c<0
Brain Trainer — Find the Equation
+10 XP

Race the clock! Find the equation for each set of information.

$c = 3$, $m = 2$
?$y = 2x + 3$
$c = -1$, $m = 3$
?$y = 3x - 1$
Crosses $(0, 4)$, gradient $= -2$
?$y = -2x + 4$
Through $(0, 0)$ and $(2, 6)$
?$m = 3$, $c = 0$, so $y = 3x$
Through $(0, -2)$ and $(3, 4)$
?$c = -2$, $m = 2$, so $y = 2x - 2$
Gradient $= \frac{1}{2}$, crosses $(0, 3)$
?$y = \frac{1}{2}x + 3$
Through $(0, 5)$ and $(2, 1)$
?$c = 5$, $m = -2$, so $y = -2x + 5$
Crosses $(0, -3)$, through $(4, 5)$
?$c = -3$, $m = 2$, so $y = 2x - 3$
Through origin, gradient $-\frac{3}{2}$
?$c = 0$, so $y = -\frac{3}{2}x$
Through $(1, 4)$ and $(3, 10)$
?$m = 3$; $4 = 3(1)+c$, $c = 1$, so $y = 3x + 1$

Q1. A line crosses the y-axis at $(0, 3)$ and has gradient $2$. What is its equation?

Q2. From the graph below, what is the equation of the line?

x y 0 1 2 3 4 2 4 (3,4)

Q3. A line passes through $(0, -1)$ and $(2, 3)$. What is its equation?

Q4. The equation of a line through the origin with gradient $-2$ is:

Q5. A line goes through $(0, 4)$ and $(3, 0)$. What is its equation?

x y 0 1 2 3 4 2 4 6 (0,4) (3,0)

SAQ 1. Find the equation of the line shown on the graph below. Show all steps.

x y 0 1 2 3 4 2 4 6 (0,3) (2,7) run=1 rise=2
Show answer

Step 1: Line crosses y-axis at $(0, 3)$, so $c = 3$.

Step 2: Gradient triangle: run $= 1$, rise $= 2$. $m = \frac{2}{1} = 2$.

Step 3: $y = 2x + 3$.

Verify: $(2, 7)$: $2(2)+3 = 7$. ✓

SAQ 2. A line has y-intercept $2$ and passes through $(4, 10)$. Find its equation step by step.

Show answer

Step 1: $c = 2$ (given).

Step 2: $m = \frac{10-2}{4-0} = \frac{8}{4} = 2$.

Step 3: $y = 2x + 2$.

Verify: $(4, 10)$: $2(4)+2 = 10$. ✓

SAQ 3. A line passes through $(2, 5)$ and $(4, 9)$. Find its equation. Hint: find $m$ first, then use a point to find $c$.

Show answer

Step 1: $m = \frac{9-5}{4-2} = \frac{4}{2} = 2$.

Step 2: Use $(2, 5)$ in $y = 2x + c$: $5 = 2(2) + c$, so $c = 1$.

Step 3: $y = 2x + 1$.

Verify: $(4, 9)$: $2(4)+1 = 9$. ✓

Challenge 1 — Points not on y-axis

A line passes through $(1, 1)$ and $(5, -7)$. Find its equation.

Solution

$m = \frac{-7-1}{5-1} = \frac{-8}{4} = -2$.

Using $(1, 1)$: $1 = -2(1) + c \Rightarrow c = 3$.

$y = -2x + 3$. Verify: $(5, -7)$: $-2(5)+3 = -7$. ✓

Challenge 2 — Parallel lines

$y = 3x - 2$ and a second line parallel to it pass through $(0, 5)$. Find the second line's equation.

Solution

Parallel lines have the same gradient: $m = 3$.

Through $(0, 5)$ means $c = 5$.

Answer: $y = 3x + 5$.

Key Takeaways — Finding Equation from a Graph
  1. Find $c$: y-coordinate where the line crosses the y-axis.
  2. Find $m$: gradient triangle $\frac{\text{rise}}{\text{run}}$, or $\frac{y_2-y_1}{x_2-x_1}$.
  3. Write: substitute $m$ and $c$ into $y = mx + c$.
  4. Verify: substitute another point — if both sides match, your equation is correct.
  5. Uphill line $\Rightarrow$ $m > 0$. Downhill line $\Rightarrow$ $m < 0$. Through origin $\Rightarrow$ $c = 0$.
  6. Always simplify $m$ — e.g. $\frac{4}{2} = 2$, $\frac{-6}{3} = -2$.
Top pitfalls
Reading $c$ from x-axis instead of y-axis. Forgetting the negative sign on a downhill $m$. Writing $y = cx + m$ instead of $y = mx + c$.

Lesson Complete!

You can now find the equation of any straight line from its graph. Next: build on this to sketch and compare linear relationships.