Expressing a positive polynomial as the sum of two squares

267 Views Asked by At

I do not think this has been asked before, as I could not find anything when I answered this question (given for context, my question is self-contained).

It is easy to show that a polynomial $p(x)\in \mathbb R[x]$ in one variable with real coefficients which has no real roots is the sum of the squares of two polynomials with real coefficients. With a possible change of sign, the polynomial can be taken to be positive for all real values of $x$.

My question is whether there is any efficient and effective way of achieving such a decomposition. The proof I have is non-constructive (or depends on knowing the roots), and most of the most accessible literature seems to pass rapidly to the case of two or more variables.

Ideally it would be possible to apply the technique without knowing in advance that the polynomial was positive - but this possibility makes me suspect that the decomposition may not be wholly straightforward.

As a start, here is a proof of what was stated. The roots of the polynomial come in complex conjugate pairs $a\pm bi$ and these pairs give rise to factors $(x-a)^2+b^2$.

Now we apply the standard identity for showing that the product two sums of two squares is itself a sum of two squares: $(p^2+q^2)(r^2+s^2)=(pr-qs)^2+(ps+qr)^2$ which is very familiar from working with sums of integer squares. Of course this is not a unique expression - we can exchange $r$ and $s$ for example, so the problem of decomposition does not necessarily yield a single answer.

Now observe that we can arrange for $p$ and $r$ to be the terms of highest degree, so that the first term on the right-hand side will be of higher degree than the second. That means we can definitely begin by completing the square with the terms of highest order.

Is there a way of continuing the decomposition which is certain to succeed (in cases where a decomposition exists)?

Or are there other methods?

Please do feel free to post references rather than detailed workings, if you know where to find this in the existing literature.