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