Any positive real polynomial $p$ can be written as $p(x)=x|u(x)|^2+|v(x)|^2$ where $u$ and $v$ are two complex polynomials 
Suppose $p:\mathbb{R}\to\mathbb{R}$ is a polynomial such that $p(x)\geq 0$ for all $x\geq 0$. There exists complex polynomials $u$ and $v$ such that
  $$
p(x)=x|u(x)|^2+|v(x)|^2.
$$

A naive attempt is to try $p(x)=ax^2+bx+c$, $a\neq 0$, and see if the approach can be generalized for polynomials of higher degrees. 
First of all, the assumptions for $p$ implies that $a>0$ and $c\geq 0$. If $b\geq 0$, then one can group $p$ as
$$
p(x)=x\cdot b+(ax^2+c)
$$
to find $u$ and $v$. On the other hand, if $b=-\beta<0$, then one can write
$$
p(x)=x\cdot \epsilon+(ax^2-(\beta+\epsilon)x+c)
$$
where $\epsilon>0$ is to be chosen. If $\epsilon>0$ is small enough, it is not difficult to show that
$$
g_\epsilon(x):=ax^2-(\beta+\epsilon)x+c\geq 0\quad\textrm{for all }x\in\mathbb{R}.
$$ 
One can then find correspondingly $u$ and $v$. However, it seems difficult to generalize this argument. 
One could try in a different way. Suppose $p(x)=a_nx^n+\cdots+a_1x+a_0\geq 0$ ($a_n\neq0$) for all $x\geq 0$. Then one must have
$$
a_n>0,\quad a_0\geq 0.\tag{1}
$$ 
Suppose one has the extra assumption that $a_k\geq 0$ for all $k$, and write
$$
p(x)=xg(x)+h(x)\tag{2}
$$
where both $g$ and $h$ are polynomials with even degrees. So $g(x), h(x)\geq 0$ for all $x\in\mathbb{R}$. Thus, one can use this result. But I'm stuck for the general case. 
 A: That seems to be a result from Pólya–Szegő, I found the following proof in VICTORIA POWERS AND BRUCE REZNICK, POLYNOMIALS THAT ARE POSITIVE ON AN INTERVAL, TRANSACTIONS OF THE
AMERICAN MATHEMATICAL SOCIETY, Volume 352, Number 10, Pages 4677–4692, Proposition 2.
Let $\Sigma \subset \Bbb R[x]$ denote the set of all polynomials which are the sum of two squares of polynomials in $\Bbb R[x]$. It is known that
$$
 (p \in \Bbb R[x], \forall x: p(x) \ge 0) \implies p \in\Sigma \, ,
$$
see for example Prove that $p \in \mathbb{R}[x]$ can be represented as a sum of squares of polynomials from $\mathbb{R}[x]$. A consequence is that $\Sigma$ is closed under multiplication.
Now let $p \in  \Bbb R[x]$ be a polynomial such that $p(x) \ge 0 $ for all $x \ge 0$. It suffices to show that $p$ is contained in the set 
$$
 S = \{ f + xg \mid f, g \in \Sigma \} \subset \Bbb R[x] 
$$
because then
$$
p(x) = (a(x)^2 + b(x)^2) + x(c(x)^2 + d(x)^2) = |a(x) + ib(x)|^2 + x |c(x) + i d(x)|^2
$$
with $a, b, c, d \in \Bbb R[x]$.
First note that $S$ is closed under multiplication as well:
$$
 p_1 = f_1 + x g_1 \, , \, p_2 = f_2 + x g_2
$$
with $f_i, g_i \in \Sigma$ implies that
$$
 p_1 p_2 = (f_1f_2 + x^2g_1 g_2) + x(f_1 g_2 + f_2 g_1)
$$
with $f_1f_2 + x^2g_1 g_2 \in \Sigma$ and $f_1 g_2 + f_2 g_1 \in \Sigma$.
Therefore it suffices to write $p$ as a product of polynomials in $S$. The strictly positive roots of $p$ must occur with an even degree, and the non-real roots occur in pairs of complex conjugates. Therefore the factorisation of $p$ can be split into a product with each term being one of the following:


*

*$(x-\alpha)^2$ with $\alpha > 0$,

*$(x+\alpha)$  with $\alpha \ge 0$ ,

*$(x - \alpha - i \beta)(x - \alpha + i \beta)= (x-\alpha)^2 + \beta^2$.


It is easy to see that each of those factors is in $S$, and the concludes the proof.
