IB Maths AA HL
Topic 2 — Functions
Paper 1 & 2
~7 min read
Completing the Square
Completing the square turns ax2 + bx + c into a(x − h)2 + k — vertex form. The reason this matters: vertex form hands you the vertex (h, k) for free, which means you instantly get the maximum or minimum of the function. That single fact is what makes this technique a workhorse — for sketching, optimisation, range questions, and even solving equations when factorising fails. It always works, no matter how ugly the numbers.
📘 What you need to know
- Goal: rewrite ax2 + bx + c as a(x − h)2 + k.
- Monic move (a = 1): halve b, square it, add and subtract. x2 + bx + c = (x + b/2)2 − (b/2)2 + c.
- Non-monic move (a ≠ 1): factor a out of the x terms only, complete the square inside the bracket, then expand back.
- Vertex sits there: from a(x − h)2 + k, vertex is (h, k). Minimum if a > 0, maximum if a < 0.
- Optimal value is k, achieved at x = h. The squared term is always ≥ 0, so it can’t pull the value below k (or above, if a < 0).
- Solving: from a(x − h)2 + k = 0, isolate the squared term, take ± square root, solve for x.
Why bother completing the square?
Find max/min
a(x − h)2 + k
vertex (h, k) is right there — no calculus needed
Solve when factorising fails
isolate, ±√, done
always works, even with irrational roots
Monic case — x2 + bx + c
The basic move is “halve b, square the half, fix the constant“:
Monic completion
x2 + bx + c = (x + b2)2 − (b2)2 + c
🤔 Why does this work?
Expanding (x + b/2)2 gives x2 + bx + (b/2)2 — the right x2 and middle term, but with an extra (b/2)2. Subtracting that bit cancels it out. The actual constant c then comes back in. Neat.
Non-monic case — ax2 + bx + c
When a ≠ 1, factor a out of the x terms only — leave c alone. Then complete the square inside.
🧭 Recipe — non-monic completion
- Factor a out of just the x2 and x terms: a(x2 + (b/a)x) + c.
- Complete the square inside the bracket using the monic move (halve, square, subtract).
- Multiply through by a to clear the bracket — careful to multiply the subtracted piece too.
- Combine the constants at the end.
Don’t factor a out of the constant c — leave it where it is. That avoids the messiest fractions and keeps the algebra clean.
Reading the vertex straight off
Once you’ve got the completed square form a(x − h)2 + k, three things are immediate:
Vertex
(h, k)
x-coord from inside the bracket (sign flips), y-coord is the constant outside
Min / max value
value = k, at x = h
min if a > 0, max if a < 0
Sign warning: the h-value is the number inside the bracket with its sign flipped. (x − 4)2 + 3 has vertex (4, 3). (x + 7)2 − 5 has vertex (−7, −5).
Worked examples
WE 1Complete the square — monic with positive middle term
Express x2 + 6x + 11 in the form (x + h)2 + k.
Halve b: half of 6 is 3
write (x + 3)² and subtract 3² to fix the constant
x² + 6x + 11 = (x + 3)² − 9 + 11
(x + 3)² + 2
check: (x + 3)² + 2 = x² + 6x + 9 + 2 = x² + 6x + 11 ✓
WE 2Complete the square — monic with negative middle term
Express x2 − 10x + 7 in completed-square form, and hence find the minimum value of the function.
Halve b: half of −10 is −5
x² − 10x + 7 = (x − 5)² − 25 + 7
= (x − 5)² − 18
Read off vertex from a(x − h)² + k form
h = 5, k = −18 → vertex (5, −18)
(x − 5)² − 18; minimum value = −18, at x = 5
since a = 1 > 0 the parabola opens up, so the vertex is a minimum
WE 3Complete the square — non-monic, a = 2
Express 2x2 + 12x + 5 in the form a(x − h)2 + k.
Step 1: Factor 2 out of the x terms only
2(x² + 6x) + 5
Step 2: Complete the square inside
half of 6 is 3 → (x + 3)² − 9
2[(x + 3)² − 9] + 5
Step 3: Multiply through by 2 and tidy
2(x + 3)² − 18 + 5
2(x + 3)² − 13
vertex (−3, −13), minimum value = −13, achieved at x = −3
WE 4Non-monic with negative leading coefficient
Express −x2 + 8x − 3 in completed-square form, and state the maximum value of the function.
Step 1: Factor −1 out of the x terms only
−(x² − 8x) − 3
Step 2: Complete the square inside
half of −8 is −4 → (x − 4)² − 16
−[(x − 4)² − 16] − 3
Step 3: Multiply through by −1 and tidy
−(x − 4)² + 16 − 3
−(x − 4)² + 13; maximum value = 13, at x = 4
since a = −1 < 0 the parabola opens down, so the vertex is a maximum
WE 5Solve a quadratic equation by completing the square
Solve 5x2 − 20x + 3 = 0 by completing the square. Give exact answers.
Step 1: Factor 5 out of the x terms
5(x² − 4x) + 3 = 0
Step 2: Complete the square inside
half of −4 is −2 → (x − 2)² − 4
5[(x − 2)² − 4] + 3 = 0
5(x − 2)² − 20 + 3 = 0
5(x − 2)² = 17
Step 3: Isolate and ±√
(x − 2)² = 17/5
x − 2 = ±√(17/5)
x = 2 ± √(17/5)
don’t forget the ± when taking the square root — both values are solutions
WE 6Optimisation — finding maximum area
A rectangular pen is built against a long straight wall, using 60 m of fencing for the other three sides. Let x be the length of each side perpendicular to the wall. Find the value of x that gives the maximum area, and state that maximum.
Step 1: Express the area as a function of x
two perpendicular sides = 2x; remaining side parallel to wall = 60 − 2x
A(x) = x(60 − 2x) = 60x − 2x²
Step 2: Complete the square
A(x) = −2x² + 60x = −2(x² − 30x)
half of −30 is −15 → (x − 15)² − 225
A(x) = −2[(x − 15)² − 225]
A(x) = −2(x − 15)² + 450
Step 3: Read off the maximum (since a = −2 < 0)
vertex (15, 450) → max value 450 when x = 15
x = 15 m gives maximum area = 450 m²
at x = 15, the parallel side = 60 − 30 = 30 m → pen is 15 by 30, twice as wide as it is deep
💡 Top tips
- Halve b, square it, subtract it — that’s the whole monic move. Memorise this and you’ve got 80% of the technique.
- Factor a out of just the x terms, never out of the constant c. Keeps the algebra clean.
- Multiply both the squared bracket AND the subtracted constant when expanding back — easy to forget the second part.
- The h-value flips sign from inside the bracket. (x − 5)2 means h = +5, not −5.
- Always expand to check. If your completed square form expands back to the original, you’re correct.
- For optimisation, set up the function first, then complete the square. The vertex is the optimum.
- For solving, isolate the squared term before taking ±√. Don’t forget the negative root.
⚠ Common mistakes
- Forgetting to subtract the squared half. Writing x2 + 8x + 3 = (x + 4)2 + 3 misses the −16 — the answer is (x + 4)2 − 13.
- Factoring a out of the constant. Don’t divide c by a — leave it alone outside the bracket.
- Multiplying back inconsistently. If you have 3[(x − 2)2 − 4] + 7, the −4 must also get multiplied by 3 → 3(x − 2)2 − 12 + 7.
- Sign error on the vertex’s x-coordinate. From (x − 6)2 + 5, the vertex is (6, 5) — flip the sign of what’s inside.
- Dropping the ± when taking square roots. Both values are solutions; missing one means missing half the marks.
- Treating the squared half as +b/2 when b is negative. Half of −10 is −5, and (x − 5)2 needs you to subtract 25, not 5.
- For non-monic with a < 0, missing the sign flip. Factoring −1 from −x2 + 8x gives −(x2 − 8x), not −(x2 + 8x).
Completing the square gives you two superpowers: instant access to the vertex (so you can find max/min and sketch immediately), and a reliable way to solve any quadratic equation. The next note brings together everything from the last few — factorising, completing the square, and the quadratic formula — so you can confidently solve quadratic equations in any form they come in.
Need help with Completing the Square?
Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.
Book Free Session →