[Sent to Math-Fun email list December 6, 2009]
The usual trigonometric solution for a monic real cubic equation with 3 real roots has the high school teacher pulling an obscure trigonometric identity out of a hat in deus ex machina fashion, leaving the high school student feeling inadequate, helpless, irritable, and (s)he probably then tunes out of the rest of the presentation and starts texting on his/her cellphone.
Here's a version of a cubic solution that a student familiar with complex numbers should feel very good about.
We first eliminate the quadratic x² term in the usual fashion by shifting the center of mass of the roots to the origin with a change of variables. Finding the center of mass doesn't require solving the equation—it is merely −1/3 the coefficient of the quadratic term. It is pretty easy to motivate this step—we almost always translate to the origin whenever easily possible!
That having been done, we are left with the so-called "incomplete" cubic:
x³+px+q = 0.
Since the 3 roots x = r1, x = r2, x = r3 are real, they can take on any real values, so long as r1+r2+r3 = 0 (remember, we already shifted the center of mass to the origin). All three could be equal (hence zero), or two could be equal (hence equal to minus half the third root). We assume that all three roots are distinct, and will check back later to make sure that everything still works for the other cases.
Here is the modest bunny we will pull out of the hat: we conjecture that all three real roots are the real parts of the 3 vertices of an equilateral triangle in the complex plane centered on the origin.
We first check the dimensionality: our equilateral triangle has only two real parameters: its size—i.e., the radius r of its circumcircle, and the angle α it has rotated relative to the x-axis (the real axis). But our incomplete cubic also has only two real parameters, p, q, so we are still in business.
We next realize that the three vertices of the equilateral triangle are the three cube roots of a complex number z = x+iy:
z³ = (r(cos(α)+i sin(α)))³ = r³ (cos(3α)+i sin(3α)) [de Moivre]
z³ = (x+iy)³ = (x³−3xy²) − i (y³−3yx²) = r³ (cos(3α)+i sin(3α))
Since we are projecting onto the x-axis, we will need only on the real part of the previous equation:
x³−3xy² = r³cos(3α)
But how to get rid of y² ?
We have the equation of the circumcircle: x²+y² = r², so y² = r²−x², and our real part equation now reads:
x³−3x(r²−x²) = r³cos(3α) =
x³−3xr²+3x³ = r³cos(3α) =
4x³−3xr² = r³cos(3α)
or, dividing by 4,
x³−3xr²/4−r³cos(3α)/4 = 0
We can now identify
p = −3r²/4,
q = −r³cos(3α)/4
We first solve for r,
r² = −4p/3
r = sqrt(−4p/3)
So p must be negative in order for x³+px+q to have 3 real roots.
We then solve for α:
cos(3α) = −4q/r³
α = acos(−4q/r³)/3
So we also need |4q/r³| ≤ 1 in order to have 3 real roots.
So our 3 real roots are:
r1 = r cos(α)
r2 = r cos(α+2π/3)
r3 = r cos(α−2π/3)
So let us now check our work.
(x−r1) (x−r2) (x−r3) = x³ − (r1+r2+r3) x² + (r1r2+r1r3+r2r3) x − r1r2r3
We already know that r1+r2+r3 = 0, but if you want to check the trigonometry, be my guest!
−r1r2r3 = −r³ cos(α) cos(α+2π/3) cos(α−2π/3) [after a lot of trig!]
= −r³ cos(3α)/4
r1r2+r1r3+r2r3 = r² (cos(α) cos(α+2π/3) + cos(α) cos(α−2π/3) + cos(α+2π/3) cos(α−2π/3)) [more trig!]
= r² (−3/4)
So our cubic equation can now be written as
x³ − 0x² + (−3r²/4) x − r³ cos(3α)/4 =
Sure, there is a lot of trigonometry involved in checking the solution, but since we have already motivated the solution and have it in hand, the trigonometry involved in checking it is less stressful (although still tedious without Macsyma or equivalent).
We do have to be careful in mapping 3 given real numbers (which sum to zero) to the three different angles α, α+2π/3, α−2π/3, to make sure that the mappings are consistent with the parameterization.
We can now see that the case of all 3 roots being equal is handled by setting the parameter r = 0, while the case of 2 roots being equal is handled by the parameter α = 0 or α = π/3, depending upon whether the double root is to the right or left, respectively, of the single root.
An interesting fact that pops out of this characterization is a relatively tight bound, |rj|² ≤ r² = −4p/3, on the size of the roots. When we are far away from the circumcircle—i.e., |x/r| >> 1, the function x³−3xr²/4−r³cos(3α)/4 looks and acts very much like x³. In other words, all of the interesting behavior of this function lies within the circumcircle.
If we examine the derivative of eqn(x) = x³−3xr²/4−r³cos(3α)/4, we get 3x²−3r²/4, which is zero when x = ±r/2;
i.e., the relative minimum and maximum of our polynomial eqn(x) occur at x = ±r/2, which is completely independent of the angle α !
If we examine the discriminant of eqn(x) = x³−3xr²/4−r³cos(3α)/4, we get
(p/3)³+(q/2)² = (−3r²/4/3)³ + (−r³cos(3α)/4/2)²
= (−r²/4)³ + (r³cos(3α)/8)²
= −r6/64 + r6cos(3α)2/64
= −(r6/64) (1−cos(3α)2)
= −(r/2)6 sin(3α)2 [Must be negative, so as to have 3 real roots.]
= (i(r/2)³ sin(3α))²