I am trying to reconstruct a derivation that I encountered a while ago somewhere on the internet, in order to build some intuition both for $H$ and $L$ in classical mechanics, and for the operation of Legendre transforms. But I can't seem to make the argument work.
The question is: can we derive Hamiltonian mechanics $H(q, p)$ by starting with an initial Lagrangian function $L(q, v, t)$, assuming no relationship at this point between $q$ and $v$, and deriving the Euler-Lagrange equations for this Lagrangian with the constraint $\dot{q} = v$?
We'd use a Lagrange multiplier: $$ \begin{align} \delta S & = \delta \int dt \left[ L(q(t), v(t), t) + \lambda(t) (\dot{q}(t) - v(t)) \right] \\ & = \int dt \left[ \left( \frac{\partial L}{\partial q} - \dot{\lambda}(t)\right) \delta q(t) + \left( \frac{\partial L}{\partial v} - \lambda(t) \right) \delta v(t) \right] + \left. \lambda(t)\delta q(t)\right|^f_i \end{align} $$ where I've used integration by parts to turn $\lambda \delta \dot{q}$ into $-\dot{\lambda} \delta q$, spitting out a boundary term which will be zero if the variation vanishes at the endpoints, and ignoring the variation $\delta \lambda$ which encodes the constraint itself.
Then, setting the coefficient of $\delta v$ to zero gives us $\lambda(t) = \frac{\partial L}{\partial v} := p(t)$, and then, plugging this in, the variation w.r.t. $\delta q(t)$ produces the regular E-L equation $\frac{\partial L}{\partial q} = \frac{d}{dt} p = \frac{d}{dt}\frac{\partial L}{\partial \dot{q}}$. Great.
If we plug $\lambda = p$ back in, the expression $$ S' = \int dt [L + p\dot{q} - pv] $$ looks like a "Legendre-transformed Action", but with $pv$ filling the role normally filled by $p \dot{q}$ (at least until you plug the constraint back in):
$$S' = \int dt [ p\dot{q} - (pv - L) ] \stackrel{?}{=} \int dt [ p\dot{q} - H ] $$
But this isn't exactly the same as the typical $H = p\dot{q} - L$ formulation, because of the $v$ floating around. And I recall from the now-lost source that there is some revealing way to interpret this modified action with the constraint term, $S'$, but I can't remember exactly what it is. I find myself very confused about what's going on here.
My specific mathematical questions are:
- In this formulation, how can I establish that this $H$ is no longer a function of $v$ or $\dot{q}$ but only of $p$? Given this, the variation of this transformed $S'$ readily produces Hamiltonian e.o.m., but I can't see how to support this.
- In a Hamiltonian formulation does this transformed action $S' = \int dt [p\dot{q} - H]$ have an interpretation, besides just being "the thing which $= \int dt L$? If you started with any old Hamiltonian function, would it be obvious that you could produce a variational equation for its dynamics in this way?
- Is there a way to go back to the $L$ formulation via another "constrained extremization"? The $v = \dot{q}$ constraint is very intuitive, but I can't see what constraint would go the other direction.
But I'm also just looking for insight on how this approach relates to the typical method. It may be that it's almost exactly the same, but it feels clearer—when I learned this we just sort of asserted that $H$ was an interesting thing to think about. Is there a book out there that develops classical mechanics this way?