Completing the square

This online calculator allows you to use completing the square technique to complete the square.

This online calculator applies completing the square technique to a quadratic polynomial, represented by its coefficients a, b and c. That is, it converts the quadratic polynomial of the form ax^2+bx+c to the form a(x-h)^2+k.

Theory and formulas can be found below the calculator.

PLANETCALC, Completing the square

Completing the square

Three quadratic polynomial coefficients, space separated, in order from higher term degree to lower
Completing the square

Completing the square.

As it was said above, completing a square is a technique for converting the form ax^2+bx+c of quadratic polynomial to the form a(x-h)^2+k.

Completing the square is used in

  • solving quadratic equations,
  • graphing quadratic functions,
  • evaluating integrals in calculus, such as Gaussian integrals with a linear term in the exponent,
  • finding Laplace transforms.

In mathematics, completing the square is often applied in any computation involving quadratic polynomials. Completing the square is also used to derive the quadratic formula.1

Formulas for h and k

Let's derive formulas for h and k coefficients. We know that the square of binomial is


Now let's factor out the coefficient a to get a monic quadratic polynomial.


We can write a square of binomial those two terms will be equal to the first two terms of quadratic polynomial:


It differs from quadratic polynomial only in the value of the constant term. Therefore


By adding constant, we complete the square hence the name of the technique.

Now we can restore a by multiplying both parts of the equality to a and finally write the equality like this.


k=c-\frac{b^2}{4a} \\\\ h=-\frac{b}{2a}

URL copiado para a área de transferência
PLANETCALC, Completing the square