Prove that $p \in \mathbb{R}[x]$ can be represented as a sum of squares of polynomials from $\mathbb{R}[x]$

Solution 1:

Wlog we can assume that $p$ is monic and let $\deg(p)=2m$. As already noted the roots of $p$ come in conjugate pairs. Choose representatives $z_1, \ldots, z_m$ in each pair. Let $$q(x)=(x-z_1)(x-z_2)\dotsc (x-z_m)\\ \overline{q}(x)=(x-\overline{z}_1)(x-\overline{z}_2)\dotsc (x-\overline{z}_m).$$ Then $p=q\,\overline{q}$. Let $q=a+\textrm{i}\, b$ with $a,b\in \mathbb{R}[x]$. Then $p=(a+\textrm{i}\, b)(a-\textrm{i}\, b)=a^2+b^2$.

Solution 2:

Without induction or using an identity, we're looking for two polynomials $A$ and $B$ in $\mathbb R[X]$, such that $P=(A+iB)(A-iB)$.

  • First, notice that the class of polynomials that can be rewritten as $A^2+B^2=(A+iB)(A-iB)$ is closed under multiplication (use the complex form $(A+iB)(A-iB)$)

  • Then, rewrite $P$ as a product of irreducible polynomials in $\mathbb R[X]$, that is $$P=\prod_{i=1}^s(X-\alpha_i)^{\omega_i}\prod_{k=0}^t(X^2+2a_kX+b_k)^{\theta_k}$$ where $a_k^2-b_k <0$ and the $\alpha_i$ are distinct.

  • From the sign assumption on $P$ and the continuity of the polynomial, you can deduce that $\omega_i$ are even.

  • Also note that $X^2+2a_kX+b_k=(X^2+a_k)^2+\left(\sqrt{b_k-a_k^2}\right)^2$

  • We have rewritten $P$ as a product of polynomials of the form $A^2+B^2$, we're done.

You can also study two related problems:

  • A complex polynomial $P$ can be rewritten as $A^2+B^2$ where $A,B$ are complex polynomials.

  • Replace $\mathbb R$ by $\mathbb Q$ in your original statement, and it stops working.