Let $f$ and $g$ be polynomials in $\mathbf x \in \mathbb R^n$. Let $X$ be a compact subset of $\mathbb R^n$. Finally, Let $\mathcal M(X)$ be the set of probability measures over $X$.
Can the optimization problem
\begin{equation} \inf_{P\in \mathcal M(X)} \left ( \int f \ dP\right )^2 - \left ( \int g \ dP\right )^2 \end{equation}
be expressed exclusively in terms of the polynomials $f$ and $g$, without reference to the measure $P$?
For example, my hunch is that the above optimization problem is equivalent to
\begin{equation} \min_{\mathbf x \in X} f(\mathbf x)^2 - g(\mathbf x)^2, \end{equation}
but I don't know how to prove this. Anyone have any ideas?
Put $n=1$, $X=\{-1,1\}$, $f(x)=x$, and $g(x)=0$. Then the infimum equals $0$, whereas the minimum equals $1$.