IB Maths AA HL Topic 2 — Functions Paper 1 & 2 ~8 min read

Equations of a Straight Line

You’ve worked with straight lines since IGCSE — gradient, y-intercept, y = mx + c, the lot. So why do this again at HL? Because in IB you’re expected to be fluent in three different forms of the same line, and to flip between them quickly depending on what the question gives you. Sometimes you’ll start with two points, sometimes a gradient and a point, sometimes you’ll need to rearrange to a “tidy” form. None of it is hard — it’s just about picking the right tool for each situation. Let’s walk through it the way I’d show a student in person.

📘 What you need to know

The gradient — “how steep is the line?”

The gradient is just a number that tells you how much the line rises (or falls) for each step you take to the right. If you’ve got two points on a line, the gradient is the rise divided by the run:

Gradient between two points m = y2y1x2x1   =   riserun ✓ in the formula booklet

A gradient of 2 means: for every 1 unit you go right, the line goes up 2 units. A gradient of −3 means: for every 1 right, the line drops 3. Bigger numbers = steeper. Negative = downhill.

A straight line and its key features
x y O y-intercept (0, c) (x₁, y₁) (x₂, y₂) rise y₂ − y₁ run x₂ − x₁ gradient m = rise / run gradient = how much the line rises for every step to the right
When you compute the gradient, it doesn’t matter which point you call “1” and which one you call “2” — as long as you’re consistent. Top of the fraction goes with bottom of the fraction. Just make sure both differences are taken in the same order.

The three forms — pick the right tool for the job

An IB question won’t always ask for “the equation” in your favourite form. It’ll specify. So you need to recognise all three and switch between them quickly. Here’s a quick comparison:

Gradient-intercept
y = mx + c
use when you can read off m and c directly
Point-gradient
yy1 = m(xx1)
use when given a point and gradient — the natural starting point
General form
ax + by + d = 0
“tidy” form — coefficients usually integers

Gradient-intercept form: y = mx + c

The most familiar form. m is the gradient. c is where the line crosses the y-axis (the y-intercept). Both pieces of info are right there in the equation — no rearranging needed.

Point-gradient form: yy1 = m(xx1)

This is the form you should build with. Every IB question that asks for “the equation of the line passing through (a, b) with gradient m” plugs straight into this template. Once you’ve written it, you can rearrange to any other form.

General form: ax + by + d = 0

Looks intimidating but it’s just y = mx + c rearranged so everything’s on the left side equal to 0, with all coefficients as integers. Useful tricks: the x-intercept is at x = −d/a, and the y-intercept is at y = −d/b.

If a question asks for general form with integer coefficients,  multiply through any fractions until you have integers, then move everything to the left. Don’t leave any fractions behind.

How to actually build an equation

Most IB exam questions either give you (a) a gradient and a point, or (b) two points. Here’s the recipe for both:

🧭 Recipe — finding the equation of a line

  1. Get the gradient. If given two points, use m = (y2y1)/(x2x1). If gradient is already given, skip this step.
  2. Pick one point (any one — if you have two, just choose either) and call it (x1, y1).
  3. Plug into point-gradient form: yy1 = m(xx1).
  4. Rearrange to whatever form the question asks for (gradient-intercept or general form).
  5. Check: plug one of your original points back into your final equation. Both sides should match.
Always start with point-gradient form when building. It’s the most flexible — you can take it anywhere from there. Trying to start with y = mx + c means you’d need to find c separately, which is one extra step.

Worked examples

WE 1

Find the gradient between two points

Find the gradient of the line passing through the points (1, 4) and (5, 12).

Step 1: Label the points (x₁, y₁) = (1, 4),   (x₂, y₂) = (5, 12) Step 2: Apply the formula m = (y₂ − y₁) / (x₂ − x₁) m = (12 − 4) / (5 − 1) m = 8 / 4 = 2 gradient m = 2 means the line goes up 2 for every 1 across — a fairly steep upward line
WE 2

Find the equation given gradient and one point

A line has gradient 3 and passes through the point (2, 7). Find its equation in the form y = mx + c.

Step 1: Plug into point-gradient form y − 7 = 3(x − 2) Step 2: Expand the brackets y − 7 = 3x − 6 Step 3: Rearrange to y = mx + c y = 3x − 6 + 7 y = 3x + 1 check: when x = 2, y = 3(2) + 1 = 7 ✓ — the line goes through (2, 7)
WE 3

Find the equation given two points

Find the equation of the line passing through (1, 5) and (4, 14), giving your answer in the form y = mx + c.

Step 1: Find the gradient first m = (14 − 5) / (4 − 1) = 9 / 3 = 3 Step 2: Pick a point and plug in (using (1, 5)) y − 5 = 3(x − 1) Step 3: Expand and rearrange y − 5 = 3x − 3 y = 3x − 3 + 5 y = 3x + 2 check the OTHER point: when x = 4, y = 3(4) + 2 = 14 ✓ — both points lie on the line
WE 4

Convert to general form with integer coefficients

The line l has equation y = 23x + 4. Express its equation in the form ax + by + d = 0, where a, b, d are integers.

Step 1: Get rid of the fraction by multiplying through by 3 3y = 2x + 12 Step 2: Move everything to the left side 0 = 2x + 12 − 3y 2x − 3y + 12 = 0 2x − 3y + 12 = 0  (with a = 2, b = −3, d = 12) it’s also fine to write −2x + 3y − 12 = 0 — multiplying by −1 gives an equivalent equation
WE 5

Find gradient and intercepts from general form

The line 4x + 3y − 12 = 0 is given. Find: (a) its gradient, (b) the y-intercept, (c) the x-intercept.

Step 1: Rearrange to y = mx + c form 3y = −4x + 12 y = −(4/3)x + 4 Step 2: Read off the gradient and y-intercept gradient m = −4/3 y-intercept = 4, so the line crosses the y-axis at (0, 4) Step 3: Find x-intercept (set y = 0 in the original) 4x − 12 = 0 → x = 3 (a) m = −4/3   (b) (0, 4)   (c) (3, 0) notice the line goes downhill (negative gradient) and cuts both axes — sketch it to check the picture matches
WE 6

Two points to general form (full pipeline)

Find the equation of the line passing through the points (−3, 2) and (5, −6), giving your answer in the form ax + by + d = 0 where a, b, d are integers.

Step 1: Find the gradient m = (−6 − 2) / (5 − (−3)) m = −8 / 8 = −1 Step 2: Plug into point-gradient form using (−3, 2) y − 2 = −1(x − (−3)) y − 2 = −(x + 3) y − 2 = −x − 3 Step 3: Move everything to the left side y − 2 + x + 3 = 0 x + y + 1 = 0  (with a = 1, b = 1, d = 1) check the OTHER point: 5 + (−6) + 1 = 0 ✓ — both points satisfy the equation

💡 Top tips

⚠ Common mistakes

Equations of straight lines are the building blocks for everything that comes next in functions — quadratics, cubics, transformations, and even calculus, where gradient becomes the gradient of a tangent line. Get really fluent with the three forms now and you’ll save time on every functions question for the rest of the course. The next note covers parallel and perpendicular lines, which is where the gradient becomes the star of the show.

Need help with Equations of a Straight Line?

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

Book Free Session →