I know there are three real roots for cubic however cubic formula is giving me non-real answer. What am I doing wrong? I want to solve the equation $x^3-x=0$ using this cubic equation. For there to be real roots for the cubic (I know the roots are $x=-1$, $x=0$, $x=1$), I assume there must be a positive inside the inner square root. (Or is that wrong?) 
However, when I substitute in $a=1$, $b=0$, $c=-1$, $d=0$, the square root term inside the cube root terms becomes
$$\sqrt{\;\left(\;2(0)^3 - 9(1)(0)(-1) + 27(1)^2(0)\;\right)^2 - 4 \left(\;(0)^2 - 3(1)(-1)\;\right)^3\quad}$$
It gives me $\sqrt{-108}$, which is $10.39i$. Now that I have a non-real number as part of the equation I can't see any way for it to be cancelled or got rid of, even though I know there is a real answer. 
Could somebody please tell me how I can get a real answer and what I am doing wrong? Thanks.
 A: Okay, so you're getting that operands of the cube root parts of the formula will look like this:
$$p + q i \qquad\text{and}\qquad p - q i$$
with some pesky non-zero $q$ (namely, $\sqrt{108}$). Well, these values are conjugates, so that their respective (principal) cube roots are conjugates, as well. For the $x_1$ value in your formula, these conjugate cube roots add together, and their imaginary parts conveniently cancel. The same kind of cancellation happens for the $x_2$ and $x_3$ values, too, because the factors $\frac{1}{2}(1+i\sqrt{3})$ and $\frac{1}{2}(1-i\sqrt{3})$ are themselves conjugates. When the dust settles, you'll have the three real roots you expect.
As @Aloizio points out, this is historically how imaginary numbers snuck into mathematics: as temporary diversions on the way to real solutions of cubic equations. These numbers seemed weird, maybe even scary, but they cancelled in the end so no harm done. Then people started to wonder about a world in which these things didn't always cancel ... 
A: I didn't check your calculations, but it seems you got into the point which actually made people turn their attention to complex numbers. Complex numbers were not "invented" in order to solve quadractic equations as some people usually tell us, but to solve cubic equations.  People discovered a formula for the roots of a cubic polynomial, but then later discovered that in some situations (actually, a lot of them), the equations passed necessarily over complex numbers. Actually, even in situations where all roots are real this happen.
If you do the calculations correctly, the complex numbers will cancel themselves in the end.
