Complex number calculator with step-by-step working
Adding, multiplying, dividing and raising complex numbers to powers step by step, modulus and argument, polar and exponential forms, nth roots and equations, with a picture on the complex plane.
(1 + 2i)(3 - i)
(3 + 4i)/(1 - 2i)
-1 + i sqrt(3)
(1 + i)^10
i^2023
cube roots of 8i
z^2 + 2z + 5 = 0
z^2 - (3 + 2i)z + 5 + i = 0
Loading the solver…
What you can type
The imaginary unit is the letter i. The solver understands four kinds of problem.
- An expression:
(1 + 2i)(3 - i),(3 + 4i)/(1 - 2i),i^2023,(1 + i)^10,sqrt(-4),|3 + 4i|,2e^(i*pi/4). It writes out each operation separately. - A single number:
-1 + i sqrt(3)or2(cos(pi/3) + i sin(pi/3)). It finds the modulus and argument and writes the number in all three forms: algebraic, polar (trigonometric) and exponential. - Roots:
cube roots of 8i,fourth roots of -16or the equationz^4 = -16. It lists all the roots and draws the polygon. - An equation in $z$: linear, quadratic (including with complex coefficients), binomial $z^n = w$, and ones that become quadratic after a substitution, such as $z^4 + 3z^2 - 4 = 0$.
Algebraic form and the four operations
A complex number $z = a + bi$ is made of a real part $a$ and an imaginary part $b$, and there’s only one thing to know about $i$: $i^2 = -1$. Nothing more is needed; you handle these numbers like two-term expressions.
Addition and subtraction go part by part: $(1 + 2i) + (3 - i) = 4 + i$. Multiplication: expand the brackets and replace $i^2$ with $-1$: $(1 + 2i)(3 - i) = 3 - i + 6i - 2i^2 = 5 + 5i$. Powers of $i$ repeat every four: $i$, $-1$, $-i$, $1$, then $i$ again. So $i^{2023} = i^{4 \cdot 505 + 3} = i^3 = -i$.
Division is trickier. Multiply the numerator and denominator by the conjugate of the denominator, the number with the opposite sign of the imaginary part. A number times its conjugate is always real: $(c + di)(c - di) = c^2 + d^2$, and $i$ leaves the denominator, just as a root does when you rationalise a denominator.
The conjugate $\bar z = a - bi$ is the mirror image of $z$ in the real axis. It has the same modulus and the opposite argument, and $z \cdot \bar z = a^2 + b^2 = |z|^2$. That’s what explains the division trick. Another useful property: if a polynomial with real coefficients has a complex root, its conjugate is a root too, so the non-real roots of such equations always come in pairs.
Modulus, argument and polar form
The number $a + bi$ is the point $(a, b)$ in the plane, or an arrow from the origin to that point. Caspar Wessel (1799) and Jean-Robert Argand (1806) were the first to draw them like this. The length of the arrow is the modulus $|z| = \sqrt{a^2 + b^2}$, and the angle from the positive direction of the real axis is the argument $\varphi$. They let you rebuild the number: $a = r\cos\varphi$, $b = r\sin\varphi$.
The argument is found from the tangent, $\tan\varphi = \frac{b}{a}$, but the arctangent alone isn’t enough: it gives angles only from $-\frac{\pi}{2}$ to $\frac{\pi}{2}$, that is, points in the right half-plane. For the second quadrant add $\pi$ to it; for the third, subtract $\pi$. The number $-1 + i\sqrt{3}$ is in the second quadrant: $r = \sqrt{1 + 3} = 2$, $\arctan(-\sqrt{3}) = -\frac{\pi}{3}$, and $\varphi = \pi - \frac{\pi}{3} = \frac{2\pi}{3}$.
The main reason this form is needed: when you multiply, the moduli multiply and the arguments add. Multiplying by a complex number means rotating and stretching. Multiplying by $i$ is a quarter turn, and turning through $90^\circ$ twice means turning round: $i^2 = -1$. Hence De Moivre’s theorem for powers and the formula for roots.
By Euler’s formula $\cos\varphi + i\sin\varphi = e^{i\varphi}$, so the same thing can be written very briefly: $z = re^{i\varphi}$, the exponential form.
Worked examples
Example 1. A high power: $(1 + i)^{10}$
Multiplying out ten brackets takes ages, but in polar form it’s one line. $|1 + i| = \sqrt{2}$ and the argument is $\frac{\pi}{4}$, so $1 + i = \sqrt{2}\left(\cos\frac{\pi}{4} + i\sin\frac{\pi}{4}\right)$. By De Moivre’s theorem,
$$(1 + i)^{10} = (\sqrt{2})^{10}\left(\cos\frac{10\pi}{4} + i\sin\frac{10\pi}{4}\right) = 32\left(\cos\frac{5\pi}{2} + i\sin\frac{5\pi}{2}\right) = 32i.$$
The angle $\frac{5\pi}{2}$ is $\frac{\pi}{2}$ plus a full turn, so the cosine is $0$ and the sine is $1$. A check another way: $(1 + i)^2 = 2i$, and $(2i)^5 = 32i^5 = 32i$.
Example 2. A quadratic equation with a negative discriminant: $z^2 + 2z + 5 = 0$
$D = 4 - 20 = -16$. There are no real roots, but $\sqrt{-16} = 4i$, and the formula works as usual: $z = \frac{-2 \pm 4i}{2} = -1 \pm 2i$. The roots are conjugates, as always happens when the coefficients are real. A check by Vieta’s formulas: the sum is $-2 = -\frac{b}{a}$, the product is $(-1)^2 + 2^2 = 5 = \frac{c}{a}$.
Example 3. Complex coefficients: $z^2 - (3 + 2i)z + 5 + i = 0$
$D = (3 + 2i)^2 - 4(5 + i) = 9 + 12i - 4 - 20 - 4i = -15 + 8i$. Look for its square root in the form $a + bi$: $a^2 - b^2 = -15$ and $2ab = 8$, and also $a^2 + b^2 = |D| = \sqrt{225 + 64} = 17$. Adding and subtracting gives $a^2 = 1$, $b^2 = 16$, and taking the sign of $2ab$ into account, $\sqrt{D} = 1 + 4i$.
Then $z = \frac{3 + 2i \pm (1 + 4i)}{2}$: $z_1 = 2 + 3i$, $z_2 = 1 - i$. A check by Vieta’s formulas: $z_1 + z_2 = 3 + 2i$, $z_1 z_2 = 2 - 2i + 3i - 3i^2 = 5 + i$.
Example 4. A binomial equation: $z^4 = -16$
We need all the fourth roots of $-16$. In polar form $-16 = 16(\cos\pi + i\sin\pi)$: modulus $16$, argument $\pi$. Each root has modulus $\sqrt[4]{16} = 2$, and the angles are $\frac{\pi + 2\pi k}{4}$ for $k = 0, 1, 2, 3$, that is, $\frac{\pi}{4}$, $\frac{3\pi}{4}$, $\frac{5\pi}{4}$, $\frac{7\pi}{4}$.
The roots: $\sqrt{2} + i\sqrt{2}$, $-\sqrt{2} + i\sqrt{2}$, $-\sqrt{2} - i\sqrt{2}$, $\sqrt{2} - i\sqrt{2}$, the vertices of a square with side $2\sqrt{2}$. A check of the first: $(\sqrt{2} + i\sqrt{2})^2 = 2 + 4i - 2 = 4i$, and $(4i)^2 = -16$.
What all this is for
Complex numbers didn’t appear out of idle curiosity. In the sixteenth century Cardano’s formula for cubic equations sometimes demanded the square root of a negative number even when all three roots were real. In 1572 Rafael Bombelli dared to calculate with such “impossible” expressions by the ordinary rules, and got the right answer. Later it turned out that in this number system every polynomial of degree $n$ has exactly $n$ roots, counted with multiplicity: that’s the fundamental theorem of algebra. Real numbers aren’t enough for this: $x^2 + 1 = 0$ has none, but it has two complex ones, $\pm i$.
Today multiplication by $e^{i\varphi}$ as a rotation is at work wherever something rotates or oscillates: in alternating-current calculations, in signal processing, in quantum mechanics. The formula $e^{i\pi} + 1 = 0$, which links the five main numbers of mathematics, is a special case of Euler’s formula, which this solver uses too.
Common mistakes
- Forgetting that $i^2 = -1$, and writing $(a + bi)^2 = a^2 + b^2$. In fact $(a + bi)^2 = a^2 - b^2 + 2abi$.
- Multiplying only the numerator by the conjugate. That changes the fraction; multiply both the numerator and the denominator.
- Taking the argument to be the bare arctangent. For $-1 - i$ the arctangent of the ratio is $\frac{\pi}{4}$, but the point is in the third quadrant, and the argument is $-\frac{3\pi}{4}$.
- Carrying the rules for roots over to negative numbers. $\sqrt{-4}\cdot\sqrt{-9} = 2i \cdot 3i = -6$, not $\sqrt{36} = 6$: the equality $\sqrt{a}\sqrt{b} = \sqrt{ab}$ holds only for non-negative $a$ and $b$.
- Finding one root instead of $n$. Every non-zero number has exactly $n$ $n$th roots; $1$ has three cube roots, not one.
- Trying to compare complex numbers. Writing $2 + i > 1$ is meaningless: the plane has no “greater” and “less”. Compare the moduli instead.
See also
How “impossible” numbers appeared in Cardano’s formula, why multiplication is a rotation, and how Bombelli’s story with $\sqrt[3]{2 + 11i} = 2 + i$ ended are in the chapter on complex numbers. Quadratic equations with a negative discriminant are worked through step by step by the quadratic equation solver, higher-degree polynomials by the higher-degree equation solver, and the trigonometry that polar form and De Moivre’s theorem rest on by the trigonometric equation solver.
Where this is explained
Other solvers
- Quadratic equation
- Linear equation
- System of linear equations
- Higher-degree equations and factoring
- Inequalities by the interval method
- Derivative
- Integral
- Limit
- Curve sketching
- Fraction arithmetic
- GCD, LCM and Euclid's algorithm
- Prime factorisation
- Solving a triangle
- Matrices: determinant, inverse, rank, eigenvalues
- Trigonometric equation
- Exponential and logarithmic equations
- Percentages, compound interest, loans
- Permutations and combinations
- Number bases
- Congruences
- Progressions
- Probability: Bayes and Bernoulli trials
- Differential equation