Recently, I was solving some math contest problems1 from past competitions, and a few times, quadratic equations came up, which reminded me of the process of solving them.

While we’ve been taught the quadratic formula in school, the opaqueness of the formula and how it was always presented got me thinking as to where the formula comes from and how one might derive it, and as I was researching it further, I noticed an interesting approach publicized in 2019 by Po-Shen Loh and previously discovered and published in 1989 by John Savage2 in 1989 that makes it much more intuitive! This work by both mathematicians was also reported by the New York Times in 2020.

Let’s see how it works.

## Background#

For reference, here’s a graph of a quadratic function $y = x^2 - x - 2$:

The roots of this equation are the points on the curve passing through the $x$ axis, i.e., where $y = 0$.

When faced with finding the roots of a quadratic equation of the form:

$$ax^2 + bx + c = 0$$

we’ve been taught to follow one of these approaches:

1. go through the factorizations of $c$ and find the pair whose sum is $b$, considering only real-valued integral factors
2. failing the first option, use the quadratic formula

So, in the simple cases, we’re supposed to factor equations to find the roots, which is easy when they’re integral, e.g.,

$$x^2 + 5x - 24 = 0$$

can be factored (with some guessing and testing) as follows:

$$(x + 8)(x - 3) = 0$$

which provides us the roots directly as:

$$x = -8 \textrm{ or } x = 3$$

However, to get there, we had to go through the various factorizations of $-24$ to find the two that add up to $5$.

If we can’t follow the first approach, i.e., we can’t easily factor $c$ such that the sum of the factors is $b$, we need to remember this seemingly arbitrary formula, which is typically not derived when presented in an algebra class, so there’s no intuition behind it:

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

Where does this formula come from, anyway?

And moreover, is there an easier, more methodical way of solving the quadratic equation without guessing or applying a magical formula when all hope is lost?

## An alternative approach#

As I was researching the quadratic formula, I came upon a blog post (and paper) by Po-Shen Loh3, professor of mathematics at Carnegie Mellon University, who came up with a much simpler approach to solving quadratic equations from an intuitive basis without any guesswork, and as a side benefit, this approach lets you derive the quadratic formula we’ve all been taught to memorize.

Let’s take as an example another quadratic equation:

$$x^2 + 4x - 21 = 0$$

The main idea behind Po-Shen Loh’s approach is to work from the sum, rather than the product, as we did above.

First, we recognize that if the sum of two numbers is $s$, then their average is $\frac{s}{2}$, and we can represent the two numbers as $\left(\frac{s}{2} - k\right)$ and $\left(\frac{s}{2} + k\right)$.

Thus, in our case above, we have the sum $4$, which means that we can represent our two numbers as $(2-k)$ and $(2+k)$, and their product must satisfy:

\begin{align*} (2 - k)(2 + k) & = -21 \\ 4 - k^2 & = -21 \\ - k^2 & = -25 \\ k^2 & = 25 \\ k & = \pm \sqrt{25} = \pm 5 \\ \end{align*}

Thus, the two values for the factors are $(2 - 5) = -3$ and $(2 + 5) = 7$:

\begin{align*} (x - 3)(x + 7) & = x^2 -3x + 7x - 21 \\ & = x^2 + 4x - 21 \\ \end{align*}

Checks out! Thus, the roots are $x = 3$ or $x = 7$.

## Generalization of the approach#

In the example above, we ignored the coefficient of $x^2$ because it was $1$, so now, let’s consider the general case, for an equation of the form:

$$ax^2 + bx + c = 0$$

When $a \ne 0$, we can just divide both sides by $a$, which gives us:

$$x^2 + \frac{bx}{a} + \frac{c}{a} = 0$$

For notational convenience, let’s substute $B = \frac{b}{a}$ and $C = \frac{c}{a}$:

$$x^2 + Bx + C = 0$$

Now, we want to find a factoring of this equation into the form:

$$(x + m)(x + n) = 0$$

and our roots will be $x = -m$ and $x = -n$.

As above, we note that $m + n = B$ and $mn = C$. As per the above, the average of $m$ and $n$ is:

$$\frac{m + n}{2} = \frac{B}{2}$$

and hence, we can represent $m$ and $n$ as differences from the average $\frac{B}{2}$ as $\frac{B}{2} \pm k$:

$$m = \frac{B}{2} - k \textrm{ and } n = \frac{B}{2} + k$$

Notes:

1. It’s easy to validate that $m + n = B$ using this new formulation.
2. It doesn’t matter which of $m$ or $n$ gets the $+k$ or $-k$ term, since they are not an ordered pair.

Then, for the product, we have:

$$C = mn = \left(\frac{B}{2} - k\right) \left(\frac{B}{2} + k\right) = \frac{B^2}{4} - k^2$$

Solving for $k$, we have:

\begin{align*} \frac{B^2}{4} - k^2 & = C \\ -k^2 & = C - \frac{B^2}{4} \\ k^2 & = \frac{B^2}{4} - C \\ k & = \pm \sqrt{\frac{B^2}{4} - C} \\ \end{align*}

And thus, the values for $m$ and $n$ (which are interchangeable) are:

$$\frac{B}{2} \pm k = \frac{B}{2} \pm \sqrt{\frac{B^2}{4} - C}$$

Note that since our factorization is actually

$$(x + m)(x + n) = 0$$

the roots of the equation are actually the negated values of the final expression above:

$$x = -\frac{B}{2} \mp \sqrt{\frac{B^2}{4} - C}$$

As John Savage notes in his paper and Po-Shen Loh mentions in his blog post, this process works even when the roots of the equation are imaginary (using $i = \sqrt{-1}$), so there are no limitations to this approach.

If you thought that the roots of the equation we computed above:

$$x = -\frac{B}{2} \pm \sqrt{\frac{B^2}{4} - C}$$

were starting to vaguely look like the traditional quadratic formula, you’re right!

Aside: we’ve flipped the $\mp$ to $\pm$ for convenience, but we don’t actually care about the order, so this is not changing anything meaningful in the results, since our roots are interchangeable.

But why is it so different? Recall that we simplified our approach by dividing both sides of the equation by $a$ and replaced our lowercase coefficients with their uppercase equivalents. So let’s bring them back:

$$B = \frac{b}{a} \hspace{2em} C = \frac{c}{a}$$

and solve for $x$:

\begin{align*} x & = -\frac{B}{2} \pm \sqrt{\frac{B^2}{4} - C} \\ & = -\frac{b}{2a} \pm \sqrt{\frac{b^2}{4a^2} - \frac{c}{a}} \\ & = -\frac{b}{2a} \pm \sqrt{\frac{b^2}{4a^2} - \frac{4ac}{4a^2}} \\ & = -\frac{b}{2a} \pm \sqrt{\frac{b^2 - 4ac}{4a^2}} \\ & = -\frac{b}{2a} \pm \frac{\sqrt{b^2 - 4ac}}{\sqrt{4a^2}} \\ & = -\frac{b}{2a} \pm \frac{\sqrt{b^2 - 4ac}}{2a} \\ & = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \\ \end{align*}

And there we have it — the quadratic equation!

## Slightly more complex example#

In the example above, it worked out rather nicely for us, because the sum of components $4$ was even, so when we divided it in half, it remained an integer, and we ended up having a perfect square at the end, so we had a very easy way of computing the answer. What happens when that is not the case?

Let’s consider a slightly different equation:

$$2x^2 + 10x - 42 = 0$$

As noted above, we can first divide both sides by $a = 2$ to simplify our equation’s coefficients:

$$x^2 + 5x - 21 = 0$$

Here, the sum is $5$, so our two components are $(2.5 - k)$ and $(2.5 + k)$:

\begin{align*} (2.5 - k)(2.5 + k) & = -21 \\ 6.25 -k^2 & = -21 \\ -k^2 & = -27.25 \\ k^2 & = 27.25 \\ k & = \pm \sqrt{27.25} = \pm \sqrt{\frac{109}{4}} = \pm \frac{\sqrt{109}}{2} \\ \end{align*}

Thus, our two components are:

\begin{align*} m & = 2.5 + \frac{\sqrt{109}}{2} & = \frac{5 + \sqrt{109}}{2} \\ n & = 2.5 - \frac{\sqrt{109}}{2} & = \frac{5 - \sqrt{109}}{2} \\ \end{align*}

Note that we are done here; since we’ve produced a factoring of the form

$$(x + m)(x + n) = 0$$

the roots are $-m$ and $-n$, but we’ll continue with the verification step below.

Let’s see how this works out with $(x + m)(x + n)$ and see if we can reduce it to our original equation:

\begin{align*} (x + m)(x + n) & = \left(x + \frac{5 + \sqrt{109}}{2}\right) \left(x + \frac{5 - \sqrt{109}}{2}\right) \\ & = x^2 + \left(\frac{5 + \sqrt{109}}{2} + \frac{5 - \sqrt{109}}{2}\right)x + \left(\frac{5 + \sqrt{109}}{2}\right) \left(\frac{5 - \sqrt{109}}{2}\right) \\ & = x^2 + \left(\frac{5}{2} + \frac{5}{2}\right)x + \frac{25 - 109}{4} \\ & = x^2 + 5x - 21 \end{align*}

That looks right! Thus, the roots of this equation are:

$$x = -\frac{5 \pm \sqrt{109}}{2}$$

Let’s finally see how we would have applied the quadratic formula here as well with the original coefficients:

\begin{align*} 0 & = 2x^2 + 10x - 42 \\ x & = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \\ & = \frac{-10 \pm \sqrt{10^2 - 4 \cdot 2 \cdot (-42)}}{2 \cdot 2} \\ & = \frac{-10 \pm \sqrt{100 + 336}}{4} \\ & = \frac{-10 \pm \sqrt{436}}{4} \\ & = \frac{-10 \pm 2\sqrt{109}}{4} \\ & = \frac{-5 \pm \sqrt{109}}{2} \\ \end{align*}

Note that if we scale the coefficients up-front to ensure $a=1$, it’s even easier:

\begin{align*} 0 & = x^2 + 5x - 21 \\ x & = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \\ & = \frac{-5 \pm \sqrt{5^2 - 4 \cdot 1 \cdot (-21)}}{2 \cdot 1} \\ & = \frac{-5 \pm \sqrt{109}}{2} \\ \end{align*}

## Summary#

Now you can solve the quadratic equation whether or not you remember the quadratic formula, and you have an alternative way to approach solving it without having to guess the roots.

And hopefully, now you have a better intuition of where the quadratic formula comes from, so it’s less opaque for you now.

## References#

1. For example, the Art of Problem Solving wiki has a wide variety of problems from many math contests; it also has links to many other sources of math competition problems. ↩︎

2. Po-Shen Loh noted this earlier work in his follow-up post on related work of solving the quadratic equation. ↩︎

3. Po-Shen Loh has also been coaching the USA team competing in the International Mathematics Olympiad, which may be how I happened to find his blog post while reading about math contests and quadratic equations. ↩︎