TITLE: Polynomials that are sums of squares
QUESTION [14 upvotes]: Is any algorithm known for determining whether or not a multivariate polynomial with integer coefficients can be written as a sum of squares of such polynomials? 
By way of background, if we one replaces "polynomial" by "rational function" then there is such an algorithm, because a rational function is a sum of squares iff it is positive definite. But this equivalence fails for polynomials.

REPLY [3 votes]: Determining whether or not a polynomial is a sum of squares can be done in polynomial time; the problem is equivalent to semidefinite programming.  As Jose Capco mentioned above, Pablo Parrilo is an authority on this subject, and has written a number of papers explaining the relationship.
Parrilo has a particularly short, simple, and self-contained exposition of this relationship in Parrilo, Pablo A. "Sum of squares programs and polynomial inequalities." SIAG/OPT Views-and-News: A Forum for the SIAM Activity Group on Optimization. Vol. 15. No. 2. 2004.