# Completing the square

## Introduction

Completing the square is a method of writing any quadratic expression in the form: \((x + a)^2 + b\) where \(a\) and \(b\) are real numbers.

For example, \(x^2 + 8x + 6 \) can be written as \((x + 4)^2 - 10\). You can show this is true by expanding and then simplifying the second expression: \begin{aligned} (x + 4)^2 - 10 & = (x + 4)(x + 4) - 10 \\ & = x^2 + 4x + 4x + 16 - 10 \\ & = x^2 + 8x + 6 \\ \end{aligned} We have arrived back at our original expression.

## How to complete the square

### Example 1

Write the expression \(x^2 + 6x + 2 \) in the form \((x + a)^2 + b\) where \(a\) and \(b\) are integers.

The first step in completing the square is to take the coefficient of the \(x\) term and divide it by two. In this case we get \(6 ÷ 2 = 3\). This gives us our value for \(a\).

Now we know \(a = 3\) the first part of our completed expression will look like \((x + 3)^2\). Expanding this gives us:
\begin{aligned}
(x + 3)^2 & = (x + 3)(x + 3) \\
& = x^2 + 3x + 3x + 9 \\
& = x^2 + 6x + 9 \\
\end{aligned}
We now have our \(6x\) term but instead of \(+ 2\) as in our original expression we have \(+ 9\).
Our current expression is \(7\) larger than it needs to be. This tells us we need to subtract \(7\) to get back to where we want. So our value for \(b = -7\).

So after completing the square we get:
\begin{aligned}
x^2 + 6x + 2 & = (x + 3)^2 - 7
\end{aligned}
You can check your answer by expanding the right hand side as in the introduction and make sure the two sides balance.

### Example 2

Write the expression \(x^2 - 10x + 40 \) in the form \((x + a)^2 + b\) where \(a\) and \(b\) are integers.

Again we first halve the coefficient of the \(x\) term to get our \(a\) value of \(-5\). Now we have:
\begin{aligned}
(x - 5)^2 & = (x - 5)(x - 5) \\
& = x^2 - 5x - 5x + 25 \\
& = x^2 - 10x + 25 \\
\end{aligned}
This time our expression is \(15\) smaller than it needs to be so we need add an extra \(15\) to complete the square.

Now we know \(b = 15\) we have:
\begin{aligned}
x^2 - 10x + 40 & = (x - 5)^2 + 15
\end{aligned}

## Worksheets to practise completing the square

Try this worksheet to practise your skills.