Omni Calculator logo

Solving Quadratic Equations by Completing the Square

Created by Anna Szczepanek, PhD
Reviewed by Rijk de Wet
Last updated: Nov 15, 2023


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 xx) and a number on the right side. That is, we transform the equation

ax2+bx+c=0ax^2 +bx + c = 0

to

a(x+d)2=ea(x+d)^2 = e

and further to

(x+d)2=e/a(x+d)^2 = e/a

where aa, bb, cc, dd, and ee are real coefficients. Next, we take a look at the right-hand side:

  • If e/aβ‰₯0e/a \ge 0 (i.e., e/ae/a is non-negative), we simplify and solve the equation by taking the square root of both sides.
  • If e/a<0e/a < 0 (i.e., e/ae/a is negative), then our equation has no solutions.

What is a quadratic equation?

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

ax2+bx+c=0ax^2+bx+c=0

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

ax2+bx+(cβˆ’w)=0ax^2 + bx + (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 x2+bx+cx^2+bx+c so as to obtain (x+d)2(x+d)^2, which is a trinomial that arises from squaring a linear binomial x+dx+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 11 (i.e., if the polynomial is not monic), then divide both sides by aa.

  2. Assume we have the expression x2+bx+c=0x^2 + bx + c = 0. Observe that (x+b/2)2=x2+bx+b2/4(x+b/2)^2 = x^2 + bx +b^2/4. The first two terms are the same, but the last terms differ.

  3. To get from cc to b2/4b^2/4, we have to subtract cc and add b2/4b^2/4. Observe that (x2+bx+c)βˆ’c+b2/4=(x+b/2)2(x^2 + bx + 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+b2/4(x+b/2)^2 = -c + b^2/4.

  5. The next step depends on the sign of the right-hand side:

    • If b2/4>cb^2/4 > c, then there's no solution.
    • If b2/4=cb^2/4 = c, then we have one solution, and it is equal to βˆ’b/2-b/2.
    • If b2/4<cb^2/4 < c, then there are two solutions and you can find them by taking the square root of both sides.

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: x2+4x+4=0x^2 + 4x + 4 = 0.

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

Since 0=0\sqrt{0} = 0, we get x+2=0x+2=0 and therefore x=βˆ’2x = -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: x2+6x+5=0x^2 + 6x + 5 = 0.

Let's take a look at the part containing the unknown xx we have x2+6xx^2 + 6x. To produce these terms by squaring a linear binomial, we can use: (x+3)2=x2+6x+9(x + 3)^2 = x^2 + 6x + 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 55 in the original equation and 99 in the perfect square. So let's add 44 to both sides of the initial equation:

x2+6x+5+4=0+4x2+6x+9=4(x+3)2=4∣x+3∣=2x+3=Β±2∴x=βˆ’1 or x=βˆ’5\begin{split} 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{split}

Example 3. Solve by completing the square: x2βˆ’2x+4=0x^2 - 2x + 4 = 0.

At the left side, we easily recognize x2βˆ’2xx^2 - 2x as part of the perfect square trinomial x2βˆ’2x+1=(xβˆ’1)2x^2 - 2x + 1 = (x-1)^2. However, we have 44 in our equation while we need 11. So let's subtract 33 from both sides:

x2βˆ’2x+4βˆ’3=βˆ’3x2βˆ’2x+1=βˆ’3(xβˆ’1)2=βˆ’3\begin{split} x^2 - 2x + 4 - 3 &= -3 \\ x^2 - 2x + 1 &= -3 \\ (x - 1)^2 &= -3 \\ \end{split}

Ouch. The equation says that some number squared (represented by the left-hand side of the equation) should be equal to βˆ’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).

Anna Szczepanek, PhD
We will solve the quadratic equation
ax2 + bx + c = 0
Enter your respective coefficients:
a
b
c
Check out 40 similar algebra calculators πŸ”‘
Absolute value equationAbsolute value inequalitiesAdding and subtracting polynomials… 37 more
People also viewed…

Golden rectangle

Golden rectangle calculator determines the missing side and area of a golden rectangle.

Ideal egg boiling

Quantum physicist's take on boiling the perfect egg. Includes times for quarter and half-boiled eggs.

Right circular cone

This right circular cone calc finds a (area), v (volume), a_l (lateral area) and a_b (base area) of a right circular cone.

Secretary problem (Valentine's day)

Use the dating theory calculator to enhance your chances of picking the best lifetime partner.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service