You are on page 1of 4

Solution of any cubic equation with real coefficients using Cardano's Method

Ax3+BX2+CX+D=0
Enter the coefficients below:
A= 2
B= -25
C= 118
D= -170

This yields x3+EX2+FX+G=0

E = B/A -12.5
F = C/A 59
G = D/A -85

The Depressed Cubic: y3 + by = c


x = y - E/3
b = F - E2/3 6.9166666667

c = FE/3 - 2E3/27 -G -16.1574074074

c2 + 4b3/27 310.0833333333

y3 + by = c
(Q + P)3 - 3QP(Q + P) = Q3 + P3
y=Q+P
P = -b/(3Q)
Q3 + P3 = c
Q6 - cQ3 - b3/27 = 0
Q3 = ( c + sqrt( c2 + 4b3/27) )/2 = Rexp(i*Phi)

R = abs((c + sqrt(c2 + 4b3/27))/2) if c2 + 4b3/27 > 0 0.7258879014

R = sqrt(-b3/27) if c2 + 4b3/27 < 0


Phi = 0, if c2 + 4b3/27 > 0 and c + sqrt(c2 + 4b3/27) > 0 0

Phi = PI, if c2 + 4b3/27 > 0 and c + sqrt(c2 + 4b3/27) < 0


cos(Phi) = c/(2R) if c2 + 4b3/27 < 0
Phi needs to be a First or Second Quadrant Angle consistent with a non negative imaginary part.
Solve for Q : The three cube roots

Q0 = R^(1/3)cos(Phi/3)+iR^(1/3)sin(Phi/3) 0.8987175 +i
Q1 = R^(1/3)cos((Phi+2PI)/3)+iR^(1/3)sin((Phi+2PI)/3) -0.4493587 +i
Q2 = R^(1/3)cos((Phi+4PI)/3)+iR^(1/3)sin((Phi+4PI)/3) -0.4493587 +i

P0 = -b/(3R^(1/3))( cos(Phi/3) - isin(Phi/3) ) -2.5653841 +i


P1 = -b/(3R^(1/3))( cos((Phi+2PI)/3) - isin((Phi+2PI)/3) ) 1.2826921 +i
P2 = -b/(3R^(1/3))( cos((Phi+4PI)/3) - isin((Phi+4PI)/3) ) 1.2826921 +i

y0 = Q0 + P0 -1.6666667 +i
y1 = Q1 + P1 0.8333333 +i
y2 = Q2 + P2 0.8333333 +i

x0 = y0 - E/3 2.5000000 +i
x1 = y1 - E/3 5.0000000 +i
x2 = y2 - E/3 5.0000000 +i

Check:
Ax03+BX02+CX0+D= 0.0000000 +i
Ax13+BX12+CX1+D= 0.0000000 +i
Ax23+BX22+CX2+D= 0.0000000 +i
dano's Method
0.0000000
0.7783122
-0.7783122

0.0000000
2.2216878
-2.2216878

0.0000000
3.0000000
-3.0000000

0.0000000
3.0000000
-3.0000000

0.0000000
0.0000000
0.0000000

You might also like