Is there really analytic solution to cubic equation?
I know the formulas for solving cubic equation, but when I try to use them in both Cardano's method and https://en.wikipedia.org/wiki/Cubic_function#Algebraic_solution, I usually encounter something like Cube root of numbers such as $2+11i$ or nested radicals, where square root is inside of cube root. According to hypergeometric's answer to my previous question, I would need to solve another cubic equation to trisects the argument angle to find the cube root and there is similiar problem with the denesting the cube root. So is there some algorithm to analytically solve cubic equation without guessing and rounding (I want to solve it symbolically)? How do the computer algebra systems like Wolfram Alpha do it?
Solution 1:
There are a number of similar questions, for example
Cubic roots and Cardano formula
Cube root of numbers such as $2+11i$
The core of all questions seems to be an uneasy feeling about cubic roots of complex numbers because "they are not really computable".
What is the difference between a purely real expression like $\sqrt[3]{2}$ and a complex expression like $\sqrt[3]{2+11i}$?
$\sqrt[3]{2}$ seems to be very familiar whereas one might be a little skeptical about $\sqrt[3]{2+11i}$ - how to compute the latter?
But is it really "easier"to compute $\sqrt[3]{2}$ than $\sqrt[3]{2+11i}$? I believe the answer is "no". If you want to compute $\sqrt[3]{2}$ you need an algorithm producing a sequence of rational approximations $x_n$ converging to $\sqrt[3]{2}$ plus a concrete estimate of $\lvert \sqrt[3]{2} - x_n \rvert$ so that you know when to stop the computation. There are very simple algorithms to compute cubic roots of real numbers, but there are also algorithms to compute cubic roots of complex numbers. These are somewhat more complicated, but there is no philosophical difference concerning the iterative approach.
Let me close with some remarks concerning the Cardano formula. In any cubic equation $$x^3 + a_2x^2 +a_1x + a_0 = 0 \tag{1}$$ we can substitute $x = y - \frac{1}{3}a_2$ and obtain the cubic equation $$y^3 +ay = b \tag{2}$$ where $a = a_1 - \frac{1}{3}a_2^2$ and $b = -\frac{2}{27}a_2^3 + \frac{1}{3}a_1a_2 - a_0$.
The solutions of $(2)$ are given as follows. Set
$$R = \frac{b^2}{4} + \frac{a^3}{27} , \tag{3}$$
$$w_+ = \sqrt[3]{\frac{b}{2} + \sqrt{R}}. \tag{4}$$
Although at first glance $w_+$ seems to be uniquely determined, it involves two choices: The square root has two values, the cubic root three values in $\mathbb{C}$. Let us adopt the following conventions:
-
For $x \ge 0$ we let $\sqrt{x}$ denote the nonnegative square root of $x$, for $x <0$ we define $\sqrt{x} = i\sqrt{-x}$.
-
For any $x \in \mathbb{R}$ we let $\sqrt[3]{x}$ denote the real cubic root of $x$.
-
For a non-real $z \in \mathbb{C}$ we do not get explicit about the choice of $\sqrt[3]{z}$ among the the three complex (non-real) cubic roots of $z$.
This gives a standard interpretation of $\sqrt[3]{\frac{b}{2} + \sqrt{R}}$ as a real number for $R \ge 0$ and leaves a single choice (of a complex cubic root) for $R < 0$.
Note that $w_+ = 0$ if and only $\sqrt{R} = -\frac{b}{2}$, i.e. $b \le 0$ and $a = 0$. This case (in which $y^3 = b$) is trivial and could also be omitted. Observe that $\frac{b}{2} - \sqrt{R} = b$ in this case.
Now define
$$w_- = \begin{cases} -\dfrac{a}{3w_+} & w_+ \ne 0 \\ \phantom{..} \sqrt[3]{b} & w_+ = 0 \end{cases} \tag{5}$$
It is easily verified that $w_-$ is a cubic root of $\frac{b}{2} - \sqrt{R}$. If $w_+$ is real (which happens precisely when $R \ge 0$), then also $w_-$ is real so that it is the standard interpretation of $\sqrt[3]{\frac{b}{2} - \sqrt{R}}$ as a real number.
So far we specified cubic roots $w_\pm$ of $\frac{b}{2} \pm \sqrt{R}$. These cubic roots are not independent, but satisfy the relation $$3w_+w_- + a = 0 . \tag{6}$$
The solutions of $(2)$ are then $$y_0 = w_+ + w_- \tag{7}$$ $$y_1 = \zeta_1 w_+ + \zeta_2 w_- \tag{8}$$ $$y_2 = \zeta_2 w_+ + \zeta_1 w_- \tag{9}$$ where $\zeta_1 = -\frac{1}{2} + \frac{\sqrt{3}}{2}i, \zeta_2 = -\frac{1}{2} - \frac{\sqrt{3}}{2}i = \zeta_1^2 = \overline{\zeta_1}$ are the two complex third unit roots. This is easily verified by inserting into $(2)$. With $\zeta_0 = 1$ we may also write $$y_k = \zeta_k w_+ + \zeta_k^2 w_- = \zeta_k w_+ + \overline{\zeta_k} w_- \tag{10}$$ Note that the $\zeta_kw_+$ are the three complex cubic roots of $\frac{b}{2} + \sqrt{R}$ and the $\zeta_kw_-$ are the three complex cubic roots of $\frac{b}{2} - \sqrt{R}$. Thus all solutions of $(2)$ are sums of certain complex cubic roots of $\frac{b}{2} + \sqrt{R}$ and $\frac{b}{2} - \sqrt{R}$.
The Cardano formula is frequently reported in the sloppy form that $$\sqrt[3]{\frac{b}{2} + \sqrt{R}} + \sqrt[3]{\frac{b}{2} - \sqrt{R}} \tag{11}$$ is a solution of $(2)$. This is misleading since it suggests that
-
there is always a standard interpretation of $\sqrt[3]{\frac{b}{2} \pm \sqrt{R}}$,
-
two separate computations for $\sqrt[3]{\frac{b}{2} \pm \sqrt{R}}$ must be performed.
But 1. is true only for $R \ge 0$, and in that case $(11)$ is in fact a solution of $(2)$. However, there are two more solutions described by $(10)$ and which involve other values of the cubic roots of $\frac{b}{2} \pm \sqrt{R}$. And, more important, 2. is not true because $w_-$ can easily be derived from $w_+$ via $(5)$. This is always easier than computing $\sqrt[3]{\frac{b}{2} - \sqrt{R}}$ ab ovo, even for $R \ge 0$. For an even easier alternative in case $R < 0$ see the discussion below.
Let us now consider three cases for $R$.
If $R > 0$, then we get one real solution $y_0$ (which may be expressed by $(11)$ in the standard interpretation) and two non-real solutions $y_1, y_2$ which are complex conjugate. All solutions can be expressed by using only square and cubic roots of real numbers.
If $R = 0$ we obtain the three real solutions $y_0 = 2\sqrt[3]{\frac{b}{2}}$ and $y_1 = y_2 = -\sqrt[3]{\frac{b}{2}}$.
The case $R < 0$ (casus irreducibilis) is most interesting. Note that it can only occur when $a < 0$. We have three distinct real solutions, but $w_+, w_-$ are non-real. They are cubic roots of the complex conjugate numbers $\frac{b}{2} \pm i \sqrt{-R}$, but recall that these cubic roots cannot be chosen independently because they are subject to $(6)$. If we make any choice for $w_+$ as a cubic root of $\frac{b}{2} + i \sqrt{-R}$, then clearly $\overline{w_+}$ is a cubic root of $\overline{\frac{b}{2} + i \sqrt{-R}} = \frac{b}{2} - i \sqrt{-R}$. We have $\lvert w_+ \rvert^3 = \lvert \frac{b}{2} + i \sqrt{-R} \rvert = \sqrt{-a^3/27}$, i.e. $\lvert w_+ \rvert = \sqrt{-a/3}$. This implies $3w_+\overline{w_+} + a = 3\lvert w_+ \rvert^2 + a = 0$ which means $$w_- = \overline{w_+} . \tag{12}$$ This is even simpler than $(5)$ and it moreover seems completely natural to choose complex conjugate cubic roots for the complex conjugate numbers $\frac{b}{2} \pm i \sqrt{-R}$.
Anyway, we get $$y_k = \zeta_k w_+ + \overline{\zeta_k} w_- = \zeta_k w_+ + \overline{\zeta_k} \overline{w_+} = \zeta_k w_+ + \overline{\zeta_k w_+} = 2 Re(\zeta_k w_+) . \tag{13}$$
Note that $\zeta_k w_+$, $k = 0,1,2$, are the three complex cubic roots of $\frac{b}{2} + i \sqrt{-R}$.
It is known that in general it is impossible to express any of these three real solutions in terms of roots of real numbers. See
https://en.wikipedia.org/wiki/Casus_irreducibilis
Those who are historically interested and read German may also look at
Hölder, Otto. "Über den Casus irreducibilis bei der Gleichung dritten Grades." Mathematische Annalen 38.2 (1891): 307-312.
Summarizing, the recipe to solve $(2)$ is the following: Compute $w_+$ as a cubic root of $\frac{b}{2} + \sqrt{R}$, then if $R \ge 0$ determine $w_-$ via $(5)$ and insert in $(10)$, and if $R < 0$ insert in $(13)$.
Remark 1:
The special case $a < 0, b = 0$ is interesting. The equation $y^3 + ay = 0$ has the obvious solution $y_1 = 0$. This reduces the problem to $y^2 + a = 0$ and gives $y_{2,3} = \pm \sqrt{-a}$.
Nevertheless we are in the casus irreducibilis: We have $R = \frac{a^3}{27} < 0$. This gives $\sqrt{R} = i \sqrt{\frac{-a^3}{27}}$ and $w_+ = \eta \sqrt{ \frac{-a}{3}} = \eta \frac{\sqrt{-a}}{\sqrt 3}$, where $\eta$ is one of the three complex cubic roots of $i$. Taking $\eta = -i$, we get $Re(w_+) = 0$, thus $y = 0$ is a solution found by Cardano's formula. The solutions $y = \pm \sqrt{-a}$ are obtained by taking $\eta = \pm \frac{\sqrt{3}}{2} + \frac{i}{2}$.
Remark 2:
Cardano mentioned that his formula $(11)$ fails in the casus irreducibilis, certainly because he did not know the general concept of complex numbers (although he had an idea about square roots of negative numbers). Rafael Bombelli (1526 - 1572) seems to be the first who really used complex numbers (although be did not introduce a proper concept of them). For the equation $x^3 = 15x + 4$ - which is casus irreducibilis - he obtained the solution (written in modern terms) $$x = \sqrt[3]{2 + \sqrt{-121}} + \sqrt[3]{2 - \sqrt{-121}}$$ and showed that a cubic root of $2 \pm \sqrt{-121}$ is given by $w_\pm = 2 \pm \sqrt{-1}$. Thus he obtained $x = 4$ which is in fact an exact real solution found by Cardano's formula. However, in a a sense he had good luck since his choices of cubic roots satisfy $(12)$.
Bombelli's example shows that in the casus irreducibilis it is sometimes possible to find a simple explicit expression for $w_+$ which allows to find the exact values of the three real solutions.
Remark 3:
To use Cardano's formula it is essential to determine the values $\sqrt[3]{\frac{b}{2} \pm \sqrt{R}}$. In Remarks 1 and 2 we have done this for some special cases. A more general approach can be found in When does $r + \sqrt s$ with $r,s \in \mathbb Q$ have a cubic root of the form $u \pm \sqrt v$ with $u,v \in \mathbb Q$?
Note, however, that the explicit computation of $\sqrt[3]{\frac{b}{2} \pm \sqrt{R}}$ requires that we know a solution of $(2)$ by applying the Rational root theorem. To put it pointedly: In some cases we can determine $\sqrt[3]{\frac{b}{2} \pm \sqrt{R}}$ by making finitely many trials.