IB Maths AI HL Linear Functions & Graphs Paper 1 & 2 Gradient, 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 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.

Anatomy of a straight line — gradient, intercepts, and the three forms x y O (0, c) (x1, y1) (x2, y2) x2x1 y2y1 gradient   m = rise / run = (y2y1) / (x2x1) RISE how much y changes RUN how much x changes
The gradient is the rise over the run between any two points on the line.
Straight-line equations (formula booklet) m = y2y1x2x1y = mx + cyy1 = m(xx1);  ax + by + d = 0

The three equations of a straight line

The three forms describe the same line, just packaged differently. Gradient-intercept y = mx + c reads off the gradient and y-intercept directly. Point-gradient yy1 = m(xx1) is the natural starting form when you have a point and a gradient. General form ax + 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

  1. Get the gradient: use m = (y2y1) / (x2x1) if two points are given.
  2. Pick a point on the line.
  3. Substitute into yy1 = m(xx1).
  4. Rearrange into the requested form.
  5. 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 / 4 m = 3/2 subtract 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 y 2y = −3x + 12 y = −(3/2)x + 6 compare with y = mx + c m = −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.

point-gradient form y − 3 = (1/2)(x − (−4)) = (1/2)(x + 4) expand & isolate y y − 3 = x/2 + 2 y = x/2 + 5 y = x/2 + 5 check: at x = −4, y = −2 + 5 = 3 ✓
WE 4

Equation from two points (y = mx + c form)

Points A(1, 4) and B(5, −8). Find the equation of line AB in the form y = mx + c.

gradient first m = (−8 − 4)/(5 − 1) = −12/4 = −3 point-gradient with point A y − 4 = −3(x − 1) y − 4 = −3x + 3 y = −3x + 7 check with B: −3(5) + 7 = −8 ✓
WE 5

Equation in ax + by + d = 0 with integer coefficients

Line l passes through (−3, 4) and (5, −2). Find its equation in the form ax + by + d = 0 with a, b, d integers.

gradient m = (−2 − 4)/(5 − (−3)) = −6/8 = −3/4 point-gradient with (−3, 4) y − 4 = (−3/4)(x + 3) multiply both sides by 4 to clear the fraction 4(y − 4) = −3(x + 3) 4y − 16 = −3x − 9 3x + 4y − 7 = 0 check: (−3, 4): −9 + 16 − 7 = 0 ✓; (5, −2): 15 − 8 − 7 = 0 ✓
WE 6

From general form: intercepts and gradient

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 = 0 4x + 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 + c 3y = 4x + 12 ⇒ y = (4/3)x + 4 x-int (−3, 0) · y-int (0, 4) · m = 4/3 · y = (4/3)x + 4 shortcut: x-int = −d/a = −12/4 = −3; y-int = −d/b = 4 ✓

💡 Top tips

âš  Common mistakes

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.

Book Free Session →