"Is there anything that I can do about this to stop my answers being complex numbers when solving cubic equations?"
You are making an assumption that is unwarranted.Namely that a cubic equation must necessarily have 3 real roots. This is not the case.
Let your equation be
If coefficients are complex you should expect some complex roots. Right?
If the coefficients are REAL then depending on the discriminant
you can have three cases
DELTA positive : three distinct real roots
DELTA=0 , the equation has a multiple root and all roots are REAL
DELTA negative: the equation has ONE real root and 2 complex roots that are complex conjugate of each other.
It suffices to look at the Tartaglia/Cardano expressions of the roots to know that more often than not there is going to be complex roots.
×