Complex numbers arise naturally from the solving of cubic equations.

Consider, for example, the cubic equation $x^3+ px + q = 0$ (incidentally, all cubic polynomial equations can be rewritten in this form). Solving for $x$ in terms of $p$ and $q$ is possible. The solution is given by:

$\begin{aligned} x &= \sqrt[3]{A} + \sqrt[3]{B} \\ A &= -\frac{q}{2} + \sqrt{\frac{q^2}{4} + \frac{p^3}{27}} \\ B &= -\frac{q}{2} - \sqrt{\frac{q^2}{4} + \frac{p^3}{27}} \end{aligned}$

(**Source**: *Lectures on Elementary Mathematics* by Lagrange. Highly recommended.)

This is the cubic analogue of the famous and familiar "quadratic formula" for calculating roots of quadratic polynomials.

The above equation, however, raises two concerns:

- All cubic polynomials have a real root (provided the coefficients are real, at least). However, it is clear that if $A$ and $B$ will have imaginary components if $\frac{q^2}{4} + \frac{p^3}{27}$.
- Cubic polynomials may have up to three roots. But this multiplicity isn't obviously.

We first recall Euler's formula:

$e^{i \theta} = \cos (\theta) + \sin(\theta) i.$

So we can write $A$ and $B$ as

$\begin{aligned} A &= r e^{i \theta} \\ B &= r e^{-i \theta}. \end{aligned}$

for some unique $r$ and unique $\theta$ (unique modulo $2\pi$).

In the complex field, roots are considered to be multi-valued. Unlike with real roots, we cannot pick the "positive" complex root of $x^n = C$ as the value of $\sqrt[n]{C}$.

$\sqrt[3]{A}=\sqrt[3]{r} \cdot e^{\frac{\theta + 2k\pi}{3}},$

where $k=0,1,2$ give unique roots.