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 2Bx | Equating the x terms |
\displaystyle -4 | \displaystyle = | \displaystyle 2B | Divide both sides by x |
\displaystyle -2 | \displaystyle = | \displaystyle B | Divide 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+23 | Adding 4-4 into the equation |
\displaystyle = | \displaystyle \left(x-2\right)^2-4+23 | Factorise the perfect square part | |
\displaystyle = | \displaystyle \left(x-2\right)^2+19 | Evaluate 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+C | Adding B^2-B^2 into the equation |
\displaystyle = | \displaystyle \left(A+B\right)^2-B^2+C | Factorise 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.
Using the method of completing the square, rewrite x^2+4x in the form \left(x+b\right)^2+c
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).
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:
Find A by taking the square root of the squared term.
Find B by dividing the middle term by 2A.
Add B^2-B^2 to the expression (which is the same as adding 0).
Factorise the perfect square part of the expression using the rule\left(A+B\right)^2=A^2+2AB+B^2.
Collect the constant terms if necessary.