IB Maths AI SL Topic 2 — Linear Functions Paper 1 & 2 In formula booklet ~7 min read

Equations of a Straight Line

Every straight line has one gradient and infinitely many points on it. You can describe it three different ways depending on what’s convenient — they’re all the same line, just rearranged.

📘 What you need to know

The gradient

Gradient — formula booklet m = y2y1x2x1
Gradient = rise / run between any two points x y 0 (2, 3) P1 (6, 11) P2 RUN = x2 − x1 = 6 − 2 = 4 RISE = y2 − y1 = 11 − 3 = 8 m = rise/run = 8/4 = 2 y-intercept (0, −1)
Pick any two points on the line. Red dashed = run (change in x); teal dashed = rise (change in y). The gradient is their ratio.

The three forms of equation

All three equivalent — choose the easiest to use y = mx + c    •    yy1 = m(xx1)    •    ax + by + d = 0
When to use each: have gradient and y-intercept → use y = mx + c. Have gradient and any other point → start with yy1 = m(xx1). The question asks for ax + by + d = 0 → rearrange and clear fractions.

🧭 Recipe — find the equation of a line

  1. Find the gradient m: from two points, or read it from a parallel/perpendicular line.
  2. Pick a known point (x1, y1) on the line.
  3. Substitute into yy1 = m(xx1) — works for any point.
  4. Rearrange into the form the question asks for.
  5. For ax + by + d = 0: clear fractions by multiplying both sides by the denominator.

Worked examples

WE 1

Find the gradient

Find the gradient of the line passing through (3, 7) and (8, 22).

Use m = (y_2 − y_1)/(x_2 − x_1) m = (22 − 7) / (8 − 3) = 15 / 5 m = 3 order doesn’t matter — just be consistent: (3,7) first means subtract its values second.
WE 2

Equation from gradient and one point

A line has gradient 4 and passes through (1, −2). Find its equation in the form y = mx + c.

Use point-gradient form y − (−2) = 4(x − 1) y + 2 = 4x − 4 Rearrange to y = mx + c y = 4x − 6 y = 4x − 6 check at (1, −2): 4(1) − 6 = −2 ✓
WE 3

Equation from two points → y = mx + c

Find the equation of the line through (2, 5) and (6, 13). Give your answer in the form y = mx + c.

Find the gradient m = (13 − 5)/(6 − 2) = 8/4 = 2 Use point (2, 5) in point-gradient form y − 5 = 2(x − 2) y − 5 = 2x − 4 y = 2x + 1 y = 2x + 1 check at (6, 13): 2(6) + 1 = 13 ✓
WE 4

Equation from two points → general form

Find the equation of the line through (4, −3) and (−2, 9). Give your answer in the form ax + by + d = 0 with integer coefficients.

Find the gradient m = (9 − (−3))/(−2 − 4) = 12/(−6) = −2 Point-gradient form with (4, −3) y − (−3) = −2(x − 4) y + 3 = −2x + 8 Move everything to one side 2x + y + 3 − 8 = 0 2x + y − 5 = 0 all coefficients integers — no need to multiply through. Check (−2, 9): 2(−2) + 9 − 5 = 0 ✓
WE 5

Intercepts from general form

Find the x-intercept and y-intercept of the line 4x − 3y + 12 = 0.

x-intercept: set y = 0 4x + 12 = 0 → x = −3 x-intercept: (−3, 0) y-intercept: set x = 0 −3y + 12 = 0 → y = 4 y-intercept: (0, 4) x-intercept (−3, 0), y-intercept (0, 4) quick formula: x-int = −d/a = −12/4 = −3 and y-int = −d/b = −12/−3 = 4.
WE 6

Real-world — taxi fare model

A taxi charges a $4 booking fee plus $2.50 per km. Let C be the cost (in $) for a journey of d km.
(a) Write a linear equation for C in terms of d.
(b) Find the cost of an 8 km journey.
(c) Find the distance for a fare of $26.50.

(a) Identify gradient and y-intercept cost per km = 2.50 (gradient) booking fee = 4 (y-intercept) C = 2.5d + 4 (b) Substitute d = 8 C = 2.5(8) + 4 = 20 + 4 C = $24 (c) Set C = 26.50 and solve for d 26.50 = 2.5d + 4 22.50 = 2.5d d = 9 km in real-world contexts, the y-intercept is usually a fixed/start cost and the gradient is a rate.

💡 Top tips

⚠ Common mistakes

Up next: Parallel & Perpendicular Lines — two lines are parallel when their gradients match, and perpendicular when their gradients multiply to give −1.

Need help with AI SL Linear Functions?

Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.

Book Free Session →