Integer Polynomials as Sums of Squares of Rational Polynomials

ac.commutative-algebrant.number-theory

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

Best Answer

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.