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.