I’m currently working on a post about continued fractions but it’s ended up taking a lot of time to complete, so while I work on that, here’s a post about a neat way to solve quadratic equations which you might not have seen before.

A quadratic equation is an equation of the form

$a x^2 + b x + c = 0,$

where $a$, $b$ and $c$ are real numbers (called the coefficients), $a \ne 0$ and $x$ is a variable. The solution is given by the well-known quadratic formula,

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

The usual method of deriving this formula is a process called “completing the square”, which takes advantage of the identity

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

allowing the solution to be found by rearrangement. However, there is an alternative method which is interesting because it can be generalised to solve polynomial equations of greater degree. This method takes advantage of the fact that for every pair of real numbers $\alpha$ and $\beta$,

$a (x - \alpha) (x - \beta) = a x^2 + b x + c$

if and only if $\alpha$ and $\beta$ are the solutions. The left-hand side expands out to $a x^2 - a (\alpha + \beta) x + a \alpha \beta$, so if this is the case, it must be the case that $\alpha + \beta = -\frac b a$ (so that $b = -a (\alpha + \beta)$) and $\alpha \beta = \frac c a$ (so that $a \alpha \beta = c$). So we know the sum and the product of the solutions, but not their actual values.

Now, since we know the sum of the solutions, if we can also find the difference of the solutions, we will be able to find each solution, because $(\alpha + \beta) + (\alpha - \beta) = 2 \alpha$ and $(\alpha + \beta) - (\alpha - \beta) = 2 \beta$. And we can find the difference, since we know the product of the solutions, by looking at the squares of the sum and difference. We have $(\alpha + \beta)^2 = \alpha^2 + \beta^2 + 2 \alpha \beta$ and $(\alpha - \beta)^2 = \alpha^2 + \beta^2 - 2 \alpha \beta$. Therefore

$\begin{array}{rcl} (\alpha - \beta)^2 &=& (\alpha + \beta)^2 + 4 \alpha \beta \\ &=& \left( -\frac b a \right)^2 + 4 \frac c a \\ &=& \frac {b^2} {a^2} + \frac {4 c} a \\ &=& \frac {b^2 - 4 a c} {a^2} \\ \alpha - \beta &=& \pm \sqrt{\frac {b^2 - 4 a c} {a^2}} \\ &=& \pm \frac {\sqrt{b^2 - 4 a c}} a. \end{array}$

Therefore

$\begin{array}{rcl} 2 \alpha &=& (\alpha + \beta) + (\alpha - \beta) \\ &=& -\frac b a \pm \frac {\sqrt{b^2 - 4 a c}} a \\ &=& \frac {-b \pm \sqrt{b^2 - 4 a c}} a \\ \alpha &=& \frac {-b \pm + \sqrt{b^2 - 4 a c}} {2 a} \end{array}$

$\begin{array}{rcl} 2 \beta &=& (\alpha + \beta) - (\alpha - \beta) \\ &=& -\frac b a \mp \frac {\sqrt{b^2 - 4 a c}} a \\ &=& \frac {-b \mp \sqrt{b^2 - 4 a c}} a \\ \beta &=& \frac {-b \mp + \sqrt{b^2 - 4 a c}} {2 a} \end{array}$

and we have the solutions.