Resources For Teachers For Tutors For Students & Parents AI New Pricing
Year 9 Maths Advanced Quadratics

Factorising by Completing the Square

20 practice questions 1 video lesson Theory + worked examples

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.

Practice 20 questions
Practice questions

Every question with a fully worked solution.

Start practising
Watch 1 video(s)
  • Factorising by Completing the Square - Video - Completing Perfect Square Trinomials Watch
Create a free accountTrack your progress and save your work as you go.
Create free account

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:

\[x^2 + bx + c = \left(x + \dfrac{b}{2}\right)^2 - \left(\dfrac{b}{2}\right)^2 + c\]

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\).

Completing the square with areasA square of side x plus two strips, each 2 by x, arranged along two sides. Together they make x squared + 4x. A dashed 2 by 2 corner is missing, so x squared + 4x = (x + 2) squared minus 4. x² 2x 2x 4 x 2 x 2 x² + 4x = (x + 2)² − 4 the corner 4 is missing
Half of \(4\) is \(2\): split the \(4x\) into two strips of \(2x\). Adding the missing \(2^2\) corner completes the square.
What the completed square tells youThree cases. (x + p) squared minus q with q positive is a difference of squares and has two factors. (x + p) squared is a perfect square. (x + p) squared plus q with q positive is always positive and has no real factors. After completing the square: (x + p)² − q, q > 0 difference of squares: two factors (x + p)² perfect square: (x + p)(x + p) (x + p)² + q, q > 0 always positive: no real factors
The sign of what is left after the square decides whether the expression factorises.
\[x^2 + bx + c = \left(x + \dfrac{b}{2}\right)^2 - \dfrac{b^2}{4} + c\]
x2+bx+c=(x+b2)2−b24+c
\[(x + p)^2 - q = \left(x + p - \sqrt{q}\right)\left(x + p + \sqrt{q}\right), \quad q > 0\]
(x+p)2−q=(x+p−q)(x+p+q)
ExpressionHalf of \(b\)Add and subtractCompleted 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\)
Leading coefficient \(a\). Take \(a\) out of the \(x\) terms only: \(ax^2 + bx + c\) \(= a\left(x^2 + \dfrac{b}{a}x\right) + c\). Complete the square inside, then multiply back. If \(a\) is a square, such as \(4x^2 = (2x)^2\), you can complete the square on \(2x\) instead.
When does \(x^2 + bx + c\) factorise? After completing the square it is \(\left(x + \dfrac{b}{2}\right)^2 - \left(\dfrac{b^2}{4} - c\right)\). It has real linear factors only when \(\dfrac{b^2}{4} - c \ge 0\).

How to complete the square

  1. Leading coefficient: if it is not \(1\), take it out of the \(x\) terms (or out of everything when factorising).
  2. Halve the coefficient of \(x\) and square it.
  3. Add and subtract that square straight after the \(x\) term.
  4. Write the first three terms as \((x + \text{half})^2\) and combine the numbers left over.

Using the completed square

  1. 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}\).
  2. To decide: square plus a positive number means no real factors; square minus a positive number means two factors.
  3. 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\).
  4. To solve: once factorised, set each factor to zero (see Solving Quadratics by Factorising).
Example 1 — Writing a completed square
Write each in the form \((x + a)^2 + b\):
(i) \(x^2 + 10x + 7\)
(ii) \(x^2 - 7x + 3\)
Solution

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}}\)
x2+10x+7=(x+5)2−18

Write \(3\) as \(\dfrac{12}{4}\) so the fractions combine: \(-\dfrac{49}{4} + \dfrac{12}{4}\) \(= -\dfrac{37}{4}\).

Example 2 — Factorising by completing the square
Factorise by completing the square:
(i) \(x^2 - 2x - 15\)
(ii) \(x^2 + 8x + 8\), with surds in simplest form.
Solution

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)}\)
(x+4−22)(x+4+22)

Part (i) could be done with product and sum, but part (ii) cannot: completing the square works for both.

Example 3 — A leading coefficient, and no factors

(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.
Solution

(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\)
x2−4x+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}\).

Example 4 — The largest area
A farmer has \(120\) m of fencing to build a rectangular yard split into two pens, as shown.
(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.
Yard split into two pensA rectangle L metres long and x metres wide, divided into two pens by a fence of length x across the middle. There are three fences of length x and two of length L. L m L m x m x m x m pen pen
Solution

(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\)
A=−32(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

Halve before squaring. For \(x^2 + 10x\) add \(25\), not \(100\): half of \(10\) is \(5\), and \(5^2 = 25\).
Subtract what you add. \(x^2 + 10x + 7 = (x + 5)^2 - 25 + 7\). Forgetting the \(-25\) changes the expression.
Keep the sign of half of \(b\). \(x^2 - 12x + \ldots\) \(= (x - 6)^2 - \ldots\); the bracket has a minus.
Multiply back through the bracket. \(2\big[(x + 3)^2 - 9\big] + 1\) \(= 2(x + 3)^2 - 18 + 1\), not \(- 9 + 1\).
Simplify the surd. \((x + 4)^2 - 8\) gives factors with \(2\sqrt{2}\), not \(\sqrt{8}\).

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\).