TITLE: Polynomial cannot have all roots real?
QUESTION [13 upvotes]: Let $P \in \mathbb R[x]$ be a degree-$n$ polynomial with real coefficients such that $P(a) \neq 0$, where $a$ is real. If $P'(a) = P ''(a) = 0$ then prove that $P$ cannot have all roots real.


Can someone suggest a possible solution using Rolle's Theorem?
All I could gather was that $P'(x) = 0$ has a repeated root by Rolle's Theorem. But I am stuck after this.

REPLY [27 votes]: Assume that $P$ has degree $n$ and let  $x_1,x_2,\dots,x _n$ be all its roots (repetitions are allowed). Then $P(x)=c\prod_{k=1}^n (x-x_k)$,
and if $x$ is not a root of $P$ we have that
$$\frac{P'(x)}{P(x)}=\sum_{k=1}^n \frac{1}{x-x_k}.$$
After taking the derivative we obtain
$$\frac{P''(x)P(x)-(P'(x))^2}{(P(x))^2}=-\sum_{k=1}^n \frac{1}{(x-x_k)^2}.$$
Finally by letting $x=a$ (which is not a root) we get a contradiction:
$$0=\frac{P''(a)P(a)-(P'(a))^2}{(P(a))^2}=-\sum_{k=1}^n \frac{1}{(a-x_k)^2}<0$$
where the right-hand side is negative because $a, x_1,x_2,\dots,x _n$ are all real.