It’s useful to think of “completing the square” as short for “completing the perfect square trinomial”.

First, recall that a perfect square is a number whose square root is an integer. The easiest way to think of perfect squares is to square the counting numbers:

12,22,32,42,52,...1^2, 2^2, 3^2, 4^2, 5^2, ...

A perfect square trinomial is a polynomial whose square root is a binomial. The easiest way to think of perfect square trinomials is to square the binomials obtained by adding counting numbers to a variable xx:

(x+1)2,(x+1)^2, (x+2)2,(x+2)^2, (x+3)2,(x+3)^2, (x+4)2,(x+4)^2, (x+5)2,(x+5)^2, \vdots

Recall that to square something is to multiply it by itself:

[x+1](x+1),[x + 1](x + 1), [x+2](x+2),[x + 2](x + 2), [x+3](x+3),[x + 3](x + 3), [x+4](x+4),[x + 4](x + 4), [x+5](x+5),[x + 5](x + 5), \vdots

Let’s distribute the second factor into the first factor:

[x(x+1)+1(x+1)],[ x(x+1) + 1(x+1) ], [x(x+2)+2(x+2)],[ x(x+2) + 2(x+2) ], [x(x+3)+3(x+3)],[ x(x+3) + 3(x+3) ], [x(x+4)+4(x+4)],[ x(x+4) + 4(x+4) ], [x(x+5)+5(x+5)],[ x(x+5) + 5(x+5) ], \vdots

Now further distribute:

[x2+1x+1x+1],[ x^2 + 1x + 1x + 1 ], [x2+2x+2x+4],[ x^2 + 2x + 2x + 4 ], [x2+3x+3x+9],[ x^2 + 3x + 3x + 9 ], [x2+4x+4x+16],[ x^2 + 4x + 4x + 16 ], [x2+5x+5x+25],[ x^2 + 5x + 5x + 25 ], \vdots

Finally, combine like terms:

x2+2x+1,x^2 + 2x + 1, x2+4x+4,x^2 + 4x + 4, x2+6x+9,x^2 + 6x + 9, x2+8x+16,x^2 + 8x + 16, x2+10x+25,x^2 + 10x + 25, \vdots

We see the general pattern for the square of a monomial of the form x+bx + b would then be

x2+2bx+b2x^2 + 2bx + b^2

So, a perfect square trinomial must, by definition, be able to be written as the square of some binomial. We just saw that if we square any monomial of the form x+bx + b, a perfect square trinomial of the form x2+2bx+b2x^2 + 2bx + b^2 emerges. This tells us that if we run into a quadratic polynomial of the form x2+2bxx^2 + 2bx, we should add b2b^2 to complete the square. In words, we add the square of half the xx coefficient.

The monomial x+bx + b is pretty general, but ax+bax + b is even more general. Think of them as the same, but in the first one we assumed a=1a = 1.

(ax+b)2=[ax+b](ax+b)=[ax(ax+b)+b(ax+b)]=[a2x2+abx+abx+b2]=a2x2+2abx+b2\begin{alignedat}{1} (ax + b)^2 &= [ax + b](ax + b)\\ &= [ax(ax + b) + b(ax + b)]\\ &= [a^2x^2 + abx + abx + b^2]\\ &= a^2x^2 + 2abx + b^2\\ \end{alignedat}

At this point, just remind yourself that if a=0a = 0, the equation would reduce to b2=b2b^2 = b^2. So let’s assume a0a \neq 0, which means a20a^2 \neq 0. We are now able to divide both sides by a2a^2:

(ax+b)2=a2x2+2abx+b2(ax+b)2a2=a2x2+2abx+b2a2(ax+ba)2=a2x2a2+2abxa2+b2a2(x+ba)2=x2+2bax+(ba)2\begin{alignedat}{1} (ax + b)^2 &= a^2x^2 + 2abx + b^2\\ \frac{(ax + b)^2}{a^2} &= \frac{a^2x^2 + 2abx + b^2}{a^2}\\ \bigg(\frac{ax + b}{a}\bigg)^2 &= \frac{a^2x^2}{a^2} + \frac{2abx}{a^2} + \frac{b^2}{a^2}\\ \bigg(x + \frac{b}{a}\bigg)^2 &= x^2 + 2\frac{b}{a}x + \bigg(\frac{b}{a}\bigg)^2\\ \end{alignedat}

The thing we need to notice here is that on the right hand side, the constant term is the square of half the coefficient of xx . Thus, to complete the square,

  1. Divide by the coefficient of x2x^2.
  2. Identify the new coefficient of xx, cut it in half, square it, then add it.
  3. What you have can now be rewritten as a perfect square trinomial.

To understand this in full generality, let’s try it with the quadratic polynomial ax2+bxax^2 + bx.

  1. x2+baxx^2 + \frac{b}{a}x
  2. x2+bax+(b2a)2x^2 + \frac{b}{a}x + \big( \frac{b}{2a} \big)^2
  3. (x+b2a)2\big( x + \frac{b}{2a} \big)^2