Let
$$J[y]=\int_0^\pi (y')^2dx, \ \ \ \ y(0)=y(\pi)=0$$
which satisfies the additional condition:
$$\int_0^\pi y^2dx=1$$ Find the extremals
Seemingly this seems easy to solve, but I get a problem
Use
$$\frac{d}{dx}\frac{\partial F}{\partial y'}-\frac{\partial F}{\partial y}=0$$
This gives:
$$\frac{d}{dx}2y'=0 \longrightarrow 2y'=C \longrightarrow y(x)=\frac{C}{2}x+D$$
Use initial conditions, and you get $C=D=0$!
What's is the right approach?
Thanks
It can be solved using Lagrange multipliers. I'll sketch it for you:
For an extra condition $C[y]=0$ we define $J[y;\lambda] = J[y] - \lambda\ C[y].$ In your case, $$ J[y;\lambda] = \int_0^\pi \left( (y')^2 - \lambda y^2 \right) \ dx + \lambda $$ and solve this in the usual way. The Euler-Lagrange equation becomes $y''-\lambda y=0.$
Consider the different cases $\lambda=0,$ $\lambda>0$ and $\lambda<0.$ Only for $\lambda<0$ there are solutions satisfying the boundary conditions. Those solutions have the form $y=c_n \sin nx,$ where $n\in\mathbb{Z}.$
Now applying the extra condition gives $\frac12 \pi c_n^2 = 1,$ i.e. $c_n=\pm\sqrt{2/\pi},$ but only for $n\neq 0.$ For $n=0$ the condition can not be satisfied since we get the zero function.
Finally we can calculate $J[y]$ for the solutions.