I'm studying calculus of variation in this semester. I have difficulties in understanding the conditions for a curve to be an extremal.
Specifically, when we are deriving the general variation of a functional of the form $\int_{a}^{b}F(x,y,y')\mathrm{d}x$, we define $p$ to be $\frac{\partial F}{\partial y'}$ and $H$ to be $y'\frac{\partial F}{\partial y'}-F$. If we don't put any restrictions on the two endpoints, we must have a) Euler-Lagrange equation must be satisfied; b) $p\delta_y|_a^b - H\delta_x|_a^b=0$.
Our professor mentioned that $p$ and $H$ represent momentum and hamiltonian respectively. But I can't understand the relationship between these two quantities and the variational problem. Because I've never seen any variational problem which involves momentum $p$ and hamiltonian $H$. An example from physics which involves momentum and hamiltonian would be very helpful.
--------The followings are edited on Apr 4, 2020---------
Moreover, I would like to know the intuition of the quantity $\delta J = p\delta_y|_{a}^{b}-H\delta_x|_{a}^{b}$ where $J[y] = \int_{a}^{b}F(x,y,y')$. This corresponds to the situation where the endpoints are not fixed and the curve $y$ is taken to be the extremal (satisfies the Euler-Lagrange equations). How could this quantity be interpreted as the variation when the endpoints are perturbed? Need a concrete example to illustrate this.
In quantum mechanics, Schrödinger's equation uses the Hamiltonian as an operator, so you can see there the Hamiltonian almost every time.
But let me show you a simpler example: Imagine a point particle at the end of an ideal spring (simple harmonic oscillator). The mass of the particle is $m$, and the spring constant is $k$. We know that the energy of the system will be $E=\frac{1}{2}mv^2+\frac{1}{2}kx^2$ with momentum $p=mv$, but we can get it directly from the Lagrange function: $$L=\frac{1}{2}mv^2-\frac{1}{2}kx^2$$ The generalised momentum (which happens to equal to the momentum this time) is $$p=\frac{\partial L}{\partial v}=mv$$ So the Hamiltonian is $$H=pv-L=pv-\frac{1}{2}mv^2+\frac{1}{2}kx^2=p\frac{p}{m}-\frac{1}{2}m\frac{p^2}{m^2}+\frac{1}{2}kx^2=\frac{p^2}{2m}+\frac{1}{2}m\omega^2x^2$$ Where we defined $\omega$ as $\omega=\sqrt{\frac{k}{m}}$ (It's nit neccessary, but people usually do this).