---
title: Euler's formula
heading: The exponential that goes around in a circle
eyebrow: A3 · Lesson 7 · Euler's formula
xp: 40
---

::: hook
The exponential function $e^{x}$ grows: it's the curve of compound interest and of runaway growth. Feed it an imaginary number, $e^{j\theta}$, and it does something that looks unrelated: it goes around in a circle, forever, never growing at all. Here's how you can watch that happen, one term at a time.

::: play
- The arrows add up the series for $e^{j\theta}$ term by term, tip to tail: $1$, then $j\theta$, then $(j\theta)^2/2!$, and so on. N is how many terms after the first are included.
- Raise N one step at a time and watch where the chain ends. The dot is the point at angle θ on the circle of radius 1.
- Change θ. However large you make it (up to half a turn), does the chain still end on the circle?
:::
:::

```sim plot
view: complex
range: 2.2
slider: N = 0..11 step 1 = 3
slider: theta = 0..3.14 step 0.01 = 1 rad
curve: exp(j*u) | over: u = 0..2*pi | dashed | color: ch4
dot: exp(j*theta) | color: ch3
arrow: step(N - 0)*1 | color: ch1 | label: 1
arrow: step(N - 1)*j*theta | from: 1 | color: ch2 | label: jθ
arrow: step(N - 2)*(j*theta)^2/2 | from: 1 + j*theta | color: ch1 | label: (jθ)²/2!
arrow: step(N - 3)*(j*theta)^3/6 | from: 1 + j*theta + (j*theta)^2/2 | color: ch2
arrow: step(N - 4)*(j*theta)^4/24 | from: 1 + j*theta + (j*theta)^2/2 + (j*theta)^3/6 | color: ch1
arrow: step(N - 5)*(j*theta)^5/120 | from: 1 + j*theta + (j*theta)^2/2 + (j*theta)^3/6 + (j*theta)^4/24 | color: ch2
arrow: step(N - 6)*(j*theta)^6/720 | from: 1 + j*theta + (j*theta)^2/2 + (j*theta)^3/6 + (j*theta)^4/24 + (j*theta)^5/120 | color: ch1
arrow: step(N - 7)*(j*theta)^7/5040 | from: 1 + j*theta + (j*theta)^2/2 + (j*theta)^3/6 + (j*theta)^4/24 + (j*theta)^5/120 + (j*theta)^6/720 | color: ch2
arrow: step(N - 8)*(j*theta)^8/40320 | from: 1 + j*theta + (j*theta)^2/2 + (j*theta)^3/6 + (j*theta)^4/24 + (j*theta)^5/120 + (j*theta)^6/720 + (j*theta)^7/5040 | color: ch1
arrow: step(N - 9)*(j*theta)^9/362880 | from: 1 + j*theta + (j*theta)^2/2 + (j*theta)^3/6 + (j*theta)^4/24 + (j*theta)^5/120 + (j*theta)^6/720 + (j*theta)^7/5040 + (j*theta)^8/40320 | color: ch2
arrow: step(N - 10)*(j*theta)^10/3628800 | from: 1 + j*theta + (j*theta)^2/2 + (j*theta)^3/6 + (j*theta)^4/24 + (j*theta)^5/120 + (j*theta)^6/720 + (j*theta)^7/5040 + (j*theta)^8/40320 + (j*theta)^9/362880 | color: ch1
arrow: step(N - 11)*(j*theta)^11/39916800 | from: 1 + j*theta + (j*theta)^2/2 + (j*theta)^3/6 + (j*theta)^4/24 + (j*theta)^5/120 + (j*theta)^6/720 + (j*theta)^7/5040 + (j*theta)^8/40320 + (j*theta)^9/362880 + (j*theta)^10/3628800 | color: ch2
readout: θ in degrees = theta*180/pi °
readout: cos θ = cos(theta)
readout: sin θ = sin(theta)
```

::: predict
## Each term in the chain turns a quarter turn from the one before, and they get shorter. Where does the chain end once there are many terms?

- [ ] At the point $1 + j\theta$
- [x] On the circle of radius 1, at angle θ
- [ ] Farther and farther out, without limit
- [ ] Back at the origin

::: reveal
On the circle, at exactly angle θ. Each term is the previous one multiplied by $j\theta/k$: turned a quarter turn and shrunk, so the chain spirals inward onto a single point, and that point is $\cos\theta + j\sin\theta$. That's Euler's formula, and it says $e^{j\theta}$ is the arrow of length 1 at angle θ.
:::
:::

::: nameit
## $e^{j\theta} = \cos\theta + j\sin\theta$

The exponential has a power series, an infinite sum that converges for every $x$:

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

(A6 shows where it comes from.) Put $x = j\theta$ and use the cycle of powers of $j$, which go $1, j, -1, -j, 1, \ldots$:

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

The real terms, $1 - \theta^2/2! + \theta^4/4! - \cdots$, are the series for $\cos\theta$, and the imaginary ones, $\theta - \theta^3/3! + \cdots$, are the series for $\sin\theta$. So

$$e^{j\theta} = \cos\theta + j\sin\theta$$

with θ in radians. This is **Euler's formula**. It packs everything from the last three lessons into one expression:

- $e^{j\theta}$ is the arrow of length 1 at angle θ, so **$r\angle\theta = r e^{j\theta}$**. That's the third form of a complex number, and the one the mathematics uses.
- Exponents add when you multiply, $e^{j\alpha}e^{j\beta} = e^{j(\alpha + \beta)}$, which is why angles add when you multiply complex numbers. The angle-sum identities from A2 are its real and imaginary parts.
- Special values follow directly: $e^{j\pi/2} = j$, $e^{j\pi} = -1$, $e^{j2\pi} = 1$.
- Reading it backward gives cosine and sine as exponentials:

$$\cos\theta = \frac{e^{j\theta} + e^{-j\theta}}{2} \qquad \sin\theta = \frac{e^{j\theta} - e^{-j\theta}}{2j}$$

A cosine is two arrows turning in opposite directions, whose imaginary parts cancel. You'll meet that picture again in signals: it's why a real sinusoid has two lines in its spectrum, at $+f$ and $-f$.

In the next lesson the angle grows with time, $\theta = \omega t$, and $e^{j\omega t}$ is an arrow turning at a steady rate: a sinusoid.
:::

::: example
## Evaluate $e^{j\pi/3}$.

::: solution
1. **Apply Euler's formula.**
   $$\begin{aligned} e^{j\pi/3} &= \cos\frac{\pi}{3} + j\sin\frac{\pi}{3} \\ &= 0.5 + 0.866j \end{aligned}$$
2. **Check the length.** It's the point at 60° on the unit circle, and its length is
   $$\sqrt{0.25 + 0.75} = 1$$
   as every $e^{j\theta}$ must be.

**Answer:** $e^{j\pi/3} = 0.5 + 0.866j$.
:::
:::

::: example
## Write $5e^{j2.5}$ in rectangular form.

::: solution
1. **Real part.**
   $$\begin{aligned} 5\cos 2.5 &= 5 \times (-0.801) \\ &= -4.006 \end{aligned}$$
2. **Imaginary part.**
   $$\begin{aligned} 5\sin 2.5 &= 5 \times 0.598 \\ &= 2.992 \end{aligned}$$
3. **Check the quadrant.** 2.5 rad is 143.2°, in the second quadrant, so a negative real part and a positive imaginary part is right. Keep the calculator in radians for this.

**Answer:** $5e^{j2.5} = -4.006 + 2.992j$.
:::
:::

::: example
## Use Euler's formula to find $\cos 75°$ and $\sin 75°$ from the 45° and 30° values.

::: solution
1. **Split the angle.**
   $$\begin{aligned} e^{j75°} &= e^{j45°}e^{j30°} \\ &= (0.7071 + j0.7071) \\ &\quad \times (0.8660 + j0.5) \end{aligned}$$
2. **Real part.**
   $$\begin{aligned} &0.7071 \times 0.8660 \\ &\quad - 0.7071 \times 0.5 \\ &= 0.2588 \end{aligned}$$
3. **Imaginary part.**
   $$\begin{aligned} &0.7071 \times 0.5 \\ &\quad + 0.7071 \times 0.8660 \\ &= 0.9659 \end{aligned}$$
4. **Why it works.** Multiplying exponentials adds their angles, so the angle-sum formulas come for free.

**Answer:** $\cos 75° = 0.2588$ and $\sin 75° = 0.9659$.
:::
:::

::: check
given: x = 0.3 | 0.8 | 1.2 | 2 | 2.5 | 3
answer: cos(x)
tolerance: 0.005

## What is the real part of $e^{j\given{x}}$, with the angle in radians?

::: right
Right. By Euler's formula the real part is $\cos(\given{x})$, the arrow's shadow on the real axis.
:::

::: misses
- [sin(x)] That's the imaginary part.
- [exp(x)] The imaginary exponent makes it turn, not grow. Use $e^{j\theta} = \cos\theta + j\sin\theta$.
- [cos(x°)] The angle {x} is in radians. Set your calculator to radians.
- [any] Not yet. Use $e^{j\theta} = \cos\theta + j\sin\theta$.
:::
:::

::: check
given: r = 2..9 int; x = 0.4 | 1 | 1.7 | 2.6
answer: r
tolerance: 0.5%

## What is the magnitude of $\given{r}e^{j\given{x}}$?

::: right
Right. $e^{j\theta}$ always has length 1, so the length is {r}, whatever the angle.
:::

::: misses
- [r*exp(x)] The imaginary exponent turns the arrow. It doesn't stretch it.
- [r*cos(x)] That's the real part. The magnitude is the full length of the arrow.
- [any] Not yet. What is the length of $e^{j\theta}$ for any θ?
:::
:::

::: check
kind: choice

## What is $e^{j\pi}$?

- [ ] 1
- [x] −1
- [ ] $j$
- [ ] $e^{\pi}$, about 23

::: right
Right. π radians is half a turn, which lands the arrow on the negative real axis: $\cos\pi + j\sin\pi = -1$.
:::

::: misses
- [1] That's a full turn, $e^{j2\pi}$.
- [3] That's a quarter turn, $e^{j\pi/2}$.
- [4] With an imaginary exponent the arrow turns rather than growing.
:::
:::

::: check
kind: expression
answer: (exp(j*x) + exp(-j*x))/2
vars: x = -3..3

## Write $\cos x$ using exponentials.

::: right
Right. The imaginary parts of $e^{jx}$ and $e^{-jx}$ cancel, and their real parts are both $\cos x$.
:::

::: misses
- [(exp(j*x) - exp(-j*x))/(2*j)] That's $\sin x$.
- [exp(j*x) + exp(-j*x)] That's $2\cos x$. Divide by 2.
- [any] Not yet. Add $e^{jx}$ and $e^{-jx}$: what cancels?
:::
:::

::: check
given: a = 0.2..1.2 sig 2; b = 0.3..1.5 sig 2
answer: a + b
tolerance: 0.5%

## $e^{j\given{a}} \times e^{j\given{b}}$ is an arrow of length 1. What is its angle, in radians?

::: right
Right. Exponents add when you multiply, so the angle is {a} + {b}.
:::

::: misses
- [a*b] When exponentials multiply, their exponents add.
- [any] Not yet. Use $e^{j\alpha}e^{j\beta} = e^{j(\alpha + \beta)}$.
:::
:::

::: check
kind: parts
given: r = 2 | 3 | 5; x = 0.5 | 1.2 | 2.5

## Let $z = \given{r}e^{j\given{x}}$, with the angle in radians.

::: part
answer: r*cos(x)
tolerance: 0.5%

### What is its real part?

::: misses
- [r*cos(x*pi/180)] The angle is in radians already.
- [any] Euler: $re^{jx} = r\cos x + jr\sin x$.
:::
:::

::: part
answer: r*sin(x)
tolerance: 0.5%

### What is its imaginary part?

::: misses
- [any] $r\sin x$.
:::
:::

::: part
answer: r^2*cos(2*x)
tolerance: 0.5%

### What is the real part of $z^2$?

::: misses
- [r^2*cos(x)^2] Square in exponential form: the angle doubles.
- [2*r*cos(x)] Squaring squares the length.
- [any] $z^2 = r^2e^{j2x}$.
:::
:::
:::

::: check
kind: derivation
vars: x = -3..3

## Derive cosine and sine from $e^{jx}$ and $e^{-jx}$.

::: step
answer: 2*cos(x)

### Add $e^{jx} = \cos x + j\sin x$ and $e^{-jx} = \cos x - j\sin x$.
:::

::: step
answer: 2*j*sin(x)

### Subtract: $e^{jx} - e^{-jx}$.
:::

::: step
answer: (exp(j*x) - exp(-j*x))/(2*j)

### Write $\sin x$ in terms of the exponentials.
:::

::: right
Right. $\cos x = \frac{e^{jx} + e^{-jx}}{2}$ and $\sin x = \frac{e^{jx} - e^{-jx}}{2j}$: a real sinusoid is two counter-rotating arrows.
:::
:::

::: explain
## In your own words, why does $e^{j\theta}$ land on the circle of radius 1?

::: model
Each term of the series for $e^{j\theta}$ is the one before multiplied by $j\theta/k$, so it's turned a quarter turn and, once k is bigger than θ, made shorter. Adding them tip to tail makes a chain that spirals in to a point. Gathering the real and imaginary terms, that point is $\cos\theta + j\sin\theta$, and since $\cos^2\theta + \sin^2\theta = 1$, it's at distance 1 from the origin, at angle θ.
:::
:::

::: practice

::: check
given: x = 0.1..3.1 sig 2
answer: sin(x)
tolerance: 0.005

## What is the imaginary part of $e^{j\given{x}}$?

::: misses
- [cos(x)] That's the real part.
- [any] Use $e^{j\theta} = \cos\theta + j\sin\theta$.
:::
:::

::: check
given: r = 1..9 int; d = 10..170 step 10
answer: r*cos(d°)
tolerance: 0.01

## $\given{r}\angle\given{d}°$ is written $\given{r}e^{j\theta}$. What is its real part?

::: misses
- [r*sin(d°)] That's the imaginary part.
- [any] It's $r\cos\theta$, with θ = {d}°.
:::
:::

::: check
given: d = 10..350 step 10
answer: d*pi/180
tolerance: 0.5%

## To write $5\angle\given{d}°$ as $5e^{j\theta}$, what is θ in radians?

::: misses
- [d] The exponent needs radians. Multiply by π/180.
- [any] Convert {d}° to radians.
:::
:::

::: check
given: n = 1..12 int
answer: Re(exp(j*pi*n/2))
tolerance: 0.001

## What is the real part of $e^{j\given{n}\pi/2}$?

::: misses
- [any] Each $\pi/2$ is a quarter turn. After {n} quarter turns, where is the arrow?
:::
:::

::: check
given: a = 1.2..2 sig 2; b = 0.25 | 0.4 | 0.6
answer: a - b
tolerance: 1%

## What is the angle, in radians, of $e^{j\given{a}} / e^{j\given{b}}$?

::: misses
- [a + b] Dividing subtracts the exponents.
- [a/b] Exponents subtract when you divide.
- [any] Use $e^{j\alpha}/e^{j\beta} = e^{j(\alpha - \beta)}$.
:::
:::
:::
