An analogous in $\mathbb R[x]$ of the property $p=a^2+b^2$ in $\mathbb N$ It is known that all prime number $p\space (>0)$ of the form $4n+1$ is a sum of two squares of integers $a, b \ge 0$. Prove the following analogous property for positive polynomials in $\mathbb R[x]$:
$$P\ge 0\iff \exists\space S,T\in\mathbb R[x]\space   \text {such that}\space P= S^2+T^2$$
HINT.- Remember that the set $S={\{a^2+b^2};\space a,b \in{\mathbb N}$} 
 is a multiplicative monoid;$\space$ i.e. closed under multiplication.
 A: Outline
We can assume $P$ is monic. This is not entirely trivial, because you have to show that the first coefficient of $P$ can't be negative. (If it were, then it wouldn't be true that $P\geq 0$.)
Now, factor $P$ into primes. All primes in $\mathbb R[x]$ are of the form $x+r$ for real $r$ or quadratics of the form $x^2+ax+b$ where $a^2<4b$ (so the roots are complex.)
We can assume that $P$ is square-free, because if $P=P_1^2P_2$ then a solution for $P_2=X^2+Y^2$ easily yields a solution $P=(P_1X)^2+(P_1Y)^2$. 
If $P$ is square-free and positive, then show that it cannot have any linear divisors $x-r$. (That's the big step.) So $P$ must be a product of quadratic primes.
Then show that $x^2+ax+b=X^2+Y^2$ can be solved when $a^2<4b$. Hint: Complete the square.
Finally, apply the hint, showing that if $P=X_1^2+Y_1^2$ and $Q=X_2^2+Y_2^2$ then you can find a solution to $PQ=X^2+Y^2$. This doesn't follow from the same fact about $\mathbb N$, but it is easily proven the same way (and it is easily proven in any commutative ring.)
