The Cubic Equation has the form ax3 + bx2 + cx + d = 0. It must have the term in x3 or it would not be cubic but any or all of b, c and d can be zero.
x1=(- term1 + r13*cos(q3/3) )
x2=(- term1 + r13*cos(q3+(2*∏)/3) )
x3=(- term1 + r13*cos(q3+(4*∏)/3) )
Where:
discriminant(Δ) = q3 + r2
q = (3c- b2)/9
r = -27d + b(9c-2b2)
s = r + √(discriminant)
t = r - √(discriminant)
term1 = √(3.0)*((-t + s)/2)
r13= 2 * √(q)
Enter values for a, b, c and d get the result x.
For example: a=1, b=8, c=16 and d=10,
x1 = -5.365230013414097
x2 = -1.3173849932929516 + 0.3582593599240431 i
x3 = -1.3173849932929516 - 0.3582593599240431 i