How To Execute The Quadratic Equation Magic Trick? - An image showing the following equation: ax² + bx + c. Below the equation, the following three questions are asked one below the other: a = ??; b = ??; c = ??

The quadratic equation magic trick is not your usual run-of-the-mill math trick. It raises the bar a couple of notches. Usually, mathematical magic tricks start with you asking someone to think of a number in their head. In this case, you ask them to think of an entire formula in their head.

The only requirement you impose is that it has to be a quadrating formula (an equation which features its highest variable power as x²). Following this, you ask them to work out the output value of the formula for following inputs: x = 0, x = 1, and x = 2.

Once the person reveals the respective output values to you (not the formula), you think for a moment, and then reveal the equation that the person had originally thought of. That is the trick!

In this essay, I will first cover how you can execute this trick. Then, I will explain why the trick works and touch upon the deeper mathematical principle that enables this trick. Let us begin.

This essay is supported by Generatebg

A product with a beautiful background featuring the sponsor: Generatebg - a service that generates high-resolution backgrounds in just one click. The description says "No more costly photographers" and displays a "Get Started" button beneath the description.

How to Execute the Quadratic Equation Magic Trick

Let us first assume that the person playing the game with you has chosen the following equation in their head:

7x² — 4x + 2

Correspondingly, the person reveals the following output values to you for x = 0, x = 1, and x = 2 respectively:

2, 5, and 22.

Once you have this, your job is to arrive at the original equation using these three values only. Here’s how you do it.

The Inverted Pyramid

First, you will need to write down the three numbers in a row. Next, you will need to write down the first row of differences, where you subtract the number on the left from the number on the right. Finally, you will need to write down the second row of differences where you follow the same procedure. You will end up with an inverted pyramid as follows:

How To Execute The Quadratic Equation Magic Trick? — An image showing three rows: Output values →2,5,22; First row of differences → 3 (5–2), 17 (22–5); Second row of differences → 14 (17–3)
Math illustrated by the author

Once you have this, the lowermost number (tip of the inverted pyramid) gives you twice the value of the coefficient of x² (‘a’). In our case, it turns out to be 7. So far, so good. Now, take the leading number from the second row of the inverted pyramid.

Then, subtract the value of ‘a’ (coefficient of x²) from it. This gives us the value of ‘b’ (coefficient of x). In our case, this turns out to be -4. Finally, the leading number on the top row gives us the value of ‘c’ (the constant in the equation).

How To Execute The Quadratic Equation Magic Trick? — An image which shows the pyramid from before. The bottom most digit is 14; 14=2a. Therefore, a = 7. The leading digit in the second row is 3; b = 3-a = 3–7 = -4. The leading digit on the top row is 2; 2 = c. Therefore, the equation is 7x²-4x+2
Math illustrated by the author

There we go! That’s all there is to it. Naturally, this takes a little bit of practice to do in the head. But until then, you may even choose to work out the pyramid on a piece of paper. Your friends would still be impressed.

Now that you know how to execute the trick, let us take a peek at what is under the hood.


The Mathematics behind the Quadratic Equation Magic Trick

The mathematics behind this magic trick is called the calculus of finite differences. This field was formally pioneered by a mathematician named Brook Taylor (the man after which the Taylor series is named) in 1715. Traces of similar techniques existed even before Taylor.

Following him, mathematicians like George Boole (the man behind Boolean logic), L.M. Milne-Thomson, and Károly Jordan helped develop the field further.

The procedure we covered when executing the quadratic equation magic trick is similar to integration in calculus. We know that the output value (y) of the formula (quadratic equation) changes based on input value(x). Based on this, we could say that the equation expresses a function of y with respect to x.

We just took advantage of this fact by providing an arithmetic series as input (0,1,2…). This in turn gave us an output series (2, 5, 22…). The calculus of finite differences helps us to fit a function that passes through the output series (think of it as a curve that passes through points on a graph).

We used a technique that allows us to deduce the coefficient values based on a common pattern for all quadratic equations when we “march” through an arithmetic series. This result can be generalized and expanded, but I will save that for another essay.

Beyond Just Tricks

As you’d imagine, calculus of finite differences finds applications in many different fields, including statistics and social sciences. The trouble with some of these applications is that the function we deduce may change based on new data points discovered in the future. We end up with something that appears to be true until it is disproven with more data.

Apart from this, there are other cool applications that I would like to demonstrate in the said future essay. But in the context of the quadratic equation magic trick, this introduction should suffice.

Final Remarks

Ifyou had been perceptive enough, you would have realized that there is no hard limit on the order of the coefficients to this trick. It was my choice to limit the trick to a second-degree polynomial and call it the “quadratic equation magic trick.”

You may choose to call it the “cubic equation magic trick” and solve for third-degree polynomial equations. The higher the order, the more the difference-rows you will be needing, and the bigger the inverted pyramid will get. So, you have the option to up the stakes if you wish to.

By outlining this trick in this essay, I wish to motivate you to explore further possibilities with the calculus of finite differences. Let your creativity flow; math need not be a guided train on rails!


References and Credit: Walter Warwick Sawyer and Martin Gardner.

If you’d like to get notified when interesting content gets published here, consider subscribing.

Further reading that might interest you: How Much String Would You Need To Wrap The Earth? and Are We Living In A Simulation?

Street Science

Explore humanity's most curious questions!

Sign up to receive more of our awesome content in your inbox!

Select your update frequency:

We don’t spam! Read our privacy policy for more info.