Mathematics/Lessons/Straight Lines/Equation of a Straight Line
Pure · Straight Lines · Year 1

Equation of a Straight Line

A line is fixed by just two things — its steepness and a point it passes through. Master gradient and point–gradient form, and every straight-line question falls open.

5 min read 1 worked example

What the equation of a line captures

Every straight line is fixed by just two pieces of information: how steep it is and where it sits. The steepness is the gradient $m$; the position is pinned by any single point the line passes through. Get those two, and the line's equation is determined. That's the whole topic in one sentence — everything else is choosing the most convenient way to write it down.

A straight line on Cartesian axes crossing the y-axis at the point c. A right-angled triangle drawn along the line shows the rise and the run, illustrating that the gradient m equals rise divided by run.
The line y = mx + c: the intercept c is where it cuts the y-axis, and the gradient m is the rise divided by the run of any triangle drawn along it.

The familiar form $y = mx + c$ makes both facts visible at a glance: $m$ is the gradient, and $c$ is the $y$-intercept (the value of $y$ when $x=0$). But in exam problems you're usually handed a point and a gradient, or two points — and for those, a second form is far quicker.

The three forms — and when to use each

Gradient between two points: $m = \dfrac{y_2 - y_1}{x_2 - x_1}$ — the change in $y$ over the change in $x$.
Point–gradient form: $y - y_1 = m(x - x_1)$ — use this whenever you know a point and the gradient. It's the fastest route in almost every question.
General form: $ax + by + c = 0$ — the tidy form exams often ask for the final answer in, with integer coefficients.

Coming up

Two ideas that build directly on gradient — how parallel and perpendicular lines relate, and how to measure length and area from coordinates — each get a lesson of their own next.

Worked example 1

Find the equation through two points
Find the equation of the line passing through $A(2, 1)$ and $B(6, 9)$, giving your answer in the form $y = mx + c$.
MethodGradient first, then point–gradient form
1
Find the gradient: $m = \dfrac{y_2-y_1}{x_2-x_1} = \dfrac{9-1}{6-2} = \dfrac{8}{4} = 2$.
Change in y over change in x.
2
Use point–gradient form with $A(2,1)$: $y - 1 = 2(x - 2)$.
Either point works; A is fine.
3
Expand: $y - 1 = 2x - 4$.
Multiply out the bracket.
4
Rearrange to $y = 2x - 3$.
Now in the requested $y=mx+c$ form.
▪ solved
Examiner's eye

Check with the other point: at $x=6$, $y = 2(6)-3 = 9$ ✓ — matches $B(6,9)$. It's a five-second guarantee your line passes through both. And be consistent labelling $(x_1,y_1)$ and $(x_2,y_2)$ — swapping them mid-calculation flips the sign of the gradient.

Check yourself

Find the equation of the line through $(2, -1)$ and $(-4, 11)$, giving your answer in the form $ax + by + c = 0$ with integer coefficients.
(Hint: gradient first, then point–gradient form, then clear fractions.)

Method
1
Gradient: $m = \dfrac{11-(-1)}{-4-2} = \dfrac{12}{-6} = -2$.
2
Point–gradient form through $(2,-1)$: $y - (-1) = -2(x - 2)$.
3
Expand: $y + 1 = -2x + 4$, so $y = -2x + 3$.
4
Rearrange to the requested form: $2x + y - 3 = 0$.
Integer coefficients, one side zero.
▪ solved

Check with the other point: $2(-4)+11-3 = -8+11-3=0$ ✓ — confirming $(-4,11)$ also lies on the line.