TITLE: Bishop ML and pattern recognition calculus of variations linear regression loss function
QUESTION [5 upvotes]: On page $46$,  there is
($1.87$) $E[L]=\int \int \{y(x)-t\}^2p(x,t)dxdt$
Calculus of variations is used to give
($1.88$) $\dfrac{\partial E[L]}{\partial{y(x)}} = $2$ \int \{y(x)-t\}p(x,t)dt = 0$
The reader is referred to appendix $D$ on calculus of variations, but I am still confused. How does one get from ($1.87$) to ($1.88$), step by step?

REPLY [11 votes]: Rename $\hat x$ as $x$, then interchange the order of integration, so that we integrate with respect to $x$ last. Then Equation (1.87) is
$$
\int\int[y(x)-t]^2p(x,t)\,dt\,dx
$$which is of the form
$$
\int G(y(x),y'(x),x)\,dx\tag{D.5}
$$
where
$$
G(y,y',x)=\int[y-t]^2p(x,t)\,dt.\tag{*}$$ By the Euler-Lagrange equations we require
$$
\frac{\partial G}{\partial y} -\frac d{dx}\left(\frac{\partial G}{\partial y'}\right)=0.\tag{D.8}
$$
In this case the function $G$ doesn't depend on $y'$ so the LHS of the Euler-Lagrange equations simplifies to
$$\frac{\partial G}{\partial y}=\int 2[y-t]p(x,t)\,dt,$$
obtained by differentiating (*) under the integral sign.