Completing the square

Completing the square

Quite often, it is not immediately obvious how to factor the quadratic equation. For example, it is not easy at all to see how to factor $x^2+3x-5=0$, since the solutions are $x=\frac{-3+\sqrt{29}}{2}$ and $x=\frac{-3-\sqrt{29}}{2}$.

For these cases the method of completing the square can be used. This method works in every case. It makes use of the algebraic identity of the perfect square $x^2 +2kx+k^2 = (x+k)^2$.

For example, $x^2 +4x+4 = (x+2)^2$ and $x^2 -10x+25 = (x-5)^2$.

Note that in these examples the constant term is the square of half the coefficient of the x term. Completing the square literally means to add a number so that the quadratic expression can be written as a perfect square.

Take a look at the following graphical representation of completing the square. A factor of $(\frac{b}{2})^2$ is added to literally complete the square.

If that’s not clear yet, maybe this nice animation will clear things up.

Let’s take a look at the quadratic equation $x^2+3x+1=0$. Consider the terms with an x only. In this case $x^2+3x$. What number do we need to add to turn the expression into a perfect square? The square of half the coefficient of the x term, hence $(\frac{3}{2})^2=\frac{9}{4}$.

To solve a quadratic equation the following steps should be taken:

1. Move the constant to the other side
2. Add a factor of $(\frac{b}{2})^2$ to both sides of the equation
3. Write the perfect square, so that $x$ appears only once in the complete equation
4. Take the square root of both sides
5. Write down the solution(s)

Example
Let’s try it on the quadratic equation $x^2+3x+1=0$.
Bring the constant to the other side
$$x^2+3x=-1$$ Add a factor of $(\frac{b}{2})^2$ to both sides of the equation
$$x^2+3x+\left(\frac{3}{2}\right)^2=-1+\left(\frac{3}{2}\right)^2$$ Simplify
$$x^2+3x+\frac{9}{4}=-1+\frac{9}{4}=\frac{5}{4}$$ Write the perfect square, so that $x$ appears only once in the complete equation
$$\left(x+\frac{3}{2}\right)^2=\frac{5}{4}$$ Take the square root of both sides
$$x+\frac{3}{2}=\pm \sqrt{\frac{5}{4}}$$ Write down the solutions
$$x=-\frac{3}{2} + \sqrt{\frac{5}{4}}~\text{or}~ x=-\frac{3}{2} – \sqrt{\frac{5}{4}}$$

A great advantage of the method of completing the square is that, unlike factoring, it works for irrational and complex roots as well.

Example
Let’s solve the quadratic equation $2x^2+4x+4=0$
First divide everything by 2
$$x^2 +2x+2=0$$ Bring the constant to the other side
$$x^2 +2x=-2$$ Add a factor of $(\frac{b}{2})^2$ to both sides of the equation
$$x^2+2x +1 =-2+1$$ Write the perfect square
$$(x+1)^2=-1$$ Take the square root of both sides
$$x+1 =\pm \sqrt{-1}$$ Bring the constant to the right
$$x= -1\pm \sqrt{-1}$$ Finally simplify the root by using the identity $i^2=-1$
$$x=-1\pm i$$