← Home 📘 Track 2: Mathematics for Quantum Hook Intuition Derivation Interactive Summary
M07 §1 · Complex Numbers ~18 min

Euler's formula — the equation that unifies everything

Three separate mathematical worlds — exponentials, trigonometry, and rotation on a plane — turn out to be the same thing. Euler's formula is the proof. And once you see it, the Bloch sphere, quantum gates, and phase factors all become the same rotation viewed from different angles.

✦ One Idea $e^{i\theta} = \cos\theta + i\sin\theta$. A complex exponential is a rotation on the unit circle. Exponential growth and trigonometric oscillation are the same mechanism, written in different notation.
Euler's formula Taylor series unit circle rotation phase $e^{i\pi}+1=0$
Hook
🪝 Hook

Three unrelated subjects. One equation.

You have learned about the unit circle from trigonometry — the circle of radius 1 where $\cos\theta$ and $\sin\theta$ live. You have also used exponential functions like $e^x$, which model growth and decay. These feel completely separate: one is about angles and waves; the other is about repeated multiplication.

Now for something strange. A Swiss mathematician named Leonhard Euler noticed a pattern in 1748: when you substitute an imaginary number into the exponential function, something impossible happens. The exponential — which normally grows without bound — wraps itself into a perfect circle. It stops growing. It starts rotating.

🌀
Why this matters for quantum computing

Every quantum gate is a rotation on the Bloch sphere. Every phase factor in a quantum state is written $e^{i\theta}$. The quantum Fourier transform is built entirely from Euler's formula. You've already seen the notation — in M04 you met $i$, in M05 you placed numbers on the complex plane, in M06 you saw complex amplitudes. Euler's formula is the key that connects all of it to rotation — to the actual mechanism of quantum phase.

The formula is simple to state. It takes a little more work to understand why it's true. This lesson does both — the intuition first, the derivation second, the interactive third. By the end, $e^{i\theta}$ won't look like notation. It will look like a point moving around a circle.

Intuition
🌱 Intuition First

Think of a wheel turning — not a value growing.

Ordinary exponentials grow along a line. $e^1 \approx 2.7$, $e^2 \approx 7.4$, $e^3 \approx 20$. Each step multiplies by the same factor. The result races off toward infinity in one direction.

🎡
The Ferris wheel analogy

Imagine a Ferris wheel of radius 1. A seat on this wheel has a position described by two coordinates: how far right it is (the cosine of its angle) and how far up (the sine). As the wheel turns, the seat doesn't grow or shrink — it traces a perfect circle. Euler's formula says: $e^{i\theta}$ is exactly that seat, at angle $\theta$. The imaginary exponent turns a growing exponential into a rotating point. Growth along the real line becomes rotation on the complex plane.

Here's the key observation: ordinary real exponentials multiply along a line. When you replace the exponent with an imaginary number $i\theta$, you're essentially saying "instead of growing forward, turn left by $\theta$ radians." The imaginary unit $i$ acts like a 90° rotation instruction — and repeated application keeps you on a circle of radius 1.

The result is that $e^{i\theta}$ is always a complex number of magnitude 1, positioned at angle $\theta$ on the unit circle:

$$e^{i\theta} = \underbrace{\cos\theta}_{\text{real part}} + i\,\underbrace{\sin\theta}_{\text{imaginary part}}$$

The real part is $\cos\theta$ — the horizontal coordinate on the circle. The imaginary part is $\sin\theta$ — the vertical coordinate. The magnitude is always $\sqrt{\cos^2\theta + \sin^2\theta} = 1$ — the unit circle, guaranteed.

⚡ Instinct Check Imaginary exponent intuition Advisory — won't block you
In the Ferris wheel analogy, what role does $\theta$ play for the point $e^{i\theta}$?
Mathematics
∑ Full Derivation

From Taylor series to $e^{i\theta} = \cos\theta + i\sin\theta$, every step shown.

The cleanest path to Euler's formula runs through Taylor series — a method for writing any smooth function as an infinite sum of simpler terms. You don't need to know Taylor series in advance; this section explains them from scratch.

Step 1: What is a Taylor series?

Every smooth function can be written as an infinite polynomial — a sum of powers of $x$ with specific coefficients. The idea is: a polynomial is determined entirely by its derivatives at a single point. If you know all the derivatives of $f(x)$ at $x = 0$, you can reconstruct $f$ everywhere.

The general formula is:

$$f(x) = f(0) + f'(0)\,x + \frac{f''(0)}{2!}\,x^2 + \frac{f'''(0)}{3!}\,x^3 + \cdots$$

where $n!$ means $n$ factorial: $1! = 1$, $2! = 2$, $3! = 6$, $4! = 24$, and so on. Each term divides by the factorial of its power.

Step 2: Taylor series for $e^x$, $\cos\theta$, and $\sin\theta$

Let's write down the Taylor series for three functions we'll need. These are standard results — you can verify each by computing derivatives and applying the formula above.

Exponential function

The exponential $e^x$ has a remarkable property: every derivative of $e^x$ is $e^x$ itself. So at $x = 0$, every derivative equals $e^0 = 1$. This gives:

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

Cosine function

The derivatives of $\cos\theta$ cycle: $\cos\theta \to -\sin\theta \to -\cos\theta \to \sin\theta \to \cos\theta \to \cdots$. At $\theta = 0$: $\cos 0 = 1$, $-\sin 0 = 0$, $-\cos 0 = -1$, $\sin 0 = 0$, and the pattern repeats. Only even powers survive:

$$\cos\theta = 1 - \frac{\theta^2}{2!} + \frac{\theta^4}{4!} - \frac{\theta^6}{6!} + \cdots$$

Sine function

The derivatives of $\sin\theta$ also cycle: $\sin\theta \to \cos\theta \to -\sin\theta \to -\cos\theta \to \cdots$. At $\theta = 0$: $\sin 0 = 0$, $\cos 0 = 1$, $-\sin 0 = 0$, $-\cos 0 = -1$. Only odd powers survive:

$$\sin\theta = \theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} - \frac{\theta^7}{7!} + \cdots$$

Step 3: Substitute $x = i\theta$ into $e^x$

Now comes the key move. The exponential formula works for any $x$ — including complex numbers. Let's replace $x$ with $i\theta$ and expand term by term:

$$e^{i\theta} = 1 + (i\theta) + \frac{(i\theta)^2}{2!} + \frac{(i\theta)^3}{3!} + \frac{(i\theta)^4}{4!} + \frac{(i\theta)^5}{5!} + \cdots$$

Now we simplify each power of $i\theta$. Recall from M04 that $i^2 = -1$, which gives us a cycling pattern:

Powers of $(i\theta)^n$ — simplified step by step
$(i\theta)^0$ $= 1$ $i^0 = 1$, so the result is simply $1$
$(i\theta)^1$ $= i\theta$ $i^1 = i$, so the result is $i\theta$
$(i\theta)^2$ $= -\theta^2$ $i^2 = -1$, so $(i\theta)^2 = i^2\cdot\theta^2 = -\theta^2$
$(i\theta)^3$ $= -i\theta^3$ $i^3 = i^2 \cdot i = -i$, so $(i\theta)^3 = -i\theta^3$
$(i\theta)^4$ $= +\theta^4$ $i^4 = (i^2)^2 = (-1)^2 = +1$, so $(i\theta)^4 = +\theta^4$
$(i\theta)^5$ $= +i\theta^5$ $i^5 = i^4 \cdot i = i$, so $(i\theta)^5 = +i\theta^5$

The signs cycle with period 4: $+1,\, +i,\, -1,\, -i,\, +1,\, +i,\, \ldots$ This pattern is exactly what makes the next step possible.

Step 4: Substitute the simplified powers back

Replacing each $(i\theta)^n$ with its simplified form:

$$e^{i\theta} = 1 + i\theta + \frac{-\theta^2}{2!} + \frac{-i\theta^3}{3!} + \frac{+\theta^4}{4!} + \frac{+i\theta^5}{5!} + \cdots$$

Step 5: Group real and imaginary parts separately

Now collect all the real terms (those without $i$) and all the imaginary terms (those with $i$):

Real terms (no factor of $i$)

$$1 - \frac{\theta^2}{2!} + \frac{\theta^4}{4!} - \frac{\theta^6}{6!} + \cdots$$

This is exactly the Taylor series for $\cos\theta$.

Imaginary terms (each has a factor of $i$)

$$i\theta - \frac{i\theta^3}{3!} + \frac{i\theta^5}{5!} - \frac{i\theta^7}{7!} + \cdots = i\!\left(\theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} - \cdots\right)$$

The quantity in parentheses is exactly the Taylor series for $\sin\theta$. So the imaginary part is $i\sin\theta$.

Step 6: Arrive at Euler's formula

Combining real part plus imaginary part:

$$e^{i\theta} = \left(1 - \frac{\theta^2}{2!} + \frac{\theta^4}{4!} - \cdots\right) + i\!\left(\theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} - \cdots\right)$$

$$\boxed{e^{i\theta} = \cos\theta + i\sin\theta}$$

That's Euler's formula. It follows directly from the Taylor series of three functions — no guesswork, no magic, just careful substitution and regrouping.

Step 7: The special case $\theta = \pi$

Let's plug in $\theta = \pi$ and see what happens:

Substituting $\theta = \pi$

$$e^{i\pi} = \cos\pi + i\sin\pi$$

Now compute: $\cos\pi = -1$ and $\sin\pi = 0$. So:

$$e^{i\pi} = -1 + i\cdot 0 = -1$$

Which gives us:

$$e^{i\pi} + 1 = 0$$

Euler's Identity
$$e^{i\pi} + 1 = 0$$
Five fundamental constants — $e$, $i$, $\pi$, $1$, $0$ — in one equation. Not a coincidence. A consequence.

This identity has been called "the most beautiful equation in mathematics" — not because of aesthetics, but because it means something precise: rotating by $\pi$ radians (one half-turn) on the complex plane takes $+1$ to $-1$. The multiplicative inverse of going all the way around. A 180° phase flip, which is exactly what the $Z$ gate does to a qubit on the Bloch sphere.

⚡ Instinct Check Grouping real and imaginary parts Advisory — won't block you
After substituting $x = i\theta$ and expanding, we grouped real terms and imaginary terms separately. Why is this grouping valid?
Interactive
🔬 Explorer

Drag $\theta$ and watch the unit circle come alive.

The formula $e^{i\theta} = \cos\theta + i\sin\theta$ places a point on the unit circle at angle $\theta$. As $\theta$ increases from $0$ to $2\pi$, the point completes one full revolution. The real part traces $\cos\theta$; the imaginary part traces $\sin\theta$. Both projections are shown live as you drag.

What to explore
Goal 1: Drag $\theta$ to $\pi/2$ (90°). Notice: real part = 0, imaginary part = 1. The point sits at the top of the circle — the imaginary axis.

Goal 2: Drag $\theta$ to $\pi$ (180°). Notice: real part = −1, imaginary part = 0. This is Euler's identity — the point has reached $(-1, 0)$.

Goal 3: Watch the complete revolution at $\theta = 2\pi$. The point returns exactly to where it started.
🔬 Explorer Unit circle — $e^{i\theta} = \cos\theta + i\sin\theta$
Complex plane view
Live values
$\theta$ = 0.00° (rad: 0.000)
$\cos\theta$ = 1.000
$\sin\theta$ = 0.000
$|e^{i\theta}|$ = 1.000 (always 1)
Angle $\theta$
$e^{i\theta}$ = 1.000 + 0.000i
Magnitude $|e^{i\theta}|$ 1.000
Special point?
🎯
You found it: $\theta = \pi$ means $e^{i\pi} = -1 + 0i$, so $e^{i\pi} + 1 = 0$. This is Euler's identity. The point has traveled exactly half a revolution and landed at $(-1,\, 0)$ — the negative real axis.

Micro practice — three quick checks

Concept — What does $e^{i\theta}$ represent geometrically?

Think before reading: if someone tells you $e^{i\cdot 0.7}$, can you describe where that point lives without calculating? It lives on the unit circle, at angle $0.7$ radians from the positive real axis — coordinates $(\cos 0.7,\, \sin 0.7) \approx (0.765,\, 0.644)$. The magnitude is exactly 1, always. The angle fully determines the position.

Prediction — What happens when $\theta = \pi/2$?

Before computing: $\pi/2$ is 90°. On the unit circle, 90° is the top of the circle: $(0, 1)$. So $e^{i\pi/2} = \cos(\pi/2) + i\sin(\pi/2) = 0 + i\cdot 1 = i$. The imaginary unit $i$ is simply the 90° rotation of $+1$. Check this in the explorer — drag the slider to 90° and confirm.

Insight — Why does exponential represent rotation?

Because multiplying by $e^{i\phi}$ rotates any complex number by $\phi$ radians — without changing its magnitude. If $z = r\,e^{i\alpha}$, then $z \cdot e^{i\phi} = r\,e^{i(\alpha+\phi)}$. The magnitude $r$ is unchanged; the angle increases by $\phi$. This is precisely what quantum gates do to amplitudes on the Bloch sphere — they rotate, never rescale.

Lesson Summary

Three worlds. One formula. Four things you now own.

  • Taylor series connect functions to power sums

    Any smooth function can be written as an infinite polynomial. The exponential $e^x = 1 + x + x^2/2! + x^3/3! + \cdots$ works for complex $x$ just as well as real $x$. Substituting $x = i\theta$ is the key move.

  • 🔄
    Powers of $i$ cycle with period 4

    $i^0=1$, $i^1=i$, $i^2=-1$, $i^3=-i$, $i^4=1$, and repeat. This cycling splits the exponential expansion into alternating real and imaginary terms — exactly the pattern of $\cos\theta$ and $\sin\theta$.

  • $e^{i\theta}$ is always on the unit circle

    $|e^{i\theta}|^2 = \cos^2\theta + \sin^2\theta = 1$ for every $\theta$. The imaginary exponent prevents growth — instead, it guarantees rotation. Phase factors in quantum states preserve normalization for this exact reason.

  • 🎯
    $e^{i\pi} + 1 = 0$ is a consequence, not a coincidence

    $\theta = \pi$ gives $e^{i\pi} = \cos\pi + i\sin\pi = -1 + 0 = -1$. Rearranging: $e^{i\pi} + 1 = 0$. Five constants from five different mathematical fields — connected through the single operation of rotation by $\pi$ radians.

How confident do you feel about Euler's formula right now?
Quick Check 4 questions — Taylor series, $i$ powers, the formula, and its identity

You now know that $e^{i\theta}$ is a rotation.
What happens when you multiply two rotations?
$e^{i\alpha} \cdot e^{i\beta} = e^{i(\alpha+\beta)}$ — angles add.

→ Multiplying complex numbers — M08
Sources & Further Reading
← Previous
Polar Form
M06 — Quantum states in the complex plane