The Equation $y = mx + c$
Every straight line on a coordinate grid can be described by the equation $y = mx + c$. This is the most important formula in this topic, and once you understand what $m$ and $c$ mean, you can read almost everything about a line directly from its equation.
• Gradient $m = 3$ (line goes up $3$ for every $1$ across)
• $y$-intercept $c = 5$ (crosses $y$-axis at $(0, 5)$)
• Gradient $m = -2$ (line slopes downward)
• $y$-intercept $c = 1$ (crosses $y$-axis at $(0, 1)$)
$2y = 4x + 6 \;\Rightarrow\; y = 2x + 3$ (divide everything by 2)
$3x + y = 7 \;\Rightarrow\; y = -3x + 7$ (subtract $3x$ from both sides)
Gradient
The gradient tells you how steep a line is and which direction it slopes. It is defined as how much the line goes up (or down) for every one unit it moves across.
What does the gradient tell you?
Slopes upward (left to right)
Slopes downward
Horizontal line
Very steep
Calculating the gradient from two points
Always subtract in the same order: $(x_2 - x_1)$ on the bottom and $(y_2 - y_1)$ on the top. It doesn't matter which point you call "1" and which you call "2", as long as you're consistent.
Apply formula: $m = \dfrac{y_2 - y_1}{x_2 - x_1} = \dfrac{11 - 3}{5 - 1} = \dfrac{8}{4} = 2$
Reading gradient from a graph
Pick two points on the line where it crosses grid intersections (so you can read off exact values). Draw a right-angled triangle and count the squares:
- Rise = vertical distance (count squares up or down)
- Run = horizontal distance (count squares across)
- $m = \dfrac{\text{rise}}{\text{run}}$ — remember to make it negative if the line goes downward left-to-right.
The right-angle triangle shows rise = 2, run = 1, so $m = \frac{2}{1} = 2$.
The $y$-intercept
The $y$-intercept is the value of $c$ in $y = mx + c$. It is the point where the line crosses the $y$-axis. At this point, $x = 0$, so you can always find it by substituting $x = 0$ into the equation.
Set $x = 0$: $y = 4(0) - 3 = -3$
$y$-intercept is $(0, -3)$.
$0 = 4x - 3 \Rightarrow x = \tfrac{3}{4}$
$x$-intercept is $\!\left(\tfrac{3}{4}, 0\right)$.
A quick way to sketch any line is to find these two intercepts and join them with a straight line. This is especially useful when $m$ is a fraction.
Plotting a Straight Line Graph
There are two main methods for plotting a line from its equation.
Method 1: Table of values
| $x$ | $-2$ | $0$ | $2$ |
|---|---|---|---|
| $y = 2x+1$ | $2(-2)+1=-3$ | $2(0)+1=1$ | $2(2)+1=5$ |
Method 2: Gradient and $y$-intercept
Finding the Equation of a Line
From a graph
From two points (neither on the $y$-axis)
When neither point is the $y$-intercept, calculate the gradient first, then use one of the points to find $c$.
$5 = 2(2) + c \;\Rightarrow\; 5 = 4 + c \;\Rightarrow\; c = 1$
Given the gradient and one point
If you are told the gradient $m$ and one point $(x_1, y_1)$ on the line, you can use the point-gradient form:
$y - (-2) = 3(x - 1)$
$y + 2 = 3x - 3$
Parallel and Perpendicular Lines
Parallel lines
Two lines are parallel if they never meet — they go in exactly the same direction. Parallel lines have equal gradients.
Lines are parallel $\;\Longleftrightarrow\; m_1 = m_2$ (and $c_1 \neq c_2$)
$y = 4x + 7$ and $y = 2x + 7$ are not parallel (different gradients).
Perpendicular lines
Two lines are perpendicular if they meet at a right angle (90°). Their gradients multiply to give $-1$.
If $m = -3$, perpendicular gradient $= +\dfrac{1}{3}$
If $m = \dfrac{3}{4}$, perpendicular gradient $= -\dfrac{4}{3}$
Perpendicular gradient: $m_2 = -\dfrac{1}{3}$
$y - 2 = -\dfrac{1}{3}(x - 6)$
$y - 2 = -\dfrac{1}{3}x + 2$
$y = -\dfrac{1}{3}x + 4$
Special Lines & Extra Skills
Horizontal and vertical lines
Midpoint of a line segment
The midpoint of the segment joining $(x_1, y_1)$ and $(x_2, y_2)$ is:
Checking whether a point lies on a line
To check if point $(a, b)$ lies on the line $y = mx + c$, substitute $x = a$ and check if the result equals $b$.
$y - 1 = \dfrac{4}{3}(x - (-2)) = \dfrac{4}{3}(x + 2)$
$y - 1 = \dfrac{4}{3}x + \dfrac{8}{3}$
$y = \dfrac{4}{3}x + \dfrac{8}{3} + 1 = \dfrac{4}{3}x + \dfrac{11}{3}$
Quick Reference Summary
| Skill | Formula / Rule | Notes |
|---|---|---|
| Gradient from two points | $m = \dfrac{y_2 - y_1}{x_2 - x_1}$ | Subtract in the same order top and bottom |
| $y$-intercept | Set $x = 0$ in the equation | Gives the point $(0, c)$ |
| $x$-intercept | Set $y = 0$ in the equation and solve | Gives the point $(k, 0)$ |
| Equation from graph | Read $c$, then calculate $m = \frac{\text{rise}}{\text{run}}$ | Use clearly visible grid points |
| Equation from gradient + point | $y - y_1 = m(x - x_1)$ | Rearrange to $y = mx + c$ |
| Parallel lines | Equal gradients: $m_1 = m_2$ | Different $y$-intercepts |
| Perpendicular lines | $m_1 \times m_2 = -1$, so $m_2 = -\dfrac{1}{m_1}$ | Flip and negate the gradient |
| Midpoint | $\left(\dfrac{x_1+x_2}{2},\; \dfrac{y_1+y_2}{2}\right)$ | Average the coordinates |
| Horizontal line | $y = k$, gradient $= 0$ | All points have the same $y$-value |
| Vertical line | $x = k$, gradient undefined | Cannot be written as $y = mx + c$ |
- Rearrange to $y = mx + c$ before reading off $m$ and $c$.
- Negative gradient → line slopes downward from left to right.
- Perpendicular means flip and negate the gradient — not just negate.
- The gradient is the same everywhere on a straight line — it doesn't change.
Practice Questions
Try each question before clicking "Show worked solution".
(a) $y = 5x - 3$ (b) $y = -2x + 7$ (c) $y = \dfrac{3}{4}x$ (d) $2y = 8x + 6$
(a) $(1, 4)$ and $(5, 12)$ (b) $(0, 6)$ and $(3, 0)$ (c) $(-2, -1)$ and $(4, 2)$
$x=-2$: $y=3(-2)-2=-8$ $x=-1$: $y=-5$ $x=0$: $y=-2$ $x=1$: $y=1$ $x=2$: $y=4$
| $x$ | $-2$ | $-1$ | $0$ | $1$ | $2$ |
|---|---|---|---|---|---|
| $y$ | $-8$ | $-5$ | $-2$ | $1$ | $4$ |
$4 = 2(3) + c = 6 + c \;\Rightarrow\; c = -2$
(a) Write down the equation of a line parallel to $L_1$ that crosses the $y$-axis at $(0, 3)$.
(b) Does the point $(2, 3)$ lie on $L_1$? Show your working.
$y - 1 = -\frac{1}{2}(x-4)$
$y - 1 = -\frac{1}{2}x + 2$
$y = -\frac{1}{2}x + 3$
(a) Find the midpoint $M$ of $PQ$.
(b) Find the gradient of $PQ$.
(c) Find the equation of the perpendicular bisector of $PQ$ (the line perpendicular to $PQ$ passing through $M$).
$y - 3 = -\frac{1}{2}(x-4) = -\frac{1}{2}x + 2$
$y = -\frac{1}{2}x + 5$
(a) Rearrange $L_1$ into the form $y = mx + c$.
(b) Find the equation of $L_2$.
(c) Find the coordinates where $L_2$ crosses the $x$-axis.
$y - 5 = -3(x-(-1)) = -3(x+1) = -3x - 3$
$y = -3x - 3 + 5 = -3x + 2$