Completing the square
Adding one number turns into a perfect square:
The number to add is half the coefficient of , squared. This page shows why that is the number, with a picture you can check and with algebra that holds for every , so the rule is something you can see rather than something to remember.
Before you start
You need three facts.
- Expanding a square: .
- The area of a rectangle is its width times its height.
- The area of a square of side is .
Predict first
The figure starts with a square of side . Two strips are added along the right and the bottom, each one wide. The strips leave a gap in the corner.
Before you read on, predict: what shape fills the gap, and what are its two side lengths? Write your prediction down. Then read the argument below and check it against the figure.
The picture
Start with a square of side . Its area is .
Now add two rectangles. Put one along the right-hand side and one along the bottom. Make each rectangle wide, and make it run the full along the square.
Each rectangle has area
There are two of them, so together they cover
The shape so far is the square plus the two strips. Its area is
The two strips meet at the bottom-right corner, and they leave a small square gap there. Look at the gap: each side of it is the width of a strip, which is . So the gap is a square of side , and its area is
Fill the gap. Now the outline is one big square. Its side is the old side plus the strip width :
That big square is made of exactly the pieces: the square , the two strips , and the corner . Add their areas:
The big square and the pieces are the same shape, so their areas are equal:
This is the whole reason the number to add is half the coefficient, squared. The half is the width of each strip, because the coefficient is shared between two strips. The square is the area of the corner that the strips leave behind.
The same thing in algebra
The picture used positive strips. The algebra does not care about the sign, and it shows the identity for every at once.
Expand the right-hand side with the first fact above, , taking :
The middle term is . The cancels the in the denominator, leaving , which is the coefficient the original expression has. The last term is , the number the picture called the area of the corner.
Why half, and not ? The expansion of a square produces the middle term twice:
To make that middle term equal to , you need , so . The picture says the same thing: the coefficient is shared between the two rectangles, so each one is wide.
When is negative, is negative and the strips are taken away rather than added. The algebra above still holds, because it only ever uses multiplied by or by itself, and a square is positive either way.
Completing the square with a constant
Most expressions also have a constant term, . Add the corner and take it away again, so the value does not change:
The bracket is the perfect square. The constant left over, , is the correction for adding a corner the expression did not have. Nothing new is happening: you added and then subtracted it.
Check your understanding
- What number do you add to to make a perfect square? Write the perfect square as well.
- Expand . What number do you add to to make a perfect square?
- In the picture the two strips together have area , even though each strip is only wide. Explain why.
Answers
- Half of is , and . Add : .
- , so add . The coefficient is negative, but the number added is , which is positive.
- Each strip has area , and there are two strips, so together they have area . The coefficient is shared between the two strips.
A common error
The number you add is the square of half the coefficient. It is not itself.
For , half of is , and the number to add is :
Adding instead gives , which is not a square.
The other trap is the sign inside the bracket. Half of is , so the bracket is , not . Expand to check: , which matches.