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 equation [1], 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].

[3]

The algebra is a bit messy, but when solving cubics, it is much easier.

[2.01]

Let us expand [2.01], bit by bit:

[2.02]

[2.03]

[2.04]

[2.05]

And finally, and trivially, the constant.

[2.05]

Now adding up the above (Noting t

[2a]

By comparing the coefficients of [2a] with [2],

[2, repeated from above]

we find:and

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:

- p or q is zero: The Cubic Reduces to an Immediately Solvable Form
- p and q are not zero: The Cubic Reduces to an Equation in p and q

If p=0, then equation [2], becomes:

, and so

If q=0, then equation [2] becomes:

, and so t=0 or

If p=0, then t=∛(-q), and the roots of the original equation are:x

x

If q=0, then we have t

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=u^{3}-v^{3} 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 u^{3}:

[6]

Now, this equation is a quadratic in u^{3}, 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 v^{3}:

[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]

Three possibilities for the value of Δ that affect how we proceed:

- Δ is zero: All Roots Real, and Two Equal
- Δ is positive: One Real and Two Complex Roots
- Δ is negative: All the Roots Are Real and Different (Called the Irreducible Case)

Notice that v

Because t=u-v, and x=t-a/3

x=u-v-a/3

Also, x

=2u

[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 v

[14]

x

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]

[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 v

[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.

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=√(a

[28]

First, it is noticeable that the "r" for both u

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:

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π

[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 u

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:

Ken's book is packed with examples and explanations that enable you to discover more than 150 techniques to speed up your arithmetic and increase your understanding of numbers. Paperback and Kindle: