Trigonometry/The solution of cubic equations

A cubic equation is an equation of the form

$ax^{3}+bx^{2}+cx+d=0$ to be solved for x. There are three possible values for x, known as the roots of the equation, though two or all three of the values may be equal (repeated root). If a, b, c and d are all real numbers, at least one value of x must be real. There are two possible cases: the other two roots may be real, or they may be a pair of complex conjugate numbers.

The roots can always be expressed exactly as surds. However, if all three roots are real, the surds involve the cube roots of complex numbers. In that case, they are in general most easily calculated using trigonometric functions.

In the above equation, a is non-zero (or the equation would be quadratic). Divide through by a to get the equation in the form

$x^{3}+Ax^{2}+Bx+C=0$ Let

$Q={\frac {3B-A^{2}}{9}},\qquad R={\frac {9AB-27C-2A^{3}}{54}},\qquad D=Q^{3}+R^{2}$ D is called the discriminant. If $D>0$ , two roots are complex; if $D=0$ there is a (real) repeated root; if $D<0$ there are three unequal real roots.

Assume $D<0$ . Clearly, $Q^{3}=D-R^{2}$ must be less than D so is also negative; thus, $-Q^{3}$ and $-Q$ are both positive. Let

$\cos(\theta )={\frac {R}{\sqrt {-Q^{3}}}}$ Then the three roots are

$x_{1}=2{\sqrt {-Q}}\cos \left({\tfrac {\theta }{3}}\right)-{\frac {A}{3}}$ $x_{2}=2{\sqrt {-Q}}\cos \left({\tfrac {\theta }{3}}+120^{\circ }\right)-{\frac {A}{3}}$ $x_{3}=2{\sqrt {-Q}}\cos \left({\tfrac {\theta }{3}}+240^{\circ }\right)-{\frac {A}{3}}$ [Add example and/or exercise]