How to maximize a lebesgue integral with respect to a probability measure I'm relatively new to measure theory, and I think this is a simple question.
I'm looking for strategies/techniques to solve optimization problems of the form:
$$\mu^* = argmax_{\mu} 
\int_X\int_X f(x,x') d\mu(x) d\mu(x')$$
In plain english: Given some function $f$ I want to find a probability measure on $X$ which maximizes the value of this lebesgue integral. Since $\mu$ has to be a probability measure, there are additional constraints that $\mu(E) \geq 0$ and $\int d\mu(x) = 1$.
I attempted to solve this by considering a simpler version and using Riemann integration, which I'm more familiar with:
Let $X = \mathbb{R}$, then we need to find $p^* = argmax_p \int_{\mathbb{R}} f(x)p(x)dx$ such that $\int_{\mathbb{R}}p(x)dx = 1$, $p(x) \geq 0, \ \forall x \in \mathbb{R}$
Wouldn't this just be $p^*(x_0) = \delta(x_0)$ for $x_0 = argmax_x f(x)$? I'm unsure about this simplified solution, and even more unsure about how it relates to the more general expression above involving the lebesgue integral.
Any help is appreciated.
 A: This sort of problem seems reminiscent of maximal transport, which is currently an area of open research.  But I can't seem to reduce it to an optimal transport problem, so maybe it's easier than I think.
Your analysis of the simplified problem "find $\mu$ maximizing $\int{f\,d\mu}$" is correct: the maximizer is $\delta_M$, where $M=\operatorname{argmax}{f}$.  But this is because the change from 2D to 1D removed an essential element of the problem.
Consider the problem "Find $\mu$ maximizing $\int_{[0,1]^2}{x(1-y)\,d^2\mu(x,y)}$."  The maximum of $x(1-y)$ is $1$, attained at $(x,y)=(1,0)$, but by Fubini \begin{align*}
\int_{[0,1]^2}{x(1-y)\,d\mu^2(x,y)}&=\left(\int_0^1{x\,d\mu(x)}\right)\int_0^1{(1-y)\,d\mu(y)} \\
&=\left(\int_0^1{x\,d\mu(x)}\right)\left(1-\int_0^1{x\,d\mu(x)}\right) \\
&\leq\frac{1}{4}
\end{align*} just by maximizing $z(1-z)$ over $[0,1]$.  And of course most $f$ do not factorize in this way.
One (relatively) nice case is when $\mu$ is absolutely continuous.  Then one can apply calculus of variations: let $d\mu(x)=\psi(x)\,dx$, so that $$\int{f(x,y)\,d\mu^2(x,y)}=\int{\psi(x)f(x,y)\psi(y)\,d^2(x,y)}\tag{1}$$  For simplicity, suppose $0<\psi<1$ on $X$; then (1) is maximized when, for every bounded function $\phi$ supported on $X$, \begin{align*}
0&=\left.\frac{d}{dt}\int{(\psi+t\phi)(x)f(x,y)(\psi+t\phi)(y)\,d^2(x,y)}\right|_{t=0} \\
&=\int{(\phi(x)f(x,y)\psi(y)+\psi(x)f(x,y)\phi(y))\,d^2(x,y)}
\end{align*}  Since $L^{\infty}$ is dense in $L^2$, this implies $0=\int{(f(y,x)\psi(x)+\psi(x)f(x,y))\,dx}$ for a.e. $y$.  Depending on your formula for $f$, you might be able to then conclude the form of $\psi$.
If you can't assume smoothness, then a good place to start might be convex combinations of atomic measures and absolutely continuous ones.
