I want to check if my solution is correct.
Exercise: Find the extremals of the functional $$J(y) = \int_{0}^{1}\Big(10y^{2}(t) - y(t)\dot{y}(t) + 5\dot{y}^{2}(t)\Big)dt$$ subject to constraints $$ y(0) = 0,~y(1) = 1,~\int_{0}^{1}y(t)dt = 1.$$
My answer:
$$H(y) = 10y^{2} - y\dot{y} + 5\dot{y}^{2} + \lambda \cdot y \\ \frac{d}{dt}\frac{\partial H}{\partial \dot{y}} - \frac{\partial H}{\partial y} = 0 \\ \frac{d}{dt}(-y + 10\dot{y}) - 20y + \dot{y} - \lambda = 0 \\ \ddot{y} - 2y = \frac{\lambda}{10}.$$ Then, $$y_{tot}(t) = Ae^{\sqrt{2}t} + Be^{-\sqrt{2}t} - \frac{\lambda}{20}.$$
Finally, using the constraints, I computed $A$, $B$ and $\lambda$. Is this correct? Thanks in advance!