Can both Lagrangian and Hamiltonian formalisms lead to different solutions?

I have a simple system described by the Lagrangian \begin{equation} L(\eta,\dot{\eta},\theta,\dot{\theta})=\eta\dot{\theta}+2\theta^2. \end{equation} The equations of motion are obtained from Euler-Lagrange eq.: \begin{eqnarray} 4\theta-\dot{\eta}=0\; \mathrm{and}\; \dot{\theta}=0, \end{eqnarray} yielding the solution $\eta(t)=4\theta_0t+\eta_0$ where $\eta_0$ and $\theta_0$ are constants.

But when I obtain one of the equations of motion from the Hamiltonian (via Legendre transformation), \begin{equation} H=\left(\frac{\partial L}{\partial\dot\eta}\right)\dot\eta+\left(\frac{\partial L}{\partial\dot\theta}\right)\dot\theta - L =-2\theta^2, \end{equation} \begin{equation} \dot\eta=\frac{\partial H}{\partial p_\eta}=0, \end{equation} the situation is surprisingly different from the Lagrangian approach because $\eta$ is now a constant!

Can someone give a proper explanation for this inconsistency? Am I doing something wrong here?

  • 2
    $\begingroup$ Hints: 1. For starters, there is a primary constraint $p_{\eta}\approx 0$. 2. I discuss this example in my Phys.SE answer here. $\endgroup$
    – Qmechanic
    May 18, 2017 at 13:08
  • $\begingroup$ Off the top of my head, note that as you computed, $\frac{\partial L}{\partial \dot \eta} = 0$ and so $p_\eta = 0$. As such, $H$ cannot be written as some unique function of $p_\eta$ in any sense, and I don't think that $\frac{\partial H}{\partial p_\eta}$ would be well-defined. $\endgroup$
    – JamalS
    May 18, 2017 at 13:08
  • 1
    $\begingroup$ Try to calculate $p_\eta$ ist zero.So you cannot express the velocity in terms of the momenta. This is called a constraint system. Dirac wrote a small book how to deal with that (since Electrodynamics is also a constraint system this is relevant for physics) $\endgroup$
    – lalala
    May 18, 2017 at 13:11

1 Answer 1


The problem here is that, because there exist constraints of the form $f(q,\,p)=0$, the phase space coordinates of the usual Hamiltonian formulation aren't independent. I'm not sure how you encountered this Lagrangian, but this issue is a common hiccup in electromagnetism and (if you'll pardon a more obscure example) BRST quantisation. The good news is you can still form a Hamiltonian description equivalent to the Lagrangian one. The trick is to append suitable terms to the "naïve" Hamiltonian, as explained here, and as a result the Poisson brackets are upgraded to what are called Dirac brackets.

For your problem the full Hamiltonian is $H=-2\theta^2+c_1 p_\eta+c_2( p_\theta-\eta)$, where the $c_i$ remain to be computed as functions of undifferentiated phase space coordinates. In fact $c_1=\frac{\partial H}{\partial p_\eta}=\dot{\eta}=4\theta$ while $c_2=\frac{\partial H}{\partial p_\theta}=\dot{\theta}=0$, so $H=-2\theta^2+4\theta p_\eta$. You can verify this gives you the right equations of motion.

  • $\begingroup$ Thanks! It's actually a part of perturbed NLS Lagrangian after an attempt of finding solution using variational method. Are the Dirac's procedure covers all Lagrangian of 'irregular' forms? $\endgroup$
    – donnydm
    May 18, 2017 at 14:39
  • $\begingroup$ @donnydm Given any Lagrangian with consistent equations of motion, this technique will ensure an equivalent Hamiltonian formulation, although if there are higher-order derivatives you also need a trick due to Ostrogradski. (An example of an inconsistent Lagrangian is $L=q$.) $\endgroup$
    – J.G.
    May 18, 2017 at 16:07

Your Answer

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