Complex Number Calculator

Type z₁ and z₂ and pick an operation. With whole-number parts of everyday size the answers come out exact: a quotient as fractions, a modulus as a surd, an argument as a fraction of π where it is one.

Multiplying i2=−1(a+bi)(c+di)=(ac−bd)+(ad+bc)i\begin{aligned}&i^{2}=-1\\&(a+bi)(c+di)=(ac-bd)+(ad+bc)i\end{aligned}
Dividing a+bic+di=(a+bi)(c−di)c2+d2\frac{a+bi}{c+di}=\frac{(a+bi)(c-di)}{c^{2}+d^{2}}
Modulus and argument z=a+bi=r(cos⁡θ+isin⁡θ)r=a2+b2,tan⁡θ=ba−180∘<θ≤180∘\begin{aligned}&z=a+bi=r(\cos\theta+i\sin\theta)\\&r=\sqrt{a^{2}+b^{2}},\quad\tan\theta=\frac{b}{a}\\&-180^{\circ}<\theta\le180^{\circ}\end{aligned}
Products and quotients ∣z1z2∣=∣z1∣∣z2∣arg⁡(z1z2)=arg⁡z1+arg⁡z2\begin{aligned}&|z_{1}z_{2}|=|z_{1}||z_{2}|\\&\arg(z_{1}z_{2})=\arg z_{1}+\arg z_{2}\end{aligned}
De Moivre’s theorem [r(cos⁡θ+isin⁡θ)]n=rn(cos⁡nθ+isin⁡nθ)\begin{aligned}&\left[r(\cos\theta+i\sin\theta)\right]^{n}\\&=r^{n}(\cos n\theta+i\sin n\theta)\end{aligned}
The n-th roots wn=r(cos⁡θ+isin⁡θ) ⇒wk=rn(cos⁡ϕk+isin⁡ϕk)ϕk=θ+360∘kn,  k=0,…,n−1\begin{aligned}&w^{n}=r(\cos\theta+i\sin\theta)\ \Rightarrow\\&w_{k}=\sqrt[n]{r}\left(\cos\phi_{k}+i\sin\phi_{k}\right)\\&\phi_{k}=\frac{\theta+360^{\circ}k}{n},\ \ k=0,\dots,n-1\end{aligned}
Loading interactive simulation...

Lesson

The theory — Complex Number Calculator

A complex number is z = a + bi, with a and b real and i² = −1. a is its real part and b its imaginary part; on the Argand plane z is the point (a, b).

Where the formula comes from

  1. Calculate as in algebra, then replace i² by −1. Brackets expand as usual, and the i² term crosses into the real part with its sign changed.
    (a+bi)(c+di)=ac+adi+bci+bdi2=(ac−bd)+(ad+bc)i\begin{aligned}(a+bi)(c+di)&=ac+adi+bci+bdi^{2}\\&=(ac-bd)+(ad+bc)i\end{aligned}
  2. Divide with the conjugate. c + di times c − di is c² + d², a real number. Multiplying top and bottom by the conjugate of the bottom leaves a real denominator, and then each part is divided separately.
    (c+di)(c−di)=c2+d2a+bic+di=(a+bi)(c−di)c2+d2\begin{aligned}&(c+di)(c-di)=c^{2}+d^{2}\\&\frac{a+bi}{c+di}=\frac{(a+bi)(c-di)}{c^{2}+d^{2}}\end{aligned}
  3. Find the modulus and argument. The modulus r is the distance from 0, the argument θ the angle from the positive real axis, taken between −180° and 180°. When a < 0, tan⁻¹(b/a) points into the opposite quadrant, so add or subtract 180°.
    r=a2+b2,θ=tan⁡−1ba  (a>0)θ=tan⁡−1ba±180∘  (a<0)\begin{aligned}&r=\sqrt{a^{2}+b^{2}},\qquad\theta=\tan^{-1}\frac{b}{a}\ \ (a>0)\\&\theta=\tan^{-1}\frac{b}{a}\pm180^{\circ}\ \ (a<0)\end{aligned}
  4. Multiply in polar form. Expanding the product brings out the compound-angle formulae: the moduli multiply and the arguments add. n equal factors give De Moivre’s theorem.
    r1(cos⁡α+isin⁡α)⋅r2(cos⁡β+isin⁡β)=r1r2[(cos⁡αcos⁡β−sin⁡αsin⁡β)+i(sin⁡αcos⁡β+cos⁡αsin⁡β)]=r1r2(cos⁡(α+β)+isin⁡(α+β))⇒ [r(cos⁡θ+isin⁡θ)]n=rn(cos⁡nθ+isin⁡nθ)\begin{aligned}&r_{1}(\cos\alpha+i\sin\alpha)\cdot r_{2}(\cos\beta+i\sin\beta)\\&=r_{1}r_{2}\big[(\cos\alpha\cos\beta-\sin\alpha\sin\beta)\\&\qquad+i(\sin\alpha\cos\beta+\cos\alpha\sin\beta)\big]\\&=r_{1}r_{2}\left(\cos(\alpha+\beta)+i\sin(\alpha+\beta)\right)\\&\Rightarrow\ \left[r(\cos\theta+i\sin\theta)\right]^{n}\\&\qquad=r^{n}(\cos n\theta+i\sin n\theta)\end{aligned}
  5. Run De Moivre backwards for roots. wⁿ = z fixes the modulus of w as the n-th root of r, but the angle only up to whole turns. θ, θ + 360°, θ + 720°, … all describe z, and dividing them by n gives n different roots, 360°/n apart.
    wn=r(cos⁡θ+isin⁡θ)⇒ wk=rn(cos⁡ϕk+isin⁡ϕk)ϕk=θ+360∘kn,  k=0,…,n−1\begin{aligned}&w^{n}=r(\cos\theta+i\sin\theta)\\&\Rightarrow\ w_{k}=\sqrt[n]{r}\left(\cos\phi_{k}+i\sin\phi_{k}\right)\\&\phi_{k}=\frac{\theta+360^{\circ}k}{n},\ \ k=0,\dots,n-1\end{aligned}

Problems solved in full

  1. Multiplying 3 steps

    Express (4 − 3i)(2 + 5i) in the form a + bi.

    Open this problem in the tool

    1. Expand as two brackets.

      (4−3i)(2+5i)=8+20i−6i−15i2(4-3i)(2+5i)=8+20i-6i-15i^{2}
    2. Replace i² by −1. The last term changes sign and joins the real part.

      =8+15+14i=23+14i=8+15+14i=23+14i
    3. A check that costs one line: the modulus of a product is the product of the moduli, so 23² + 14² must equal 5² × 29.

      232+142=529+196=725=52×2923^{2}+14^{2}=529+196=725=5^{2}\times29

    Answer

    23 + 14i

    23+14i23+14i
  2. Dividing by the conjugate 4 steps

    Express (3 + 2i)/(1 + 2i) in the form a + bi.

    Open this problem in the tool

    Show solution
    1. Multiply top and bottom by 1 − 2i, the conjugate of the bottom.

      3+2i1+2i⋅1−2i1−2i\frac{3+2i}{1+2i}\cdot\frac{1-2i}{1-2i}
    2. The bottom becomes 1² + 2² = 5, a real number.

      (1+2i)(1−2i)=12+22=5(1+2i)(1-2i)=1^{2}+2^{2}=5
    3. Expand the top and replace i² by −1.

      (3+2i)(1−2i)=3−6i+2i−4i2=7−4i(3+2i)(1-2i)=3-6i+2i-4i^{2}=7-4i
    4. Divide each part by 5.

      7−4i5=75−45i\frac{7-4i}{5}=\frac{7}{5}-\frac{4}{5}i

    Answer

    7/5 − 4/5 i, or 1.4 − 0.8i.

    75−45i\frac{7}{5}-\frac{4}{5}i
  3. An argument in the third quadrant 4 steps

    Find the modulus and argument of z = −2 − 2i. Hence write z² in modulus-argument form.

    Open this problem in the tool

    Show solution
    1. The modulus by Pythagoras.

      ∣z∣=(−2)2+(−2)2=8=22|z|=\sqrt{(-2)^{2}+(-2)^{2}}=\sqrt{8}=2\sqrt{2}
    2. tan⁻¹ of (−2)/(−2) is 45°, which points into the first quadrant. z is below and to the left of 0, in the third, so subtract 180°.

      tan⁡−1−2−2=45∘arg⁡z=45∘−180∘=−135∘=−3π4\begin{aligned}&\tan^{-1}\frac{-2}{-2}=45^{\circ}\\&\arg z=45^{\circ}-180^{\circ}=-135^{\circ}=-\frac{3\pi}{4}\end{aligned}
    3. Squaring squares the modulus and doubles the argument. −270° lies outside −180° to 180°, so add a whole turn.

      ∣z2∣=(22)2=82arg⁡z=−270∘→−270∘+360∘=90∘\begin{aligned}&|z^{2}|=(2\sqrt2)^{2}=8\\&2\arg z=-270^{\circ}\to-270^{\circ}+360^{\circ}=90^{\circ}\end{aligned}
    4. Modulus 8 at 90° is 8i, and multiplying out (−2 − 2i)² agrees.

      z2=8(cos⁡90∘+isin⁡90∘)=8i(−2−2i)2=4+8i+4i2=8i\begin{aligned}&z^{2}=8(\cos90^{\circ}+i\sin90^{\circ})=8i\\&(-2-2i)^{2}=4+8i+4i^{2}=8i\end{aligned}

    Answer

    |z| = 2√2, arg z = −135° = −3π/4; z² = 8(cos 90° + i sin 90°) = 8i.

    ∣z∣=22,arg⁡z=−3π4;z2=8(cos⁡90∘+isin⁡90∘)=8i|z|=2\sqrt2,\quad\arg z=-\frac{3\pi}{4};\qquad z^{2}=8(\cos90^{\circ}+i\sin90^{\circ})=8i
  4. Multiplying in polar form 3 steps

    z = 1 + i and w = 2i. Write both in modulus-argument form and find zw without expanding.

    Open this problem in the tool

    Show solution
    1. Modulus and argument of each.

      z=2(cos⁡45∘+isin⁡45∘)w=2(cos⁡90∘+isin⁡90∘)\begin{aligned}&z=\sqrt2(\cos45^{\circ}+i\sin45^{\circ})\\&w=2(\cos90^{\circ}+i\sin90^{\circ})\end{aligned}
    2. Multiply the moduli and add the arguments.

      zw=22(cos⁡135∘+isin⁡135∘)zw=2\sqrt2(\cos135^{\circ}+i\sin135^{\circ})
    3. Back to a + bi with cos 135° = −√2/2 and sin 135° = √2/2.

      =22(−22+22i)=−2+2i=2\sqrt2\left(-\frac{\sqrt2}{2}+\frac{\sqrt2}{2}i\right)=-2+2i

    Answer

    zw = 2√2(cos 135° + i sin 135°) = −2 + 2i

    zw=22(cos⁡135∘+isin⁡135∘)=−2+2izw=2\sqrt2(\cos135^{\circ}+i\sin135^{\circ})=-2+2i
  5. A high power 3 steps

    Find (1 + i)⁸.

    Open this problem in the tool

    Show solution
    1. Eight brackets is the slow way. Write 1 + i in polar form instead.

      1+i=2(cos⁡45∘+isin⁡45∘)1+i=\sqrt2(\cos45^{\circ}+i\sin45^{\circ})
    2. De Moivre: the modulus to the 8th power, the argument times 8.

      (1+i)8=(2)8(cos⁡360∘+isin⁡360∘)(1+i)^{8}=(\sqrt2)^{8}(\cos360^{\circ}+i\sin360^{\circ})
    3. (√2)⁸ = 2⁴ = 16, and 360° is a whole turn.

      =16(1+0i)=16=16(1+0i)=16

    Answer

    (1 + i)⁸ = 16

    (1+i)8=16(1+i)^{8}=16
  6. Cube roots 3 steps

    Solve z³ = 8i, giving the roots in the form a + bi.

    Open this problem in the tool

    Show solution
    1. 8i in polar form.

      8i=8(cos⁡90∘+isin⁡90∘)8i=8(\cos90^{\circ}+i\sin90^{\circ})
    2. Take the cube root of the modulus. Add whole turns to the argument before dividing it by 3.

      zk=2(cos⁡ϕk+isin⁡ϕk)ϕk=90∘+360∘k3,  k=0,1,2\begin{aligned}&z_{k}=2(\cos\phi_{k}+i\sin\phi_{k})\\&\phi_{k}=\frac{90^{\circ}+360^{\circ}k}{3},\ \ k=0,1,2\end{aligned}
    3. k = 0, 1, 2 give 30°, 150° and 270°. k = 3 would give 390°, which is 30° again.

      z0=2(cos⁡30∘+isin⁡30∘)=3+iz1=2(cos⁡150∘+isin⁡150∘)=−3+iz2=2(cos⁡270∘+isin⁡270∘)=−2i\begin{aligned}&z_{0}=2(\cos30^{\circ}+i\sin30^{\circ})=\sqrt3+i\\&z_{1}=2(\cos150^{\circ}+i\sin150^{\circ})=-\sqrt3+i\\&z_{2}=2(\cos270^{\circ}+i\sin270^{\circ})=-2i\end{aligned}

    Answer

    z = √3 + i, −√3 + i, −2i: three points 120° apart on the circle of radius 2.

    z=3+i,−3+i,−2iz=\sqrt3+i,\quad-\sqrt3+i,\quad-2i
  7. A square root by equating parts 3 steps

    Find the square roots of 5 + 12i.

    Open this problem in the tool

    Show solution
    1. Let (a + bi)² = 5 + 12i with a and b real, expand, and match the real and the imaginary parts.

      (a+bi)2=a2−b2+2abia2−b2=5,2ab=12\begin{aligned}&(a+bi)^{2}=a^{2}-b^{2}+2abi\\&a^{2}-b^{2}=5,\quad2ab=12\end{aligned}
    2. Taking moduli gives a third equation, and it makes the system easy.

      a2+b2=∣5+12i∣=52+122=13a^{2}+b^{2}=|5+12i|=\sqrt{5^{2}+12^{2}}=13
    3. Adding and subtracting give a² = 9 and b² = 4. Since ab = 6 is positive, a and b have the same sign.

      2a2=18,  2b2=8 ⇒ (a,b)=(3,2), (−3,−2)2a^{2}=18,\ \ 2b^{2}=8\ \Rightarrow\ (a,b)=(3,2),\ (-3,-2)

    Answer

    3 + 2i and −3 − 2i

    ±(3+2i)\pm(3+2i)
  8. A quadratic with complex roots 3 steps

    Solve z² − 4z + 13 = 0, and check that the roots have sum 4 and product 13.

    Open this problem in the tool

    Show solution
    1. The discriminant is negative, and its square root is imaginary.

      b2−4ac=16−52=−36,−36=6ib^{2}-4ac=16-52=-36,\qquad\sqrt{-36}=6i
    2. The formula as usual.

      z=4±6i2=2±3iz=\frac{4\pm6i}{2}=2\pm3i
    3. Real coefficients give a conjugate pair. The sum loses its imaginary parts, and the product is |2 + 3i|².

      (2+3i)+(2−3i)=4,(2+3i)(2−3i)=4+9=13(2+3i)+(2-3i)=4,\qquad(2+3i)(2-3i)=4+9=13

    Answer

    z = 2 ± 3i

    z=2±3iz=2\pm3i
  9. Multiplying 3 + 2i by its conjugate to prove a product 5 steps

    Multiply 3 + 2i by its conjugate, then turn the result into a proof that a product of two sums of two squares is again a sum of two squares. This is Multiply with z₁ = 3 + 2i and z₂ = 3 − 2i.

    Open this problem in the tool

    Show solution
    1. The two cross terms are equal and opposite, so they cancel. What is left is the −b²i², which changes sign and adds instead of subtracting — so a conjugate pair always multiplies to a real number, and that number is assembled by squaring.

      (a+bi)(a−bi)=a2−b2i2=a2+b2⟹(3+2i)(3−2i)=9+4=13(a+bi)(a-bi)=a^{2}-b^{2}i^{2}=a^{2}+b^{2}\quad\Longrightarrow\quad(3+2i)(3-2i)=9+4=13
    2. That real number already has a name. The modulus is the distance from the origin, so |z|² is a² + b² by Pythagoras, and the panel's 3.606 is √13 rounded up in the third decimal.

      ∣z∣=a2+b2=13=3.605551,zzˉ=∣z∣2=13|z|=\sqrt{a^{2}+b^{2}}=\sqrt{13}=3.605551,\qquad z\bar z=|z|^{2}=13
    3. Now the general product of two complex numbers, with i² = −1 sending one term across to join the real part. No moduli appear here yet.

      (a+bi)(c+di)=(ac−bd)+(ad+bc)i(a+bi)(c+di)=(ac-bd)+(ad+bc)i
    4. Apply step 1 to that product. A second pair of cross terms, −2abcd and +2abcd, cancels in the expansion, and the four terms that survive factor into two brackets. Every letter is an integer if you want it to be, and nothing in the final line mentions i.

      (ac−bd)2+(ad+bc)2=a2c2+b2d2+a2d2+b2c2=(a2+b2)(c2+d2)(ac-bd)^{2}+(ad+bc)^{2}=a^{2}c^{2}+b^{2}d^{2}+a^{2}d^{2}+b^{2}c^{2}=(a^{2}+b^{2})(c^{2}+d^{2})
    5. So a pair of integer pairs manufactures a third. 3 + 2i carries 13 and 1 + 2i carries 5; their product carries 65. Conjugating the second factor reflects it across the real axis and delivers a different pair with the same sum.

      (3+2i)(1+2i)=−1+8i: 12+82=65=13×5;(3+2i)(1−2i)=7−4i: 72+42=65(3+2i)(1+2i)=-1+8i:\ 1^{2}+8^{2}=65=13\times5;\qquad(3+2i)(1-2i)=7-4i:\ 7^{2}+4^{2}=65

    Answer

    The panel prints the conjugate product as 13 and the modulus as 3.606, and 3.606² = 13.003 is the rounding rather than a disagreement. What is worth keeping is that the identity survives having the complex numbers erased: (a² + b²)(c² + d²) = (ac − bd)² + (ad + bc)² is a statement about four integers with no i left in it. Diophantus recorded this very number in the third century — 65 splits as 1 + 64 and as 16 + 49, he noted, because it is 13 × 5 and each factor is itself a sum of two squares — some thirteen centuries before Cardano first wrote down a square root of a negative number. Two prime factors, two representations: 13 alone has only 9 + 4, and 5 alone has only 1 + 4. Complex multiplication is the machine that manufactures the second representation, and the conjugate is the lever that switches between them.

    (a2+b2)(c2+d2)=(ac−bd)2+(ad+bc)2(a^{2}+b^{2})(c^{2}+d^{2})=(ac-bd)^{2}+(ad+bc)^{2}

Supplementary problems, answers only

  1. Express (2 − i)(3 + 4i) in the form a + bi.

    Show answer

    10 + 5i

    10+5i10+5i
  2. Express (1 + 3i)/(2 − i) in the form a + bi.

    Show answer

    −1/5 + 7/5 i

    −15+75i-\frac{1}{5}+\frac{7}{5}i
  3. Find the modulus and argument of −√3 + i.

    Show answer

    2 and 150° = 5π/6

    2,150∘=5π62,\quad150^{\circ}=\frac{5\pi}{6}
  4. Find (√3 + i)⁶.

    Show answer

    −64

    −64-64
  5. Solve z³ = −8.

    Show answer

    z = 1 + √3 i, −2, 1 − √3 i

    1+3 i,−2,1−3 i1+\sqrt3\,i,\quad-2,\quad1-\sqrt3\,i
  6. Find the square roots of −3 + 4i.

    Show answer

    1 + 2i and −1 − 2i

    ±(1+2i)\pm(1+2i)
  7. Solve z² − 2z + 5 = 0.

    Show answer

    z = 1 ± 2i

    z=1±2iz=1\pm2i

Imaginary numbers born to find real answers

Complex numbers weren't invented to solve x² + 1 = 0 — nobody lost sleep over that. They were forced on mathematicians by cubic equations. Cardano's 1545 formula for x³ = px + q can pass through square roots of negative numbers even when all three solutions are ordinary real numbers. In 1572 Bombelli showed those "impossible" quantities cancel to give the correct real answers. The imaginary was a detour to the real.

Learning path

Beyond the quadratic

References (1)
  • Insight block 3 — the cubic that made imaginary numbers unavoidable: G. Cardano, Artis Magnae, sive de Regulis Algebraicis. Nuremberg, 1545, chapter XXXVII. R. Bombelli, L'Algebra, Book I. Bologna, 1572 — where the "impossible" quantities are shown to cancel and leave the real roots.