  A celebrated result by Hilbert says that every real nonnegative ternary
quartic is a sum of three squares. We show more generally that every
nonnegative quadratic form on a real projective variety $X$ of minimal degree
is a sum of $\dim(X)+1$ squares of linear forms. This strengthens one direction
of a recent result due to Blekherman, Smith, and Velasco. Our upper bound is
the best possible, and it implies the existence of low-rank factorizations of
positive semidefinite bivariate matrix polynomials and representations of
biforms as sums of few squares. We determine the number of equivalence classes
of sum-of-squares representations of general quadratic forms on surfaces of
minimal degree, generalizing the count for ternary quartics by Powers, Reznick,
Scheiderer, and Sottile.
