# Solving Quadratic Equations by Completing the Square

Created by Anna Szczepanek, PhD
Reviewed by Rijk de Wet
Last updated: Feb 02, 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 $x$) and a number on the right side. That is, we transform the equation

$ax^2 +bx + c = 0$

to

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

and further to

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

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

• If $e/a \ge 0$ (i.e., $e/a$ is non-negative), we simplify and solve the equation by taking the square root of both sides.
• If $e/a < 0$ (i.e., $e/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 $x$ is desired so that a quadratic polynomial (a polynomial of degree $2$) is equal to zero:

$ax^2+bx+c=0$

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

$ax^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 $x^2+bx+c$ so as to obtain $(x+d)^2$, which is a trinomial that arises from squaring a linear binomial $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$ (i.e., if the polynomial is not monic), then divide both sides by $a$.

2. Assume we have the expression $x^2 + bx + c = 0$. Observe that $(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 $c$ to $b^2/4$, we have to subtract $c$ and add $b^2/4$. Observe that $(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 + b^2/4$.

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

• If $b^2/4 > c$, then there's no solution.
• If $b^2/4 = c$, then we have one solution, and it is equal to $-b/2$.
• If $b^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: $x^2 + 4x + 4 = 0$.

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

Since $\sqrt{0} = 0$, we get $x+2=0$ and therefore $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 + 6x + 5 = 0$.

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

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

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

$\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$. 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
a
b
c
People also viewedβ¦

### Arc length

Our arc length calculator can calculate the length of an arc of a circle and the area of a sector.

### Car vs. Bike

Everyone knows biking is fantastic, but only this Car vs. Bike Calculator turns biking hours into trees! π³

### Pizza size

This calculator will help you make the most delicious choice when ordering pizza.

### Trapezoid perimeter

Find the perimeter of a trapezoid with any of the possible combination of inputs with our trapezoid perimeter calculator!