If you have an expression, say
that you need to complete the square of, consider the following:
So we wish to add a number to our expression to put it in the above form.
So equate the coefficients of the linear terms:
According to the prescription, then, we need to add an to our to make it a perfect square. But what we add on one side, we must also subtract (so we're adding a net of zero to that side), thus: