De Moivre's Theorem Calculator (Powers and nth Roots of Complex Numbers with Steps and a Polygon Graph)
Choose what to find, then enter the real part a and the imaginary part b of z = a + bi, and the whole number n. The expression below is linked to the input fields, so you can also edit the numbers directly in it.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and figures
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Find the \(n\)th power \(z^n\) of a complex number \(z = a + bi\) for a whole number \(n\) (1 to 20) on the spot. Built on De Moivre's theorem \(\left(\cos\theta + i\sin\theta\right)^n = \cos n\theta + i\sin n\theta\), the steps show one at a time the absolute value raised to the power, \(r^n\), and the argument multiplied by \(n\), \(n\theta\)
- The answer \(z^n\) is always shown as an exact value with whole numbers and fractions. When the argument is a special angle (on an axis or a multiple of 45°), the steps also use exact trig values
- In nth roots mode, it lists all \(n\) complex numbers \(w\) with \(w^n = z\) (the \(n\)th roots of \(z\)), from \(k = 0\) to \(n-1\) (\(n\) from 2 to 12). Roots that can be written exactly are given as exact values, such as \(-1 + \sqrt{3}i\)
- You can also see the result on the complex plane. The \(n\)th roots appear as a regular polygon with \(n\) sides, evenly spaced on a circle of radius \(\sqrt[n]{r}\), and a power appears as the points \(z\) and \(z^n\) with arcs for their arguments
- The expression above the input fields (MathLive) is linked to them, so you can also edit the numbers in \(\left(1 + i\right)^{4}\) directly
What is this calculation used for?
Set \(n = 2\) or \(3\) in De Moivre's theorem, expand the left side, and compare the real and imaginary parts. This gives the double- and triple-angle formulas in one go, such as \(\cos 2\theta = \cos^2\theta - \sin^2\theta\) and \(\cos 3\theta = 4\cos^3\theta - 3\cos\theta\).
The strength is that you can rebuild the formulas yourself from this theorem instead of memorizing them, and "use De Moivre's theorem to derive the triple-angle formula" is a classic Precalculus exercise. It is a theorem with a great view, tying together trigonometry and complex numbers, two topics you learned separately.
Behind listening to music or saving a photo on your phone runs a calculation called the discrete Fourier transform, which breaks a signal down into "how much of each wave pitch is in it". The heart of this calculation is the \(n\)th roots of unity: each data value of the signal is multiplied by a power of an \(n\)th root of unity, and the results are added up.
Audio compression, image compression (the transforms used in JPEG), noise removal, speech recognition and other technologies for digital sound and images are all built on the "complex numbers that split a circle evenly" on this page.
The three-phase AC power sent from power plants to factories and large buildings is made of three waves whose timing is shifted by 120° from each other. Written with complex numbers, these "120° shifts" are exactly the cube roots of unity \(1,\ \omega,\ \omega^2\). The three waves add up to 0 (\(1 + \omega + \omega^2 = 0\)), and this cancellation is the very reason three-phase power saves on transmission wires.
The design of the utility grid and the control of factory motors are built on this property of the cube roots of unity.
In games and graphics, tasks such as "placing enemies evenly around a circle", "placing the corners of a radar chart" or "drawing the marks on a clock face" are nothing more than finding the coordinates \(\left(\cos\dfrac{2k\pi}{n},\ \sin\dfrac{2k\pi}{n}\right)\) of the points that split a circle into \(n\) equal parts. This is exactly the layout of the \(n\)th roots of unity.
In programming, multiplying a complex number by an \(n\)th root of unity is enough to "rotate a point to the next vertex", so it is used as a simple tool for rotating and evenly spacing things.
Formulas and figures
Symbols and terms
Symbols
| \(i\) | i | The imaginary unit, the number whose square is \(-1\) (\(i^2 = -1\)). The letter comes from "imaginary". |
| \(z\) | z | The letter usually used for a complex number. By custom, \(z\) and \(w\) are used for complex numbers, to tell them apart from real variables \(x,\ y\). |
| \(w\) | w | On this page, the letter for an \(n\)th root of \(z\) (a complex number with \(w^n = z\)). It follows the custom of using \(w\), the letter just before \(z\) in the alphabet, for a second complex number. |
| \(a,\ b\) | a, b | The real part (\(a\)) and the imaginary part (\(b\)) of \(z = a + bi\). Both are real numbers. On the complex plane, \(a\) is the position across (along the real axis) and \(b\) is the position up (along the imaginary axis). |
| \(r\) | r | The letter for the absolute value (the distance from the origin to the point \(z\)). It comes from "radius". In polar form it is a real number that is 0 or more. |
| \(\theta\) | theta | The Greek letter used for the argument. In math it is the usual letter for an angle. |
| \(n\) | n | On this page, the whole number that is the exponent of a power (which power) or the index of a root (which root). It comes from "number". |
| \(k\) | k | The letter that numbers the \(n\)th roots (from \(0\) to \(n-1\)). Counting letters are usually \(i,\ j,\ k\), but with complex numbers \(i\) is easily confused with the imaginary unit, so \(k\) is the usual choice. |
| \(\sqrt[n]{\ }\) | nth root | The \(n\)th root sign. \(\sqrt[3]{8} = 2\) says "the positive number whose cube is 8 is 2". The small number at the upper left is the index of the root; with no number, it is a square root. |
| \(\cos\theta,\ \sin\theta\) | cosine theta, sine theta | Trigonometric functions. On the circle of radius 1 (the unit circle), the point in the direction of angle \(\theta\) has horizontal position \(\cos\theta\) and vertical position \(\sin\theta\). In polar form they are the part that gives the direction. |
| \(\pi\) | pi | The ratio of a circle's circumference to its diameter (about 3.14159). In radians, a half turn, \(180^{\circ}\), is exactly \(\pi\), and a full turn is \(2\pi\). The Greek letter \(\pi\) is said to come from the first letter of the Greek word for "perimeter". |
| \(\omega\) | omega | The usual letter for the imaginary cube root of 1 (\(\omega = -\dfrac{1}{2} + \dfrac{\sqrt{3}}{2}i\)). It satisfies \(\omega^3 = 1\) and \(\omega^2 + \omega + 1 = 0\). It is the last letter of the Greek alphabet and is widely used for roots of unity. |
Terms
| complex number | A number of the form \(a + bi\), where \(a\) and \(b\) are real numbers. It is a number system that brings the real and imaginary numbers together, taught in Algebra 2. |
| imaginary unit | The number \(i\) whose square is \(-1\). No real number has a negative square, so it was introduced as a new number. |
| complex plane | The plane where \(a + bi\) is shown as the point \((a,\ b)\). The horizontal axis is the real axis and the vertical axis is the imaginary axis. A drawing of it is also called an Argand diagram. It is taught in Precalculus. |
| polar form | Writing a complex number with its distance \(r\) from the origin and its angle of rotation \(\theta\) from the real axis, as \(r(\cos\theta + i\sin\theta)\). Also called trigonometric form. De Moivre's theorem is about complex numbers in this form. |
| absolute value (modulus) | The distance from the origin to the point \(z\), calculated as \(|z| = \sqrt{a^2 + b^2}\). Taking the \(n\)th power raises the absolute value to the \(n\)th power (\(r^n\)). |
| argument | The angle of the direction from the origin to the point \(z\), measured counterclockwise from the positive real axis. Adding a full turn (\(2\pi\)) gives the same direction, so by convention the answer is given in the range \(0 \le \theta < 2\pi\). Taking the \(n\)th power multiplies the argument by \(n\) (\(n\theta\)). |
| exponentiation (raising to a power) | Multiplying the same number by itself again and again. \(z^4\) is \(z\) multiplied together 4 times. The small raised number is the exponent. |
| nth root | A number whose \(n\)th power is the given number. Among the complex numbers, every nonzero complex number has exactly \(n\) \(n\)th roots (among the real numbers, 8 has only one cube root, 2, but among the complex numbers it has three). |
| nth roots of unity | The complex numbers with \(z^n = 1\). They are the \(n\) points that split the unit circle into \(n\) equal parts, and they form a regular polygon with \(n\) sides that has \(1\) as one vertex. ("Unity" is another word for 1.) |
| De Moivre's theorem | The theorem \(\left(\cos\theta + i\sin\theta\right)^n = \cos n\theta + i\sin n\theta\), named after the French-born mathematician Abraham de Moivre. It is the result of repeating "multiplying adds the arguments" \(n\) times. |
| unit circle | The circle of radius 1 centered at the origin. Every complex number with absolute value 1 (a number of the form \(\cos\theta + i\sin\theta\)) lies on this circle. |
| regular polygon | A polygon whose sides are all the same length and whose angles are all the same size (an equilateral triangle, a square, a regular pentagon and so on). The \(n\) points of the \(n\)th roots are evenly spaced on a circle, so they are the vertices of a regular polygon with \(n\) sides. |
| special angles | \(30^{\circ}\), \(45^{\circ}\), \(60^{\circ}\) and related angles (these plus multiples of \(90^{\circ}\)). Their trig values can be written exactly, as \(\dfrac{1}{2}\), \(\dfrac{\sqrt{2}}{2}\) and \(\dfrac{\sqrt{3}}{2}\), and most textbook and test problems use these angles. |
| radian measure (radians) | Measuring an angle by the length of the arc it cuts on a circle of radius 1. \(180^{\circ} = \pi\) radians, and a full turn is \(2\pi\) radians. From trigonometric functions in Precalculus on, radians are the standard unit rather than degrees. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over these topics is the quickest way forward.
| Square roots and radicals (Grades 8–9) |
|
| Exponent rules (Grade 8, Algebra 1) |
|
| Complex numbers (Algebra 2) |
|
| Trigonometry and the unit circle (Geometry, Algebra 2) |
|
| Radian measure (Algebra 2, Precalculus) |
|
| The complex plane and polar form (Precalculus) |
|
How to calculate it in Excel
| Real part a | 1 |
| Imaginary part b | 1 |
| Exponent n | 4 |
| z to the nth power | =IMPOWER(COMPLEX(B1,B2),B3) |
| Absolute value to the nth power r^n | =IMABS(COMPLEX(B1,B2))^B3 |
| Argument times n, nθ (radians) | =B3*IMARGUMENT(COMPLEX(B1,B2)) |
| Real part a | 8 |
| Imaginary part b | 0 |
| Index of the root n | 3 |
| Root number k (0 to n−1) | 1 |
| Radius of the root circle | =IMABS(COMPLEX(B1,B2))^(1/B3) |
| Argument of the kth root (radians) | =(MOD(IMARGUMENT(COMPLEX(B1,B2)),2*PI())+2*PI()*B4)/B3 |
| Real part of the kth root | =B5*COS(B6) |
| Imaginary part of the kth root | =B5*SIN(B6) |
In the first table, COMPLEX(real part, imaginary part) makes a complex number, and IMPOWER returns its power as text such as "-4". For the example z = 1 + i and n = 4, z to the nth power is almost exactly -4 (a tiny imaginary part may appear because of floating-point error), r^n = 4 and nθ = π ≈ 3.14159.
The second table finds one root, the kth one. IMARGUMENT returns the argument (greater than −π and up to π), so MOD first turns it into a value from 0 up to (but not including) 2π; then k full turns are added and the result is divided by n. For the example z = 8, n = 3 and k = 1, the radius is 2 and the argument is 2π/3 ≈ 2.0944, so the real part = −1 and the imaginary part ≈ 1.7320508 (= √3). Change k to 0, 1 and 2 to get all three roots.
Excel gives decimals, so if you want exact values with square roots or fractions, use the calculator on this page.
How to calculate it in Google Sheets
| Real part a | 1 |
| Imaginary part b | 1 |
| Exponent n | 4 |
| z to the nth power | =IMPOWER(COMPLEX(B1,B2),B3) |
| Absolute value to the nth power r^n | =IMABS(COMPLEX(B1,B2))^B3 |
| Argument times n, nθ (radians) | =B3*IMARGUMENT(COMPLEX(B1,B2)) |
| Real part a | 8 |
| Imaginary part b | 0 |
| Index of the root n | 3 |
| Root number k (0 to n−1) | 1 |
| Radius of the root circle | =IMABS(COMPLEX(B1,B2))^(1/B3) |
| Argument of the kth root (radians) | =(MOD(IMARGUMENT(COMPLEX(B1,B2)),2*PI())+2*PI()*B4)/B3 |
| Real part of the kth root | =B5*COS(B6) |
| Imaginary part of the kth root | =B5*SIN(B6) |
How to calculate it in Python
import cmath
import math
# nth power of a complex number (gives the same result as De Moivre's theorem)
z = complex(1, 1) # z = 1 + i
n = 4
z_power = z ** n
print(f"z to the power {n} = {z_power}")
# Parts of the polar form (absolute value and argument)
absolute_value, argument = cmath.polar(z) # r and θ (−π < θ ≤ π)
if argument < 0:
argument += 2 * math.pi # move it into the range 0 ≤ θ < 2π
print(f"Absolute value r = {absolute_value}")
print(f"Argument θ = {argument} rad")
# nth roots of a complex number (list all n of them, k = 0 to n−1)
z = complex(8, 0) # z = 8
n = 3
radius = abs(z) ** (1 / n)
theta = cmath.phase(z) % (2 * math.pi)
for k in range(n):
angle = (theta + 2 * math.pi * k) / n
w = cmath.rect(radius, angle)
print(f"w_{k} = {w}")
How to write it in LaTeX and other math languages (copy and paste)
(cosθ + i sinθ)ⁿ = cos nθ + i sin nθ
(\cos\theta + i\sin\theta)^{n} = \cos n\theta + i\sin n\theta
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msup>
<mrow>
<mo>(</mo>
<mi>cos</mi><mi>θ</mi>
<mo>+</mo>
<mi>i</mi><mi>sin</mi><mi>θ</mi>
<mo>)</mo>
</mrow>
<mi>n</mi>
</msup>
<mo>=</mo>
<mi>cos</mi><mi>n</mi><mi>θ</mi>
<mo>+</mo>
<mi>i</mi><mi>sin</mi><mi>n</mi><mi>θ</mi>
</mrow>
</math>
(cos theta + i sin theta)^n = cos(n theta) + i sin(n theta)
(Cos[theta] + I Sin[theta])^n == Cos[n theta] + I Sin[n theta]
(cos(theta) + I*sin(theta))^n = cos(n*theta) + I*sin(n*theta);
zn = (cos(t) + 1i*sin(t))^n;
(cos θ + i sin θ)^n = cos nθ + i sin nθ
zⁿ = rⁿ(cos nθ + i sin nθ)
z^{n} = r^{n}(\cos n\theta + i\sin n\theta)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msup><mi>z</mi><mi>n</mi></msup>
<mo>=</mo>
<msup><mi>r</mi><mi>n</mi></msup>
<mo>(</mo>
<mi>cos</mi><mi>n</mi><mi>θ</mi>
<mo>+</mo>
<mi>i</mi><mi>sin</mi><mi>n</mi><mi>θ</mi>
<mo>)</mo>
</mrow>
</math>
z^n = r^n (cos(n theta) + i sin(n theta))
r^n (Cos[n theta] + I Sin[n theta])
zn := r^n*(cos(n*theta) + I*sin(n*theta));
zn = r^n*(cos(n*t) + 1i*sin(n*t));
z^n = r^n (cos nθ + i sin nθ)
w_k = ⁿ√r (cos((θ + 2kπ)/n) + i sin((θ + 2kπ)/n)) (k = 0, 1, …, n−1)
w_{k} = \sqrt[n]{r}\left(\cos\dfrac{\theta + 2k\pi}{n} + i\sin\dfrac{\theta + 2k\pi}{n}\right) \quad (k = 0, 1, \ldots, n-1)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msub><mi>w</mi><mi>k</mi></msub>
<mo>=</mo>
<mroot><mi>r</mi><mi>n</mi></mroot>
<mo>(</mo>
<mi>cos</mi>
<mfrac>
<mrow><mi>θ</mi><mo>+</mo><mn>2</mn><mi>k</mi><mi>π</mi></mrow>
<mi>n</mi>
</mfrac>
<mo>+</mo>
<mi>i</mi><mi>sin</mi>
<mfrac>
<mrow><mi>θ</mi><mo>+</mo><mn>2</mn><mi>k</mi><mi>π</mi></mrow>
<mi>n</mi>
</mfrac>
<mo>)</mo>
</mrow>
</math>
w_k = root(n)(r) (cos((theta + 2k pi)/n) + i sin((theta + 2k pi)/n))
Table[r^(1/n) (Cos[(theta + 2 k Pi)/n] + I Sin[(theta + 2 k Pi)/n]), {k, 0, n - 1}]
wk := r^(1/n)*(cos((theta + 2*k*Pi)/n) + I*sin((theta + 2*k*Pi)/n));
wk = r^(1/n)*(cos((t + 2*k*pi)/n) + 1i*sin((t + 2*k*pi)/n));
w_k = r^(1/n) (cos((θ + 2kπ)/n) + i sin((θ + 2kπ)/n))
z_k = cos(2kπ/n) + i sin(2kπ/n) (k = 0, 1, …, n−1)
z_{k} = \cos\dfrac{2k\pi}{n} + i\sin\dfrac{2k\pi}{n} \quad (k = 0, 1, \ldots, n-1)
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<msub><mi>z</mi><mi>k</mi></msub>
<mo>=</mo>
<mi>cos</mi>
<mfrac>
<mrow><mn>2</mn><mi>k</mi><mi>π</mi></mrow>
<mi>n</mi>
</mfrac>
<mo>+</mo>
<mi>i</mi><mi>sin</mi>
<mfrac>
<mrow><mn>2</mn><mi>k</mi><mi>π</mi></mrow>
<mi>n</mi>
</mfrac>
</mrow>
</math>
z_k = cos((2k pi)/n) + i sin((2k pi)/n)
Table[Cos[2 k Pi/n] + I Sin[2 k Pi/n], {k, 0, n - 1}]
zk := cos(2*k*Pi/n) + I*sin(2*k*Pi/n);
zk = cos(2*k*pi/n) + 1i*sin(2*k*pi/n);
z_k = cos(2kπ/n) + i sin(2kπ/n)
How to have ChatGPT do the calculation
You are a math calculation assistant for the complex plane and De Moivre's theorem. Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). 1. Find the 4th power z^4 of the complex number z = 1 + i. Also show the absolute value r and the argument θ, the absolute value to the 4th power r^4 and the argument times 4, 4θ. 2. Find all three cube roots of the complex number z = 8 (the complex numbers whose cube is 8), for k = 0, 1, 2. If possible, also show them as exact values with square roots. In Python, use the complex type, cmath.polar and cmath.rect, and show the formulas you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
