MATH-334 · Lesson 1 of 12 · 24 min

Complex numbers: algebra, geometry and polar form

Complex analysis is the study of functions of a complex variable. It is one of the most beautiful parts of mathematics and one of the most useful. Electrical engineers use it to analyze alternating current circuits and filters, physicists use it to solve problems in electrostatics, heat flow and fluid mechanics, and mathematicians use it to count prime numbers and evaluate integrals that resist every technique of real calculus. This course assumes the multivariable calculus of MATH-209: partial derivatives, line integrals and Green's theorem. Rigorous proofs at the level of MATH-241 Real Analysis I help but are not required; we prove the main theorems carefully, and we use Python throughout to check results numerically.

This first lesson builds the number system itself. We define complex numbers, learn their algebra, and then see that every complex number is also a point and a vector in the plane. The geometric picture, and especially the polar form, will make multiplication, powers and roots almost effortless.

Why complex numbers?

The complex numbers did not arise from the equation \(x^2 + 1 = 0\), as is often said. Mathematicians were happy to declare that equation unsolvable. They arose from cubic equations. In 1545 Gerolamo Cardano published, in his book Ars Magna, a formula for the roots of cubics such as \(x^3 = 15x + 4\). For that equation the formula produces the expression \(\sqrt[3]{2 + \sqrt{-121}} + \sqrt[3]{2 - \sqrt{-121}}\), which involves the square root of a negative number, even though the equation has the perfectly real root \(x = 4\). Around 1572 Rafael Bombelli showed that if you calculate formally with \(\sqrt{-1}\), treating it like any other symbol and replacing its square by \(-1\), then \(2 + \sqrt{-121} = (2 + \sqrt{-1})^3\), and the two cube roots add up to 4. Imaginary quantities were a working tool for reaching real answers long before anyone could say what they were.

Over the next two centuries Leonhard Euler used complex numbers freely, introduced the symbol \(i\) for \(\sqrt{-1}\) in 1777, and discovered the formula \(e^{i\theta} = \cos\theta + i\sin\theta\). The picture of complex numbers as points in a plane was published by the Norwegian surveyor Caspar Wessel in 1799 and independently by Jean-Robert Argand in 1806; Carl Friedrich Gauss popularized it in the 1830s. In the 1820s and 1830s Augustin-Louis Cauchy built the theory of complex integration that is the heart of this course, and in 1851 Bernhard Riemann gave the geometric theory of analytic functions in his doctoral thesis.

The definition

A complex number is an expression \(z = x + iy\), where \(x\) and \(y\) are real numbers and \(i\) is a symbol satisfying \(i^2 = -1\). The real number \(x\) is the real part of \(z\), written \(\operatorname{Re} z\), and \(y\) is the imaginary part, written \(\operatorname{Im} z\). The imaginary part is a real number: \(\operatorname{Im}(3 - 4i) = -4\), not \(-4i\). Two complex numbers are equal exactly when their real parts are equal and their imaginary parts are equal. The set of all complex numbers is written \(\mathbb{C}\).

Addition and multiplication follow the usual rules of algebra together with \(i^2 = -1\):

\[(a + ib) + (c + id) = (a + c) + i(b + d), \qquad (a + ib)(c + id) = (ac - bd) + i(ad + bc).\]

To be fully rigorous, one can define \(\mathbb{C}\) as the set of ordered pairs \((x, y)\) of real numbers, with \((a, b) + (c, d) = (a + c, b + d)\) and \((a, b)(c, d) = (ac - bd, ad + bc)\), and then write \(i\) for \((0, 1)\). This removes any mystery: \(i\) is just a pair of real numbers, and \(i^2 = (0, 1)(0, 1) = (-1, 0)\), which we identify with the real number \(-1\). With these operations \(\mathbb{C}\) is a field: addition and multiplication are associative and commutative, multiplication distributes over addition, 0 and 1 are identities, and every non-zero number has a multiplicative inverse. Unlike \(\mathbb{R}\), however, \(\mathbb{C}\) cannot be ordered in a way compatible with its arithmetic. If it could, either \(i > 0\) or \(i < 0\), and in both cases \(i^2 = -1 > 0\), which is false. So inequalities such as \(z < w\) have no meaning for complex numbers; we compare only their sizes.

Conjugate, modulus and division

The complex conjugate of \(z = x + iy\) is \(\bar{z} = x - iy\). Conjugation respects the arithmetic: \(\overline{z + w} = \bar{z} + \bar{w}\) and \(\overline{zw} = \bar{z}\,\bar{w}\). It also extracts the real and imaginary parts: \(\operatorname{Re} z = \frac{z + \bar{z}}{2}\) and \(\operatorname{Im} z = \frac{z - \bar{z}}{2i}\). A number is real exactly when \(z = \bar{z}\).

The modulus, or absolute value, of \(z\) is \(|z| = \sqrt{x^2 + y^2}\). It is the distance from the origin to the point \((x, y)\), so \(|z - w|\) is the distance between \(z\) and \(w\). The key identity linking conjugate and modulus is

\[z\bar{z} = (x + iy)(x - iy) = x^2 + y^2 = |z|^2.\]

This identity makes division easy. To divide by \(w \ne 0\), multiply top and bottom by \(\bar{w}\), which turns the denominator into the positive real number \(|w|^2\):

\[\frac{z}{w} = \frac{z\bar{w}}{w\bar{w}} = \frac{z\bar{w}}{|w|^2}.\]

For example, \(\frac{1 + 2i}{3 - 4i} = \frac{(1 + 2i)(3 + 4i)}{25} = \frac{3 + 4i + 6i + 8i^2}{25} = \frac{-5 + 10i}{25} = -\frac{1}{5} + \frac{2}{5}i\). In particular \(\frac{1}{z} = \frac{\bar{z}}{|z|^2}\), and \(\frac{1}{i} = -i\).

The modulus is multiplicative: \(|zw| = |z|\,|w|\). The proof is one line, \(|zw|^2 = zw\,\overline{zw} = z\bar{z}\,w\bar{w} = |z|^2|w|^2\). The modulus also satisfies the triangle inequality \(|z + w| \le |z| + |w|\) and the reverse triangle inequality \(\big|\,|z| - |w|\,\big| \le |z - w|\). These inequalities do in complex analysis exactly what they do in real analysis: they let us estimate sizes we cannot compute exactly.

Proof of the triangle inequality. Compute \(|z + w|^2 = (z + w)(\bar{z} + \bar{w}) = |z|^2 + |w|^2 + z\bar{w} + \bar{z}w = |z|^2 + |w|^2 + 2\operatorname{Re}(z\bar{w})\). Since the real part of a number is at most its modulus, \(\operatorname{Re}(z\bar{w}) \le |z\bar{w}| = |z|\,|w|\). Hence \(|z + w|^2 \le (|z| + |w|)^2\), and taking square roots gives the result. \(\blacksquare\)

The complex plane

Identify \(z = x + iy\) with the point \((x, y)\). The horizontal axis is the real axis and the vertical axis is the imaginary axis. This picture is called the complex plane or Argand diagram. Addition is vector addition: \(z + w\) is the fourth corner of the parallelogram with sides \(z\) and \(w\). Subtraction gives the vector from \(w\) to \(z\). Conjugation is reflection in the real axis, and negation is rotation by a half turn about the origin.

The complex plane with the point z equal to 3 plus 2i, its modulus r drawn as a segment from the origin, the argument theta measured from the positive real axis, and the conjugate 3 minus 2i reflected below the real axis.
A complex number as a point: modulus, argument and conjugate

Many sets in the plane have neat descriptions. The circle of radius \(r\) about \(z_0\) is \(\{z : |z - z_0| = r\}\), the open disk is \(\{z : |z - z_0| < r\}\), the line \(\operatorname{Re} z = 2\) is a vertical line, and the set \(\{z : |z - 1| = |z + 1|\}\) is the imaginary axis, since it is the set of points equidistant from 1 and \(-1\).

Polar form

Every non-zero complex number can be written in polar form. If \(r = |z|\) and \(\theta\) is the angle from the positive real axis to the segment from 0 to \(z\), measured counterclockwise, then \(x = r\cos\theta\) and \(y = r\sin\theta\), so

\[z = r(\cos\theta + i\sin\theta) = re^{i\theta}.\]

For now, read \(e^{i\theta}\) as shorthand for \(\cos\theta + i\sin\theta\); lesson 5 defines the complex exponential properly and shows that this is Euler's formula. The angle \(\theta\) is called an argument of \(z\), written \(\arg z\). It is not unique: adding any multiple of \(2\pi\) gives the same point. The principal argument \(\operatorname{Arg} z\) is the unique argument in the interval \((-\pi, \pi]\). For example, \(\operatorname{Arg}(-1) = \pi\), \(\operatorname{Arg}(-i) = -\frac{\pi}{2}\), and \(\operatorname{Arg}(-1 - i) = -\frac{3\pi}{4}\). The multi-valuedness of the argument looks like a nuisance now, but it is the source of the most interesting behavior of the logarithm and of powers, and, in lesson 10, of the residue theorem itself.

To find an argument, use \(\tan\theta = \frac{y}{x}\) with care about the quadrant: \(\arctan\) alone returns angles in \((-\frac{\pi}{2}, \frac{\pi}{2})\) and cannot tell \(1 + i\) from \(-1 - i\). Python's math.atan2(y, x) and cmath.phase(z) handle the quadrants correctly and return the principal argument.

Multiplication is rotation and scaling

The polar form reveals what multiplication does. If \(z = r(\cos\alpha + i\sin\alpha)\) and \(w = s(\cos\beta + i\sin\beta)\), then multiplying out and using the angle addition formulas,

\[zw = rs\big[(\cos\alpha\cos\beta - \sin\alpha\sin\beta) + i(\sin\alpha\cos\beta + \cos\alpha\sin\beta)\big] = rs\big(\cos(\alpha + \beta) + i\sin(\alpha + \beta)\big).\]

So to multiply complex numbers, multiply their moduli and add their arguments. In exponential notation this is just \(re^{i\alpha} \cdot se^{i\beta} = rse^{i(\alpha + \beta)}\). Multiplying by \(i = e^{i\pi/2}\) rotates every point by a quarter turn counterclockwise; multiplying by \(2e^{i\pi/6}\) doubles distances from the origin and rotates by 30 degrees. Division divides moduli and subtracts arguments. This is the first sign of a theme of the whole course: complex multiplication is a geometric operation, and functions built from it act on the plane by local rotations and scalings.

De Moivre's formula, powers and roots

Applying the multiplication rule \(n\) times gives de Moivre's formula, named for Abraham de Moivre:

\[(\cos\theta + i\sin\theta)^n = \cos n\theta + i\sin n\theta \quad \text{for every integer } n.\]

For positive \(n\) this follows by induction from the multiplication rule; for \(n = 0\) both sides are 1; and for negative \(n\) it follows because \(\frac{1}{\cos\theta + i\sin\theta} = \cos\theta - i\sin\theta = \cos(-\theta) + i\sin(-\theta)\). The formula is a powerful way to derive trigonometric identities. Expanding \((\cos\theta + i\sin\theta)^3\) by the binomial theorem and comparing real parts gives \(\cos 3\theta = \cos^3\theta - 3\cos\theta\sin^2\theta = 4\cos^3\theta - 3\cos\theta\).

Powers become easy. To compute \((1 + i)^{10}\), write \(1 + i = \sqrt{2}e^{i\pi/4}\); then \((1 + i)^{10} = 2^5 e^{i\,10\pi/4} = 32e^{i\pi/2} = 32i\). Expanding with the binomial theorem would take eleven terms.

Roots are where the multi-valued argument pays off. To solve \(z^n = w\) with \(w = \rho e^{i\varphi} \ne 0\), write \(z = re^{i\theta}\). Then \(r^n e^{in\theta} = \rho e^{i\varphi}\), so \(r^n = \rho\) and \(n\theta = \varphi + 2\pi k\) for some integer \(k\). Hence \(r = \rho^{1/n}\), the positive real root, and

\[z_k = \rho^{1/n} e^{i(\varphi + 2\pi k)/n}, \qquad k = 0, 1, \dots, n - 1.\]

Other values of \(k\) repeat these. So every non-zero complex number has exactly \(n\) distinct \(n\)th roots, equally spaced on a circle of radius \(\rho^{1/n}\). The solutions of \(z^n = 1\) are the \(n\)th roots of unity \(\omega^k\), where \(\omega = e^{2\pi i/n}\); they form a regular \(n\)-gon inscribed in the unit circle with one vertex at 1. Their sum is 0 when \(n \ge 2\), because \(1 + \omega + \dots + \omega^{n-1} = \frac{\omega^n - 1}{\omega - 1} = 0\).

The six sixth roots of unity drawn as the vertices of a regular hexagon on the unit circle, starting at 1 and spaced 60 degrees apart, with the root omega labeled.
The sixth roots of unity form a regular hexagon on the unit circle

Worked problem

Cube roots

Find all solutions of \(z^3 = -8i\).

Show solution
  1. Write \(-8i = 8e^{-i\pi/2}\), so \(\rho = 8\) and \(\varphi = -\frac{\pi}{2}\).
  2. The roots have modulus \(8^{1/3} = 2\) and arguments \(\frac{-\pi/2 + 2\pi k}{3}\) for \(k = 0, 1, 2\), namely \(-\frac{\pi}{6}\), \(\frac{\pi}{2}\) and \(\frac{7\pi}{6}\).
  3. So \(z_0 = 2e^{-i\pi/6} = \sqrt{3} - i\), \(z_1 = 2e^{i\pi/2} = 2i\) and \(z_2 = 2e^{i7\pi/6} = -\sqrt{3} - i\).
  4. Check one: \((2i)^3 = 8i^3 = -8i\).

Answer: The three roots \(\sqrt{3} - i\), \(2i\) and \(-\sqrt{3} - i\) are the vertices of an equilateral triangle on the circle of radius 2.

Quadratic equations and the fundamental theorem

The quadratic formula works over \(\mathbb{C}\) for any complex coefficients, provided we interpret \(\sqrt{b^2 - 4ac}\) as either square root of the discriminant. For instance \(z^2 + 2z + 5 = 0\) gives \(z = \frac{-2 \pm \sqrt{-16}}{2} = -1 \pm 2i\). More remarkably, every non-constant polynomial with complex coefficients has a complex root. This is the fundamental theorem of algebra. Gauss gave a proof in his 1799 doctoral dissertation, though by modern standards it had a gap, and many proofs have been found since. In lesson 8 we will prove it in four lines using Liouville's theorem, one of the first rewards of complex analysis. A consequence is that every polynomial of degree \(n\) factors completely into \(n\) linear factors over \(\mathbb{C}\).

For polynomials with real coefficients, non-real roots come in conjugate pairs: if \(p(z) = 0\) then \(p(\bar{z}) = \overline{p(z)} = 0\), because conjugation respects sums and products and leaves real coefficients alone.

Computing with complex numbers in Python

Python has complex numbers built in. The literal 3+4j is the complex number \(3 + 4i\); engineers write \(j\) because \(i\) usually denotes current. The cmath module provides polar conversion, the principal argument and complex versions of the elementary functions. Floating-point arithmetic introduces tiny rounding errors, so results such as \(10^{-16}i\) should be read as zero.

Complex arithmetic, polar form and roots with the cmath module
import cmath, math

z = 3 + 4j
w = 1 - 2j
print("z + w =", z + w, "  z * w =", z * w, "  z / w =", z / w)
print("|z| =", abs(z), "  conj(z) =", z.conjugate(), "  z*conj(z) =", z * z.conjugate())

r, theta = cmath.polar(-1 - 1j)
print(f"-1-i in polar form: r = {r:.4f}, Arg = {theta:.4f} = {theta/math.pi:.2f} pi")

# Multiplication adds arguments and multiplies moduli.
a, b = cmath.rect(2, math.pi/6), cmath.rect(3, math.pi/4)
p = a * b
print(f"|ab| = {abs(p):.4f} (2*3 = 6),  Arg(ab)/pi = {cmath.phase(p)/math.pi:.4f} (1/6 + 1/4 = {1/6+1/4:.4f})")

# (1+i)^10 by polar form and directly
print("(1+i)^10 =", (1 + 1j) ** 10)

# All n-th roots of w
def roots(w, n):
    rho, phi = cmath.polar(w)
    return [cmath.rect(rho ** (1/n), (phi + 2*math.pi*k)/n) for k in range(n)]

for zk in roots(-8j, 3):
    print(f"root {zk.real:+.4f}{zk.imag:+.4f}i   cubed = {zk**3:.4f}")
unity = roots(1, 6)
print("sum of the sixth roots of unity has size", f"{abs(sum(unity)):.1e}")
Output
z + w = (4+2j)   z * w = (11-2j)   z / w = (-1+2j)
|z| = 5.0   conj(z) = (3-4j)   z*conj(z) = (25+0j)
-1-i in polar form: r = 1.4142, Arg = -2.3562 = -0.75 pi
|ab| = 6.0000 (2*3 = 6),  Arg(ab)/pi = 0.4167 (1/6 + 1/4 = 0.4167)
(1+i)^10 = 32j
root +1.7321-1.0000i   cubed = 0.0000-8.0000j
root +0.0000+2.0000i   cubed = -0.0000-8.0000j
root -1.7321-1.0000i   cubed = -0.0000-8.0000j
sum of the sixth roots of unity has size 4.6e-16

Common mistakes

Common mistakes

  • MistakeWriting \(\operatorname{Im}(3 - 4i) = -4i\).

    InsteadThe imaginary part is the real number \(-4\); the imaginary component of the point is \(-4i\).

  • MistakeFinding the argument of \(-1 - i\) as \(\arctan(1) = \frac{\pi}{4}\).

    InsteadThe point is in the third quadrant; its principal argument is \(-\frac{3\pi}{4}\). Use atan2 or check the quadrant.

  • MistakeUsing \(\sqrt{zw} = \sqrt{z}\sqrt{w}\) freely.

    InsteadWith principal roots it fails: \(\sqrt{-1}\sqrt{-1} = i \cdot i = -1\) but \(\sqrt{(-1)(-1)} = 1\). Square roots are two-valued.

  • MistakeListing only one \(n\)th root.

    InsteadA non-zero number has exactly \(n\) distinct \(n\)th roots, spaced \(\frac{2\pi}{n}\) apart.

  • MistakeWriting \(z < w\) for complex numbers.

    Instead\(\mathbb{C}\) has no compatible order; compare moduli \(|z| < |w|\) or real parts instead.

Summary and key terms

  • Complex numbers \(x + iy\) form a field \(\mathbb{C}\) with \(i^2 = -1\); they arose in the sixteenth century from Cardano's and Bombelli's work on cubic equations.
  • The conjugate satisfies \(z\bar{z} = |z|^2\), which gives division and the multiplicativity of the modulus.
  • In the complex plane, addition is vector addition and the modulus is distance; the triangle inequality holds.
  • Polar form \(z = re^{i\theta}\) turns multiplication into multiplying moduli and adding arguments.
  • De Moivre's formula gives powers, and every non-zero number has exactly \(n\) distinct \(n\)th roots on a circle.
Modulus
\(|z| = \sqrt{x^2 + y^2}\), the distance from 0 to \(z\).
Conjugate
\(\bar{z} = x - iy\), the reflection of \(z\) in the real axis.
Argument
An angle \(\theta\) with \(z = |z|e^{i\theta}\); defined up to multiples of \(2\pi\).
Principal argument
The argument \(\operatorname{Arg} z\) in \((-\pi, \pi]\).
Roots of unity
The \(n\) solutions \(e^{2\pi ik/n}\) of \(z^n = 1\).

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Write \(\frac{2 + i}{1 - i}\) in the form \(x + iy\).

    Show answer

    Multiply by \(\frac{1 + i}{1 + i}\): \(\frac{(2 + i)(1 + i)}{2} = \frac{1 + 3i}{2} = \frac{1}{2} + \frac{3}{2}i\).

  2. Find the modulus and principal argument of \(-\sqrt{3} + i\).

    Show answer

    \(|z| = 2\); the point is in the second quadrant with reference angle \(\frac{\pi}{6}\), so \(\operatorname{Arg} z = \frac{5\pi}{6}\).

  3. Compute \((1 - i)^8\).

    Show answer

    \(1 - i = \sqrt{2}e^{-i\pi/4}\), so \((1 - i)^8 = 16e^{-2\pi i} = 16\).

  4. Find the fourth roots of \(-16\).

    Show answer

    \(-16 = 16e^{i\pi}\); roots \(2e^{i(\pi + 2\pi k)/4}\): \(\sqrt{2}(\pm 1 \pm i)\), all four sign choices.

  5. Describe the set \(\{z : |z - i| < |z + i|\}\).

    Show answer

    Points closer to \(i\) than to \(-i\): the open upper half-plane \(\operatorname{Im} z > 0\).

  6. Use de Moivre's formula to express \(\sin 2\theta\) and \(\cos 2\theta\) in terms of \(\cos\theta\) and \(\sin\theta\).

    Show answer

    \((\cos\theta + i\sin\theta)^2 = \cos^2\theta - \sin^2\theta + 2i\sin\theta\cos\theta\); compare parts: \(\cos 2\theta = \cos^2\theta - \sin^2\theta\), \(\sin 2\theta = 2\sin\theta\cos\theta\).

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz