IB Maths AA HLTopic 2 — FunctionsPaper 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 (slope) of a line through two points (x1, y1) and (x2, y2) is m = (y2 − y1) / (x2 − x1). This is in the formula booklet.
You’ll see a straight line written in three different forms in IB exams:
• y = mx + c (gradient-intercept form — gradient and y-intercept are right there)
• y − y1 = m(x − x1) (point-gradient form — best when you have a gradient and one point)
• ax + by + d = 0 (general form — coefficients usually integers)
The point-gradient form is the workhorse — start here whenever you’re building an equation.
To turn point-gradient form into the general form, multiply through any denominators and rearrange so everything is on one side equal to 0.
Gradient is just “how steep”. Positive m → goes up left to right. Negative m → goes down. Big |m| → steep. Small |m| → gentle.
Always check what form the question wants — IB questions specify a form. If it says ax + by + d = 0, the coefficients usually need to be integers.
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 pointsm = y2 − y1x2 − x1 = 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
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
y − y1 = m(x − x1)
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: y − y1 = m(x − x1)
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
Get the gradient. If given two points, use m = (y2 − y1)/(x2 − x1). If gradient is already given, skip this step.
Pick one point (any one — if you have two, just choose either) and call it (x1, y1).
Plug into point-gradient form: y − y1 = m(x − x1).
Rearrange to whatever form the question asks for (gradient-intercept or general form).
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 formulam = (y₂ − y₁) / (x₂ − x₁)m = (12 − 4) / (5 − 1)m = 8 / 4 = 2gradient m = 2means 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 formy − 7 = 3(x − 2)Step 2: Expand the bracketsy − 7 = 3x − 6Step 3: Rearrange to y = mx + cy = 3x − 6 + 7y = 3x + 1check: 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 firstm = (14 − 5) / (4 − 1) = 9 / 3 = 3Step 2: Pick a point and plug in (using (1, 5))y − 5 = 3(x − 1)Step 3: Expand and rearrangey − 5 = 3x − 3y = 3x − 3 + 5y = 3x + 2check 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 33y = 2x + 12Step 2: Move everything to the left side0 = 2x + 12 − 3y2x − 3y + 12 = 02x − 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 form3y = −4x + 12y = −(4/3)x + 4Step 2: Read off the gradient and y-interceptgradient m = −4/3y-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 gradientm = (−6 − 2) / (5 − (−3))m = −8 / 8 = −1Step 2: Plug into point-gradient form using (−3, 2)y − 2 = −1(x − (−3))y − 2 = −(x + 3)y − 2 = −x − 3Step 3: Move everything to the left sidey − 2 + x + 3 = 0x + 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
Always start with point-gradient form when building an equation. It’s the most flexible — rearrange to whatever the question wants from there.
Check your equation by plugging a point back in. Especially useful when the question gave you two points — pick the one you didn’t use to build the equation.
For two-point gradient questions, watch the signs. The “minus a negative” trick (e.g. x2 − (−3) = x2 + 3) is where most slip-ups happen.
For general form, multiply away all fractions first, then move everything to the left. Coefficients should usually be integers.
Read the question carefully — it specifies the form. y = mx + c and ax + by + d = 0 are graded differently if you put the answer in the wrong form.
Use your GDC on Paper 2 — enter the two points in stats mode, find the regression line y = ax + b. That’s your equation in gradient-intercept form, ready to rearrange.
A horizontal line has gradient 0 (form y = k). A vertical line has undefined gradient (form x = k). Don’t try to use y = mx + c for a vertical line.
⚠ Common mistakes
Mixing up rise and run — putting the x-difference on top instead of the y-difference. Always: m = (y2 − y1) / (x2 − x1), not the other way round.
Sign errors when subtracting negatives. (x1, y1) = (−2, 3) means x − x1 = x − (−2) = x + 2. Don’t forget to flip the sign.
Forgetting to multiply BOTH sides when clearing fractions. If you multiply the left by 3, the right side gets multiplied by 3 too — including any constant.
Leaving fractional coefficients in general form when the question asks for integers.
Putting the answer in the wrong form. Always re-read the question to check it asks for y = mx + c or ax + by + d = 0.
Confusing the y-intercept (the value of c) with the point on the y-axis (0, c). They’re the same idea but written differently — check what form the question wants.
Trying to find the gradient of a vertical line. Vertical lines have undefined gradient — the formula gives a divide by zero.
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.