Conditions for Functional to be Extremum of Two-variable Functional over Canonical Variable p

Theorem
Let $y=y \left({ x } \right)$ and $F \left({ x, y, y' } \right)$ be a real functions.

Let $ \displaystyle \frac{ \partial ^2 F}{ \partial {y'}^2 } \ne 0$.

Let $ \displaystyle J[y]=\int_a^b F \left({ x, y, y' } \right) \mathrm d x$

Let $J \displaystyle [y, p]=\int_a^b \left({ -H \left ({ x, y, p } \right)+py} \right) \mathrm d x$, where $H$ is the Hamiltonian of $J[y]$.

Then $ \displaystyle J[y]= J[y, p] \big \vert_{ \frac{ \delta J[y, p] }{ \delta p} =0}$

Proof
Euler's equations for $J\left [{y, p} \right]$: