Free lesson

Every lesson is free, no account needed. Make a free account to save your progress.

Live classGet practice + mocks
  1. Home
  2. Lesson Library
  3. The equation of a line
UPCAT Math Review · Coordinate geometry

The Equation of a Line

Find the slope, use a point, then tidy into whichever form the question wants.

The problem

Find the equation of the line through (2, −3) and (6, 5).

Slope first, always.

m = y₂ − y₁x₂ − x₁

m = 5 − (−3)6 − 2

watch the double negative

= 84

5 + 3 on top

m = 2

up 2 for every 1 across

Keep the points in the same order

Whichever point you call first, use it first on both top and bottom. Mixing them flips the sign and the line leans the wrong way.

Point-slope: drop in either point.

y − y₁ = m(x − x₁)

y − (−3) = 2(x − 2)

using (2, −3)

y + 3 = 2x − 4

tidy both sides

y = 2x − 7

− 3 both sides

y = 2x − 7

Using (6, 5) instead gives y − 5 = 2(x − 6), which tidies to the same line.

The four forms, and when each is wanted.

Form Looks like Use it when
slope-intercepty = mx + bgraphing, or reading off the slope
point-slopey − y₁ = m(x − x₁)you have a point and a slope
standardAx + By = Cthe answer choices are written that way
interceptxa + yb = 1both intercepts are given

y = 2x − 7

slope-intercept

2x − y = 7

the same line, standard form

They are all the same line. If your answer is not among the choices, try rearranging before you assume it is wrong.

Reading the line off the equation.

(2, −3) (6, 5) y = 2x − 7

m = 2

rises steeply, left to right

b = −7

crosses the y-axis at −7

For the x-intercept, set y = 0: 2x = 7, so x = 3.5.

Parallel and perpendicular.

parallel

same slope

m = 2

perpendicular

negative reciprocal

m = −½

Flip it and change the sign. The two slopes always multiply to −1.

LineSlopePerpendicular slope
y = 3x + 13−⅓
y = −¾x−¾⁴⁄₃
horizontal, y = 40undefined — vertical

Variations: a fraction slope, a horizontal line, a vertical line.

A fraction slope. The line through (−1, 2) and (3, 5), in standard form.

m = (5 − 2) ÷ (3 − (−1)) = 34

not a whole number this time

y − 2 = 34(x + 1)

point-slope with (−1, 2)

4y − 8 = 3x + 3

× 4 clears the fraction

3x − 4y = −11

check (3, 5): 9 − 20 = −11 ✓

What is different: multiply by the denominator of the slope before tidying, so standard form ends with whole numbers.

Same y twice. The line through (−4, 6) and (5, 6).

m = (6 − 6) ÷ (5 − (−4)) = 0 ÷ 9 = 0

a 0 on top is allowed

y − 6 = 0(x + 4)

point-slope still works

y = 6

no x term at all

What is different: a horizontal line has slope 0 and its equation is just y = the shared y-value.

Same x twice. The line through (2, −1) and (2, 7).

m = (7 − (−1)) ÷ (2 − 2) = 8 ÷ 0

a 0 on the bottom is not allowed

every point on it has x = 2

it runs straight up

x = 2

no slope, no y-intercept

What is different: a vertical line cannot be written as y = mx + b at all; its equation is x = the shared x-value.

y = for level, x = for upright

The line through (2, −1) and (2, 7) is not y = 2 — that is a horizontal line. Whichever coordinate the two points share names the equation.

Intercepts, standard form, and the triangle with the axes.

Worked: the line has x-intercept 5 and y-intercept −2. Write it in standard form and give its slope.

x5 + y−2 = 1

intercept form: x over a, y over b

2x − 5y = 10

× 10 clears both fractions

slope = −AB = −2−5 = 25

from Ax + By = C, no rearranging needed

Check the intercepts: y = 0 gives 2x = 10, x = 5; x = 0 gives −5y = 10, y = −2 ✓.

A letter in the equation: the line 2x + ky = 8 passes through (1, 3). Find its slope.

2(1) + k(3) = 8, so 3k = 6, k = 2

a point on the line makes the equation true

2x + 2y = 8 → slope = −2 ÷ 2 = −1

find the letter first, then read −A ÷ B

Backwards: a line of slope −25 cuts off a triangle of area 20 with the positive axes. Find the line.

intercepts (a, 0) and (0, b):  slope = −ba

down b while going across a

ba = 25, so b = 2a5

from the slope

½ · a · b = 20, so a · 2a5 = 40

the legs of the triangle are the intercepts

a² = 100, a = 10, b = 4

positive axes, so take the positive root

x10 + y4 = 1 → 2x + 5y = 20

× 20; check area ½ · 10 · 4 = 20 ✓

The half and the swapped intercepts

The triangle's area is half of intercept × intercept — dropping the ½ doubles the answer. And xa + yb = 1 puts the x-intercept under x: writing 4x + 10y = … would swap the two intercepts.

On the exam

Line questions want the answer in standard form and often set it up through an intercept, a parallel line or a triangle with the axes. Build the line with point-slope, clear fractions, then spend ten seconds substituting both given points (or both intercepts) into your choice.

Check: both points must satisfy it.

(2, −3) 2(2) − 7 = −3 ✓
(6, 5) 2(6) − 7 = 5 ✓
sensible? y grew as x grew a positive slope ✓

Testing only the point you substituted proves nothing — check the other one.

Remember the flow

Slope · Point-slope · Rearrange

Parallel keeps m; perpendicular flips and negates it.
Now you try

Practice problem

Standard form

Find the equation of the line through (−1, 4) and (3, −4), in standard form.