#### [SOLVED] Help understanding what the Hamiltonian signifies for the action compared with the Euler-Lagrange equations for the Lagrangian?

Consider the Lagrangian for a simple harmonic oscillator \begin{equation} L (x,\dot{x}) = \frac{1}{2}m\dot{x}^2 - \frac{1}{2}kx^2 \end{equation} Obviously we have \begin{align} \frac{\partial L}{\partial x} & = -kx\\ \frac{\partial L}{\partial \dot{x}} & = m\dot{x}\\ \frac{d}{dt} \left(\frac{\partial L}{\partial \dot{x}}\right) & = m\ddot{x} \end{align} So this satisfies the Euler-Lagrange in that we know a $F = ma$ and therefore the force of a spring should follow this law as well, giving us \begin{align} \frac{d}{dt} \left(\frac{\partial L}{\partial \dot{x}}\right) -\frac{\partial L}{\partial x} & =0 \\ m\ddot{x} + kx &= 0 \end{align} Now let's do the Hamiltonian version. Here's where I'm having a problem. We obtain the Hamiltonian via the Legendre transformation and get
\begin{equation} H(x,p) = \frac{1}{2}\frac{p^2}{m} + \frac{1}{2}kx^2 \end{equation} Now, according to what I understand, the equations of motion should be \begin{align} -\frac{\partial H}{\partial x} & = -kx = \dot{p}\\ \frac{\partial H}{\partial p} & = \frac{p}{m} = \dot{x} \end{align} But I don't see what this tells me about the relationship between Newton's law and Hooke's law. For the Lagrangian, when I plug in the relevant information, I get a relationship that explicitly shows for the action \begin{equation} S[x] = \int_a^bL(t,x,\dot{x})dt \end{equation} that it satisfies the EL equation as a necessary condition for $S[x]$ to have an extremum for the given function $x(t)$.

My Question:

How do Hamilton's equations do this? When I look at the "equations of motion" for the Hamiltonian, I don't see how they tell me anything about the action. But they should! That's what their purpose is, just like their Lagrangian analogs do.

The only way I see to do it is to do something like \begin{align} \frac{d}{dt}\left(m\frac{\partial H}{\partial p}\right) & = m\frac{d}{dt}\dot{x}\\ &=m\ddot{x}\\ \end{align} and then organize them something like \begin{align} \frac{d}{dt} \left(m\frac{\partial H}{\partial p}\right) + \frac{\partial H}{\partial x} & =0 \\ m\ddot{x} + kx &= 0 \end{align} But I've never seen anyone do this in the introductory books, so I feel like I must be misunderstanding what the Hamiltonian signifies relative to the action. #### @Ryan Unger 2015-03-03 20:23:41

I know I'm late to the party, but let me show that Lagrangian and Hamiltonian mechanics are compatible by direct substitution of the Lagrangian into Hamilton's equations.

The Hamiltonian is, in terms of the Lagrangian, $$H(p,q)=p\dot q(p,q)-L(q,\dot q(p,q))$$ Now we take the first Hamilton equation and plug in $$\dot q=\frac{\partial H}{\partial p}=\dot q+p\frac{\partial\dot q}{\partial p}-\frac{\partial L}{\partial\dot q}\frac{\partial \dot q}{\partial p}$$ Which implies $$p=\frac{\partial L}{\partial \dot q}$$ Now we take the second Hamiltonian equation and plug in $$-\dot p=\frac{\partial H}{\partial q}=p\frac{\partial \dot q}{\partial q}-\frac{\partial L}{\partial q}-\frac{\partial L}{\partial\dot q}\frac{\partial \dot q}{\partial q}$$ Using the first Hamiltonian equation, we see that the last term cancels the first one. We then get $$\dot p=\frac{\partial L}{\partial q}$$ We can then combine the two equations and obtain $$\frac{\partial L}{\partial q}-\frac{d}{dt}\frac{\partial L}{\partial \dot q}=0$$ which is just the Euler-Lagrange equation.

Thus Hamiltonian and Lagrangian mechanics are equivalent. #### @Qmechanic 2015-03-03 12:37:46

OP asks in the title (v1) for help understanding what the Hamiltonian signifies for the action compared with the Euler-Lagrange equations for the Lagrangian.

It seems relevant in this context to point out that there is an action principle for both the Lagrangian and Hamiltonian formalism.

1. On one hand, the stationary action principle for the Lagrangian action $$\tag{L1} S[q]~:=~\int \! dt ~ L(q,\dot{q},t)$$ in the Lagrangian formalism leads to Lagrange's equations of motion (eom)$^1$ $$\tag{L2} \frac{d}{dt}\frac{\partial L}{\partial \dot{q}^i} ~\approx~ \frac{\partial L}{\partial q^i}.$$

2. On the other hand, the stationary action principle for the Hamiltonian action $$S_H[q,p] ~:=~ \int \! dt ~ L_H(q,\dot{q},p,t),$$ $$\tag{H1} L_H(q,\dot{q},p,t) ~:=~ p_i \dot{q}^i - H(q,p,t),$$ in the Hamiltonian formalism leads to Hamilton's eom $$\tag{H2} \dot{q}^i ~\approx~ \frac{\partial H}{\partial p_i}, \qquad -\dot{p}_i ~\approx~ \frac{\partial H}{\partial q^i}.$$

--

$^1$ Here the $\approx$ symbol means equality modulo eom. #### @Stan Shunpike 2015-03-03 21:57:19

thanks for addressing this particular issue. So, let me see if I understand: to find the Hamiltonian action, I take the Legendre transform of the Hamiltonian. But I thought this was an involution. So like if $T$ is the Legendre transform yielding $H$ from $L$, then $T \circ T$ should yield $L$ again. But that's not what you have. You have $L_H(q,\dot{q},p,t)$. Why? I would have thought it would be $L(q,\dot{q},t)$ again. Isn't that the definition of an involution? Also, why does the Hamiltonian action then depend on $q,p$ but not the other two variables? #### @Qmechanic 2015-03-03 22:19:48

1. If we have derived the condition $\dot{q}^i=f^i(q,p,t)$ from the Legendre transformation, then the Hamiltonian Lagrangian and the Lagrangian take the same value $$L_H(q,f(q,p,t),p,t)~=~ L(q,f(q,p,t),t)$$ on this condition. The Legendre transformation is addressed in more detail in e.g. this Phys.SE post. 2. An action does never depend on dot variables, see e.g. this Phys.SE post. #### @Phoenix87 2015-03-03 09:43:06

Observe that from the second equation you get $p=m\dot x$, so that substituting into the first gives you $-kx=m\ddot x$. #### @CStarAlgebra 2015-03-03 06:26:12

Beginning with

\begin{align} -\frac{\partial H}{\partial x} & = -kx = \dot{p}\\ \frac{\partial H}{\partial p} & = \frac{p}{m} = \dot{x} \end{align}

One takes the time derivative of both sides of the second equation

$\frac{d}{dt}(\frac{p}{m}) = \frac{d}{dt}\dot{x}$

giving

$\frac{\dot{p}}{m} = \ddot{x}$

Substituting from Hamilton's first equation

$\frac{-kx}{m} = \ddot{x}$

giving finally

$-kx = m\ddot{x}$