Suppose we are given a univariate polynomial $p(x)$ with rational coefficients, $p \in \Bbb Q [x]$, and are told that $p(x)$$p$ can be expressed as the sum of $k$ squares of polynomials with rational coefficients. It is well-known that every univariate SOSsum of squares (SOS) polynomial can be expressed as a sum of two squares.
Can we efficiently find a representation of $p(x)$ asan SOS decomposition $f^2(x) + g^2(x)$$p = f^2 + g^2$, where both f and g have rational coefficients$f, g \in \Bbb Q [x]$?
Just to be clear: I want an efficient algorithm whichthat takes as input a polynomial $p(x)$, which is guaranteed to have a representation as the sum of $k$ squares of polynomials with rational coefficients, and outputs two polynomials $f(x), g(x)$ with rational coefficients such that $p(x) = f^2(x) + g^2(x)$.
$$p(x) = f^2(x) + g^2(x)$$