TITLE: If a polynomial $P$ has only real roots, so does $P'-2xP$
QUESTION [17 upvotes]: Let $P$ be a polynomial such that all of the roots of $P$ are real. Prove that all the roots of $P'-2xP$ are also real. I know a proof for this fact but it is very computational and messy. Is there an elegant solution?

REPLY [5 votes]: May assume that $P$ has $n$ distinct roots $a_1< \ldots < a_n$, otherwise the multiple roots are also roots of the new equation.  The equation is equivalent to $\frac{P'(x)}{P(x)} = 2 x$, that is
$$\sum_{i=1}^n \frac{1}{x-a_i} = 2x$$
On each interval $(a_i, a_{i+1})$ the LHS decreases from $+\infty$ to $-\infty$, while the  RHS increases between two finite values. Therefore, the equality is achieved exactly once in each $(a_i, a_{i+1})$. Now, on the interval $(a_{n}, \infty)$, LHS decreases from $+\infty$ to $0$, while RHS increases from a finite value to $+ \infty$. So we have exactly one root in $(a_{n}, \infty)$. Similarly in $(-\infty, a_1)$. We conclude that the equation has exactly $n+1$ solutions.  Note that we can substitute $2 x$ with any continuous increasing function with infinite limits. The case of a constant is also interesting.
The picture for  $P(x)=(x+1)(x-1)(x-2)$ is below.

Note: @Hagen von Eitzen: 's method works for any functions $P(x)$, since
$(e^{-L(x)}P(x))' = e^{-L(x)}( P'(x) - l(x) P(x))$, so we do get a root ( an odd number) between two (consecutive) roots of $P(x)$. If $e^{-L(x)}P(x)$ is $0$ at $\pm \infty$ $  we do get extra roots.
Does our method work for functions $P(x)$ that are not polynomial? Say $a$, $b$ are consecutive simple roots of $P(x)$. Then $P'(a)$, $P'(b)$ are of opposite value so on the interval $(a,b)$ the function $\frac{P'(x)}{P(x)}$ ranges from $+\infty$ to $-\infty$.  At $\pm \infty$ it's about the behaviour of $\frac{P'(x)}{P(x)}$. The method seems to still work.
$\bf{Added:}$ Say we are want to show that $(x-\alpha) P'(x) + \lambda P(x)=0$ has all roots real ( $\lambda> 0$ or $\lambda < -n$) (Laguerre).  Consider the derivative of $|x-\alpha|^{\lambda} P(x)$.  Or we can do the analysis with $\frac{P'(x)}{P(x)}$.