The Most Beautiful Formula

Euler's equation \(e^{i \pi} + 1 = 0\) is often described as the most beautiful formula in mathematics. It's beautiful because it combines several fundamental mathematical ideas - the exponential function, imaginary numbers, pi, zero and unity, equality - in a surprising way.

However, it's hard to grasp what the equation means or how to picture it. Which is why the illustration from Martin Gardner's The Unexpected Hanging and Other Mathematical Diversions caught my eye (on page 42 in my copy; it was originally published in the September 1964 issue of Scientific American). In his article the equation is shown as a path in the complex plane, representing the convergence of the series for \(e^{i \pi}\). It looks something like this:

To understand what the diagram is showing, we start with the Taylor series for \(e^z\), which is $$e^z = \frac{z^0}{0!} + \frac{z^1}{1!} + \frac{z^2}{2!} + \frac{z^3}{3!} + \frac{z^4}{4!} + \frac{z^5}{5!} + \cdots$$

Substituting \(z = i \pi\) gives $$e^{i \pi} = \frac{(i \pi)^0}{0!} + \frac{(i \pi)^1}{1!} + \frac{(i \pi)^2}{2!} + \frac{(i \pi)^3}{3!} + \frac{(i \pi)^4}{4!} + \frac{(i \pi)^5}{5!} + \cdots$$

Which we can simplify a bit by considering the powers of \(i\): $$e^{i \pi} = \frac{(+1) \pi^0}{0!} + \frac{(i) \pi^1}{1!} + \frac{(-1) \pi^2}{2!} + \frac{(-i) \pi^3}{3!} + \frac{(+1) \pi^4}{4!} + \frac{(i) \pi^5}{5!} + \cdots$$ Notice that the powers of \(i\) have period four: the first term is a positive real number, the second is a positive imaginary number, the third is a negative real number, and the fourth is a negative imaginary number. The pattern then repeats.

In geometric terms in the complex plane, this is equivalent to moving right, then up, then left, then down - and repeating. The distance we move each time is the magnitude of each term; a power of \(\pi\) divided by a factorial.

So \(\cfrac{\pi^0}{0!}\ = 1\) unit to the right, then \(\cfrac{\pi^1}{1!}\ = 3.14\ldots\) units up, then \(\cfrac{\pi^2}{2!}\ = 4.93\ldots\) units left, then \(\cfrac{\pi^3}{3!}\ = 5.16\ldots\) units down, and so on.

1 3.14 4.93 5.16

Although the size of the first few terms are getting bigger, as you calculate more terms the magnitude rapidly decreases due to the factorial function, which grows faster than any power.

Looking at the \(n\)th term (counting from zero), for \(n = 10\) the magnitude is \(0.0258\), and for \(n = 20\) the magnitude is \(0.00000000360\), or \(3.6 \times 10^{-9}\).

So the series converges very rapidly. Geometrically, it spirals in towards the point of convergence, which from Euler's equation we know is \(-1\).

The rapid convergence means it's over very quickly. However, if the animation is changed to zoom in, then we can see more of the spiral pattern. We've shifted the path over so that it starts at \(1\) and converges on the origin. (Open in new window.)

We can't zoom indefinitely since eventually we run into the limited precision of floating point arithmetic. The previous animation restarts after a few seconds when it reaches a zoom factor of one million. We can use arbitrary precision arithmetic to allow greater zoom factors.

This animation runs for a few minutes before restarting. (Open in new window.)

(Implementation note: I tried to add labels to the SVG animation to show each term: \(1\), \(\pi\), \(\frac{\pi^2}{2!}\), ... etc, but MathJax and SVG are hard to get to work well together, especially animated SVG. Hopefully this will become easier in the future.)

Tom White, November 2019