## Completing the Square – Fast and Formal

Here is a strictly formal way to complete the square. We want to express $ax^2+bx+c$ in the form $a(x-h)^2+k$.  We may want to do this for many reasons, for example, to graph a quadratic function (parabola), to solve a quadratic equation, to integrate a rational function or to solve a differential equation.

If we expand $a(x-h)^2+k$, we get $ax^2-2ahx+ah^2+k$. If $ax^2+bx+c=ax^2-2ahx+ah^2+k$ for all $x$, and we know $a,b \text{ and } c$, we only need to solve two equations.  First solve $b = -2ah$ for $h$. Note we already know $a$.  Then solve $c = a^2h+k$ for $k$. Here we already know $a\text{ and } h$. Here are two examples.

Completing the Square Example I

Completing the Square Example II