# how to find the roots of a cubic equation?

Given a formula

$$x^3+ax^2+bx+c=0$$

how can I get the value of x without having an $i$ in my roots? Because Cardano's formula does have imaginary numbers if the discriminant is less than zero. My task is to generalize it and all the cases about the discriminant is applied without having a restriction in imaginary numbers.

I have been using Cardano's formula but if the cases are not suitable there is a root with imaginary numbers.

• If one insists on using only "algebraic" methods, then as explained by Ryan Reich, non-real numbers on the way to real solutions are unavoidable in the casus irreducibilis. However, if we allow trig functions, inverse trig functions, and their hyperbolic analogues, one can get explicit formulas for the real roots that do not travel through the complex numbers. For some discussion, please see this. – André Nicolas Aug 5 '13 at 2:27

If you read up on the casus irreducibilis, you will find that it is impossible to express the general cubic formula in such a way that real roots will always be expressed without intermediate complex numbers. This is actually a (possibly) historical reason that complex numbers were originally accepted in algebra, since not only equations with complex roots such as $x^2 + 1 = 0$, but also certain cubic equations with only real roots, required complex numbers to express those roots.