Just because I enjoy doing it, here is a derivation of Cardano's formula:
If a and b are any two real numbers then [itex](a- b)^3= a^3- 3a^2b+ 3ab^2- b^3[/itex] and [itex]3ab(a- b)= 3a^2b- 3ab^2[/itex] so that [itex](a- b)^3+ 3ab(a- b)= a^3- b^3[/itex]. If we let x= a- b, m= 3ab, and [itex]n= a^3- b^3[/itex], we have the [itex]x^3- mx= n[/itex]. That is a "reduced" cubic equation. (Reduced because there is no "[itex]x^2[/itex]" term. Given any cubic equation, [itex]x^3+ px^2+ qx+ r= 0[/itex], we can always replace x by y- a, then choose a so that the coefficient of [itex]y^2[/itex] is 0.)
Now, the question is, suppose we know m and n, can we solve for a and b and so find x? The answer is, of course, yes. From m= 3ab, b= m/3a so that [itex]n= a^3- b^3= a^3- m^3/3^3a^3[/itex] and, multiplying through by [itex]a^3[/itex], [itex]na^3= n(a^3)^2- (m/3)^3= 0.[/itex] That is a quadratic equation for [itex]a^3[/itex] that we can solve using the quadratic equation:
[tex]a^3= \frac{n\pm\sqrt{n^2- 4(m/3)^3}}{2}= \frac{n}{2}\pm\sqrt{\left(\frac{n}{2}\right)^2- \left(\frac{m}{3}\right)^3}[/tex]
Since [itex]a^3- b^3= n[/itex],
[tex]b^3= a^3- n= -\frac{n}{2}\pm\sqrt{\left(\frac{n}{2}\right)^2- \left(\frac{m}{3}\right)^3}[/tex]