= Solution
Vary $S=\int L(q,\dot q,t)dt$ with fixed endpoints. <Integration by parts> gives $\delta S=\int\sum_i[L_{q_i}-dL_{\dot q_i}/dt]\delta q_i\,dt$, hence the <Euler-Lagrange equation>[Euler-Lagrange equations]. Define $p_i=L_{\dot q_i}$ and, assuming an invertible velocity-momentum relation, $H=p\cdot\dot q-L$. The equivalent action is $\int(p\cdot\dot q-H)dt$. Independent variations of $p$ and $q$ yield
$$
\boxed{\dot q_i=H_{p_i},\qquad\dot p_i=-H_{q_i}.}
$$
<Boundary term>[Boundary terms] vanish for fixed endpoint coordinates; constraining <momenta> independently at the same endpoints is unnecessary. Singular <Lagrangian>[Lagrangians] require constraint analysis instead of this unconstrained <Legendre transform>.
Back to article page