Find roots of a cubic function thank to roots of derivative function

398 Views Asked by At

Let $f(x) = x^3 + px + q$

I have to find how many roots $f$ has. If $p\geq 0$, the answer is one.

But now I have to find the answer for $p<0$. We know that $f'(x) = 3x^2 + p$

The roots of $f'$ are easy to find. I will call them $x_1$ and $x_2$. I read that I could find the roots of $f$ by finding the sign of $f(x_1)f(x_2)$ (Sturm's theorem?). How could that be?

My idea is that if $f(x_1)f(x_2)$ is positive, that means the extrema share the same sign so there are no roots. Is that correct?