1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Why are the Lagrangian and the Hamiltonian defined as they are?

  1. May 16, 2012 #1
    I have two somewhat related questions.

    First, why would we care about the Lagrangian L = T - V (or K - U)? I understand with the Hamiltonian H = T +V, the total energy is conserved. But with the Lagrangian, what does it actually mean? Mathematically, it only inverts the potential energy portion (let's make attraction negative; repulsion positive) compared to the Hamiltonian. Wouldn't it make more sense to find stationary action using the Hamiltonian instead of the Lagrangian?

    Second (related), the Hamiltonian is actually not necessarily T + V, but is the Legendre transform of the Lagrangian. So, in general, besides the physical interpretation of total energy, what do we have to gain from performing this transform?
  2. jcsd
  3. May 16, 2012 #2


    User Avatar
    Science Advisor
    Gold Member

    The Lagrangian is defined so that finding the minimum (more generally the stationary points) of the action functional [itex]S=\int_a^b \mathcal{L} dt[/itex] will yield the correct equations of motion. It turns out that for non-relativistic mechanics, the correct Lagrangian to choose is T-V.

    One gains both a new perspective and perhaps a simpler method when switching from Lagrangian to Hamiltonian mechanics. The Hamiltonian formulation reduces the N 2nd order differential equations found from the Euler Lagrange equations into 2N 1st order differential equations which can sometimes be easier to solve.
  4. May 16, 2012 #3
    I'm afraid your knowledge of Classical Mechanics is very chaotic.

    Hamilton's principle (of least action) is quite different from a Hamiltonian.

    The priniciple should give the equations of motion. Try to extremize:
    Y[q(t), p(t)] = \int_{t_i}^{t_f}{\left( \frac{p^2}{2m} + V(q)\right) \, dt}
    where Y stands for "your action", with the Hamiltonian as an integrand (displayed as a function of coordinate and momentum, as it ought to be). Vary it w.r.t. both q and p. What do you get?
  5. May 16, 2012 #4
    The lagrangian is important because of its integral, a quantity called action:

    http://en.wikipedia.org/wiki/Action_(physics [Broken])

    Action is a property of the dynamics of a system, that takes as an input the trajectory of a dynamical system. It has been both proven and observed that nature chooses the path the gives the smallest value for that integral, otherwise known as "the principle of least action".

    EDIT: We all answered in the same time :)
    Last edited by a moderator: May 6, 2017
  6. May 21, 2012 #5
    Does anyone have an example of when -- e.g. using Lagrangian mechanics -- kinetic energy T depends on not just generalized velocity but also generalized position?
  7. Jun 6, 2012 #6
    Sure: switch to polar coordinates when looking at the Lagrangian for an orbiting mass (or just use polar coordinates in general: Newtonian gravity is nice because it's simple). Another less contrived example (any change in coordinates can result in weird position-dependent kinetic energies) is in the "extended" Lagrangian used to model constant temperature and pressure ensembles in molecular dynamics simulations. You can read about it here:

    One issue with Hamiltonian minimization is that it isn't a well defined decision protocol in Hamiltonian systems (that is, systems where the total energy is constant like the classical universe). Also, even if we instead treated the total energy as a variable in the path, we would get time reversal issues and additional decision-protocol problems: in the short run, it might be better for a marble to roll to the closest energy minimum and stay. However, in the long run it would be better for the marble to find the shortest path to the lowest energy possible and then stay there forever.
  8. Jun 6, 2012 #7
    Consider a "double pendulum", i.e. two point particles with masses [itex]m_1[/itex], and [itex]m_2[/itex], connected to the pivot and each other with rigid massless rods of lengths [itex]L_1[/itex], and [itex]L_2[/itex], respectively.


    One can choose the angles [itex]\theta_{1,2}[/itex] on the above figure as generalized coordinates. The position of each particle are:
    x_1 = L_1 \, \sin \theta_1, \ y_1 = L_2 \, \cos \theta_1
    x_2 = L_1 \, \sin \theta_1 + L_2 \, \sin \theta_2, \ y_2 = L_1 \, \sin \theta_1 + L_2 \, \sin \theta_2
    The velocity components are given by the derivaties:
    \dot{x}_1 = \dot{\theta}_1 \, L_1 \, \cos \theta_1, \ \dot{y}_1 = -\dot{\theta}_1 \, L_1 \, \sin \theta_1
    \dot{x}_2 = \dot{\theta}_1 \, L_1 \, \cos \theta_1 + \dot{\theta}_2 \, L_2 \, \cos \theta_2, \ \dot{y}_2 = -\dot{\theta}_1 \, L_1 \, \sin \theta_1 - \dot{\theta}_2 \, L_2 \, \sin \theta_2
    Then, the square of the speeds are:
    v^{2}_{1} = \dot{x}^{2}_{1} + \dot{y}^{2}_{1} = \dot{\theta}^{2}_{1} \, L^{2}_{1}
    v^{2}_{2} = \dot{x}^{2}_{2} + \dot{y}^{2}_{2} = \dot{\theta}^{2}_{1} \, L^{2}_{1} + \dot{\theta}^{2}_{2} \, L^{2}_{2} + 2 \, \dot{\theta}_{1} \, \dot{\theta}_{2} \, L_{1} \, L_{2} \, \cos \left( \theta_2 - \theta_1\right)
    and the kinetic energy of the system is:
    T = \frac{m_1 \, v^{2}_{1}}{2} + \frac{m_2 \, v^{2}_{2}}{2} = \frac{(m_1 + m_2 ) \, L^{2}_{1}}{2} \, \dot{\theta}^{2}_{1} + \frac{m_2 \, L^{2}_{2}}{2} \, \dot{\theta}^{2}_{1} + \color{\red}{m_2 \, L_1 \, L_2 \, \dot{\theta}_1 \, \dot{\theta}_2 \, \cos \left( \theta_2 - \theta_1 \right)}
    As you can see, the term in red contains the generalized coordinates through the cosine of the difference of the two angles.
  9. Jun 7, 2012 #8


    User Avatar
    Gold Member

    The Lagrangian does have meaning, and in my opinion, once you know that meaning it makes perfect sense.

    In november 2010 I posted in a thread titled 'Lagrangian'.

    My purpose is to show that the form of the Lagrangian follows from the Work/Energy theorem. The mathematical discussion that I posted here on physicsforums is a shortened one, a more extensive discussion is on my own website.
    (I'm strongly influenced by Edwin Taylor, who is a strong proponent of the principle of least action. I recommend Edwin Taylor's least action web pages.)

    The discussion that I present is only for a specific example. I believe the discussion can be readily generalized, but I didn't persue that because I wanted to keep it very tangible.

    Anyway, while the Lagrangian looks counterintuitive, it does make sense. I encourage you to look into the resources I mentioned.
  10. Jun 7, 2012 #9
    There are maybe 3 ways to think of the T-U Lagrangian.

    1st way is that you look for a Lagrangian that give you Newton's equations of motion as the Euler-Lagrange equation in rectangular coordinates. By a simple calculation, T-U is what you come up with.

    2nd way: Think of throwing a ball in the air. Its trajectory is a parabola. Think of the action as a cost which you are trying to minimize. T-U tells you it likes to be in state where U is high and it doesn't like to be in a state where T is high. So, it wants to go up high because U is high there, but it has to get back down somehow (in Lagrangian mechanics, you fix a starting place and ending place). So it does that and spends as little time as possible down low. So, you can see that roughly parabolic motion should minimize the action.

    3rd way: the principle of virtual work. Essentially, the variation of the T part of the action represents work done by a fictitious force on a trajectory that deviates slightly from the Newtonian path, and the variation of the U part is the extra work done by the potential to deviate by that path. That's really the physical meaning of the Lagrangian. I've been fairly terse here, so here are some more detailed notes:


    I have worked out my own more intuitive approach to this derivation, but I'm too lazy to reproduce it here, and it might end up getting a bit too long.
  11. Jun 8, 2012 #10


    User Avatar
    Gold Member

    Let me expand on this one.

    The newtonian path has the following property: at every point in time the rate of change of kinetic energy matches the rate of change of potential energy. Now draw a diagram with two curves: the kinetic energy as a function of time, and the potential energy as a function of time, but draw the potential energy curve upside down. That is, draw the curve for minus the potential energy.

    For the newtonian path the diagram has the following property: the curves for kinetic energy and minus potential energy are parallel to each other at every point in time.
    Conversely, for any path that deviates anywhere from the newtonian path the curves are not parallel to each other at every point in time.

    This gives a hint towards explaining why the lagrangian works with minus the potential energy. The action is minimal when the curve for kinetic energy and the curve for minus potential energy are parallel to each other at every point in time.

    Hi homeomorphic, can I persuade you to check out the article Least action visualized that is on my website.
    I'm very curious whether the discussion there is similar to the intuitive approach you've worked out for yourself.
  12. Jun 9, 2012 #11
    I didn't read it too carefully, but it looks like it's a bit different from mine. Mine is closer to what Baez says in the notes that I linked to.
  13. Jun 22, 2012 #12
    This is great. Allow me some time to read over them.
    I should have checked back sooner, but for a while no new posts were being made.
  14. Jun 23, 2012 #13


    User Avatar
    Gold Member

    For Edwin Taylor's website a good place to start, I think, is the page that was created by Edwin Taylor and Slavomir Tuleja: Principle of least action interactive.

    Taylor and Tuleja show that the newtonian trajectory can be found with an iterative process. The iteration finds a trajectory with the property that along each subsection the change of kinetic energy and the change of potential energy are a match for each other.

    What I find interesting about that iterative approach is that it's in a sense an intermediate between the f=ma approach, that is handled with differentiatial calculus, and the least action approach, that is handled with integral calculus.

    In the iterative approach for each subsection local change of kinetic energy and potential energy is evaluated. Exhaustively cycling throught the iterations makes the evaluation comprehensive for the trajectory as a whole.
  15. Jun 27, 2012 #14
    I'm wondering, are there cases where the action has no local minimum? With respect to small s, that is. Because if [itex]{\partial \over \partial s}S(\mathbf{q}(t))|_{s=0}[/itex] were not 0, then it would no longer be equivalent to [itex]\mathbf{F} = m\mathbf{a}[/itex].
    On a related note, [itex]\mathbf{F} = m\mathbf{a}[/itex] plus the conservation of energy seem to be able to specify a future location, but with the action principle, you have to try all locations or know the final position beforehand. Meanwhile, they both require additional pieces of information (e.g. initial/final position, initial/final velocity, and the total time elapsed). Any thoughts on that?

    This is a consequence of the conservation of energy right? But I can't seem to figure out what significance it holds in terms of minimizing the action. I think the conservation of energy is an "outside" albeit evidentially valid constraint that must be introduced into the Lagrangian or the Newtonian analysis in order to define potential energy in the first place, which is why the action principle uses both the Lagrangian and the conservation of energy.

    So the action [itex]\mathbf{S}[/itex] is like weighted time. I'm wondering, can you specify an ending place that is not possible to reach (due to insufficient energy or being along a different direction from the particle's initial heading)? Would we still end up with "the correct solution"? Would the action principle be general enough to accommodate for such trials?
    And the virtual work principle sounds similar to the "path" of least resistance, except it isn't necessarily a path (function mapping from every [itex]t[/itex] to a single value of [itex]q[/itex]) where quantum mechanics is concerned?
    Last edited: Jun 27, 2012
  16. Jun 27, 2012 #15
    By the way Cleonis, I really like your Site. I had visited it before for the sections on the Coriolis effect and Foucault's pendulum, but I didn't know you are on this forum as well.
  17. Jun 27, 2012 #16


    User Avatar
    Gold Member

    Let me give an example of a case where the definition of potential energy is independent from other energies: planetary motion.

    We have the inverse square law of gravitation, which describes the force, and using the work/energy theorem the potential energy law follows mathematically from the force law. Solving the differential equations of the force law also gives the physical trajectory of a planet.
    Then you evaluate the sum of kinetic energy and potential energy at every point in time, and you find that the magnitude of this sum does not change.

    This illustrates that Newton's laws of motion alone suffice to imply conservation of the sum of potential gravitational energy and kinetic energy. It's already there.

    I do grant you that in the history of physics there have been situations where potential energy was defined by way of reliance on energy conservation. For some phenomenon there would be an appearence of energy not being conserved. Time and again the following strategy proved fruitful: assume some unknown force law is at work and infer the corresponding potential energy law by tracking how much apparent violation of energy conservation you see, and take it from there. So yes, there have been cases where in order to make headway some as yet unknown form of potential energy was defined by way of reliance on energy conservation. If that would be the the case for all forms of potential energy, then as you say the rule of conservation of energy would be merely a rule to 'define potential energy in the first place'.

    However, once a phenomenon is understood potential energy that is involved can be defined independently, and planetary motion is an example of that.

    I'm pleased you hear you like my website.
    I have periods that I'm active on this forum, but also periods that I don't visit/read/post for months
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook