# How are completing the square and quadratic formula related?

Jun 10, 2015

The quadratic formula can be deduced from generically completing the square.

#### Explanation:

Given a generic quadratic equation:

$f \left(x\right) = a {x}^{2} + b x + c = 0$

Notice that:

$a {\left(x + \frac{b}{2 a}\right)}^{2} = a \left({x}^{2} + 2 \frac{b}{2 a} x + {b}^{2} / {\left(2 a\right)}^{2}\right)$

$= a {x}^{2} + b x + {b}^{2} / \left(4 a\right)$

So

$f \left(x\right) = a {x}^{2} + b x + c = a {\left(x + \frac{b}{2 a}\right)}^{2} + \left(c - {b}^{2} / \left(4 a\right)\right)$

If $f \left(x\right) = 0$ then

$a {\left(x + \frac{b}{2 a}\right)}^{2} + \left(c - {b}^{2} / \left(4 a\right)\right) = 0$

Add $\left({b}^{2} / \left(4 a\right) - c\right)$ to both sides to get:

$a {\left(x + \frac{b}{2 a}\right)}^{2} = \left({b}^{2} / \left(4 a\right) - c\right) = \frac{{b}^{2} - 4 a c}{4 a}$

Divide both sides by $a$ to get:

${\left(x + \frac{b}{2 a}\right)}^{2} = \frac{{b}^{2} - 4 a c}{4 {a}^{2}} = \frac{{b}^{2} - 4 a c}{{\left(2 a\right)}^{2}}$

Hence:

$x + \frac{b}{2 a} = \pm \sqrt{\frac{{b}^{2} - 4 a c}{{\left(2 a\right)}^{2}}} = \pm \frac{\sqrt{{b}^{2} - 4 a c}}{2 a}$

Subtract $\frac{b}{2 a}$ from both sides to get:

$x = \frac{- b \pm \sqrt{{b}^{2} - 4 a c}}{2 a}$