A positive polynomial is the sum of two squares in $\mathbb{R}[X]$ [duplicate]
Solution 1:
Your identity shows that the product of terms, each of which is a sum of two squares, is a sum of two squares. So we just have to write your polynomial as a product of terms, each of which is a sum of two squares of real polynomials.
- If $P(x) \ge 0$ for all real $x$, and $\alpha$ is a real root of $P$, then it must have even multiplicity (otherwise $P(x)$ would change sign as you move from $< \alpha$ to $> \alpha$). $(x-\alpha)^2 = (x-\alpha)^2 + 0^2$.
- If $\beta = s + i t$ and $\overline{\beta} = s - i t$ are a complex-conjugate pair, $(x - \beta)(x-\overline{\beta}) = (x - s - it)(x - s + it) = (x-s)^2 + t^2$ is a sum of two squares.