A cubic equation is a polynomial equation in which the highest occurring power of the unknown x is the third power. An example is the equation
- 2x3 - 4x2 + 3x - 4 = 0
and the general form may be written as
- a0x3 + a1x2 + a2x + a3 = 0
Solving a cubic equation amounts to finding the roots of a cubic function. Every cubic equation with real coefficients has at least one solution x among the real numbers. We can evaluate the different possible cases in terms of the quantities and along with s = q/r. We have
- A quadratic equation if a0 = 0, otherwise
- A single real root which is a triple root if both q and r are zero, otherwise
- Two real roots, one of which is a double root, if s = 4, otherwise
- Three distinct real roots if
- A single real root and a pair of complex conjugate roots which are complex numbers if s > 4 or s < 0.
We first divide the given equation by a0 to arrive at an equation of the form
- x3 + ax2 + bx + c = 0 (1)
The substitution x = t - a/3 eliminates the quadratic term and we get at a cubic equation of the form
- t3 + pt + q = 0. (2)
To solve this equation, find two numbers u and v such that
- u3 - v3 = q
- uv = p/3
A solution to our equation is then given by
- t = v - u
as can be checked by directly substituting this value for t in (2).
The above system for u and v can always be solved: solve the second equation for v, substitute into the first equation, solve the resulting quadratic equation for u3, then take the cube root to find u. When the cubic equation has three real roots, the quadratic equation will give complex solutions, and so finding the real roots of a polynomial with real coefficients by means of extracting cube roots sometimes requires the use of complex numbers. This was already noticed by Cardano and is a strong argument for the usefulness (if not the existence) of complex numbers; historically the acceptance of complex numbers as having at least an imaginary sort of existence on account of their usefulness stemmed from this fact.
Once the values for t are known, the substitution x = t - a/3 can be undone to find the values of x solving the original equation.
If we have an equation
- x3 + ax2 + bx + c = 0
we may set
So that u3 - v3 = q, and uv = p/3, we find
and since x + a/3 = v - u then
In order to consistently define cube roots, we take the principal branch of the cube root function; so that if we express a number in polar coordinates with the polar angle θ in the range , to define the complex cube root we take the cube root of the radius and divide the polar angle by three. This means that the cube root of a negative real number will be a complex number.
Note that in finding u, there were six possibilities, since there are two solutions to the square root, and three complex solutions to the cubic root. However, which solution to the square root is chosen does not affect the final resulting x.
The symmetric group S3 of order three has the cyclic group of order three as a normal subgroup, which suggests making use of the discrete Fourier transform of the roots, an idea due to Lagrange. If r0, r1 and r2 are the roots of equation (1), and if so that ζ3=1 and ζ is a primitive third root of unity, then we may set The roots may then be recovered from the three si by inverting the above linear transformation, giving We already know the value s0 = -a, so we only need to seek values for the other two. However, if we take the cubes, a cyclic permutation leaves the cubes invariant, and a transpostion of two roots exchanges s13 and s23, hence the polynomial
is invariant under permutations of the roots, and so has coefficients expressible in terms of (1). Using calculations involving symmetric functions or alternatively field extensions, we can calculate (3) to be
then the roots of (4) are
Taking cube roots gives us u and v, which we can set to s2 and s3 and thereby obtain our solution.
If r is any root of (1), then we may factor using r to obtain
- (x - r)(x2 + (a + r)x + b + ar + r2) = x3 + ax2 + bx + c.
Hence if we know one root we can find the other two by solving a quadratic equation, giving for the other two roots. If we are finding the roots of a polynomial with real coefficients and one real root, we can find the real root purely in terms of the real (rather than complex) cube root function, or alternatively stated we can find the root by extracting cube roots only of positive quantities. The complex conjugate roots can then be found as above.
The cube root function is in some respects not a well-behaved function, or one convenient for the purposes of finding the roots of a cubic equation. While cube roots are well-known and traditional, it is possible to use other algebraic functions to determine the roots, and avoid some of the problems of cube roots. The cube root function has a branch singularity at zero, as a result of which the real cube root function does not extend nicely to a complex cube root function. Moreover, when using cube roots to find the roots of a polynomial with three real roots we must take the roots of complex numbers, which introduces complex numbers into a situation which does not, in fact, require them.
We can get around these problems by using Chebyshev cube roots in place of ordinary cube roots. The polynomial C3 = x3 - 3x is the third Chebyshev polynomial normalized to the interval [-2, 2], which we use in place of [-1, 1] so as to obtain a monic polynomial. This polynomial function is equal to which therefore can be inverted to obtain which satisfies x3 - 3x = t.
This procedure is precisely analogous to the definition of the cube root in terms of logarithms and exponentials, with 2 arccosh(x) in the place of ln(x), and cosh(x/2) in the place of exp(x). However, it tangles us up in the question of the branch cuts of arccosh, and rather than dealing with the complexities of that, we can define the Chebyshev cube root for all complex values directly. For | t - 2 | < 4, we have the following convergent series:
We can now define for the whole complex plane by taking a branch cut from to -2, and analytically continuing; continuing to the branch cut itself through the upper half-plane.
Now if we want the roots of x3 - 3x - t we may find them in terms of as r3 = - r1 - r2.
If we have a cubic equation in depressed form, we may write it as x3 - 3px + q = 0. Substituting we obtain . From this we obtain solutions to our original equation in terms of the Chebyshev cube root as r3 = - r1 - r2. If now we start from equation (1) and reduce to the depressed form, we have p = (a2 - 3b) / 9 and q = (2a3 - 9ab + 27c) / 27, leading to
This gives us solutions to (1) as
- r3 = - r1 - r2.
Suppose the coefficients of (1) are real. If s is the quantity q/r from the section on real roots, then s = t2; hence 0 < s < 4 is equivalent to -2 < t < 2, and in this case we have a polynomial with three distinct real roots, expressed in terms of a real function of a real variable, quite unlike the situation when using cube roots. If s > 4 then either t > 2 and is the sole real root, or t < -2 and is the role real root. If s < 0 then the reduction to Chebyshev polynomial form has given a t which is a pure imaginay number; in this case is the sole real root. We are now evaluating a real root by means of a function of a purely imaginary argument; however we can avoid this by using the function
which is a real function of a real variable with no singularities along the real axis. If a polynomial can be reduced to the form x3 + 3x - t with real t, this is a convenient way to solve for its roots.