ハミルトン力学
d L = ∑ i ( d q i p ̇ i + d q ̇ i p i ) + ∂ L ∂ t d t = ∑ i ( d q i p ̇ i − q ̇ i d p i + d ( q ̇ i p i ) ] + ∂ L ∂ t d t {\displaystyle {\begin{aligned}dL&=\sum _{i}(dq_{i}\,{\dot {p}}_{i}+d{\dot {q}}_{i}\,p_{i})+{\frac {\partial L}{\partial t}}dt\\&=\sum _{i}(dq_{i}\,{\dot {p}}_{i}-{\dot {q}}_{i}\,dp_{i}+d({\dot {q}}_{i}\,p_{i})]+{\frac {\partial L}{\partial t}}dt\\\end{aligned}}}
となる。全微分を移項して
d ( ∑ i q ̇ i p i − L ) = ∑ i ( q ̇ i d p i − d q i p ̇ i ) − ∂ L ∂ t d t {\displaystyle d{\Bigl (}\sum _{i}{\dot {q}}_{i}\,p_{i}-L{\Bigr )}=\sum _{i}({\dot {q}}_{i}\,dp_{i}-dq_{i}\,{\dot {p}}_{i})-{\frac {\partial L}{\partial t}}dt}
となる。ハミルトニアン
H ( p , q , t ) = ∑ i q ̇ i ( p , q , t ) p i − L ( q , q ̇ ( p , q , t ) , t ) {\displaystyle H(p,q,t)=\sum _{i}{\dot {q}}_{i}(p,q,t)\,p_{i}-L(q,{\dot {q}}(p,q,t),t)}