Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Complex numbers and Euler's formula, from scratch

~16 min

This course leans on complex numbers constantly starting in chapter 3. Not as a curiosity. The complex form of a Fourier series is shorter to write and easier to manipulate. It's also the natural language for the Fourier transform several chapters later. A full course on complex analysis isn't a prerequisite here. So this section builds everything actually needed, from the definition of i up through Euler's formula. The result is one self-contained foundation nothing later in the course will have to re-derive.

A real number lives on one line. A complex number needs two coordinates. In fact "how far from zero," the modulus, and "which direction," the argument, describe it just as completely as its real and imaginary parts do. It's the same way a location can be given as (east, north) or as (distance, compass heading) without changing where it points. Euler's formula is the dictionary translating between those two coordinate systems. Take the specific case of a distance-1 point. e^{i\theta} is that point, one unit from the origin, sitting at angle \theta. It's the same point, described in the exponential alphabet instead of the (\cos, \sin) one.

Why does an exponential describe a rotation? Ordinary exponential growth, e^{kt}, stretches a length by a fixed proportional amount each instant. Euler's formula feeds in an imaginary rate instead, e^{i\theta}, and that turns the same stretching instinct sideways. Instead of growing longer, the point spins in place. It moves through a proportional amount of angle each instant, and its distance from the origin never changes at all. It's the same exponential machinery, pointed in a direction where growth becomes rotation instead of expansion.

A complex number z = a + bi pairs a real number a (the real part) with a real number b (the imaginary part), where i is defined by i^2 = -1. Plot a on a horizontal axis and b on a vertical one, the complex plane. Then z has a modulus |z| = \sqrt{a^2+b^2}, its distance from the origin, and an argument \theta, the angle its ray makes with the positive real axis. Together these give the polar form z = r(\cos\theta + i\sin\theta) with r=|z|.

Euler's formula, recalled below, says that same polar form can be written far more compactly as z = re^{i\theta}. It's a genuine algebraic identity between the exponential function and the trigonometric functions, not a notational trick. Two consequences of it are used constantly in this course. First, multiplying two complex numbers in this form multiplies their moduli and adds their arguments, r_1e^{i\theta_1}\cdot r_2e^{i\theta_2} = r_1r_2\,e^{i(\theta_1+\theta_2)}. That turns a geometric rotation-and-scaling into ordinary exponent addition. Second, Euler's formula and its complex conjugate (e^{-i\theta}=\cos\theta - i\sin\theta) can be solved together. Doing so recovers cosine and sine directly from exponentials: \cos\theta = \frac{e^{i\theta}+e^{-i\theta}}{2}, \qquad \sin\theta = \frac{e^{i\theta}-e^{-i\theta}}{2i}. This second identity is the bridge chapter 3 uses. It converts the familiar real Fourier series, built from \cos and \sin, into its complex form, built from e^{in\theta}. It's the same content, written in whichever alphabet the calculation at hand finds easier.

Theorem

Euler's Formula

also known as: e^{i\theta} = \cos\theta + i\sin\theta

Recalled from Calculus II — Integral Calculus & Infinite Series · Euler's formula and complex exponentials — first taught there.

🔖

For every real number \theta, e^{i\theta} = \cos\theta + i\sin\theta.

Substitute x = i\theta into the Maclaurin series for e^x and use i^2=-1, i^3=-i, i^4=1 (the pattern repeats every four powers): e^{i\theta} = \sum_{n=0}^{\infty}\frac{(i\theta)^n}{n!} = 1 + i\theta - \frac{\theta^2}{2!} - i\frac{\theta^3}{3!} + \frac{\theta^4}{4!} + i\frac{\theta^5}{5!} - \cdots Collecting the terms with no factor of i and the terms with one factor of i into two separate sums gives e^{i\theta} = \underbrace{\left(1 - \frac{\theta^2}{2!} + \frac{\theta^4}{4!} - \cdots\right)}_{\cos\theta} + i\underbrace{\left(\theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} - \cdots\right)}_{\sin\theta}. The first parenthesis is exactly the Maclaurin series for \cos\theta and the second is exactly the Maclaurin series for \sin\theta, so e^{i\theta} = \cos\theta + i\sin\theta.

Complex numbers add like vectors

Drag z_1 or z_2. Their sum traces the same parallelogram rule as ordinary vector addition.

Loading interactive…

One point, two shadows

Drag \theta, or press Play. The point's horizontal position IS \cos\theta's height on the right, and its vertical position IS \sin\theta's height, at the same instant.

Loading interactive…

Worked example

A basic value from Euler's formula

  1. 1

    Evaluate e^{i\pi/2}.

  2. 2

    By Euler's formula, e^{i\pi/2} = \cos\frac{\pi}{2} + i\sin\frac{\pi}{2}.

  3. 3

    \cos\frac{\pi}{2}=0 and \sin\frac{\pi}{2}=1.

  4. 4
    \boxed{e^{i\pi/2} = i}

    Geometrically: the point at angle \frac{\pi}{2} (a quarter turn) on the unit circle sits directly on the imaginary axis, at height 1.

Worked example

A neighboring angle, easy to confuse

  1. 1

    Evaluate e^{i\pi}, and contrast it with e^{i\pi/2} from the previous example.

    Common trap. Euler's identity, e^{i\pi}=-1, is famous enough that it's easy to misremember which special angle produces which value.

  2. 2

    e^{i\pi} = \cos\pi + i\sin\pi = -1 + i(0) = -1, while e^{i\pi/2} = i from the previous example. Two different angles on the unit circle, two genuinely different landing points.

  3. 3

    \boxed{e^{i\pi}=-1}. Always re-derive from \cos\theta and \sin\theta at the specific \theta given, rather than pattern-matching to whichever famous identity comes to mind first.

Worked example

Converting a real sinusoid to complex-exponential form

  1. 1

    Write 3\cos\theta + 4\sin\theta using complex exponentials instead of \cos and \sin.

  2. 2

    Substitute \cos\theta=\frac{e^{i\theta}+e^{-i\theta}}{2} and \sin\theta=\frac{e^{i\theta}-e^{-i\theta}}{2i}: 3\cos\theta+4\sin\theta = 3\cdot\frac{e^{i\theta}+e^{-i\theta}}{2} + 4\cdot\frac{e^{i\theta}-e^{-i\theta}}{2i}.

    rewrite \frac1i=-i before combining, so every term shares the same denominator

  3. 3
    = \frac{3}{2}e^{i\theta}+\frac{3}{2}e^{-i\theta} - 2i\,e^{i\theta}+2i\,e^{-i\theta} = \left(\frac32-2i\right)e^{i\theta} + \left(\frac32+2i\right)e^{-i\theta}.
  4. 4
    \boxed{3\cos\theta+4\sin\theta = \left(\tfrac32-2i\right)e^{i\theta}+\left(\tfrac32+2i\right)e^{-i\theta}}

    The two coefficients are complex conjugates of each other. That's no accident. Chapter 3 shows this always happens whenever the original function is real-valued, which is exactly what makes each complex Fourier coefficient and its mirror-image coefficient conjugates of each other.

Loading interactive…

Multiplying rotates and scales at once

Drag z_1 or z_2. The product's angle is the SUM of the two angles, and its length is the PRODUCT of the two lengths.

Loading interactive…

Where this goes next

The complex Fourier series, chapter 3

Chapter 3 writes every Fourier series two ways. There's the real form, built from \cos(n\theta) and \sin(n\theta), and the complex form, built from a single family e^{in\theta} with complex coefficients. The conversion worked out above, turning a\cos\theta+b\sin\theta into a pair of conjugate exponential terms, is exactly the computation that turns one form into the other, term by term.

Check your understanding (counts toward your progress)

Which expression equals \sin\theta?

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

That combination is \cos\theta, not \sin\theta — it's the SUM, divided by 2, not 2i.

Close, but missing the i in the denominator — without it this isn't purely real for real \theta.

This isn't one of the two standard identities at all.

Why

Solving e^{i\theta}=\cos\theta+i\sin\theta and e^{-i\theta}=\cos\theta-i\sin\theta together for \sin\theta gives \sin\theta = \frac{e^{i\theta}-e^{-i\theta}}{2i}.

Subtract e^{-i\theta}=\cos\theta-i\sin\theta from e^{i\theta}=\cos\theta+i\sin\theta and see what cancels.

Find the real part of e^{i\pi/4}.

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Any equivalent form counts — 2x+3, 3 + 2·x, … Use the keypad below the field for fractions, roots, and other symbols.

Why

e^{i\pi/4} = \cos\frac{\pi}{4} + i\sin\frac{\pi}{4}, and \cos\frac{\pi}{4} = \frac{\sqrt2}{2}.

Correct answer

Also accepted:

Why

Which value equals e^{i\pi}?

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

That's e^{i\pi/2}, a quarter turn — a different angle entirely.

That's e^{i\cdot 0} or e^{2\pi i}, a full turn back to the start.

That's e^{-i\pi/2} or e^{i3\pi/2}, a different angle.

Why

e^{i\pi} = \cos\pi+i\sin\pi = -1+0i = -1.

Practice: Moving between polar angles and exponential form (4 problems · doesn’t affect your progress)

Evaluate e^{i3\pi/2} in the form a+bi (enter as a+b*i).

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Any equivalent form counts — 2x+3, 3 + 2·x, … Use the keypad below the field for fractions, roots, and other symbols.

Why

e^{i3\pi/2}=\cos\frac{3\pi}{2}+i\sin\frac{3\pi}{2} = 0 + i(-1) = -i.

Correct answer

Also accepted:

Why

-i

Which complex-exponential expression equals \cos\theta+\sin\theta?

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

The two conjugate coefficients are swapped — check which one multiplies e^{i\theta} versus e^{-i\theta} after combining the \cos and \sin substitutions.

This is 2\cos\theta alone, missing the \sin\theta contribution entirely.

This drops the e^{-i\theta} term and the \sin\theta contribution both.

Why

Substituting the exponential forms of \cos\theta and \sin\theta and collecting terms gives coefficient \frac{1-i}{2} on e^{i\theta} and \frac{1+i}{2} on e^{-i\theta} — the same pattern as the lesson's 3\cos\theta+4\sin\theta example, with both coefficients set to 1.

\left(\tfrac{1-i}{2}\right)e^{i\theta}+\left(\tfrac{1+i}{2}\right)e^{-i\theta}

Find the modulus |z| of z = 3e^{i\pi/6}.

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Why

Euler's formula's polar form z=re^{i\theta} reads the modulus straight off the coefficient out front: here r=3, regardless of the angle.

Correct answer

Also accepted:

Why

3

Which angle \theta makes e^{i\theta} = -i?

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

That angle gives \cos\frac{\pi}{2}+i\sin\frac{\pi}{2} = i, the positive imaginary axis, not -i.

That angle gives \cos\pi+i\sin\pi=-1, the negative real axis, not -i.

That angle is a full turn back to \cos 0+i\sin 0 = 1, not -i.

Why

e^{i3\pi/2}=\cos\frac{3\pi}{2}+i\sin\frac{3\pi}{2} = 0 + i(-1) = -i, three-quarters of the way around the unit circle.

\frac{3\pi}{2}

Feeling good about this section?

Take the section quiz

Every answer gets a full explanation at the end.

Graph settings

Calculator

Sign in to save highlights

Insert an equation

  • No matches.