# Completing the square

Completing the square is a method for solving for the roots of the general quadratic equation:

ax2 + bx + c = 0, where $a \ne 0$

It is first taught using equations with "friendly" numbers in place of a, b, and c to get the student used to the process.

What one does is add and multiply by various carefully chosen constants to create an equation of the form:
d2x2 + 2dex + e2 = f where d, e and f are constants expressed in a, b, and c.
This resolves to:
(dx + e)2 = f (grouping)
$dx + e = \pm \sqrt{f}$ (take square root)
$dx = -e \pm \sqrt{f}$ (subtract e)
$x = \frac{-e \pm \sqrt{f}}{d}$ (divide by e)

By then applying the process to the general equation, we can derive the quadratic formula:

ax2 + bx + c = 0 (given)
4a2x2 + 4abx + 4ac = 0 (multiply by 4a)
4a2x2 + 4abx = − 4ac (subtract 4ac)
4a2x2 + 4abx + b2 = − 4ac + b2 (add b^2)
(2ax + b)2 = b2 − 4ac (group each side)
$2ax + b = \pm \sqrt{b^2 - 4ac}$ (take square root, allow for both roots)
$2ax = -b \pm \sqrt{b^2 - 4ac}$ (subtract b)
$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$ (divide by 2a)

We can now determine the real or imaginary roots of any quadratic equation by simply inserting a, b, and c into the formula.