topic badge
Australia
Year 10

2.06 Complete the square

Lesson

Completing the square

Earlier we saw the identity \left(A+B\right)^2=A^2+2AB+B^2. Sometimes it's useful to be able to have a perfect square. However, not every quadratic trinomial can be factorised this way.

Instead we can use a method called completing the square. The idea behind completing the square is that some part of the original expression is a perfect square, and the remainder is a constant.

Complete the square on x^2-4x+23.

First, notice that x^2-4x+23 is not a perfect square, because it doesn't fit the pattern A^2+2AB+B^2. Instead we want to find out which part does fit this pattern.

The first term is x^2, and so we want A=x. Substituting this in gives us x^2+2Bx+B^2. So what is B? We can see that -4x=2Bx and from this we can solve for B.

\displaystyle -4x\displaystyle =\displaystyle 2BxEquating the x terms
\displaystyle -4\displaystyle =\displaystyle 2BDivide both sides by x
\displaystyle -2\displaystyle =\displaystyle BDivide both sides by 2

So B=-2. Substituting this gives us A^2+2AB+B^2=x^2-4x+4. While this is not quite the expression we started with, if we can separate this from the expression then we have a perfect square.

If we add 4 and then subtract 4 from a number then we end up with the number that we started with. In other words, +4-4 is the same as 0. Applying this to the expression:

\displaystyle x^2-4x+23\displaystyle =\displaystyle x^2-4x+4-4+23Adding 4-4 into the equation
\displaystyle =\displaystyle \left(x-2\right)^2-4+23Factorise the perfect square part
\displaystyle =\displaystyle \left(x-2\right)^2+19Evaluate the constant

And now we have a perfect square plus a constant. In generality, let A, B, and C be any numbers. Applying the whole process:

\displaystyle A^2+2AB+C\displaystyle =\displaystyle A^2+2AB+B^2-B^2+CAdding B^2-B^2 into the equation
\displaystyle =\displaystyle \left(A+B\right)^2-B^2+CFactorise the perfect square part

So we can complete the square on any expression. We find A by finding the squared term, and then we find B by dividing the middle term by 2A. Then we add B^2-B^2 and we have a perfect square plus a constant.

Examples

Example 1

Using the method of completing the square, rewrite x^2+4x in the form \left(x+b\right)^2+c

Worked Solution
Create a strategy

Add b^2-b^2 into the expression and factorise the perfect square part.

Apply the idea

If x^2+2bx=x^2+4x then 2b=4 so b=2.

\displaystyle x^2+4x\displaystyle =\displaystyle x^2+4x +2^2-2^2Adding 2^2-2^2
\displaystyle =\displaystyle (x+2)^2-2^2Factorise the perfect square part
\displaystyle =\displaystyle (x+2)^2-4Evaluate the constant

Example 2

Factorise the quadratic y=x^2+4x+3 using the method of completing the square to get it into the form y=\left(x+a\right)\left(x+b\right).

Worked Solution
Create a strategy

Use the completing the square method.

Apply the idea

We have a coefficient of 4 in the x term, then 2B=4 so B=2.

\displaystyle y\displaystyle =\displaystyle x^2+4x+2^2-2^2+3Add 2^2-2^2
\displaystyle =\displaystyle \left(x+2\right)^2-2^2+3Factorise the perfect square part
\displaystyle =\displaystyle \left(x+2\right)^2-1Evaluate the constant
\displaystyle =\displaystyle \left(x+2\right)^2-1^2Write as difference of 2 squares
\displaystyle =\displaystyle \left((x+2)+1\right)\left((x+2)-1\right)Factorise by difference of 2 squares
\displaystyle =\displaystyle \left(x+3\right)\left(x+1\right)Simplify each bracket
Idea summary

Completing the square is a method which allows us to find a perfect square by using the rule \left(A+B\right)^2=A^2+2AB+B^2. The method involves the following steps:

  1. Find A by taking the square root of the squared term.

  2. Find B by dividing the middle term by 2A.

  3. Add B^2-B^2 to the expression (which is the same as adding 0).

  4. Factorise the perfect square part of the expression using the rule\left(A+B\right)^2=A^2+2AB+B^2.

  5. Collect the constant terms if necessary.

Outcomes

AC9M10A01

expand, factorise and simplify expressions and solve equations algebraically, applying exponent laws involving products, quotients and powers of variables, and the distributive property

What is Mathspace

About Mathspace