Tags Math

The Euler formula states that for any real x:

\[e^{ix}=cos(x)+i sin(x)\]

Where i is the imaginary unit. This formula is extremely important in many branches of mathematics and engineering, but at first glance it's puzzling. What does a complex exponent even mean, and how can it be related to the trigonometric functions?

Complex number representations

Complex numbers have two canonical representations:

Cartesian and polar representation of a complex number
  • Cartesian: x+iy
  • Polar: r\angle \theta

Trigonometric formulae can be used to convert between the two in a straightforward way:

  • Given x+iy, we can compute r=\sqrt{x^2+y^2} and \theta=tan^{-1}(\frac{y}{x})
  • Given r\angle \theta we can compute x=r cos\theta and y=r sin\theta

Some intuition for Euler's formula

Representing x and y as above, we have:

\[z=r(cos\theta+i sin\theta)\]

Now, let's take two complex numbers, multiply them together and use some basic trigonometric identities:

\[\begin{align*} z_1&=r_1 (cos\theta+i sin\theta) \\ z_2&=r_2 (cos\phi+i sin\phi)\\ z_1 z_2 &= r_1 r_2 (cos\theta+i sin\theta)(cos\phi+i sin\phi)\\ &=r_1 r_2 ((cos\theta cos\phi -sin\theta sin\phi) +i(cos\theta sin\phi + cos\phi sin\theta))\\ &=r_1 r_2 (cos(\theta+\phi) + i sin(\theta+\phi))\\ &= r_1 r_2 \angle (\theta+\phi) \end{align*}\]

When multiplying two complex numbers in polar form, their magnitudes multiply but their angles add [1].

Now, suppose we have a hypothetical function f(\theta) such that r f(\theta) represents a complex number. We've just shown that:

\[(r_1 f(\theta))\cdot(r_2 f(\phi))=r_1 r_2 f(\theta+\phi)\]

What real-life function do you know that behaves like this? An exponential function! a^x a^y=a^{x+y} for some a. This isn't a proof of anything, of course, and the base of the exponent can be arbitrary - but it does show that there's something about complex numbers that behaves like exponentials.

Let's look at it from another direction. Once again starting with:

\[z=r(cos\theta+i sin\theta)\]

We'll treat z as a function of \theta, and find its derivative:

\[\frac{dz}{d\theta}=-rsin\theta +i cos\theta\]

If we factor i out of the parenthesis, we get:

\[\frac{dz}{d\theta}=ri(cos\theta+i sin\theta)=iz\]

Note that this is exactly the derivative if z(\theta)=e^{i\theta}, another clue that complex numbers behave like exponential functions.

Proof using power series

The canonical proof of Euler's formula uses Maclaurin series expansions for e^x, cos(x) and sin(x).

As a reminder, the Maclaurin series approximation for a function f(x) is:

\[p(x) = f(0)+\frac{f'(0)}{1!}x+\frac{f''(0)}{2!}x^2+\frac{f'''(0)}{3!}x^3+\cdots=\sum_{n=0}^{\infty} \frac{f^{(n)}(0)}{n!}x^n\]

For e^x:

\[e^{x}=1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\frac{x^5}{5!}+\cdots\]

Substituting ix for x and applying powers of i:

\[\begin{align*} e^{ix}&=1+ix+\frac{(ix)^2}{2!}+\frac{(ix)^3}{3!}+\frac{(ix)^4}{4!}+\frac{(ix)^5}{5!}+\cdots\\ &=1+ix-\frac{x^2}{2!}-\frac{ix^3}{3!}+\frac{x^4}{4!}+\frac{ix^5}{5!}+\cdots \end{align*}\]

Now let's regroup the real and imaginary parts of the series:

\[e^{ix}=\left(1-\frac{x^2}{2!}+\frac{x^4}{4!}+\cdots\right) +i\left(x-\frac{x^3}{3!}+\frac{x^5}{5!}+\cdots\right)\]

The contents of the first parenthesis is precisely the Maclaurin series expansion of cos(x), and the contents of the second parenthesis is the expansion of sin(x); therefore, we've just proven the Euler formula [2].

Proof using derivatives

Let's define \xi(x) as follows:

\[\xi(x)=\frac{cos(x)+isin(x)}{e^{ix}}=e^{-ix}(cos(x)+isin(x))\]

And compute its derivative:

\[\begin{align*} \frac{d\xi(x)}{dx}&=e^{-ix}(-sin(x)+icos(x))-ie^{-ix}(cos(x)+isin(x))\\ &=e^{-ix}(-sin(x)+icos(x))-e^{-ix}(icos(x)-sin(x))=0 \end{align*}\]

Thus, it's a constant function; what is its value? We can find \xi(0) easily - it's 1. Therefore, \xi(x)=1 everywhere and thus its numerator and denominator are always equal \blacksquare.

Visualizing Euler's formula

It's interesting to plot e^{i\phi} to observe its behavior. In the general case, it's very difficult to visualize functions in the complex domain because both the input and output are two-dimensional; so we'd need a 4D plot. Luckily for us, we're usually interested in e^{i\phi} only for \phi\in\mathbb{R}, so we have 3 dimensions to deal with:

  • Input dimension: \phi
  • Output dimensions: Re(e^{i\phi}) and Im(e^{i\phi})
3D Plot of e^{i phi}

If we isolate the two 2D plots of f(\phi)=Re(e^{i\phi}) as a function of g(\phi)=Im(e^{i\phi}), we get:

Two 2D plots separately of Re and Im

This is the expected result from Euler's formula! The real part of the complex exponent is cos(\phi), while the imaginary part is sin(\phi).

Finally, let's plot the projection of the 3D plot onto the real+imaginary axes:

Plotting e^{i phi} as projection on the re+im axes, unit circle

It hopefully comes as no surprise that we get the unit circle! This is another way to demonstrate the beautiful connection between the trigonometric functions and circles. If you imagine a point moving along the unit circle counter-clockwise, this point's Re value will be cos(\phi) where \phi is its angle from the Re axis, and its Im value will be sin(\phi).

Euler's identity

Euler's famous identity ties the "five fundamental constants of mathematics" together:

\[e^{i\pi}+1=0\]

This identity is trivial to derive from the Euler formula, because:

\[e^{i\pi}=cos(\pi)+i sin(\pi)=-1\]

De Moivre formula

Let's take the complex exponent e^{ix} and raise it to the n-th power, where n is an integer:

\[(e^{ix})^n=e^{inx}\]

We can replace the complex exponent by its trigonometric equivalent using Euler's formula on both sides:

\[(cos(x) +isin(x))^n=cos(nx)+isin(nx)\]

This is De Moivre's Formula, which is extremely useful in calculations involving complex numbers, and is a treasure trove of trigonometric identities.

An alternative formulation of the De Moivre formula uses fractional powers and is useful for finding the roots of complex numbers. However, we have to be careful here, because the complex root function (just like its real counterpart!) is multi-valued; it maps a single value in its domain to potentially multiple values in its range [3].

This formulation says:

\[e^{\frac{ix}{n}}=(cos(x) +isin(x))^{\frac{1}{n}}=cos(\frac{x+2\pi k}{n})+isin(\frac{x+2\pi k}{n})\]

For integer $$0\leq k< n$$. This is because if we raise this number back to the power of n, we'll get back the original e^{ix} for any of these k (both sine and cosine are periodic with a period of 2\pi).


[1]In other words, multiplying by a complex number combines a scaling and rotation operations. Multiplying any z by r\angle \theta scales (multiplies) z's magnitude by r and rotates it (counter-clockwise) by angle \theta.
[2]I've seen places that treat this as the definition of what a complex exponential means, rather than a proof.
[3]And thus isn't strictly a function at all, if we want to put our abstract algebra hat on.