Finding all three roots of cubic polynomial using Cardano's method To solve $x^3 + px + q = 0$. I'm using Cardano's method, with the substitution $x = u + v$.
In the special case that $3uv + p = 0$, I've derived $u$ and $v$ as the following:
$u = \sqrt[3]{-\frac{q}{2}+\sqrt{(\frac{q}{2})^2 + (\frac{p}{3})^3}}$
and
$v = \sqrt[3]{-\frac{q}{2}-\sqrt{(\frac{q}{2})^2 + (\frac{p}{3})^3}}$
The next step is to find $x$, which is $x=u+v$, but how would I go about finding all three values for x when there are 9 possible combinations for $u_1, u_2, u_3,$ and $v_1, v_2, v_3$?
EDIT: If it's of any relevance, this is the expression I'm trying to solve:
$x^3 + \frac{7}{8}x- \frac{25}{16} = 0$.
 A: $u$ and $v$ are also constrained by $3uv + p = 0$.
In this particular problem you get
$$u = \sqrt[3]{\frac{25}{32} + \sqrt{\frac{17561}{27648}}},\quad v = \sqrt[3]{\frac{25}{32} - \sqrt{\frac{17561}{27648}}}$$
so if $\alpha$ and $\beta$ are real cube roots, all roots are given by
$$u_0 = \alpha, \quad u_1 = \alpha e^{\frac{2\pi i}3},\quad u_2 = \alpha e^{\frac{4\pi i}3}$$
$$v_0 = \beta, \quad v_1 = \beta e^{\frac{2\pi i}3},\quad v_2 = \beta e^{\frac{4\pi i}3}$$
So $$\mathbb{R} \ni -\frac{p}3 = u_kv_j = \alpha\beta e^{\frac{2\pi i}3 (k+j)}$$
Hence $k+j \in\{ 0, 3\}$, so the valid combinations are $$k = l = 0$$ $$k = 1, \quad l = 2$$
$$k = 2, \quad l = 1$$
A: Suppose you have a cubic equation $ax^3+bx^2+cx+d=0$ with a root $x_1$ you found via the Cardano method, or perhaps as a rational root or even a specified root value you used to construct the equation.  Then you always have:
$ax^3+bx^2+cx+d=a(x-x_1)(x^2+rx+s)\text{   Eq. 1}$
$a(x-x_1)(x^2+rx+s)=ax^3+a(r-x_1)x^2+a(s-rx_1)x-ax_1s\text{   Eq. 2}$
So matching the quadratic and constant terms between the right side of Eq. 2 and the left side of Eq. 1 gives
$r=(b/a)+x_1, s=-d/(ax_1)$
With these values of $r$ and $s$ derived, just use the quadratic formula to get the remaining roots:
$x_2,x_3=\frac{-r\pm\sqrt{r^2-4s}}{2}=\frac{2s}{-r\mp\sqrt{r^2-4s}}$
