Completing the square is a technique of elementary algebra wherein an expression

is replaced by one of the form

Specifically, we have

See quadratic formula for the application to the problem of solving the quadratic equation.

Example

Consider the problem of finding this antiderivative:

The denominator is

Adding (10/2)2 = 25 to x2 - 10x gives a perfect square x2 - 10x + 25 = (x - 5)2. So we get

Our integral becomes

Completing the square reduces any problem involving a quadratic polynomial to one involving a quadractic polynomial with no 1st-degree term.