# Solving Quadratic Equations by Completing the Square Not all quadratics factorise easily. For instance, $x^2+6x+2$ cannot be factorised by simple factorisation. In other words, we cannot write $x^2+6x+2$ in the form $(x-a)(x-b)$ where $a$ and $b$ are rational.

An alternative way to solve this equation $x^2+6x+2$ is by completing the square.

Equations of the form $ax^2+bx+c$ can be converted to the form $a(x+p)^2=q$ from which the solutions are easy to obtain.

\begin{align} \displaystyle \require{color} x^2+6x+2 &= 0 \\ x^2+6x &= -2 \\ x^2+6x \color{red}+ 3^2 \require{green} &= -2 \color{red}+3^2 \\ (x+3)^2 &= 7 \\ x+3 &= \pm \sqrt{7} \\ \therefore x &= -3 \pm \sqrt{7} \\ \end{align}

### Example 1

Solve $(x-2)^2=5$ for $x$.

\begin{align} \displaystyle (x-2)^2 &= 5 \\ x-2 &= \pm \sqrt{5} \\ \therefore x &= 2 \pm \sqrt{5} \\ \end{align}

### Example 2

Solve $(x+4)^2=-1$ for $x$.

This equation has no real solutions since the square $(x+4)^2$ cannot be negative.

### Example 3

Solve $x^2 + 8x -2= 0$ for $x$.

\begin{align} \displaystyle x^2 + 8x -2 &= 0 \\ x^2 + 8x &= 2 \\ x^2 + 8x + 4^2 &= 2 + 4^2 \\ (x+4)^2 &= 18 \\ x+4 &= \pm \sqrt{18} \\ x+4 &= \pm 3\sqrt{2} \\ \therefore x &= -4 \pm 3\sqrt{2} \\ \end{align}

### Example 4

Solve $2x^2 – 8x +1= 0$ for $x$.

\begin{align} \displaystyle 2x^2 – 8x +1 &= 0 \\ 2x^2 – 8x &= -1 \\ x^2 – 4x &= -\dfrac{1}{2} \\ x^2 – 4x + 2^2 &= -\dfrac{1}{2} + 2^2 \\ (x-2)^2 &= \dfrac{7}{2} \\ x-2 &= \pm \sqrt{\dfrac{7}{2}} \\ \therefore x &= 2\pm \sqrt{\dfrac{7}{2}} \\ \end{align} 