How does $e^{\pi i}$ equal $-1$

I was on xkcd a while back and there was the equation $e^{\pi i}$ which somehow miraculously equals $-1$. So, I put it into Google and it works. So, I tried solving it on my own:

\begin{align} e^{\pi i} &= -1 \\ \ln e^{\pi i} &= \ln (-1) \\ \pi i \times \ln e &= \ln (-1) \\ \pi i \times 1 &= \ln (-1) \\ \pi i &= \ln (-1) \end{align}

But that's as far as I can get as $\ln (-1)$ gives Error on my calculator. So how does $e^{\pi i} = -1$ work?

• mathworld.wolfram.com/EulerFormula.html – lab bhattacharjee Dec 7 '12 at 19:27
• $e^{i\theta} = \cos \theta + i \sin \theta$. – copper.hat Dec 7 '12 at 19:30
• I love how the OP said, "I put it into the calculator and it works". Love this, my favorite example of how non-intuitive math can be. – Fixed Point Dec 7 '12 at 21:01
• @ColeJohnson, $e^{i\pi}=-1$ is a consequence of how the objects $e$, $\pi$ and raising a number to the power of a complex number are defined. There is no deep truth behind the equation as some like to think. You are confused because you have a feeling for what $e$, $\pi$ and $-1$ are but you can't see the relation. The mystery lies in the definition of $i$ and what it means to have it in the exponent. It just turns out that with the definitions we have of those elements one ends up with the $e^{i\pi}=-1$ equation. – Cantor Dec 7 '12 at 21:42
• You can think of $e^{i\theta}$ as a rotation on complex plane. a rotation of $\pi$ will take you from 1 to -1. – karakfa Dec 7 '12 at 22:38

This is an interesting proof that you may have seen.

Let us define

$$e^x := \sum_{n=0}^\infty \frac{x^n}{n!}$$

Then \begin{align}e^{i \pi} &= \sum_{n=0}^\infty \frac{(i\pi)^n}{n!} \\ &= 1+i\pi-\frac{\pi^2}{2}-\frac{\pi^3}{3!} + \cdots\\ &= \left(1-\frac{\pi^2}{2}+\frac{\pi^4}{4!}+\cdots\right) + i\left(\pi-\frac{\pi^3}{3!}+\frac{\pi^5}{5!}+\cdots\right) \\ \\ &= \cos \pi +i\sin \pi \\ \\ &= -1\end{align}

This method can be generalized to show Euler's identity, $e^{i\theta}=\cos \theta+i\sin\theta$. From this we find that $e^z$ is actually a periodic function over $2\pi i$, and because of this, it follows that $\log z$, as the inverse of $e^z$, must be multivalued (because, $e^{i\theta} = e^{i\theta +2\pi i}=e^{i\theta -2\pi i}=\cdots = e^{i\theta+2 \pi i n}$ where $n \in \mathbb Z$).

• According to Sarason, "Complex Function Theory," Page 35, the generalization mentioned is how Euler himself came up with his expression. – user12802 Dec 8 '12 at 2:46
• I feel it should be noted that @AmWhy left your answer as a remark at the end of her post. – JavaMan Dec 8 '12 at 5:57
• @Argon: I aligned your equations using the align setting. – JavaMan Dec 8 '12 at 5:59

$e^{\pi i}$ corresponds to $z = (-1, 0) = -1$ on the unit circle in the complex plane.

That is, it is positioned $\pi = 180^\circ$ from the position (1, 0) on the complex unit circle. It has no "height" in the direction of either $i$ or $-i$. From $e^{\pi i} = -1$, we obtain Euler's Identity: $e^{\pi i} + 1 = 0$.

Indeed one of the amazing things is that $e$ and $\pi$ have a lot to do with each other:

For example, see Euler's formula: $\quad e^{i\theta} = \cos \theta + i\sin \theta$.

So $e^{\pi i} = \cos {\pi} + i \sin {\pi} = -1 + (i \times 0)$.

A visual image may help make sense of Euler's formula and $e^{\pi i}$: If you really want to pursue this question, and how Euler came up with his formula, you may want take on the following challenge:

Try computing the Taylor expansion (Maclaurin Series) of $e^{\pi i}$ and see that it equals sum of the Taylor (Maclaurin) expansions of $\cos {\pi}$ and $i \sin {\pi}$. Both sum to $-1$! Or if you are lazy, you can look over at Wikipedia

BOTH $e$ and $i$ are fascinating, because they "crop up" almost everywhere in math, physics, and many other fields. For more ways of representing $e$, look at this list.

• That I get, but my question is why? $\pi$ and $e$ have nothing to do with eachother – Cole Johnson Dec 7 '12 at 19:29
• @ColeJohnson, clearly they do... – lhf Dec 7 '12 at 19:33
• Euler begs to differ... – copper.hat Dec 7 '12 at 19:34
• @ColeJohnson: I wonder what you mean by '$\pi$ and $e$ have nothing to do with each other'. If you've done a course in analysis you'll know that the exponential function is very closely related to trig functions (via complex numbers). The former is related to $e$ and the latter are related to $\pi$. – Clive Newstead Dec 7 '12 at 19:39
• I love dynamical plots Amy. +) – mrs Aug 15 '13 at 12:49

First you need to understand why, for a complex number $z$, $z = x + iy$ and $z = r e^{i \theta}$ -- where $x = r \cos \theta$ and $y = r \sin \theta$ -- are equivalent. From that, $e^{\pi i\left(1+2n\right)} = -1$ and $\ln \left(-1\right) = \pi i \left(1 + 2 n\right)$ follow for $n$ integer.

To see the former, substitute $r=1$ and $\theta = \pi\left(1+2n\right)$ into $r e^{i \theta} = r \cos \theta + i r \sin \theta$.

To see the latter, take $\ln$ of the result $e^{\pi i\left(1+2n\right)} = -1$, or take $\ln$ of $z = e^{i \theta}$: $$\ln z = \ln r e^{i \theta} = \ln r + i \theta.$$ With $z = -1$, $r = 1$ and $\theta = \left(1+2n\right)$, and $$\ln \left(-1\right) = \pi i\left(1+2n\right).$$

$\pi$ is 180 degrees.

-1 is 180 degrees away from 1, around the complex plane's origin.

$e^{0i}$ is 1.

$e^{\theta i}$ is a point on the unity circle around the complex plane origin determined by the angle $\theta$, in radians. So if $\theta =\pi$, we get -1.

Complex exponentiation with other bases is also a rotation around the unity circle. For instance $5^{\phi i}$ also traces out a circle as we vary $\phi$. However, for such other bases, $\phi$, though an angle, isn't an angle measured in radians, and so $5^{\pi i}$ is not -1.

The correspondence between radians and the coefficient is only in the case of $e$.

$e$ is a special number which is inherently connected to the special number $\pi$ in multiple ways.

Here are two ways of seeing this.

Consider the function $f(\theta)=e^{i \theta}$. Then $f''(\theta)=-f(\theta)$. Differential equations tell us that any such solution is a linear combination of $\sin(\theta)$ and $\cos(\theta)$ [reason:The Wronskiansk tells us that $f, \sin(x), \cos(x)$ are linearly dependent, while $\sin(x), \cos(x)$ are linearly independent].

Thus $f(\theta)=A \cos(\theta)+ B \sin(\theta)$ for some $A,B$. Setting $\theta=0$ Yields $A=1$, and derivating and setting $\theta=0$ Yields $B=i$.

Second apprroach

Let $f(x,y)=e^x (\cos(y)+i\sin(y))$.

Then $f(z_1+z_2)=f(z_1)f(z_2)$, and $f$ is continuous.Thus, $f$ is an exponential function. Since $f(1)=e$ we get that $f(z)=e^z$.

Note $f(z)$ satisfies the condition of CR- equations, and is $C_1$, thus it is analityc. Hence, it is the only analityc extension of $e^x$ to the complex plane.

Considering the principal branch of $\log(z)$, we have

$$\log{(-1)}= \ln{|-1|}+ i \arg{(-1)}=i \pi.$$

Your calculator considers the domain of the $\log$ function as $(0,\infty)$.

• Don't forget about multivaluedness! – Argon Dec 7 '12 at 20:33
• @Argon that's okay right now. – Berkheimer Dec 7 '12 at 20:58
• Does this imply that an iPhone is not a smart phone? – Dirk Dec 7 '12 at 21:10
• @Dirk It implies that it might be smart but not that much. – Berkheimer Dec 7 '12 at 21:15