We consider a closed set
S??
n and a linear operator
$\Phi \colon \mathbb{R}X_1,\ldots,X_n]\rightarrow \mathbb{R}X_1,\ldots,X_n]$
that preserves nonnegative polynomials, in the following sense: if
f≥0 on
S, then Φ(
f)≥0 on
S as well. We show that each such operator is given by integration with respect to a measure taking nonnegative functions as its values. This can be seen as a generalization of Haviland’s Theorem, which concerns linear
functionals on ?
X 1,…,
X n ]. For compact sets
S we use the result to show that any nonnegativity preserving operator is a pointwise limit of very simple nonnegativity preservers with finite dimensional range.