# Can a cubic that crosses the x axis at three points have imaginary roots?

I have a cubic polynomial, $x^3-12x+2$ and when I try to find it's roots by hand, I get two complex roots and one real one. Same, if I use Mathematica. But, when I plot the graph, it crosses the x-axis at three points, so if a cubic crosses the x-axis a three points, can it have imaginary roots, I think not, but I might be wrong.

-

A cubic has (counting multiplicity) exactly three roots in $\mathbb C$. Thus if you already have three real roots, then that's all there is.

A quick check shows that the derivative has roots $\pm2$ and that the cubic is positive at $-2$, negative at $+2$ and of course goes from $-\infty$ to $+\infty$ as $x$ does. Therefore even without plotting, we can conclude that there are indeed three real roots just by counting the sign changes.

-
What are the roots of the polynomial then? – Kabelo Moiloa Nov 22 '12 at 17:59
See Fly's answer for approximate values. Starting from my observations above, approximations with any prescribed accuracy can be found with arbitrary precision by e.g. regula falsi. I'm not used to the classical formuly for cubics, but it is in fact possible to express the roots as radicals. Note that when doing so, intermediate results may be complex, but that cancels. – Hagen von Eitzen Nov 22 '12 at 19:07

The three roots are, approximately, $z = -3.545$, $0.167$ or $3.378$.

A corollary of the fundamental theorem of algebra is that a cubic has, when counted with multiplicity, exactly three roots over the complex numbers. If your cubic has three real roots then it will not have any other roots.

I've checked the plot, and you're right: there are three real roots. All I can think is that maybe you have made a mistake when substituting your complex "root" into the equation. Perhaps you might like to post the root and we can check it for you.

Another thing to convince you there's an error. Let $z= r_1,r_2,r_3$ be the three real roots. If $z=c$ is your complex root then the conjugate $z = \overline{c}$ must also be a root. Thus:

$$z^3-12z+2 = (z-r_1)(z-r_2)(z-r_3)(z-c)(z-\overline{c}) \, .$$

Hang on! That means your cubic equation starts $z^5 + \cdots$ and isn't a cubic after all. Contradiction! Either it doesn't have three real roots, or your complex "root" is not a root after all.

Beware that computer programs use numerical solutions and you get rounding errors.

-
Wain for 10 minutes as I recheck my working... – Kabelo Moiloa Nov 22 '12 at 18:17
Yes, I you are right, the solutions are indeed the ones you have mentioned. I will file a bug with Mathematica, I was using Solve, which uses symbolic computation not numerical computation, and the answer was actually contradictory, thank you for you help! – Kabelo Moiloa Nov 22 '12 at 18:23
@Kabelo: What results did you get from Mathematica? – Rahul Nov 22 '12 at 18:55

Since I have not a copy of Mathematica with me right now, I will send a link to the Wolfram Alpha results: http://www.wolframalpha.com/input/?i=solve+x3%E2%88%9212x%2B2+%3D+0, which are the same as the Mathematica results, since Wolfram Alpha uses Mathematica as a computational engine.

-
Surely you need to give a bit more context here? Like pointing out that those imaginary parts appear to be rounding errors? – Simon Hayward Nov 23 '12 at 10:26
Yes but they shouldn't be rounding errors since the erronous result was arrived at by using symbolic computation, not numeric computation. – Kabelo Moiloa Nov 26 '12 at 14:22

You may have gotten the answer $\sqrt[3]{(-3i\sqrt{7}-1)}+ \sqrt[3]{(3i\sqrt{7}-1)}$ when you computed it by hand. The three real solutions can be presented as follows, rounded as it appears that this cubic equation may not be able to be solved with radicals $$(-1.772303408...+i0.9267905...)+(-1.772303408...-i0.9267905...)=-3.544...$$

$$(0.083527587...+i1.998255024...)+(0.083527587...-i1.998255024...)=.1670...$$

$$(1.688775821...+i1.071464524...)+(1.688775821...-i1.071464524...)=3.377...$$

Each of the above numbers in parentheses is a cube root of $$\sqrt[3]{(-3i\sqrt{7}-1)}$$ and $$\sqrt[3]{(3i\sqrt{7}-1)}$$ respectively. You can see that each $Im(z)$ cancel to arrive at the real number solution. I believe this is called casus irreducibilis which you can check out on Wikipedia http://en.wikipedia.org/wiki/Casus_irreducibilis. You can see one method of computing the cube roots of these nested cubic radicals on Stack Exchange Question 16331.

-