Factorising by Completing the Square
Completing the square rewrites \(x^2 + bx + c\) as \(\left(x + \dfrac{b}{2}\right)^2\) plus or minus a number. A quadratic that will not factorise with whole numbers can then be factorised with surds as a difference of two squares. This NSW Year 9 Advanced maths subtopic uses the method (NESA outcome MA5‑EQU‑P‑02).
You will find the number that completes a square, write quadratics in the form \((x + a)^2 + b\) with whole numbers and fractions, and factorise with surds, including when the \(x^2\) term has a coefficient. You will decide which quadratics have no linear factors, find exact solutions, find the smallest value of a quadratic, and find the largest area a length of fencing can enclose. It is part of Year 9 Advanced Quadratics.
Every question with a fully worked solution.
- Factorising by Completing the Square - Video - Completing Perfect Square Trinomials Watch
Theory
Completing the square rewrites a quadratic as a perfect square plus or minus a number, such as \(x^2 + 6x + 2 = (x + 3)^2 - 7\). It factorises quadratics that product and sum cannot, and shows at a glance whether a quadratic has factors and what its smallest or largest value is. This Year 9 Advanced maths page leads straight on to solving quadratics and to Advanced and Extension maths.
A perfect square is an expression of the form \((x + p)^2 = x^2 + 2px + p^2\). Its constant \(p^2\) is the square of half the coefficient of \(x\).
Completing the square means adding and subtracting that number so that the first three terms form a perfect square:
If the result is a square minus a positive number, it is a difference of two squares and factorises, often with surds. If it is a square plus a positive number, it is always positive and has no real factors.
Since a square is never negative, \((x + p)^2 + q\) has smallest value \(q\), when \(x = -p\).
| Expression | Half of \(b\) | Add and subtract | Completed square |
|---|---|---|---|
| \(x^2 + 12x + 1\) | \(6\) | \(36\) | \((x + 6)^2 - 35\) |
| \(x^2 - 3x\) | \(-\dfrac{3}{2}\) | \(\dfrac{9}{4}\) | \(\left(x - \dfrac{3}{2}\right)^2 - \dfrac{9}{4}\) |
| \(x^2 + 2kx + k^2 - 4\) | \(k\) | already there | \((x + k)^2 - 4\) |
How to complete the square
- Leading coefficient: if it is not \(1\), take it out of the \(x\) terms (or out of everything when factorising).
- Halve the coefficient of \(x\) and square it.
- Add and subtract that square straight after the \(x\) term.
- Write the first three terms as \((x + \text{half})^2\) and combine the numbers left over.
Using the completed square
- To factorise: write the number subtracted as a square (using a surd if needed) and use the difference of two squares. Simplify surds: \(\sqrt{12} = 2\sqrt{3}\).
- To decide: square plus a positive number means no real factors; square minus a positive number means two factors.
- To find a minimum or maximum: \(a(x + p)^2 + q\) has its smallest (\(a > 0\)) or largest (\(a < 0\)) value \(q\) at \(x = -p\).
- To solve: once factorised, set each factor to zero (see Solving Quadratics by Factorising).
(i) \(x^2 + 10x + 7\)
(ii) \(x^2 - 7x + 3\)
Halve the coefficient of \(x\), square it, then add and subtract that square so the value does not change.
| \(\left(\dfrac{10}{2}\right)^2\) | \(=\) | \(25\) |
| \(x^2 + 10x + 7\) | \(=\) | \(x^2 + 10x + 25 - 25 + 7\) |
| \(\) | \(=\) | \(\boldsymbol{(x + 5)^2 - 18}\) |
(ii) Half of \(-7\) is \(-\dfrac{7}{2}\), and \(\left(-\dfrac{7}{2}\right)^2\) \(= \dfrac{49}{4}\).
| \(x^2 - 7x + 3\) | \(=\) | \(x^2 - 7x + \dfrac{49}{4} - \dfrac{49}{4} + \dfrac{12}{4}\) |
| \(\) | \(=\) | \(\boldsymbol{\left(x - \dfrac{7}{2}\right)^2 - \dfrac{37}{4}}\) |
Write \(3\) as \(\dfrac{12}{4}\) so the fractions combine: \(-\dfrac{49}{4} + \dfrac{12}{4}\) \(= -\dfrac{37}{4}\).
(i) \(x^2 - 2x - 15\)
(ii) \(x^2 + 8x + 8\), with surds in simplest form.
Complete the square, write what is subtracted as a square, then use \(A^2 - B^2 = (A - B)(A + B)\).
| \(x^2 - 2x - 15\) | \(=\) | \(x^2 - 2x + 1 - 1 - 15\) |
| \(\) | \(=\) | \((x - 1)^2 - 16\) |
| \(\) | \(=\) | \((x - 1)^2 - 4^2\) |
| \(\) | \(=\) | \((x - 1 - 4)(x - 1 + 4)\) |
| \(\) | \(=\) | \(\boldsymbol{(x - 5)(x + 3)}\) |
(ii) The number left over is not a perfect square, so write it as the square of a surd: \(8 = (\sqrt{8})^2 = (2\sqrt{2})^2\).
| \(x^2 + 8x + 8\) | \(=\) | \(x^2 + 8x + 16 - 16 + 8\) |
| \(\) | \(=\) | \((x + 4)^2 - 8\) |
| \(\) | \(=\) | \((x + 4)^2 - \left(2\sqrt{2}\right)^2\) |
| \(\) | \(=\) | \(\boldsymbol{\left(x + 4 - 2\sqrt{2}\right)\left(x + 4 + 2\sqrt{2}\right)}\) |
Part (i) could be done with product and sum, but part (ii) cannot: completing the square works for both.
(i) Write \(3x^2 - 12x + 5\) in the form \(a(x + h)^2 + k\).
(ii) Show that \(x^2 - 4x + 9\) cannot be factorised, and find its smallest value.
(i) Take the \(3\) out of the \(x\) terms only, complete the square inside, then multiply back.
| \(3x^2 - 12x + 5\) | \(=\) | \(3(x^2 - 4x) + 5\) |
| \(\) | \(=\) | \(3\big[(x - 2)^2 - 4\big] + 5\) |
| \(\) | \(=\) | \(3(x - 2)^2 - 12 + 5\) |
| \(\) | \(=\) | \(\boldsymbol{3(x - 2)^2 - 7}\) |
(ii) Complete the square.
| \(x^2 - 4x + 9\) | \(=\) | \(x^2 - 4x + 4 - 4 + 9\) |
| \(\) | \(=\) | \((x - 2)^2 + 5\) |
A square is never negative, so \((x - 2)^2 \ge 0\) and the expression is always at least \(5\). It is never zero, so it has no linear factors. Its smallest value is \(\boldsymbol{5}\), when \(x - 2 = 0\), that is \(\boldsymbol{x = 2}\).
(i) Show that the area is \(A = 60x - \dfrac{3}{2}x^2\).
(ii) Complete the square to find the largest possible area, and the dimensions that give it.
(i) The fencing is three widths and two lengths.
| \(3x + 2L\) | \(=\) | \(120 \ \Rightarrow\ L = 60 - \dfrac{3}{2}x\) |
| \(A\) | \(=\) | \(x\left(60 - \dfrac{3}{2}x\right) = 60x - \dfrac{3}{2}x^2\) |
(ii) Take out \(-\dfrac{3}{2}\) from both terms, then complete the square inside.
| \(A\) | \(=\) | \(-\dfrac{3}{2}\left(x^2 - 40x\right)\) |
| \(\) | \(=\) | \(-\dfrac{3}{2}\big[(x - 20)^2 - 400\big]\) |
| \(\) | \(=\) | \(-\dfrac{3}{2}(x - 20)^2 + 600\) |
The squared term is never negative, so it can only take away from \(600\). The area is largest when \(x = 20\).
| \(A_{\max}\) | \(=\) | \(\boldsymbol{600}~\text{m}^2\) |
| \(x\) | \(=\) | \(\boldsymbol{20}~\text{m},\quad L = 60 - 30 = \boldsymbol{30}~\text{m}\) |
Check: \(3(20) + 2(30) = 120\) m of fencing \(\checkmark\)
Common pitfalls
Frequently asked questions
What does completing the square mean?
Adding and subtracting the square of half the \(x\) coefficient so that part of the quadratic becomes a perfect square, giving the form \((x + a)^2 + b\).
How do you factorise by completing the square?
Complete the square to get a square minus a number, write the number as a square (a surd if needed), then use the difference of two squares.
What if the coefficient of x is odd?
Half of it is a fraction, which is fine. For \(x^2 + 5x\), add and subtract \(\dfrac{25}{4}\) to get \(\left(x + \dfrac{5}{2}\right)^2 - \dfrac{25}{4}\).
How can you tell a quadratic has no factors?
Complete the square. If you get a square plus a positive number, the expression is always positive, so it has no real linear factors.
How does completing the square give a maximum or minimum?
In \(a(x + p)^2 + q\) the squared part is never negative. If \(a > 0\) the smallest value is \(q\); if \(a < 0\) the largest value is \(q\). Both occur at \(x = -p\).