Let the input variable $X \in \mathcal{X}$ and the target variable $Y \in \mathcal{Y}$. For a fixed hypothesis $h \in \mathcal{H}$ I want to solve \begin{equation} \min_{p(X,Y)} \int_{\mathcal{X}}\int_{\mathcal{Y}}p(x,y)\ell(h(x),y) \,dy \,dx \\ \textrm{s.t.} \quad \quad \int_{\mathcal{X}}\int_{\mathcal{Y}}p(x,y) \,dy \,dx =1 \end{equation}
The Lagrangian here is: \begin{equation} \mathcal{L}(p, \lambda)= \int_{\mathcal{X}}\int_{\mathcal{Y}}p(x,y)\ell(h(x),y) +\lambda p(x,y) \,dy \,dx - \lambda \end{equation}
Is there a way to derive the optimal distribution $p^*(X,Y)$ by solving $\frac{\partial\mathcal{L}}{\partial p(x,y)}=0$ (e.g., as we can do in entropy maximisation problems)? Else, is there another technique I could use to get some insights for the optimal distribution ?