# A Relations between lagrangian and hamiltonian

1. May 7, 2017

### LagrangeEuler

Lagrangian is defined by $L=L(q_i,\dot{q}_i,t)$ and hamiltonian is defined by $H=H(q_i,p_i,t)$. Why there is relation
$$H=\sum_i p_i\dot{q}_i-L$$
end no
$$H=L-\sum_i p_i\dot{q}_i$$
or why $H$ is Legendre transform of $-L$?

2. May 7, 2017

### zwierz

$H$ is the Legendre transform of $L$ It is just a definition. Such a definition is convenient because $H$ turns to be the energy of the system: $L=T-V;\quad H=T+V$

3. May 8, 2017

### robphy

For me, there is some mystery with the Legendre transform that I haven't resolved for myself... but hope to get back to this summer.

Here are some possibly enlightening resources:

"Making Sense of the Legendre Transform" by R. K. P. Zia, Edward F. Redish, Susan R. McKay
http://doi.org/10.1119/1.3119512 American Journal of Physics 77, 614 (2009)
https://arxiv.org/abs/0806.1147

"Legendre Transforms for Dummies" by Carl E. Mungan
https://www.aapt.org/docdirectory/meetingpresentations/SM14/Mungan-Poster.pdf

"A Graphical Derivation of the Legendre Transform" by Sam Kennerly https://sites.google.com/site/samkennerly/maths

4. May 8, 2017

### zwierz

If not to discuss the Legendre transform in general but focus on Lagrangian aspect only then everything is clear already because we know that autonomous Lagrangian system has the first integral
$$\dot q^i\frac{\partial L}{\partial \dot q^i}-L$$
and $p_i=\frac{\partial L}{\partial \dot q^i}$ is a generalized impulse

5. May 12, 2017

### vanhees71

The choice of the sign for the Hamiltonian is of course convention, but it's a useful one, because then we have the sign defining energies and potential as it is common practice for centuries, and everybody is used to that convention. Let's take the most simple case of a non-relativistic particle moving in a potential. The Lagrangean reads
$$L=\frac{m}{2} \dot{\vec{x}}^2-V(\vec{x}).$$
The Hamiltonian thus gets (note that you should eliminate the velocities by canonical momenta $\vec{p}=\partial_{\dot{\vec{x}}} L=m \dot{\vec{x}}$) after some simple algebra
$$H=\vec{p} \cdot \dot{\vec{x}}-L=\frac{\vec{p}^2}{2m} + V(\vec{x}).$$
That's the "right sign" in the sense that it counts kinetic energy positive and the potential thus also appears positive.

Now, indeed (as mentioned in #4) $H$ is conserved for a system that is invariant under time translations, and thanks to Noether that's the (in my opinion only!) safe ground to define, what "energy" is, namely the conserved quantity due to time-translation invariance. Noether's theorem tells us that the system is for sure time-translation invariant if the Lagrangian does not depend explicitly on time. Then indeed, using the Euler-Lagrange Equations gives
$$\dot{H}=0 \; \Rightarrow \; H=E=\text{const},$$
where $E$ is the total energy of the system.