Solving Quadratic Equations by Completing the Square

Here, we discuss how you can quickly and easily solve a quadratic equation with the method of completing the square. Examples of solutions are included!

What is completing the square?

We've already introduced this method in our completing the square calculator, but it's always good to have a quick refresher, isn't it?

OK. Completing the square is a method in mathematics (in algebra, to be precise) that we use to solve quadratic equations (or equivalently, to factor quadratic trinomials). It's an alternative method to using the quadratic formula calculator. The goal is to obtain a perfect square (this notion is explained in depth in our perfect square trinomial calculator) on the left side of the equation (where we have the unknown x x x ) and a number on the right side. That is, we transform the equation

a x 2 + b x + c = 0 ax^2 +bx + c = 0 a x 2 + b x + c = 0 a ( x + d ) 2 = e a(x+d)^2 = e a ( x + d ) 2 = e ( x + d ) 2 = e / a (x+d)^2 = e/a ( x + d ) 2 = e / a

where a a a , b b b , c c c , d d d , and e e e are real coefficients. Next, we take a look at the right-hand side:

What is a quadratic equation?

In math, a quadratic equation is an equation where a value of x x x is desired so that a quadratic polynomial (a polynomial of degree 2 2 2 ) is equal to zero:

a x 2 + b x + c = 0 ax^2+bx+c=0 a x 2 + b x + c = 0

where a a a , b b b , and c c c are real coefficients. If the right side is not zero (i.e. a x 2 + b x + c = w ax^2+bx+c = w a x 2 + b x + c = w and w ≠ 0 w \ne 0 w  = 0 ), you can always transfer to the left side to get the form given above:

a x 2 + b x + ( c − w ) = 0 ax^2 + bx + (c-w) = 0 a x 2 + b x + ( c − w ) = 0

Why 'complete the square'?

This method is called "complete the square" because we are hunting for perfect square trinomials. Formally, we want to transform the expression x 2 + b x + c x^2+bx+c x 2 + b x + c so as to obtain ( x + d ) 2 (x+d)^2 ( x + d ) 2 , which is a trinomial that arises from squaring a linear binomial x + d x+d x + d . We can then apply the square root to both sides of the equation to solve the initial equation.

Completing the square formula

In order to solve a quadratic equation by completing the square, follow these steps:

  1. If the leading coefficient of your quadratic equation is not 1 1 1 (i.e., if the polynomial is not monic), then divide both sides by a a a .
  2. Assume we have the expression x 2 + b x + c = 0 x^2 + bx + c = 0 x 2 + b x + c = 0 . Observe that ( x + b / 2 ) 2 = x 2 + b x + b 2 / 4 (x+b/2)^2 = x^2 + bx +b^2/4 ( x + b /2 ) 2 = x 2 + b x + b 2 /4 . The first two terms are the same, but the last terms differ.
  3. To get from c c c to b 2 / 4 b^2/4 b 2 /4 , we have to subtract c c c and add b 2 / 4 b^2/4 b 2 /4 . Observe that ( x 2 + b x + c ) − c + b 2 / 4 = ( x + b / 2 ) 2 (x^2 + bx + c) - c + b^2/4 = (x+b/2)^2 ( x 2 + b x + c ) − c + b 2 /4 = ( x + b /2 ) 2 .
  4. We have to perform the same operation on the right side! Finally, our equation is equivalent to ( x + b / 2 ) 2 = − c + b 2 / 4 (x+b/2)^2 = -c + b^2/4 ( x + b /2 ) 2 = − c + b 2 /4 .
  5. The next step depends on the sign of the right-hand side:

How do you know when to apply complete the square formula?

Completing the square is a method of solving quadratic equations that always works — even if the coefficients are irrational or if the equation does not have real roots!

It's up to you to decide whether you want to deal with a given quadratic expression by using the quadratic formula, or by the method of completing the square. There are many quadratic equations for which the latter is much faster and more elegant — you just need to gain a bit of experience to be able to quickly choose the best method.

Examples of completing the square

Let's discuss a few examples of solving quadratic equations by completing the square.

Example 1. Solve by completing the square: x 2 + 4 x + 4 = 0 x^2 + 4x + 4 = 0 x 2 + 4 x + 4 = 0 .

We immediately recognize the short multiplication formula working in reverse: ( x + 2 ) 2 = x 2 + 4 x + 4 (x+2)^2 =x^2 + 4x + 4 ( x + 2 ) 2 = x 2 + 4 x + 4 . Thus, our problem can be rewritten as ( x + 2 ) 2 = 0 (x+2)^2 = 0 ( x + 2 ) 2 = 0 .

Since 0 = 0 \sqrt = 0 0

​ = 0 , we get x + 2 = 0 x+2=0 x + 2 = 0 and therefore x = − 2 x = -2 x = − 2 . In fact, in this example we didn't have to complete the square, because the perfect square trinomial was already there, staring at us defiantly!

Example 2. Solve using the completing the square method: x 2 + 6 x + 5 = 0 x^2 + 6x + 5 = 0 x 2 + 6 x + 5 = 0 .

Let's take a look at the part containing the unknown x x x we have x 2 + 6 x x^2 + 6x x 2 + 6 x . To produce these terms by squaring a linear binomial, we can use: ( x + 3 ) 2 = x 2 + 6 x + 9 (x + 3)^2 = x^2 + 6x + 9 ( x + 3 ) 2 = x 2 + 6 x + 9 .

As you can see, the third term doesn't agree with what we have in our equations, so we need to complete the square. We have 5 5 5 in the original equation and 9 9 9 in the perfect square. So let's add 4 4 4 to both sides of the initial equation:

x 2 + 6 x + 5 + 4 = 0 + 4 x 2 + 6 x + 9 = 4 ( x + 3 ) 2 = 4 ∣ x + 3 ∣ = 2 x + 3 = ± 2 ∴ x = − 1 or x = − 5 \begin x^2 + 6x + 5 + 4 &= 0 + 4 \\ x^2 + 6x + 9 &= 4 \\ (x + 3)^2 &= 4 \\ |x + 3| &= 2 \\ x + 3 &= \pm 2 \\ \therefore\qquad x &= -1 \\ \text < or >x &= -5 \\ \end x 2 + 6 x + 5 + 4 x 2 + 6 x + 9 ( x + 3 ) 2 ∣ x + 3∣ x + 3 ∴ x or x ​ = 0 + 4 = 4 = 4 = 2 = ± 2 = − 1 = − 5 ​

Example 3. Solve by completing the square: x 2 − 2 x + 4 = 0 x^2 - 2x + 4 = 0 x 2 − 2 x + 4 = 0 .

At the left side, we easily recognize x 2 − 2 x x^2 - 2x x 2 − 2 x as part of the perfect square trinomial x 2 − 2 x + 1 = ( x − 1 ) 2 x^2 - 2x + 1 = (x-1)^2 x 2 − 2 x + 1 = ( x − 1 ) 2 . However, we have 4 4 4 in our equation while we need 1 1 1 . So let's subtract 3 3 3 from both sides:

x 2 − 2 x + 4 − 3 = − 3 x 2 − 2 x + 1 = − 3 ( x − 1 ) 2 = − 3 \begin x^2 - 2x + 4 - 3 &= -3 \\ x^2 - 2x + 1 &= -3 \\ (x - 1)^2 &= -3 \\ \end x 2 − 2 x + 4 − 3 x 2 − 2 x + 1 ( x − 1 ) 2 ​ = − 3 = − 3 = − 3 ​

Ouch. The equation says that some number squared (represented by the left-hand side of the equation) should be equal to − 3 -3 − 3 . The problem is, squaring always leads to non-negative numbers! Therefore, we can deduce that our equation has no solutions (in real numbers).