TITLE: Prove that $p \in \mathbb{R}[x]$ can be represented as a sum of squares of polynomials from $\mathbb{R}[x]$
QUESTION [8 upvotes]: $p \in \mathbb{R}[x]$ and $ \forall x\in\mathbb{R} \ \ p(x) > 0$. Prove that $p = \sum_{k=1}^{n}p^2_k, \ \ p_k \in \mathbb{R}[x]$.
I have noticed that $\deg(p)$ must be even, because $p(x)$ doesn't intersect $\{x=0\}$.
How can I proceed with the proof?

REPLY [5 votes]: Here's another inductive proof that avoids complex numbers.  If $p$ is constant then it is itself a square.  Otherwise let $p$ attain a minimum $\alpha^2$ at $x_0$.  Then $p-\alpha^2$ is non-negative with a root at $x_0$.  This root must therefore have an even order so $$0\leq p(x)-\alpha^2=(x-x_0)^{2 d}q(x)$$ for some $d\geq 1$ and $q\in \mathbb{R}[x]$.  Since $q\geq 0$ and $\deg(q)<\deg(p)$ we conclude by induction that $q$ is a sum of squares $$q=q_1^2+\ldots+q_m^2.$$ Then  $$p = \alpha^2+\left((x-x_0)^dq_1\right)^2+\ldots+\left((x-x_0)^dq_m\right)^2$$ is itself a sum of squares.