Solution (source code)

= Solution

For fixed endpoint values, the <Euler-Lagrange equation> is
$$
\boxed{\frac d{dx}F_{y'}(x,y,y')-F_y(x,y,y')=0.}
$$
It follows by differentiating the functional along $y+\varepsilon\eta$ with $\eta(0)=\eta(\pi)=0$, integrating the $F_{y'}\eta'$ term by parts and applying the <fundamental lemma of the calculus of variations>.

For this quadratic integrand it becomes $y''+ky=0$. If $k>0$, write $\nu=\sqrt k$; the condition at zero gives $y=B\sin(\nu x)$, and that at $\pi$ requires $B\sin(\nu\pi)=0$. Consequently \b[$y=0$ is the only <extremal> when $\sqrt k$ is not an integer]. If $\sqrt k=n$ is a positive integer, all <extremals> are
$$
\boxed{y(x)=B\sin(nx),\qquad B\in\mathbb R.}
$$
The integer case $n=0$ must be handled separately: $y''=0$ with both endpoints zero has only $y=0$. If negative real $k$ is allowed, the hyperbolic-<function> solutions also yield only zero under these endpoints. These statements concern stationary <functions>; no minimum is assumed.