TITLE: Calculus of variation
QUESTION [5 upvotes]: This is probably simple but I'm stuck somewhere. I am trying to solve the calculus of variation problem that arise in an applied field: $$\min_{f \in C^1} \int^1_0 \int^1_0 (x-y)^2f(x,y)dxdy$$ $$\text{s.th: } f\geq 0 \text{, }  \int^1_0 f(x,y)dy=1 \text{ and } \int^1_0 y \partial_x f(x,y) dy=0 \text{ }\forall\text{ } x.$$
I tried standard techniques - perturbations with test functions - but because of the bidimensionality I'm missing something.

REPLY [2 votes]: For the moment, fix $$c=\int_0^1 yf(x,y)\,dy.$$ It is clear that we must have $0\le c\le 1$ to satisfy the constraints on $f$. We can write the integral to be minimized as $$\int_0^1\Bigl(x^2-2cx+\int_0^1 y^2f(x,y)\,dy\Bigr)\,dx.$$ Now we fix $x$ and minimize the inner integral. Since by Cauchy-Schwarz we have $$c^2\le \int_0^1 f(x,y)\,dy\int_0^1 y^2f(x,y)\,dy=\int_0^1 y^2f(x,y),$$with equality only if $f(x,y)=\delta(y-c)$, we find that the minimum is achieved when $f(x,y)=\delta(y-c)$. It remains to find $c$. With $f(x,y)=\delta(y-c)$, the outer integral becomes $\int_0^1 (x-c)^2\,dx$, which is minimized when $c=1/2$.