Solving Cubic Equations

If you thought the Quadratic Formula was complicated, the method for solving Cubic Equations is even more complex.
Let's use the equation from the Cubic Equation Calculator as our first example:

2x3   - 4x2   - 22x + 24 = 0

Cubic equations have to be solved in several steps. First we define a variable 'f':

f = (3c/a) - (b²/a²)
3
"Plugging in" the numbers from the above equation, we get:
f = ((3 • -22/2) - (16/4)) / 3       =     - 12.333333...

Next we define 'g':

g = (2b³/a³) - (9bc/a²) + (27d/a)
27
From this point on, you are expected to "plug in" the numbers:
g = 4.07407407407407....

Then we define 'h':

h = (g²/4) + (f³/27)

h = -65.333333...

If h > 0, there is only 1 real root and is solved by another method.
(SCROLL down for this method)

For the special case where f=0, g=0 and h = 0, all 3 roots are real and equal.
(SCROLL to the bottom for this method)

When h <= 0, as is the case here, all 3 roots are real and we proceed as follows:

ALL 3 Roots Are Real

We just calculated the values of 'f','g' and 'h' so let's calculate the rest.

i = ((g²/4) - h)½

i = 8.33563754151978...


j = (i)
j = 2.0275875100994063...

NOTE: The following trigonometric calculations are in radians
k = arc cosine (- (g / 2i))
k = 1.817673356517739...

L = j • -1
L = -2.0275875100994...

M = cosine (k/3)
M = 0.8219949365268...

N = (Square Root of 3) • sine (k/3)
N = 0.9863939238321...

P = (b/3a) • -1
P = 0.6666666666666...

x1 = 2j • cosine(k/3)   -(b/3a)
x1 = 4

x2 = L • (M + N) + P
x2 = -3

x3 = L • (M - N) + P
x3 = 1

When Only 1 Root Is Real
3x3   - 10x2   + 14x + 27 = 0
f = (3c/a) - (b²/a²)
3
f =   .962962962962962...

g = (2b³/a³) - (9bc/a²) + (27d/a)
27
g = 11.441700960219478...

h = (g²/4) + (f³/27)
h = 32.761202560585275...

R = -(g/2) + (h)½
R = .002889779596782...

S = (R)
S = .142436591824886...

T = -(g/2) - (h)½
T = -11.4445907398163...

U = (T)
U = -2.25354770293599...

X1 = (S + U) - (b/3a)
X1 = -1

X2 = -(S + U)/2 - (b/3a) + i•(S-U)•(3)½/2
X2 = 2.16666666666... + i•2.07498326633146

X3 = -(S + U)/2 - (b/3a) - i•(S-U)•(3)½/2
X3 = 2.16666666666... - i•2.07498326633146

When All 3 Roots Are Real and Equal

x3   + 6x2   + 12x + 8 = 0
f = (3c/a) - (b²/a²)
3
f =   ((3•12/1)-(36/1)) / 3
f =   0

g = (2b³/a³) - (9bc/a²) + (27d/a)
27
g = ((2•216/1) - (9•6•12/1) + (27•8/1)) / 27
g = (432 - 648 + 216) / 27
g = 0

h = (g²/4) + (f³/27)
h=0

x1 = x2 = x3= (d/a)1/3 • -1
x1 = x2 = x3= (8/1)1/3 • -1
x1 = x2 = x3= -2



RETURN   TO   CUBIC   EQUATION   CALCULATOR


Return To Home Page

Copyright © 1999 -     1728 Software Systems