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.



Calculus of variation
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$.


