First suppose , with a real positive semidefinite matrix and a symmetric nonnegative matrix. Factor , and write . Then
Each term is a square multiplied by a nonnegative scalar, so is a sum of squares polynomial.
Conversely, suppose . Because is a degree-four homogeneous polynomial, the homogeneous sum of squares representation allows every to be quadratic and homogeneous. Explicitly, higher-degree parts cannot cancel in a sum of squares; constant parts vanish because , and the degree-two part forces all linear parts to vanish. Write
Since is invariant under every coordinate sign change, sign averaging of a sum of squares over independent Rademacher random variables gives
The cross terms vanish because their sign products contain an odd power of at least one independent sign. Set
Then is a positive semidefinite matrix and is a symmetric nonnegative matrix. Comparing the coefficients of and gives . This proves the sum of squares criterion for a biquadratic form.
For a real symmetric matrix , set . Then
For sufficiency, factor . Its contribution is a sum of squares of linear combinations of , while the contribution of is . For necessity, use a homogeneous sum of squares representation and sign averaging of a sum of squares. Writing each quadratic summand with coefficients gives , and for . Comparing coefficients gives .
This is the basic semidefinite programming certificate of copositivity discussed in Parrilo's paper on matrix copositivity.