IB Maths AI HLLinear Functions & GraphsPaper 1 & 2Gradient, intercepts, forms~7 min read
Equations of a Straight Line
Every straight line is fixed by a gradient and one point — or equivalently by two points. From there it slots into one of three standard forms: gradient-intercept, point-gradient, or general. The trick is picking the right starting form and rearranging cleanly.
📘 What you need to know
Gradient between two points: m = (y2 − y1) / (x2 − x1). In the formula booklet.
Gradient-intercept form: y = mx + c. Reads off the gradient and the y-intercept (0, c) directly.
Point-gradient form: y − y1 = m(x − x1). The natural starting form when you have a point and a gradient.
General form: ax + by + d = 0. x-intercept (−d/a, 0); y-intercept (0, −d/b).
To get an equation from two points: find m, drop into point-gradient form, then rearrange to the requested form.
GDC shortcut: enter the two points in stats mode and read off the linear regression y = ax + b.
Gradient of a straight line
The gradient measures how steeply the line rises per unit you move right. Between two points (x1, y1) and (x2, y2) on the line it is the rise over the run. Positive gradient slopes up; negative slopes down; zero is horizontal; undefined (run = 0) is vertical.
The gradient is the rise over the run between any two points on the line.
Straight-line equations (formula booklet)m = y2 − y1x2 − x1; y = mx + c; y − y1 = m(x − x1); ax + by + d = 0
The three equations of a straight line
The three forms describe the same line, just packaged differently. Gradient-intercepty = mx + c reads off the gradient and y-intercept directly. Point-gradienty − y1 = m(x − x1) is the natural starting form when you have a point and a gradient. General formax + by + d = 0 is preferred for integer coefficients and gives both intercepts in one rearrangement.
Match the required form: IB questions almost always specify y = mx + c or ax + by + d = 0. For the general form, multiply through to clear fractions and check the coefficients are integers.
Finding the equation of a straight line
You need a gradient and one point. If given two points, compute the gradient first. Then drop into point-gradient form and rearrange to whichever form the question requests. As a cross-check, the GDC’s linear regression on the two points returns y = ax + b directly.
🧠Recipe — finding the equation of a straight line
Get the gradient: use m = (y2 − y1) / (x2 − x1) if two points are given.
Pick a point on the line.
Substitute into y − y1 = m(x − x1).
Rearrange into the requested form.
For ax + by + d = 0: multiply through to clear fractions; check integer coefficients.
Worked examples
WE 1
Gradient from two points
Find the gradient of the line through (3, −1) and (7, 5).
apply m = (y₂ − y₁)/(x₂ − x₁)m = (5 − (−1)) / (7 − 3)= 6 / 4m = 3/2subtract y-values, then x-values, in the same order.
WE 2
Rearrange to read off gradient and y-intercept
For the line 3x + 2y = 12, find the gradient and the y-intercept.
isolate y2y = −3x + 12y = −(3/2)x + 6compare with y = mx + cm = −3/2 · y-intercept (0, 6)isolate y first — coefficient of x is m, constant is c.
WE 3
Equation from gradient and a point
A line has gradient m = 1/2 and passes through (−4, 3). Find its equation in the form y = mx + c.
The line l has equation 4x − 3y + 12 = 0. (a) Find the x– and y-intercepts. (b) Find the gradient. (c) Write l in the form y = mx + c.
(a) x-intercept: set y = 04x + 12 = 0 ⇒ x = −3 ⇒ (−3, 0)y-intercept: set x = 0−3y + 12 = 0 ⇒ y = 4 ⇒ (0, 4)(b) and (c) rearrange to y = mx + c3y = 4x + 12 ⇒ y = (4/3)x + 4x-int (−3, 0) · y-int (0, 4) · m = 4/3 · y = (4/3)x + 4shortcut: x-int = −d/a = −12/4 = −3; y-int = −d/b = 4 ✓
💡 Top tips
Always state in the requested form — y = mx + c or ax + by + d = 0.
For integer coefficients, multiply through by the lowest common denominator before rearranging.
The point-gradient form is your universal starting point; rearrange from there.
Use the GDC’s linear regression on two points as a fast cross-check.
For general form, the shortcuts x-int = −d/a, y-int = −d/b save a rearrangement.
âš Common mistakes
Subtracting the y’s and x’s in opposite orders — the result flips sign.
Sign slips on y − (−y1) and similar — brackets are your friend.
Leaving fractional coefficients in ax + by + d = 0 when integers were asked for.
Forgetting the coefficient of x when reading off the gradient from a rearranged equation.
Mis-reading the y-intercept from ax + by + d = 0 without rearranging first.
Next up: Parallel & Perpendicular Lines — once you have the gradient of one line, the gradient of a parallel or perpendicular line is one quick step away.
Need help with AI HL Linear Functions?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.