Proofs

Completing the square

Adding one number turns x2+bxx^2 + bx into a perfect square:

x2+bx+(b2)2=(x+b2)2x^2 + bx + \left(\frac{b}{2}\right)^2 = \left(x + \frac{b}{2}\right)^2

The number to add is half the coefficient of xx, squared. This page shows why that is the number, with a picture you can check and with algebra that holds for every bb, so the rule is something you can see rather than something to remember.

Before you start

You need three facts.

Predict first

The figure starts with a square of side xx. Two strips are added along the right and the bottom, each one b2\frac{b}{2} 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 xx. Its area is x2x^2.

Now add two rectangles. Put one along the right-hand side and one along the bottom. Make each rectangle b2\frac{b}{2} wide, and make it run the full xx along the square.

Each rectangle has area

b2×x=bx2.\frac{b}{2} \times x = \frac{bx}{2}.

There are two of them, so together they cover

2×bx2=bx.2 \times \frac{bx}{2} = bx.

The shape so far is the square plus the two strips. Its area is

x2+bx.x^2 + bx.

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 b2\frac{b}{2}. So the gap is a square of side b2\frac{b}{2}, and its area is

(b2)2=b24.\left(\frac{b}{2}\right)^2 = \frac{b^2}{4}.

Fill the gap. Now the outline is one big square. Its side is the old side xx plus the strip width b2\frac{b}{2}:

side=x+b2.\text{side} = x + \frac{b}{2}.

That big square is made of exactly the pieces: the square x2x^2, the two strips bxbx, and the corner (b2)2\left(\frac{b}{2}\right)^2. Add their areas:

x2+bx+(b2)2.x^2 + bx + \left(\frac{b}{2}\right)^2.

The big square and the pieces are the same shape, so their areas are equal:

x2+bx+(b2)2=(x+b2)2.x^2 + bx + \left(\frac{b}{2}\right)^2 = \left(x + \frac{b}{2}\right)^2.

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 bb 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 bb at once.

Expand the right-hand side with the first fact above, (x+k)2=x2+2kx+k2(x + k)^2 = x^2 + 2kx + k^2, taking k=b2k = \frac{b}{2}:

(x+b2)2=x2+2⋅b2⋅x+(b2)2=x2+bx+(b2)2.\left(x + \frac{b}{2}\right)^2 = x^2 + 2 \cdot \frac{b}{2} \cdot x + \left(\frac{b}{2}\right)^2 = x^2 + bx + \left(\frac{b}{2}\right)^2.

The middle term is 2⋅b2⋅x2 \cdot \frac{b}{2} \cdot x. The 22 cancels the 22 in the denominator, leaving bxbx, which is the coefficient the original expression has. The last term is (b2)2\left(\frac{b}{2}\right)^2, the number the picture called the area of the corner.

Why half, and not bb? The expansion of a square produces the middle term twice:

(x+k)2=x2+kx+kx+k2.(x + k)^2 = x^2 + kx + kx + k^2.

To make that middle term equal to bxbx, you need 2k=b2k = b, so k=b2k = \frac{b}{2}. The picture says the same thing: the coefficient bb is shared between the two rectangles, so each one is b2\frac{b}{2} wide.

When bb is negative, b2\frac{b}{2} is negative and the strips are taken away rather than added. The algebra above still holds, because it only ever uses b2\frac{b}{2} multiplied by 22 or by itself, and a square is positive either way.

Completing the square with a constant

Most expressions also have a constant term, x2+bx+cx^2 + bx + c. Add the corner and take it away again, so the value does not change:

x2+bx+c=(x+b2)2−(b2)2+c=(x+b2)2+(c−b24).x^2 + bx + c = \left(x + \frac{b}{2}\right)^2 - \left(\frac{b}{2}\right)^2 + c = \left(x + \frac{b}{2}\right)^2 + \left(c - \frac{b^2}{4}\right).

The bracket is the perfect square. The constant left over, c−b24c - \frac{b^2}{4}, is the correction for adding a corner the expression did not have. Nothing new is happening: you added (b2)2\left(\frac{b}{2}\right)^2 and then subtracted it.

Check your understanding

  1. What number do you add to x2+10xx^2 + 10x to make a perfect square? Write the perfect square as well.
  2. Expand (x−5)2(x - 5)^2. What number do you add to x2−10xx^2 - 10x to make a perfect square?
  3. In the picture the two strips together have area bxbx, even though each strip is only b2\frac{b}{2} wide. Explain why.
Answers
  1. Half of 1010 is 55, and 52=255^2 = 25. Add 2525: x2+10x+25=(x+5)2x^2 + 10x + 25 = (x + 5)^2.
  2. (x−5)2=x2−10x+25(x - 5)^2 = x^2 - 10x + 25, so add 2525. The coefficient is negative, but the number added is (−5)2=25(-5)^2 = 25, which is positive.
  3. Each strip has area b2×x=bx2\frac{b}{2} \times x = \frac{bx}{2}, and there are two strips, so together they have area bx2+bx2=bx\frac{bx}{2} + \frac{bx}{2} = bx. The coefficient bb is shared between the two strips.

A common error

The number you add is the square of half the coefficient. It is not b2\frac{b}{2} itself.

For x2+6xx^2 + 6x, half of 66 is 33, and the number to add is 99:

x2+6x+9=(x+3)2.x^2 + 6x + 9 = (x + 3)^2.

Adding 33 instead gives x2+6x+3x^2 + 6x + 3, which is not a square.

The other trap is the sign inside the bracket. Half of −6-6 is −3-3, so the bracket is (x−3)2(x - 3)^2, not (x+3)2(x + 3)^2. Expand to check: (x−3)2=x2−6x+9(x - 3)^2 = x^2 - 6x + 9, which matches.

Settings

Colour scheme

Applies to every book you read here.

Reading theme

Applies to every book you read here.