Often it is extremely difficult to figure out an algorithm, but once it
is discovered, proving it is considerably easier, and in the case of
the solving the cubic, it means what was impossible to do, is now
possible.
In 1545, Cardan (or Cardano) published methods to solve the cubic and
quartic equations. His great achievement was to make public the work of
others, which had been previously kept secret. This method is based on
Cardan's published method.
Consider the following equation: [1]
While I do not know how to solve this equation, I do know how to solve
cubic equations of the form: [2]
And I know how to reduce equation [1] to equation [2], so effectively I
can solve equation [1].
Reducing
the Cubic
Any cubic of the form of equation [1] can be reduced to one of the form
of equation [2] by substituting: [3]
The algebra is a bit messy, but when solving cubics, it is much easier.
By expanding the above and simplifying (noting that
t2 cancels out), we find:
[2a]
And so, by comparing the coefficients of [2a] with [2], we find: and
Solving
the Reduced Cubic
First recall equation [2]
[2, repeated]
If p and q are zero, then t is zero. Otherwise, we consider the cases when
the value of p or q is zero and when both aren't zero:
If p=0, then
t=∛(-q),
and the roots of the original equation are:
x1=∛(-q) - a/3 (using equation
3:
x=t-a/3)
x2,3=∛(-q)[-1/2±
√(3)i/2] - a/3 (multiplying t by the irrational cubic roots
of one:
-1/2+√(3)i/2, and -1/2-√(3)i/2)
If q=0,
then we have t3+pt=0, giving t1=0,
and t2,3 are the solutions to t2+p=0,
or
x1=-a/3 (using equation 3: x=t-a/3)
x2,3=±√(-p)-a/3 (multiplying t by the two
roots of one: +1 and (-1) )
Naturally, if p or q are zero, then we have solved the equation. If
not, we continue.
The values of p and q in the equation below are not zero.
[2, repeated] So, we must solve this equation. Consider, that, for two numbers u and
v:
[Note: This is the cubic equivalent of completing the square in quadratics.] And, if we substitute in [2] : p=3uv, and -q=u3-v3 and let
t=u-v We find that, because the result is zero, that u-v is a root of our
equation. By finding the values of u and v, we will be able to solve
the cubic. The reason will become clear. We substitute for v, using:
[4] (Note that u cannot be zero, because p would also be zero, and we have
dealt with that case above. So neither u nor v is zero here.) in: [5] To get: Multiplying throughout by u3: [6] Now, this equation is a quadratic in u3, so we
know how to solve it, and hence the cubic!
Or, simplified: [7] There are 3 roots of a cubic, and not 6, as promised with the above,
but thankfully, we
find that it doesn't matter which of the ± values we take,
and
normally, I just take the plus sign. The occasions which might cause
problems have already been dealt with above. So, I will
quietly drop the ±, and keep the +. (Naturally, the serious
reader will check this is true!) From equation 5, we can find v3: [8] Quite clearly, the
discriminant,
D or Δ, is the bit in the square root. [9] If Δ=0, then all the roots are real, and at least
two are equal. If Δ>0, then √(Δ) is a real
number, and so one
root (the principal root) is real, and the other two are complex
numbers. If Δ<0, then √(Δ) is
imaginary, so all the
roots are real, and u and v will be complex numbers. This is the so
called irreducible case from antiquity (of course, it isn't irreducible
with complex arithmetic), when we need to use complex arithmetic.
Substituting Δ in 7 and 8, we have:
[10] And:
[11]
If Δ=0, then from 10 and 11, taking cube roots,
noting √(Δ)=0:
Notice that v1=-u1, when
Δ=0.
Because t=u-v,
and x=t-a/3
x=u-v-a/3
Also, x1=u1-v1-a/3
=2u1-a/3 (because v1=-u1)
[12]
We can find the other x's by multiplying by the cube roots of one. (The
complex numbers must be conjugate because 3uv=p, which is real):
[13]
As v1=-u1 [14]
x2,3=u2,3 - v2,3
-a/3 (because t=u-v,
and x=t-a/3)
So we add the corresponding parts
The imaginary part vanishes, leaving us with: [15]
That is both of these roots are the same (and real).
[16]
Or
[17]
Here, Δ is not negative, so the square root is a real number.
We continue from Equation 7 and
reproduce the equations below, as a reminder: [7] [8]
The discriminant is: [9]
Substituting Δ in Equations 7, 8:
[10]
[11]
Taking cube roots, we find:
[18]
[19]
Remembering that t=u-v, and x=t-a/3, we have:
So:
[20]
We can find the other u's using the cube roots of unity, but we need to
note that the complex root of unity used for, v2, or v3 is the complex
conjugate of the root used for the corresponding u2, u3. This is so
because 3uv=p, a real number, so the imaginary parts must vanish.
If :
[21]
Then v2 has the conjugate complex number: [22]
Again we use the formula: x=u-v-a/3:
So, by simplifying, we get: [23]
And, similarly: [24]
So: [25]
We have now solved the equation 1,
if two of the roots are complex and the other real.
Whilst with the quadratic when all the roots are real, the discriminant
is also real, the cubic is different in that when all the roots are
real and different, the discriminant (Δ) is a complex number.
We will remind ourselves of some basic equations which we have derived
earlier: [7] [8]
The discriminant is: [9]
Substituting Δ in Equations 7, 8:
[10]
[11]
Taking cube roots, we find:
[18]
[19]
So, in this case, Δ is negative, so √(Δ)
is an imaginary number. If Δ <0, then
√(Δ)=√(-Δ)i. Therefore:
[26]
[27]
To discover the cube roots, we note that the complex number is of the
form a+bi. When we convert to trigonometric form, absolute value of the
complex number, r=√(a2+b2).
The argument or phase, φ is the slope of r. The complex
number,
(a+bi) can be represented as r(cos (φ) +i sin (φ) ),
where cos (φ)=a/r, and sin (φ)=b/4. For our cube
root,
de
Moivre's law is: [28]
First, it is noticeable that the "r" for both u3
and v3 is the same. Also note that cos(φv)=-cos(
iφu), and sin(φv)=sin(
iφu), because the real parts of u and v
have an opposite sign and the imaginary bits have the same sign.
Trigonometric
Representation of u3
We find r2 using the normal formula for the
absolute value of a complex number:
[29]
Expanding Δ (it becomes minus):
[30]
The q's cancel out leaving the p term:
[31]
Finally, take the square root: [32]
Now we know r, and we can find cos(φ): [33]
We need φ for our calculations, and now we will go on to find
the u's and v's and therefore the x's:
Finding
u and v
Similarly, noting that for v, the r value is the same, the cosine
negative, and the sign the same as the u value, we can just write down
the v:
Our first x, calling it x1=u1-v1-a/3
Because we know or can compute the value of the cosine, (getting phi
from the inverse cosine, and dividing it by 3, etc), we have only to
deal with the remaining x's. We simply add multiples of 2π to
the old
φ values. So:
The values cycle for further multiples of 2π
Summary
We start with our normalised equation (that is, coefficient of xn
is 1): [1]
Our ideal equation is: [2]
Where:
But we would normally find it by substituting x=t-a/3 and expand ans
simplify to get Equation 2
If p or q or both are zero, then the equation is easily solved.
The secret to solving this equation is:
And noticing:
So 3uv=p, and u3 -v3=-q
The discriminant of the cubic is: [9]
The u and v values are:
[18]
[19]
[20] [25]
We now have all the information needed to solve any cubic, but if
√(Δ) is a complex number, it is hard to
solve Equations 18 and 19.
Therefore, we use trigonometry: [32] [33]
We use Equations 32 and 33 to find r and phi, finding phi with the
inverse cosine.
The x's are then: