IB Maths AI SLTopic 2 — Linear FunctionsPaper 1 & 2In 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
Gradient formula (in formula booklet): m = (y2 − y1) / (x2 − x1) — the rise over the run.
Gradient-intercept form: y = mx + c. Reads off the gradient m and y-intercept (0, c) immediately.
Point-gradient form: y − y1 = m(x − x1). Use when you have the gradient and any one point.
General form: ax + by + d = 0. Coefficients usually need to be integers.
From general form: x-intercept is (−d/a, 0); y-intercept is (0, −d/b).
Positive m → line rises left to right. Negative m → line falls. Zero m → horizontal line.
The gradient
Gradient — formula bookletm = y2 − y1x2 − x1
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 usey = mx + c • y − y1 = m(x − x1) • 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 y − y1 = m(x − x1). The question asks for ax + by + d = 0 → rearrange and clear fractions.
🧭 Recipe — find the equation of a line
Find the gradient m: from two points, or read it from a parallel/perpendicular line.
Pick a known point (x1, y1) on the line.
Substitute into y − y1 = m(x − x1) — works for any point.
Rearrange into the form the question asks for.
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 / 5m = 3order 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 formy − (−2) = 4(x − 1)y + 2 = 4x − 4Rearrange to y = mx + cy = 4x − 6y = 4x − 6check 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 gradientm = (13 − 5)/(6 − 2) = 8/4 = 2Use point (2, 5) in point-gradient formy − 5 = 2(x − 2)y − 5 = 2x − 4y = 2x + 1y = 2x + 1check 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 gradientm = (9 − (−3))/(−2 − 4) = 12/(−6) = −2Point-gradient form with (4, −3)y − (−3) = −2(x − 4)y + 3 = −2x + 8Move everything to one side2x + y + 3 − 8 = 02x + y − 5 = 0all 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 = 04x + 12 = 0 → x = −3x-intercept: (−3, 0)y-intercept: set x = 0−3y + 12 = 0 → y = 4y-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-interceptcost per km = 2.50 (gradient)booking fee = 4 (y-intercept)C = 2.5d + 4(b) Substitute d = 8C = 2.5(8) + 4 = 20 + 4C = $24(c) Set C = 26.50 and solve for d26.50 = 2.5d + 422.50 = 2.5dd = 9 kmin real-world contexts, the y-intercept is usually a fixed/start cost and the gradient is a rate.
💡 Top tips
Use the GDC to check: enter the two points in stats mode and run linear regression — y = ax + b gives you m and c.
Read the required form carefully: y = mx + c vs ax + by + d = 0 — usually integer coefficients for the second.
For real-world questions: gradient = rate, y-intercept = starting/fixed amount.
Always verify by substituting one of the given points back into your final equation.
⚠ Common mistakes
Swapping order inconsistently in the gradient formula: if you do y2 − y1 on top, you MUST do x2 − x1 on the bottom.
Sign errors with negatives: y − (−3) = y + 3, not y − 3.
Leaving fractions in ax + by + d = 0: multiply through by the denominator to get integer coefficients.
Forgetting the y-intercept sign: if the question gives the y-intercept as (0, −5), then c = −5, so y = mx − 5.
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.