Solution (source code)

= Solution

For fixed endpoint values, a stationary differentiable path obeys the <Euler-Lagrange equation>
$$
\boxed{\frac{\partial f}{\partial y}-\frac d{dx}\left(\frac{\partial f}{\partial y'}\right)=0.}
$$
It follows by taking the <first variation> of the functional and integrating the term in $\delta y'$ by parts; $\delta y$ vanishes at the endpoints.