Complex Numbers Explained: From i to Fourier Transforms
July 7, 2026 · 9 min read
Complex Numbers Explained: From i to Fourier Transforms
Complex numbers are one of those mathematical structures that look like a trick the first time you see them — and then turn out to be load-bearing in almost every quantitative field. Signal processing, quantum mechanics, control systems, electrical engineering, and computer graphics all depend on them not as a notational convenience but as the natural language of oscillation, rotation, and frequency. If you have written a Fourier transform, designed a digital filter, or studied AC circuit analysis, you have already used complex numbers whether you framed it that way or not. This guide builds the intuition from scratch: arithmetic first, geometry second, then the connection to frequency analysis.
What Is i, Exactly?
The imaginary unit i is defined as the number whose square is -1:
i² = -1
That definition sounds circular — or even nonsensical — if you are used to the real number line, where squaring any number always yields a non-negative result. The move that makes complex numbers useful is to stop trying to locate i on the real line and instead extend the number system into two dimensions.
A complex number z has a real part and an imaginary part:
z = a + bi
where a and b are ordinary real numbers. The real part is Re(z) = a and the imaginary part is Im(z) = b. Note that Im(z) is itself a real number — it is the coefficient of i, not an "imaginary" quantity in any philosophical sense.
Some concrete examples:
3 + 4i— real part 3, imaginary part 4-2 - 7i— real part -2, imaginary part -75 + 0i = 5— every real number is a complex number with zero imaginary part0 + 3i = 3i— a purely imaginary number
The set of all complex numbers is written ℂ. The real numbers ℝ sit inside ℂ as the horizontal axis. This is not a hierarchy where complex numbers are "more advanced" — it is a two-dimensional extension of the real line, and many problems that are awkward in one dimension become straightforward in two. The Complex Number Calculator can evaluate any expression in a + bi form instantly.
Arithmetic: Addition, Subtraction, and Multiplication
Addition and subtraction work component-wise — treat the real and imaginary parts independently:
(3 + 4i) + (1 - 2i) = (3+1) + (4-2)i = 4 + 2i
(3 + 4i) - (1 - 2i) = (3-1) + (4+2)i = 2 + 6i
Multiplication uses standard distribution (FOIL) plus the rule i² = -1:
(3 + 4i)(1 - 2i)
= 3·1 + 3·(-2i) + 4i·1 + 4i·(-2i)
= 3 - 6i + 4i - 8i²
= 3 - 2i - 8(-1)
= 11 - 2i
The complex conjugate of z = a + bi is z* = a - bi — flip the sign of the imaginary part. It is essential for division. To divide, multiply numerator and denominator by the conjugate of the denominator:
(3 + 4i) / (1 - 2i)
= (3 + 4i)(1 + 2i) / (1 - 2i)(1 + 2i)
= (3 + 6i + 4i + 8i²) / (1 + 4)
= (3 + 10i - 8) / 5
= (-5 + 10i) / 5
= -1 + 2i
The denominator becomes real because (a + bi)(a - bi) = a² + b² — the imaginary cross terms cancel. This trick works whenever you need to eliminate i from a denominator.
The modulus (magnitude) of z = a + bi is:
|z| = √(a² + b²)
For 3 + 4i, |z| = √(9 + 16) = √25 = 5. The modulus obeys |z₁ · z₂| = |z₁| · |z₂|, making it multiplicative — a fact that becomes critical in filter design and stability analysis.
The Complex Plane
Plot z = a + bi with a on the horizontal axis and b on the vertical axis. This is the Argand diagram or complex plane. Each complex number corresponds to a unique point; real numbers lie on the x-axis; purely imaginary numbers lie on the y-axis.
The modulus |z| is the Euclidean distance from the origin to the point (a, b). The argument arg(z) is the angle from the positive real axis, measured counterclockwise:
arg(z) = θ = arctan(b/a)
In code, always use atan2(b, a) rather than arctan(b/a) — it handles all four quadrants correctly and avoids division by zero when a = 0.
For z = -3 + 4i:
import math
a, b = -3, 4
modulus = math.sqrt(a**2 + b**2) # 5.0
argument = math.atan2(b, a) # 2.2143 rad ≈ 126.87°
The angle is in the second quadrant, as expected for a negative real part and positive imaginary part. A naive arctan(b/a) = arctan(4/-3) ≈ -53.13° would land in the fourth quadrant — completely wrong.
The unit circle — all complex numbers with |z| = 1 — is particularly important. Every point on it is cos θ + i sin θ for some angle θ, which leads directly to the polar representation.
Polar Form and Euler's Formula
Any complex number can be written in polar form using its modulus r and argument θ:
z = r(cos θ + i sin θ)
Euler's formula connects this to the exponential function:
e^(iθ) = cos θ + i sin θ
This identity is not a definition — it follows from the Taylor series of eˣ, cos x, and sin x. Expanding e^(iθ) term by term and collecting real and imaginary parts reproduces cos θ + i sin θ exactly. The polar form then becomes:
z = r · e^(iθ)
In Python, cmath handles polar conversion directly:
import cmath
z = 3 + 4j # Python uses j for the imaginary unit
r = abs(z) # 5.0
theta = cmath.phase(z) # 0.9273 radians ≈ 53.13°
# Reconstruct from polar
z_back = cmath.rect(r, theta) # (3+4j)
Multiplication in polar form is where things get elegant:
z₁ · z₂ = r₁e^(iθ₁) · r₂e^(iθ₂) = (r₁r₂) · e^(i(θ₁+θ₂))
Multiply the moduli, add the arguments. Multiplication in Cartesian form requires four real multiplications and two additions; in polar form it requires one multiplication and one addition. More importantly, it has a clean geometric meaning: scaling and rotating.
Multiplication as Rotation
Multiplying any complex number by e^(iθ) rotates it by θ radians counterclockwise around the origin, leaving its length unchanged. This is the geometric heart of complex arithmetic.
Multiply z = 3 + 4i by i = e^(iπ/2) (a 90° counterclockwise rotation):
(3 + 4i) · i = 3i + 4i² = -4 + 3i
Original: (3, 4), modulus 5, argument ≈ 53.13°. Result: (-4, 3), modulus still 5, argument ≈ 143.13°. Difference: exactly 90°.
De Moivre's theorem generalises this to integer powers:
z^n = r^n · e^(inθ) = r^n(cos(nθ) + i sin(nθ))
For z = 1 + i (r = √2, θ = π/4), compute z^8:
z^8 = (√2)^8 · e^(i · 8 · π/4)
= 16 · e^(i · 2π)
= 16 · 1
= 16
Verify the long way: (1+i)^2 = 2i, (2i)^2 = -4, (-4)^2 = 16. Same result, far fewer steps.
This rotation interpretation is why complex numbers appear in 2D graphics transformations, rigid body physics, and AC phasor diagrams. The 2×2 rotation matrix [[cos θ, -sin θ], [sin θ, cos θ]] is exactly equivalent to multiplication by e^(iθ). For matrix operations over complex fields, the Matrix Calculator supports complex entries across all standard operations.
Complex Exponentials and Oscillation
Real sinusoids appear throughout signal processing: A cos(ωt + φ). Working with them directly means tracking sine and cosine components separately and reaching for angle-addition identities. Complex exponentials collapse that bookkeeping.
A general sinusoid at angular frequency ω (radians/second) is the real part of:
z(t) = A · e^(i(ωt + φ)) = (A · e^(iφ)) · e^(iωt)
The factor A · e^(iφ) is a phasor — a single complex number encoding both amplitude A and phase offset φ. The factor e^(iωt) rotates at constant speed ω. Summing two sinusoids at the same frequency reduces to complex addition of their phasors:
import cmath, math
phasor1 = cmath.rect(3, 0) # amplitude 3, phase 0
phasor2 = cmath.rect(4, math.pi/2) # amplitude 4, phase π/2 (90°)
total = phasor1 + phasor2 # (3+0j) + (0+4j) = 3+4j
amplitude = abs(total) # 5.0
phase = cmath.phase(total) # 0.9273 rad ≈ 53.13°
The combined signal has amplitude 5 at phase 53.13°. No trigonometric identities required. This phasor technique is the standard approach in AC circuit analysis — it is exactly why impedance is a complex number (resistance plus reactance), and why power engineers work in the complex plane.
Fourier Transforms
The Discrete Fourier Transform (DFT) converts N time-domain samples into N complex frequency-domain coefficients. Each coefficient is:
X[k] = Σ(n=0 to N-1) x[n] · e^(-i · 2πkn/N)
The basis functions e^(-i·2πkn/N) are complex exponentials, each completing exactly k full rotations across the N samples. The DFT asks: how closely does the input signal resemble each basis oscillation? The answer is a complex number — its modulus is the amplitude at frequency k/N, and its argument is the phase.
In NumPy:
import numpy as np
N = 8
n = np.arange(N)
x = np.cos(2 * np.pi * n / N) # one full cycle across N samples
X = np.fft.fft(x)
print(np.round(np.abs(X), 10))
# [0. 4. 0. 0. 0. 0. 0. 4.]
Energy appears only at k=1 and its mirror k=7, each with magnitude 4 (= N/2 for a real cosine). A pure cosine at frequency f always produces two symmetric DFT bins. A sine at the same frequency produces the same magnitude pattern but rotated phases — cmath.phase(X[1]) shifts by -π/2.
The FFT (Cooley-Tukey algorithm) computes the DFT in O(N log N) instead of O(N²) by exploiting the periodicity of e^(-i·2πkn/N). For N = 1,048,576 (2²⁰), the DFT requires roughly 1.1 trillion multiply-accumulate operations; the FFT needs about 21 million — a 50,000x reduction. That gap is why real-time audio processing, radar, and image compression are practical. The Scientific Calculator covers the transcendental functions underlying these transforms, including e^z for complex inputs.
Conclusion
Complex numbers extend the real line into two dimensions, and that extension pays off across nearly every branch of quantitative computing. The key ideas to carry forward: a complex number is a point in the plane; its modulus is distance from the origin; its argument is angle; multiplication scales and rotates; Euler's formula connects exponentials to sinusoids; phasors reduce sinusoidal addition to vector addition; and the Fourier transform decomposes any signal into complex amplitudes at each frequency. These are not separate topics — they are the same idea expressed at increasing levels of abstraction.
For hands-on exploration, the Complex Number Calculator handles arithmetic, polar conversion, modulus, and argument calculations directly in your browser. If your work involves matrices over complex fields, the Matrix Calculator supports complex entries for determinants, inverses, and eigenvalue problems. For general scientific computation including complex exponentials and logarithms, the Scientific Calculator covers the full range of relevant functions.
Try these free tools
Free & private — all tools run in your browser, nothing uploaded.