I have the following polynomial with real coefficients: $$f(x)=x^3-(m+2)x^2+(m^2+1)x-1$$ I have to find all real $m$'s so that all of the roots of $f$ are real.

Trying to guess a root didn't get me anywhere.

I computed $x_1^2+x_2^2+x_3^2$ using Vieta's relations to be $-(m-2)^2+6$. This has to be positive if the roots are real, so $m\in[-\sqrt6+2, \sqrt6+2]$.

I tried using the derivative of $f$ and Rolle's theorem, but the calculations get complicated quite fast. I managed to prove that m has to be somewhere in the interval $(-\sqrt\frac32+1, \sqrt\frac32+1)$, though I can't guarantee that this is correct. I could continue this way and I'll probably reach a solution sooner or later, but I hope there's a much more elegant solution that I've missed.

Thanks for your help!

  • $\begingroup$ I'm guessing the limiting cases are values $m$ that give double roots, i.e. shared roots between $f$ and its derivative. Have you tried that? $\endgroup$
    – hardmath
    Jun 14, 2020 at 14:00
  • $\begingroup$ I almost missed your comment. I haven't tried that. The $m$'s that give double roots are solutions, since the other root must be real too, but I'm not sure how much would this help. $\endgroup$
    – Wolfuryo
    Jun 14, 2020 at 14:21

3 Answers 3


I shall assume that we want three different real roots Consider $$f(x)=x^3-(m+2)x^2+(m^2+1)x-1$$ The first condition is that $$f'(x)=3x^2-2(m+2)x+(m^2+1)$$ shows two real roots which are $$x_\pm=\frac{1}{3} \left(m+2\pm\sqrt{-2 m^2+4 m+1}\right)$$ This gives the first condition $$-2 m^2+4 m+1 > 0$$

Now, you need that $$f(x_-) \times f(x_+) <0$$ that is to say $$3 m^6-4 m^5+6 m^4-22 m^3-9 m^2+26 m+23 < 0$$ which cannot be solved. Numerical calculations give $$1.558 < m < 1.756 $$

  • $\begingroup$ This was pretty much what I did, but I was hoping for nicer solution. Thanks anyway! $\endgroup$
    – Wolfuryo
    Jun 14, 2020 at 14:06


$f$ satisfies Rolle's Theorem, so if it has three roots, its derivative will have two real roots, $\color{red}{a,b}.$


the reduced discriminant $$\delta=(m+2)^2-3(m^2+1)$$ $$=-2m^2+4m+1$$

should necessarily be $>0$.

To be sufficient, you need


  • 1
    $\begingroup$ This is not sufficient $\endgroup$ Jun 14, 2020 at 13:51
  • $\begingroup$ This is how I obtained the last interval that I mentioned above. Unfortunately it is not enough. If the roots of the derivative are a and b, they would also have to satisfy f(a)>0 and f(b)<0. The calculations that would follow out of that are very complicated though. Edit:messed up the > and <. $\endgroup$
    – Wolfuryo
    Jun 14, 2020 at 13:55
  • $\begingroup$ The roots $x_1, x_2$ of $f'(x)=0$ should be real and be such that $f(x_1)f(x_2)<0$, in order to have a concave bump above $x$ axis followed by a convex one below $x$ axis. This can be explained regorously by invoking a properties of the so-called discriminant = resultant (f,f') if you happen to know it... $\endgroup$
    – Jean Marie
    Jun 14, 2020 at 13:57
  • 1
    $\begingroup$ @JeanMarie Yes, i added that before reading your post. thanks quand même. $\endgroup$ Jun 14, 2020 at 14:01
  • $\begingroup$ I see. I was hoping for a nicer solution, but I guess this will do. Thanks! $\endgroup$
    – Wolfuryo
    Jun 14, 2020 at 14:05

This answer should be seen as a complement to the other answers.

A third degree curve $y=f(x)=x^3+\cdots$ is known to have two possible shapes

enter image description here

according to the fact that its derivative has sign changes (necessarily a "$+ - +$" pattern) or not (a simple "+" pattern), i.e., respectively two real roots $a,b$ or no real root. [we leave apart the limit case of one real root]. In the first case, we have a relative maximum in $(a,f(a))$, followed by a relative minimum in $(b,f(b))$. There will be 3 real roots if $(a,f(a))$ is above $x$ axis and $(b,f(b))$ is below $x$ axis ; this is equivalent to say that


This condition has to be expressed in terms of parameter $m$.

I will use for that a method that is classical, but necessitates to know what a resultant is (explanations below). It suffices to write twice the coefficients of $f$, ans 3 times the coefficients of $f'$, with a shift for the first one and two shifts for the second one

$$Res(f,f')=\begin{vmatrix} 1& - m - 2& m^2 + 1& -1& 0\\ 0& 1& - m - 2& m^2 + 1& -1\\ 3& - 2m - 4& m^2 + 1& 0& 0\\ 0& 3& - 2m - 4& m^2 + 1& 0\\ 0& 0& 3& - 2m - 4& m^2 + 1\end{vmatrix}=0\tag{2}$$

which is identical to

$$3m^6 - 4m^5 + 6m^4 - 22m^3 - 9m^2 + 26m + 23=0$$

(the very same polynomial found by Claude).

Explanation about the calculation : the nullity of the resultant $Res(f,g)=0$ of 2 (parametric) polynomials $f$ and $g$ is a necessary and sufficient condition for these polynomials to have a common root ; here in the case $g=f'$ ; $f$ and $f'$ have a common root if and only $f$ has a double root. It is known to be a limit case between cases "a single real root" and "3 real roots". The sign of this resultant will change once we have crossed the case $R(f,f')=0$.

The resultant $R(f,g)$ can be computed in (at least) two ways :

  • up to a factor, it is the the product of values of $f$ computed at the roots of $g$, which is formula (1)

  • as the determinant computed above (in (2)) .

Remark : $Res(f,f')$ is called the discriminant of $f$ : it generalizes the discriminant of a a second degree polynomial $ax^2+bx+c$ for which the corresponding resultant is :

$$\begin{vmatrix} a& b& c\\ 2a& b& 0\\ 0& 2a& b\end{vmatrix}=-a(b^2 - 4ac)$$

where we recognize our classical $b^2-4ac$.

  • 1
    $\begingroup$ Interesting. I'll look into resultants one of these days. Thanks! $\endgroup$
    – Wolfuryo
    Jun 14, 2020 at 17:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .