# The roots of a cubic polynomial via radicals

I had read some years ago that when Ramanujan was shown the formula for finding the roots of a cubic equation via radicals, it motivated him to find the corresponding formula for the quartic, by himself. He apparently even tried to solve the quintic via radicals, because he did not know this was impossible. At the time that I read the above story, I actually didn’t even know the formula for the cubic. So I decided to derive it myself just for fun. Here I derive, step by step, the formula for the roots of a general cubic equation.

First, to gain intuition, let us derive the formula for quadratic equations. Consider a quadratic polynomial with complex coefficients, whose roots we wish to find: $\displaystyle a x^2 + b x + c =0 ~,\ \ \ \ \ \ (1)$

or, $\displaystyle x^2 + (b/a) x + c/a =0 ~.\ \ \ \ \ \ (2)$

Let us “complete the square” via a change of variables: let ${y= x + b/2a}$ so that $\displaystyle y^2 = x^2 + (b/a) x + b^2/4a^2 ~. \ \ \ \ \ (3)$

Eq. (2) becomes $\displaystyle x^2 + (b/a) x + c/a = y^2 + c/a - b^2/4a^2= 0 \ \ \ \ \ (4)$

The two roots in ${y}$ are the positive and negative square roots: $\displaystyle y = \pm \sqrt {b^2/4a^2-c/a} ~. \ \ \ \ \ (5)$

But ${x = y-b/2a }$ so that $\displaystyle x = {-b \pm \sqrt {b^2-4ac} \over 2a } ~. \ \ \ \ \ (6)$

which is the famous quadratic formula.

Having seen the derivation of the quadratic case, let us have some fun repeating this exercise for cubics! The third degree polynomial equation $\displaystyle ax^3 + b x^2 + c x + d=0 \ \ \ \ \ (7)$

becomes $\displaystyle x^3 + (b/a) x^2 + (c/a) x + d /a =0 ~. \ \ \ \ \ (8)$

Let us “complete the cube”, in analogy to completing the square as we did above for the quadratic equation.

Let ${y=x + (b/3a)}$, so that $\displaystyle y^3 = x^3 + (b/a) x^2 + 3 (b/3a)^2 x + (b/3a)^3 \ \ \ \ \ (9)$

so that ${x^3 + (b/a) x^2}$ becomes ${ y^3 - 3 (b/3a)^2 x - (b/3a)^3}$ and ${x^3 + (b/a) x^2 + (c/a) x + d /a =0}$ becomes $\displaystyle \begin{array}{rcl} 0&=&y^3 - 3 (b/3a)^2 x - (b/3a)^3 + (c/a) x + d /a \\ & =& y^3 + (-3 (b/3a)^2 + c/a) (y-b/3a) + d/a - (b/3a)^3 \\ &= & y^3 + y ( -b^2/3a^2 + c/a) + b^3/9a^3 - bc/3a^2 + d/a - b^3/27a^3 \\ &= & y^3 + y ( -b^2/3a^2 + c/a) + 2b^3/27a^3 - bc/3a^2 + d/a ~. \end{array}$

Let us rewrite the last equation as $\displaystyle \begin{array}{rcl} A & = & ( -b^2/3a^2 + c/a) \\ B & = & + 2b^3/27a^3 - bc/3a^2 + d/a \\ 0 &=& y^3 + Ay + B ~. \end{array}$

This is as far as we are going to get by just “completing the cube.” Cubic equations with no quadratic monomial are known as depressed cubics. So we have taken a general cubic and turned it into a depressed cubic.

Next, we can use a different trick to transform this equation into a solvable quadratic equation, as follows. Let $\displaystyle y = z - A/3z \ \ \ \ \ (10)$

so that $\displaystyle y^3 = z^3 - Az + A^2/3z - A^3/27z^3 ~. \ \ \ \ \ (11)$

Hence, ${ y^3 + Ay + B=0 }$ becomes $\displaystyle \begin{array}{rcl} 0&= & z^3 - Az + A^2/3z - A^3/27z^3 + A (z-A/3z ) +B \\ & =& z^3 + A^2/3z - A^3/27z^3 + -A^2/3z +B \\ & =& z^3+B - A^3/27z^3 ~. \end{array}$

Now, let ${u=z^3}$, so that the above becomes $\displaystyle \begin{array}{rcl} u+B - A^3/27u&=& 0\\ u^2+Bu - A^3/27&=& 0 ~. \end{array}$

We can solve this! We get $\displaystyle u = {-B \pm \sqrt {B^2 + 4 A^3/27} \over 2} ~. \ \ \ \ \ (12)$

We now back substitute to find ${z}$, then ${y}$, then ${x}$: $\displaystyle \begin{array}{rcl} z &=& \sqrt {{-B \pm \sqrt {B^2 + 4 A^3/27} \over 2}} \\ y & =& z - A/3z\\ x & =& y - b/3a ~. \end{array}$

We are done! If we want, we can simplify this expression somewhat by multiplying ${A}$ by ${3a^2}$ and ${B}$ by ${27a^3}$. Let us write $\displaystyle \begin{array}{rcl} C_1 &=& 3a^2 A = 3ac - b^2\\ C_2 &=& = 27 a^3 B = 2 b^3 - 9 a b c + 27 a ^2 d\\ z &=& \sqrt {{-B \pm \sqrt {B^2 + 4 A^3/27} \over 2}} \\ & = & \frac 1{3a} \sqrt {{-C_2 \pm \sqrt {C_2^2 + 4 C_1^3} \over 2}} ~. \end{array}$

Let $\displaystyle C= \sqrt {{-C_2 \pm \sqrt {C_2^2 + 4 C_1^3} \over 2}} \\ \ \ \ \ \ (13)$

Then $\displaystyle \begin{array}{rcl} y &=& \frac 1{3a} (C - C_1/[3a^23 ( \frac 1{3a} C) ]) \\ &=& \frac 1{3a} (C - C_1/3aC )\\ & =& \frac 1{3a} [C - C_1/C ] \end{array}$

We thus arrive at our final general expression, which of course must be handled with care when there are multiple roots and so forth. Recalling the definitions $\displaystyle \begin{array}{rcl} C_1 &=& 3ac - b^2\\ C_2 &=& 2 b^3 - 9 a b c + 27 a ^2 d\\ C&=& \sqrt {{-C_2 \pm \sqrt {C_2^2 + 4 C_1^3} \over 2}}~, \end{array}$

the 3 roots are given by $\displaystyle x = \frac {C - C_1/C - b} {3a } \ \ \ \ \ (14)$

by inserting the 3 values of ${C}$.

Appendix

As a double check, let us consider the cubic $\displaystyle (x-1)(x-2)(x-4) = x^3 -7 x^2 +14 x -8=0 ~. \ \ \ \ \ (15)$

We have $\displaystyle \begin{array}{rcl} a&=&1 \\ b&=&-7 \\ c&=&14 \\ d&=& -8 \\ C_1&=& 42 -49 = -7 \\ C_2&=& -686 +882 - 216 =-20 \\ C&=& = \sqrt {{20 \pm \sqrt {400 - 1372} \over 2}} \\ &=& \sqrt {{20 \pm 18 i \sqrt{3} \over 2}} \\ &=& \sqrt {{10 \pm 9 i \sqrt{3} }} ~. \end{array}$

For the principal branch of the cube root we obtain ${x=4}$: $\displaystyle x= \frac{1}{3} \left(7+\frac{7}{\left(10+9 i \sqrt{3}\right)^{1/3}}+\left(10+9 i \sqrt{3}\right)^{1/3}\right) =4 ~. \ \ \ \ \ (16)$

We leave it as an exercise for the reader to show that the expression with radicals above adds up to give 4 as the total answer. (See answer below for how to obtain 4, but try very hard to do it all by yourself before you look at the answer. )

The other 2 roots are obtained by taking the 2 other cube roots. If we multiply by ${\exp(\pm 2 i \pi/3)}$ the value of ${C}$ on the principal branch of the cube root, we get the roots ${x=1}$ and ${x=2}$.

See answer below the line for how to arrive at 4 in (16).

Here we will prove that $\displaystyle \frac{1}{3} \left(7+\frac{7}{\left(10+9 i \sqrt{3}\right)^{1/3}}+\left(10+9 i \sqrt{3}\right)^{1/3}\right) =4 ~. \ \ \ \ \ (17)$

The evaluation of sums of cube roots that sum up to rationals can seem very difficult at first sight. If you are unfamiliar with such sums, try taking a look at some better known problems, such as this one here.

First, let $\displaystyle u=\sqrt {{10 + 9 i \sqrt{3} }} ~. \ \ \ \ \ (18)$

Next, notice that $\displaystyle (5+ i \sqrt 3)^3 = 125 + 75 i \sqrt 3 - 45 - i 3\sqrt 3 = 80 + 72 i\sqrt 3 ~. \ \ \ \ \ (19)$

Now observe that $\displaystyle (5+ i \sqrt 3)^3 = 80 + 72 i \sqrt 3 = 8 u^3 \ \ \ \ \ (20)$

so that $\displaystyle u = {5+ i \sqrt 3 \over 2} ~. \ \ \ \ \ (21)$

Now, this means that $\displaystyle \frac 7 {\left(10+9 i \sqrt{3}\right)^{1/3}}+\left(10+9 i \sqrt{3}\right)^{1/3} = \frac 7 {\left( {5+ i \sqrt 3 \over 2}\right)}+\left( {5+ i \sqrt 3 \over 2}\right) ~. \ \ \ \ \ (22)$

Let $\displaystyle v= \frac 7 {\left( {5+ i \sqrt 3 \over 2}\right)}+\left( {5+ i \sqrt 3 \over 2}\right) ~. \ \ \ \ \ (23)$

Using common denominators, $\displaystyle v = \frac {7 + (25 + 10 i \sqrt 3 - 3)/4} {\left( {5+ i \sqrt 3 \over 2}\right)} = \frac {25 + 5 i \sqrt 3} {5+ i \sqrt 3 } =5 ~. \ \ \ \ \ (24)$

Putting everything back together, we finally get $\displaystyle \frac{1}{3} \left(7+\frac{7}{\left(10+9 i \sqrt{3}\right)^{1/3}}+\left(10+9 i \sqrt{3}\right)^{1/3}\right) = \frac{1}{3} (7+5) = 4 . \ \ \ \ \ (25)$