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}$$

Example: solution to $$x^3-3x+1=0$$: $$A=0$$, $$B=-3$$, and $$C=1$$. One finds $$Q=-1$$, $$R=-1/2$$, $$D=-3/4$$, and $$\theta = 2\pi/3, 4 \pi/3$$, with the result that $$x=2 \cos(4 \pi/9) = 2 \sin(\pi/18)=0.347296$$, $$x=2 \cos(2\pi/9)=1.53209$$, $$x=-2 \cos(\pi/9)=-1.87939$$, the first being the critical threshold for bond percolation on the triangular lattice (Sykes and Essam 1964).

[Add example and/or exercise]