A while ago, I read an article about an “amazing trick” that makes it easier to solve quadratic equations. I couldn't remember the algebra, so I came up with a geometric memorization instead. I wrote a Jupyter notebook to explain it, but was never quite happy with it. When it stopped working because of a Google Colab library versioning issue, I redid it in JavaScript. Check it out—JavaScript is a good tool for story telling. The New York Times published this article about an "amazing trick" to make solving quadratic equations easier for middle school students. Instead of memorizing a dreary formula, students would derive it every time by using an easy and intuitive algorithm.

How easy and intuitive? When I tried to reconstruct it an hour later, I forgot and had to re-read the article. It seemed more trouble than just memorizing the formula.

And then I derived the quadratic formula in an instant after drawing three parabolas. That is where Loh (the professor at CMU who professes to being "completely shocked" after stumbling on what turned out to be an ancient Babylonian recipe) might have missed an opportunity. Instead of being seduced by the mystique of the ancient Babylonians, he could have turned to Descartes, the inventor of Cartesian coordinates. Read on to see how.

## The Meaning of c

First look at the curve y=x^2+c. Such a curve is called a parabola. Depending on c (play with the slider below), the curve is shifted up or down.

The parabola intersects the x-axis twice if c<0. Where are those intersection points? (We call the intersection points the zeroes of the parabola.)

If y=x^2+c=0, then x=−sqrt(-c) or x=sqrt(-c).

Also note that the lowest point of the parabola is at (0,c).

For example, if c=−4, then the lowest point of the parabola is at (0, -4) and the zeroes are (2, 0) and (-2, 0).

The origin (0, 0) is the midpoint between the two zeroes. In the graph above, we draw the distance from that midpoint to the lowest point below (green) and to the zero to the right (orange).

The length of the orange segment is the square root of the length of the green segment. Remember this.

## The Meaning of b

Next, let's look at the curve y=x^2+bx. How does its shape change when b changes? In the plot below, move the slider for b and observe where the parabola intersects the x-axis.

As you can see, the parabola intersects the x-axis at 0 and −b. That makes sense: If x is −b, then x^2+bx=(−b)^2+b(−b)=0.

And therefore the lowest point is halfway between, at x=−b/2. Remember this.

## And All Together

Now onto the more general equation y=x^2+bx+c.

It is no longer clear where the parabola intersects the x-axis. That is where the "quadratic formula" comes in.

The key is to first find the lowest point of the parabola. By symmetry, the x-value of the lowest point is halfway between the zeroes.

Note that the x-value of the lowest point doesn't depend on c. Changing c shifts the parabola up or down.

Remember where the lowest point is when c is 0? It is at −b/2, halfway between the zeroes 0 and −b.

And that's where the lowest point is always, also when c is not zero.

What about the zeroes? Let's draw those orange and green segments again.

We can compute the length of the orange segment by plugging in x=−b/2 into the formula y=x^2+bx+c.

y=x^2+bx+c=(−b/2)^2+b(−b/2)+c=−b^2/4+c

Then we know the length of the green segment. It's the square root of the length of the orange segment, sqrt(b^2/4−c). (We need to take the negative because the green segment is pointing downward.)

To get to the zeroes, take x=−b/2 and add/subtract the orange segment:

x_(1,2)=−b/2±sqrt(b^2/4−c)

Now we have derived the quadratic formula from geometry, not the algebraic mumbo-jumbo of "completing the square".

That's nice, but that's not what the middle schooler would do to solve an equation.

## The Middle School Student

Remember, the point of Loh's exercise is to avoid memorizing the quadratic formula. Instead, the middle schooler remembers:

• The midpoint between the zeroes is at -b/2
• The value of the function at that point is the downward length of the orange segment. Just plug in and take the negative.
• The length of the green segment is the square root. That's the distance from the midpoint and a zero.

Let's work the example from the article:

y=x^2−4x−5

The midpoint has x=−b/2=2.

Plug in to get y=2^2−4⋅2−5=−9.

The orange segment has length 9. The green segment has length sqrt(9)=3.

Take the midpoint and add/subtract the green segment to get the zeroes 2+3=5 and 2−3=−1.

I frankly have no idea whether this approach is helpful for middle school students. But if nothing else, it teaches a useful skill—correlating algebra and geometry.

## But Why?

Here is what really irked me about the article.

Why learn how to solve quadratic equations by hand at all? After all, we can just ask a computer.

When I was a middle school student, there were no personal computers and no Internet. We had to learn how to solve quadratic equations by hand because that was the only way. We didn't learn it for the math, but because it was a useful skill. Today's middle schoolers can be free from this particular drudgery. They could learn math skills that are useful for this century.

What are those skills, and how should they be taught? That's the question that we should really think about.

## Why not a Jupyter Notebook?

When I first prepared this material, I wanted to learn more about Jupyter notebooks and Sympy. Check out the notebook version.

First off, it doesn't work right now. There is some incompatibilty between the Sympy and Matplotlib versions that I don't know how to fix.

And even when it did work, while it was nice in theory to see the code, it was also pretty messy. All plotting code get messy quickly.

And if it works again for you, or you copy the code to another Jupyter instance, you'll see that the sliders are very jerky, not buttery smooth like the JavaScript sliders.

For curve plotting, the admirable JSXGraph served me well. There is no symbolic algebra system quite like Sympy for JavaScript...yet. Following Atwood's law (“anything that can be done in JavaScript will be done in JavaScript”), there may be one soon enough.