The least-action principle is a statement in classical physics saying that all bodies in a system follow a trajectory that minimize the following functional (ignoring explicit time dependence for now): $$ S[L] = \int dt L(x(t), \dot{x}(t)) \qquad\rightarrow\qquad \frac{d}{dt}\Big(\frac{\partial L}{\partial \dot{x}}\Big) - \frac{\partial L}{\partial x} = 0. $$ The Hamiltonian of the same system can be constructed using the Legendre transform: $$ H(p, x) = \dot{x}\cdot p - L(x, \dot{x})\;;\quad p \equiv \frac{\partial L}{\partial\dot{x}}. $$ Pedagogically, one first studies Lagrangian Mechanics starting from the least-action principle, and eventually constructs an equivalent Hamiltonian Mechanics framework. But suppose I was a weird physicist who wanted to teach Hamiltonian mechanics first, and then later construct Lagrangian Mechanics. What would be the best way to do this?

  • 2
    $\begingroup$ The Legendre transform works both ways, and Hamiltonian mechanics is still an action principle, just with different variables $\endgroup$
    – Slereah
    Commented Sep 18, 2020 at 19:25
  • $\begingroup$ If we intend to start from from the Hamiltonion Mechanics framework, how does a least-action principle lead us directly to Hamilton's equations? $\endgroup$
    – firest
    Commented Sep 18, 2020 at 21:03
  • $\begingroup$ Related : A mathematically illogical argument in the derivation of Hamilton's equation in Goldstein. $\endgroup$
    – Frobenius
    Commented Sep 18, 2020 at 22:18

2 Answers 2


Well, if you don't mind explaining before Hamilton-Jacobi's equation then it's not impossible.
From the derivation of the Hamilton-Jacobi equation (see for yourself!) I have that \begin{equation} \mathrm{d}\mathcal{S}=p\ \mathrm{d}q-\mathcal{H}\ \mathrm{d}t \end{equation} Where $\mathcal{S}$ is the action, $p$ the generalized momentum, $\mathcal{H}$ the Hamiltonian and $q$ the generalized coordinate.
If you check your calculations I suggested you to do beforehand, then you can recognize that solving Hamilton-Jacobi basically imposes that $\mathrm{d}\mathcal{S}$ is an exact differential, i.e. I can write explicitly the following integral \begin{equation} \mathcal{S}[q(t)]=\int\left(p\ \mathrm{d}q-\mathcal{H}\ \mathrm{d}t\right) \end{equation} Well, then I can impose Hamilton's principle to this action and find an extremal! Note that \begin{aligned} \delta(p\ \mathrm{d}q)&=\delta p\ \mathrm{d}q+p\ \mathrm{d}\delta q\\ \delta\mathcal{H}&=\frac{\partial\mathcal{H}}{\partial p}\delta p+\frac{\partial\mathcal{H}}{\partial q}\delta q \end{aligned} Now if you do your calculations, if you look closely, the integral splits in two parts that multiply the variations of $p$ and $q$, while one part goes to zero in an integration by parts. Simply impose that those two parts must be simultaneously zero in order to satisfy Hamilton's principle and boom, you're done.
Note that for a completely pedagogical situation it's almost impossible to teach Hamiltonian mechanics before Lagrangian mechanics.

  1. It's much easier to derive HJE if you actually know what is actually a Lagrangian
  2. The physics gets sometimes lost in the mathematical abstractness, and it's not ideal in a classical mechanics course
  3. As you see in Lagrangian mechanics, generalized coordinates are not always real coordinates and can mean whatever, when you insert canonical momenta it just goes bonkers. See the Lotka-Volterra equations as an example or just think about this simple canonical transformation \begin{equation}\left\{ \begin{aligned} p&=q\\q&=p \end{aligned} \right.\end{equation} I just switched momenta and coordinates, and the new Hamiltonian still solves HJE and the canonical equations of motion. In my honest opinion this idea before even really knowing how analytical mechanics works on the other side of the Legendre transform would almost irreparably confuse me.

Conclusion: Quite hard to do but not impossible, personally wouldn't do it.

  • $\begingroup$ I suppose the statement is that, as you said, the Action is an exact differential, where you have coordinate q, conjugate momentum p, and a parameter describing the trajectories of p and q in phase space. Imposing the Action as an exact differential leads you directly to the Hamilton Jacobi equations. I am aware that this is not a very useful way to pedagogically teach people. I was however hoping to gain a new perspective in classical physics... But you are right. Starting from Hamiltonion Mechanics is kinda bonkers. $\endgroup$
    – firest
    Commented Oct 4, 2020 at 3:12
  • 1
    $\begingroup$ It seems this answer (v1) conflates Hamilton's principal function and the action functional. $\endgroup$
    – Qmechanic
    Commented May 24, 2021 at 10:14
  1. The Hamiltonian action reads $$ S_H[q,p]:=\int \! dt\left(p_i\dot{q}^i-H(q,p,t)\right). $$ Its EL equations are Hamilton's equations.

  2. The equivalence between Lagrangian & Hamiltonian mechanics is discussed in e.g. this Phys.SE post.

  • $\begingroup$ My problem with this is two-fold. 1a. First, how would one intuit that the integrand is of the form $p\dot{q} - H(p, q, t)$. 1b. Where does the $p\dot{q}$ come from? It appears very unnatural. 1c. Why not just have the integrand be a more general function $\tilde{H}(p, q, t)$? 2. My second problem is that the Hamiltonian, from this perspective, is defined as the Legendre Transform of the Lagrangian which, while true, defeats the purpose of the question: How do you start with first deriving Hamilton's equations? $\endgroup$
    – firest
    Commented Sep 18, 2020 at 21:08
  • $\begingroup$ 1. One argument is that unlike the Lagrange equations, which are homogeneous in $L$, the Hamilton's equations are inhomogeneous in $H$. 2. Traditionally, the Hamiltonian formulation is indeed derived via a Legendre transformation of the Lagrangian formulation. Alternatively, it is postulated as a first principle. $\endgroup$
    – Qmechanic
    Commented Sep 19, 2020 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.