terican

Last verified · v1.0

Calculator · math

Complex Root Calculator

Calculate all n distinct nth roots of any complex number a + bi using De Moivre's theorem. Returns real or imaginary component of each root w_k.

FreeInstantNo signupOpen source

Inputs

Root Component Value

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Root Component Value

The formula

How the
result is
computed.

Understanding Complex nth Roots

Every non-zero complex number z = a + bi has exactly n distinct complex nth roots. The Complex Root Calculator applies De Moivre's theorem in polar form to compute each root with precision, returning the real or imaginary component of any selected root wk.

Step 1: Converting to Polar Form

The calculation begins by converting the rectangular form z = a + bi into polar form using two fundamental quantities:

  • Modulus (r): r = √(a² + b²) — the distance from the origin to the point (a, b) in the complex plane.
  • Argument (θ): θ = atan2(b, a) — the angle in radians measured counterclockwise from the positive real axis, with range (−π, π].

The atan2 function handles all four quadrants correctly. For example, z = −1 + 0i yields r = 1 and θ = π, while z = 1 + i yields r = √2 and θ = π/4 ≈ 0.7854 rad. This two-argument form avoids the quadrant ambiguity of the single-argument arctangent.

Step 2: The nth Root Formula

With r and θ established, each of the n distinct nth roots is computed as:

wk = r1/n · [cos((θ + 2πk)/n) + i · sin((θ + 2πk)/n)]

where k = 0, 1, 2, …, n − 1. The root at k = 0 is the principal root. All n roots share the same modulus r1/n but are equally spaced around a circle of that radius in the complex plane, each separated by an angular gap of 2π/n radians (360°/n).

Worked Example: Cube Roots of −8

Find all three cube roots of z = −8 + 0i with n = 3.

  • Modulus: r = √(64 + 0) = 8
  • Argument: θ = atan2(0, −8) = π ≈ 3.14159 rad
  • Shared magnitude: r1/3 = 81/3 = 2
  • k = 0 (principal): w0 = 2[cos(π/3) + i·sin(π/3)] = 1 + i√3 ≈ 1 + 1.7321i
  • k = 1: w1 = 2[cos(π) + i·sin(π)] = −2 + 0i
  • k = 2: w2 = 2[cos(5π/3) + i·sin(5π/3)] = 1 − i√3 ≈ 1 − 1.7321i

Verification: (−2)3 = −8 ✓. All three roots satisfy w3 = −8, and they lie exactly 120° apart on a circle of radius 2 centered at the origin.

Square Roots of a Complex Number

For n = 2, the formula yields exactly two roots 180° apart. For z = 3 + 4i: r = 5, θ = atan2(4, 3) ≈ 0.9273 rad, and r1/2 = √5 ≈ 2.2361. The two square roots are w0 ≈ 2 + i and w1 ≈ −2 − i. For any real positive z, both roots are real; for any real negative z, both roots are purely imaginary; for general complex z, the two roots are unrelated complex numbers.

Applications of Complex Roots

  • Electrical engineering: Phasor analysis of AC circuits relies on complex exponentials derived from roots of unity, enabling impedance calculations across all frequencies.
  • Signal processing: The Fast Fourier Transform (FFT) uses the n-th roots of unity as twiddle factors, enabling O(n log n) transforms that underpin modern audio and image compression.
  • Control systems: Locations of characteristic polynomial roots in the complex plane determine closed-loop stability. Roots with negative real parts indicate stable exponential decay.
  • Differential equations: Complex characteristic roots α ± βi produce oscillatory solutions of the form eαt(C1cos(βt) + C2sin(βt)), as detailed in Paul's Online Math Notes on Complex Roots.

Methodology and Sources

This calculator implements the standard polar-form nth root algorithm derived from De Moivre's theorem. The atan2 convention follows IEEE 754 floating-point practice, ensuring correct branch selection across all quadrants without division-by-zero errors. Computational implementation follows practices documented in UC Berkeley's guide to Working with Complex Numbers. Numerical root stability analysis draws from NIST research on calculating zeros of polynomials. Algebraic treatment of complex roots in educational contexts follows Louisiana DOE Algebra II Teacher Companion standards.

Reference

Frequently asked questions

How many nth roots does a complex number have?
Every non-zero complex number has exactly n distinct nth roots. For example, any complex number has 2 square roots, 3 cube roots, and 4 fourth roots. These roots are always equally spaced by 360°/n around a circle of radius r^(1/n) in the complex plane. The only exception is zero itself, which has exactly one nth root: zero.
What is the principal root of a complex number?
The principal root is the nth root corresponding to k = 0 in the formula w_k = r^(1/n)[cos((θ + 2πk)/n) + i·sin((θ + 2πk)/n)]. It uses the principal argument θ = atan2(b, a) with no added 2π offset. For positive real numbers, the principal nth root is always the positive real result — for instance, the principal square root of 9 is 3, not −3, and the principal cube root of 8 is 2.
Why does the complex root formula use atan2 instead of arctan?
The standard arctan function returns values only in the range (−π/2, π/2), covering just the right half of the complex plane and losing quadrant information. The atan2(b, a) function accepts both coordinates as separate arguments and returns the full-range angle in (−π, π]. For instance, atan2(1, −1) = 3π/4, while arctan(1/−1) = −π/4 — a difference of π that would produce entirely wrong roots for numbers in the second and third quadrants.
What does the Output Component setting control?
The Output Component setting selects which part of the computed complex root w_k = x + yi to display. Choosing 'real' returns x = r^(1/n)·cos((θ + 2πk)/n), the horizontal coordinate in the complex plane. Choosing 'imaginary' returns y = r^(1/n)·sin((θ + 2πk)/n), the vertical coordinate. This is useful when only one component feeds a downstream calculation — for example, extracting the real part of a characteristic root to determine system stability, where a negative real part confirms exponential decay.
Can the nth root of a complex number ever be a real number?
Yes. When z is a positive real number, the principal nth root (k = 0) is always a positive real number — for example, the principal fourth root of 16 is 2. When z is a negative real number and n is odd, exactly one of the n roots is a negative real number — the real cube root of −27 is −3. However, when n is even and z is negative, all n roots are non-real complex numbers, since squaring any real number always yields a non-negative result.
How are complex roots used in solving polynomial equations?
The nth root formula directly solves binomial equations of the form z^n = c. For general polynomials of degree n, the Fundamental Theorem of Algebra guarantees exactly n complex roots counting multiplicity. For real-coefficient polynomials, complex roots always appear in conjugate pairs — if a + bi is a root, so is a − bi. This conjugate-pair property is fundamental in control engineering, where the locations of characteristic polynomial roots in the complex plane determine both the stability and the oscillatory behavior of a system.