I have the following question for which I haven't been able to find any reference or proof.


Suppose we know that a univariate polynomial $P(X)$ with integer coefficients is the sum of squares of two polynomials with rational coefficients. 


Is it true that $P(X)$ must also be the sum of squares of two polynomials with
integer coefficients?


For example, take $P(X)=50X^2+14X+1$, then we see that $P(X)=(5X+3/5)^2+(5X+4/5)^2$, but it is also $X^2+(7X+1)^2$.


I would greatly appreciate any help pointing me into the right direction.


Thanks in advance, and regards,
Guillermo



About integer polynomials which are sums of squares of rational polynomials...
Yes. Suppose $n\in \mathbb N$ is minimal so that $P(x)=f\_1^2+f\_2^2$, where $nf\_1$ and $nf\_2$ are in $\mathbb Z[x]$.


Let $p$ be a prime with $p^\alpha||n$. Since $P\in \mathbb Z[x]$ we have $p^{2\alpha}| (p^\alpha f\_1)^2+(p^\alpha f\_2)^2$. Denoting $p^\alpha f\_i$ by $g\_i$, and letting $\beta$ be square root of $-1\pmod{p^{2\alpha}}$ (it is not hard to show that this must exist by looking at the coefficients of $g\_i$ with lowest $p$-valuation).


We have $g\_1^2+g\_2^2\equiv 0\pmod{p^{2\alpha}}$ so $g\_2^2\equiv (\beta g\_1)^2\pmod{p^{2\alpha}}$ so that $p^{2\alpha}| ag\_1+bg\_2$ for some integers $a,b$ with $a^2+b^2=p^{2\alpha}$
and $(ab,p)=1$.


Now we can take $P(x)=\left(\frac{af\_1+bf\_2}{p^{\alpha}}\right)^2+\left(\frac{af\_2-bf\_1}{p^\alpha}\right)^2$ and both polynomials have coefficients with $\nu\_p\geq 0$. Now repeat the procedure with other prime divisors of $n$ until you have polynomials with integer coefficients.


