Equation of a Line: $y = mx + c$
Master the gradient-intercept form. Write, read and rearrange the equation of any straight line using just two numbers: $m$ and $c$.
Printable Worksheets
Print or save as PDF — or build a custom worksheet from any module's questions.
You know a line has gradient 2 and crosses the y-axis at $(0, 3)$. How could you write its equation in a compact form?
The equation $y = mx + c$ is the most important formula for straight lines. It tells you everything you need to know to draw or describe any line.
| Equation | Gradient ($m$) | y-intercept ($c$) |
|---|---|---|
| $y = 2x + 1$ | $2$ | $1$ |
| $y = -3x + 5$ | $-3$ | $5$ |
| $y = x - 4$ | $1$ | $-4$ |
| $y = \frac{1}{2}x$ | $\frac{1}{2}$ | $0$ |
| $y = -x + 3$ | $-1$ | $3$ |
When you are given the gradient and y-intercept, substitute them directly into $y = mx + c$.
- Start with $y = mx + c$.
- Substitute $m = 2$ and $c = 3$: $y = 2x + 3$.
- The equation of the line is $y = 2x + 3$. (Gradient 2, crosses y-axis at $(0, 3)$.)
- Start with $y = mx + c$.
- Substitute $m = -1$ and $c = 4$: $y = (-1)x + 4$.
- Simplify $(-1)x$ to $-x$: the equation is $y = -x + 4$. (Slopes downward, crosses at $(0, 4)$.)
When an equation is already in $y = mx + c$ form, read $m$ and $c$ directly by matching terms.
- Compare $y = 3x - 2$ with $y = mx + c$.
- The coefficient of $x$ is $3$, so $m = 3$. The constant term is $-2$, so $c = -2$.
- Gradient $= 3$; y-intercept $= -2$ (the line crosses the y-axis at $(0, -2)$).
Some equations are not given in gradient-intercept form. Rearrange by making $y$ the subject.
- Start: $2x + y = 5$.
- Subtract $2x$ from both sides: $y = 5 - 2x$.
- Rewrite with $x$ term first: $y = -2x + 5$.
- $m = -2$, $c = 5$. The gradient is $-2$ and the line crosses the y-axis at $(0, 5)$.
Once you have $y = mx + c$, substitute any $x$-value to find the matching $y$-value, or check if a point lies on the line.
The line $y = \frac{1}{2}x + 2$ has gradient $m = \frac{1}{2}$ and y-intercept $c = 2$.
Answer as quickly as you can — no calculators!
?
$y = 3x + 5$?
$y = -2x + 4$?
$m = 5$?
$c = 6$?
$y = 4x + 2$?
$y = -x + 7$?
$m = \frac{1}{3}$, $c = -4$?
$y = -4x$?
$y = 3x - 2$?
$3(2)+1 = 7$. Yes!Multiple Choice
Q1. What is the equation of a line with gradient $3$ and y-intercept $-2$?
Q2. In the equation $y = -2x + 5$, what is the gradient?
Q3. Rearrange $x + y = 3$ into the form $y = mx + c$.
Q4. A line has equation $y = \frac{1}{2}x + 3$. What are $m$ and $c$?
Q5. Which equation represents a line with gradient $-3$ passing through $(0, 2)$?
Short Answer
SAQ 1. Write the equation of a line with gradient $4$ and y-intercept $-1$. Show your substitution into $y = mx + c$.
Show answer
$y = mx + c$ with $m = 4$, $c = -1$: $y = 4x + (-1) = 4x - 1$.
SAQ 2. Rearrange $2y = 4x + 6$ into $y = mx + c$ form, then state the values of $m$ and $c$.
Show answer
$2y = 4x + 6$. Divide every term by 2: $y = 2x + 3$. So $m = 2$ and $c = 3$.
SAQ 3. Explain what $m$ and $c$ each tell you about a line. Give one example for each.
Show answer
$m$ (gradient): tells how steep the line is and which direction it slopes. Positive $m$ slopes up, negative $m$ slopes down. Example: in $y = 2x + 3$, $m = 2$ means the line rises 2 for every 1 to the right.
$c$ (y-intercept): tells where the line crosses the y-axis — the point $(0, c)$. Example: in $y = 2x + 3$, $c = 3$ means the line crosses at $(0, 3)$.
Stretch Challenges
Challenge 1 — Equation from intercept and gradient
A line passes through $(0, -3)$ and has gradient $\frac{2}{3}$. Write its equation and find the coordinates of the point where $x = 6$.
Solution
$y = mx + c$ with $m = \frac{2}{3}$, $c = -3$: $y = \frac{2}{3}x - 3$.
When $x = 6$: $y = \frac{2}{3}(6) - 3 = 4 - 3 = 1$. Point: $(6, 1)$.
Challenge 2 — Verify a point
Show that $(-2, 7)$ lies on the line $y = -3x + 1$. Then find a point that does not lie on this line.
Solution
Sub $x = -2$: $y = -3(-2) + 1 = 6 + 1 = 7$. LHS $= 7$ = RHS. ✓ The point lies on the line.
Example of a point not on the line: $(0, 2)$. Sub: $-3(0)+1 = 1 \neq 2$. ✗
Challenge 3 — Both intercepts
A line has equation $3x + 2y = 12$. Rearrange into $y = mx + c$ form, then find where the line crosses both axes.
Solution
$3x + 2y = 12 \Rightarrow 2y = -3x + 12 \Rightarrow y = -\frac{3}{2}x + 6$. So $m = -\frac{3}{2}$, $c = 6$.
y-intercept: $(0, 6)$. x-intercept: set $y = 0$: $0 = -\frac{3}{2}x + 6 \Rightarrow x = 4$. So $(4, 0)$.
- $y = mx + c$ is the gradient-intercept form of a straight line.
- $m$ is the gradient (steepness and direction); $c$ is the y-intercept.
- To write the equation: substitute $m$ and $c$ into $y = mx + c$.
- To read $m$ and $c$: compare term by term — $m$ is the coefficient of $x$, $c$ is the constant (including sign).
- To rearrange: make $y$ the subject, then simplify.
- Use the equation to predict points or verify if a point lies on the line.
Lesson Complete!
You can now write, read and rearrange $y = mx + c$. Next: use these skills to find the equation of a line from a graph.