Completing the Square

Completing the square is a process that may be used to solve any quadratic equation. Given that most quadratic equations will not be perfect squares, completing the square involves rewriting the original equation in an equivalent form so that the quadratic expression is written as a complete square, plus or minus a constant. Whereas factorising a quadratic equation often does not work for roots that are irrational or complex numbers, completing the square does (note however that we will not be dealing with equations involving complex numbers here). Probably the first question we should ask ourselves is why we would want to get a quadratic equation into this form in the first place. Forgetting for the moment the general form of a quadratic equation (ax 2 + bx + c = 0), think instead about a very simple quadratic equation such as:

x 2 = 16

This is a very easy problem to solve, since all we need to do in order to find possible values of x is to rewrite the equation by taking the square root of each side:

x = √16    x = ± 4

Note that there are two possible values of x that satisfy the equation, since the square root of any positive real-valued number may be either positive or negative. The problem is easy to solve, because both sides of the equation are perfect squares. In fact, you could probably do this example in your head. Even if the term on the right-hand side of the equation is not a perfect square, we don't really have a problem. Consider the following:

x 2 = 7    x = ± √7 (or  x ≈ ± 2.645751)

In this example, the term on the right-hand side is not a perfect square, and the root is an irrational number (i.e. it does not terminate and there is no repeating pattern), so the options are to either leave it as √7 or round the decimal conversion off to the required number of decimal places, in which case it is an approximate answer. If the quadratic equation is part of a larger problem, and the possible values of x will be used in other calculations, it may be better to leave the answer as a surd (a surd is a number written as the nth root of another number). Let's consider a slightly more involved quadratic:

(x - 5) 2 = 7

We still have a squared term on the left-hand side of the equation, so we can solve it by taking the square root of both sides (the left-hand side is a perfect square because it is the result of squaring the expression x - 5):

x - 5 = ± √7 (or  x - 5 ≈ ± 2.645751)

Since we are looking for values of x, we need to add five to both sides of the equation:

x = 5 ± √7 (or x ≈ 5 ± 2.645751)    x ≈ 7.645751 or x ≈ 2.354249

Unfortunately, not all quadratic equations make life easy by having an expression on the left hand side that is a perfect square. If fact, most do not. Consider the following quadratic equation written in the standard format (ax 2 + bx + c = 0):

x 2 + 10x - 21 = 0

The first step in completing the square is to move the constant term over to the right-hand side of the equation:

x 2 + 10x = 21

We can now deal with the left-hand side of the equation. As it stands, the expression on the left-hand side is not a perfect square (i.e. we cannot simply re-write it in the form (x + a) 2 or (x - a) 2. If it was in either of these forms, we could expand the brackets as follows:

(x + a) 2 = (x + a)(x + a) = x 2 + 2ax + a 2

(x - a) 2 = (x - a)(x - a) = x 2 - 2ax + a 2

If we compare the quadratic expression x 2 + 10x with the complete square x 2 + 2ax + a 2, we can see that the quadratic term in both cases is the same (i.e. x 2), which means that the quadratic coefficient is also the same (i.e. one). What we would like to do, therefore, is match the linear terms (2ax and 10x). This means that the linear coefficients must be equal, so 2a will equal ten (2a = 10) and a will equal five (a = 5). Remembering that (x + a) 2 expands to x 2 + 2ax + a 2, if we replace a with five we will get:

(x + 5) 2 = x 2 + 10x + 25

So, if we replace the left hand side of our original equation with (x + 5) 2, what we have effectively done is to replace x 2 + 10x with x 2 + 10x + 25. This means that in order to balance the equation, we need to add twenty-five (25) to the right-hand side of the equation, as follows:

(x + 5) 2 = 21 + 25    (x + 5) 2 = 46

Taking the square root of both sides of the equation, we get:

x + 5 = ± √46    x = -5 ± √46

It should now be evident that given a monomial quadratic equation (i.e. one in which the quadratic coefficient is one), it is relatively straightforward to re-write the equation so that we get a perfect square on the left-hand side. We can then solve for x by taking the square root of both sides of the equation. The important thing to note here is that the value of a in the generalised form of the completed square will be half the value of the linear coefficient in the original equation. Let's try another example:

x 2 - 8x = 7

Because the linear coefficient is negative, we take the generalised form of the equation x 2 - 2ax + a 2. The value of a will be minus eight divided by two (-8 ÷ 2), so our original equation can be re-written as:

(x - 4) 2 = 7 + 16    (x - 4) 2 = 23

Don't forget that the a 2 term (in this case, -4 2 = 16) needs to be added to the right-hand side of the equation in order to balance things out. Taking the square root of both sides, we get:

x - 4 = √23    x = 4 ± √23

If the linear coefficient is an odd number, the value of a will clearly not be an integer. In a situation like this, completing the square works exactly the same, but you can either write a as a fraction, or as its decimal equivalent. In many cases, writing a as a fraction is the better option, since it avoids the possibility of rounding errors (you can always convert the answers to decimal format at a later stage). Consider the following equation:

x 2 - 9x - 5 = 0

We can start by moving the constant term to the right hand side:

x 2 - 9x = 5

Now we will rewrite the left hand expression to get a perfect square and add the a 2 term to the right hand side of the equation to balance it up:

(x  -  9)2  =  5 + (9)2    (x  -  9)2  =  5 + 81    (x  -  9)2  =  101
222424

Now we take the square root of each side:

x  -  9  =  101    x  =  9 ± 101
2424

Converting these values of x to decimal format gives us x = 9.52 or x = -0.52 (accurate to two decimal places).

When the quadratic coefficient is greater than one

Completing the square for quadratic equations in which the quadratic coefficient is one is relatively straightforward. Things get slightly more complicated when the quadratic coefficient is greater than one, but the method is essentially the same, with the addition of an additional step. Consider the following quadratic equation:

5x 2 - 4x - 2 = 0

The additional step required here is to divide both sides of the equation by the quadratic coefficient, which in this case is five:

x 2  -  4x  -  2  =  0
55

Since five is not a factor of either four or two, we will write the linear coefficient and constant terms as rational numbers (fractions). As before, move the constant term to the right hand side of the equation:

x 2  -  4x  =  2
55

We can now write the left hand side of the equation as a complete square, and add the a 2 term to the right-hand side of the equation:

(x  -  2)2  =  2 + 4    (x  -  2)2  =  14
5525525

Now take the square root of each side:

x  -  2  =  ±14    x  =  2 ±14
525525

You could of course have rewritten the quadratic equation (as a monomial) as:

x 2 - 0.8x - 0.4 = 0

This leads to:

(x - 0.4) 2 = 0.4 + 0.16    (x - 0.4) 2 = 0.56    x - 0.4 = 0.56

From which we get the following values of x:

x ≈ 0.4 ± 0.75    x ≈ 1.15  or  x ≈ -0.35

Note that taking the square root of 0.56 does not give exactly 0.75. We have rounded the answer to two decimal places. Whether this is accurate enough depends on the nature of the overall problem you are trying to solve. In an exam scenario, you should give answers in the form requested, when this is specified. The procedure for solving quadratic equations in the form ax 2 + bx + c = 0 by completing the square can be summarised as follows:

This will leave you with an equation in the form:

x = -a ± (constant term + a 2)

The algebraic relationship between the value of a in the above equation and the quadratic and linear coefficients in the generalised form of the quadratic equation is very important, as it can be used to derive the quadratic formula. The quadratic formula, its derivation, and its usage will be discussed on another page.