if $f(x)\geq0$ for all $x$, then $f+f'+f''+f'''+ \cdots + f^n \geq0$

Let $g(x) = \sum\limits_{k=0}^n f^{(k)}(x)$. Notice

$$(e^{-x} g)' = e^{-x}(g'-g) = e^{-x}\sum_{k=0}^n (f^{(k+1)} - f^{(k)}) = e^{-x}(f^{(n+1)} - f)$$ Since $f$ is a non-negative polynomial of degree $n$, we get $$f^{(n+1)}\equiv 0 \quad\implies\quad (e^{-x}g)' = -e^{-x} f \le 0\quad\forall x \in \mathbb{R}$$ This means the function $e^{-x}g(x)$ is non-increasing.

Since $f(x)$ is non-negative for all $x$, $n$ has to be an even integer and the leading coefficient of $f(x)$ is positive. It is easy to see $g(x)$ is a polynomial with same degree $n$ and leading coefficient as $f(x)$. This means for sufficiently positive $y$, we will have $g(y) > 0$.

For any $z \in \mathbb{R}$, take a $y > z$ large enough to make $g(y) > 0$. Using the fact $e^{-x} g(x)$ is non-increasing, we obtain

$$e^{-z}g(z) \ge e^{-y}g(y) > 0\quad\implies\quad g(z) > 0$$

This is slightly stronger than we want to show. Namely, $g(x)$ is not only non-negative for all $x$, it is positive for all $x$.


It is known that a polynomial that is nonnegative on all reals must be the sum of squares of two polynomials. As a result, it suffices to prove the claim when the given polynomial $f$ can be written as $g^2$ for some polynomial $g$. We may show that $$\frac{d}{d^k}g^2=\sum_{i=0}^k\binom ki g^{(i)}g^{(k-i)}$$ by induction on $k$, and so, if $g$ has degree $m=n/2$, the sum we desire is $$\sum_{k=0}^{2m}\sum_{i=0}^k\binom kig^{(i)}g^{(k-i)}.$$ As $g^{(i)}=0$ for $i>m$, this sum can be rewritten as $$\sum_{j_1=0}^m\sum_{j_2=0}^m\binom{j_1+j_2}{j_1}g^{(j_1)}g^{(j_2)}.$$ For a given $x$, write $\frac{1}{j!}g^{(j)}(x)=x_j$, so $x_0=x$. We will show that, for any reals $x_0,\dots,x_m$, $$\sum_{j_1=0}^m\sum_{j_2=0}^m(j_1+j_2)!x_{j_1}x_{j_2}\geq 0,$$ which will finish the proof. We note that we have $$k!=\int_0^\infty e^{-t}t^kdt,$$ so our sum is $$\int_0^\infty \sum_{j_1=0}^m\sum_{j_2=0}^mx_{j_1}x_{j_2}t^{j_1+j_2}e^{-t}dt=\int_0^\infty e^{-t}\left(\sum_{j=0}^m x_jt^j\right)^2dt;$$ for each $t$, the integrand is nonnegative, and so the whole integral is nonnegative, finishing the proof.