LOG#202. Harmonic oscillator.

Some clever physicists say that everything is an harmonic oscillator, and that every hard problem is just solvable in terms of a suitable set of harmonic oscillators (even true with string theory!):

In classical mechanics (CM) you have a the following standard harmonic oscillator lagrangian:

    \[L_{HO}=\dfrac{1}{2}m\dot{q}^2-\dfrac{1}{2}kq^2=T-U=\mbox{Kinetic Energy-Potential Energy}\]

The first order lagrangian given above depends upon the generalized velocities in the kinetic energy part. It provides the following Euler-Lagrange equations (EL):

    \[E(L)\equiv \dfrac{\partial L}{\partial q}-\dfrac{d}{dt}\left(\dfrac{\partial L}{\partial \dot{q}}\right)=0\]

For the L_{HO} given above, you obtain

    \[ \dfrac{\partial L}{\partial q}=-kq\]

    \[\dfrac{d}{dt}\left(\dfrac{\partial L}{\partial \dot{q}}\right)=\dfrac{dp}{dt}=m\ddot{q}\]

where p=m\dot{q} is the generalized momentum. Putting the two terms together, you get

    \[-m\ddot{q}-kq=0\leftrightarrow m\ddot{q}+kq=0\leftrightarrow \ddot{q}+\dfrac{k}{m}=0\leftrightarrow \ddot{q}+\omega^2 q=0\]

Indeed, you recognize this equation as the classical harmonic oscillator solution, that of course you can also get from Newton’s second for a Hooke’s law F=-kq. Moreover, you can also be general, and from the prescription:


derive the Newton’s law from this energetic approach, since EL applied to it implies

    \[\dfrac{d}{dt}\left(\dfrac{\partial L}{\partial \dot{q}}\right)=\dfrac{dp}{dt}\]

if you define the generalized momentum as

    \[p\equiv \dfrac{\partial L}{\partial \dot{q}}\]

and, by the other hand, for the potential energy depending ONLY on the generalized coordinates you get

    \[\dfrac{\partial L}{\partial q}=-\dfrac{\partial U}{\partial q}\]

Note that the last term is only the prescription for a conservative force F=-\nabla U.


  1. What if U=U(q,\dot{q}) or U(q,\dot{q},t). Nothing changes, unless the potential energy depends explicitly on time, what renders issues to the problem. Energy could be not conserved. And generally it is not conserved, unless time is not present explicitly in the lagrangian.
  2. What about non-conservative forces? Well, there are some issues too. Several methods have been developed to account for in into the lagrangian method. E.g.: Rayleigh dissipative function, fractional calculus techniques and others.
  3. What if lagrangians act on fractional derivatives?
  4. Riewe’s mechanism using dynamics is remarkable.
  5. What about the field theory extension of the harmonic oscillator?

Furthermore, consider the canonical HO lagrangian

    \[L_{HO}\equiv L_1=\dfrac{1}{2}m\dot{q}^2-\dfrac{1}{2}kq^2\]

Next, consider the change of the lagrangian by a piece (extra langrangian)


A change or variation in the lagrangian of the form

    \[L\rightarrow L+\dfrac{d}{dt}f(q,\dot{q})\]

is generally called gauge invariance for L. The addition of the total time derivative to the lagrangian does not change the equations of motion (EOM). In a field theory, the addition of a divergence (total derivative with respect all the spacetime indices) does not change the EOM. Then,


This trick, however, has a caveat here, since I used a function f(q,\dot{q}). The lagrangian L_3 depends on the generalized accelerations and you will have to use a second order EL equations to do the job. The proof is simple:



    \[\boxed{L_3\equiv L_{HO}^{HO}=-\dfrac{mq\ddot{q}}{2}-\dfrac{1}{2}kq^2}\]

is the higher order harmonic oscillator (HOHO) lagragian! If you dislike the minus signs, you can even define L_4=-L_3 and to continue the next steps below. The second order (higher order) EL equations read as follows:

    \[E(L)\equiv \dfrac{\partial L}{\partial q}-\dfrac{d}{dt}\left(\dfrac{\partial L}{\partial \dot{q}}\right)+\dfrac{d^2}{dt^2}\left(\dfrac{\partial L}{\partial \ddot{q}}\right)=0\]

Now, you can recover the HO equation from this higher (second) order lagrangian. Proof:

    \[\dfrac{\partial L}{\partial q}=-\dfrac{m\ddot{q}}{2}-kq\]

    \[\dfrac{\partial L}{\partial \dot{q}}=0\rightarrow \dfrac{d}{dt}\left(\dfrac{\partial L}{\partial \dot{q}}\right)=0\]

    \[\dfrac{\partial L}{\partial \ddot{q}}=-\dfrac{mq}{2}\rightarrow \dfrac{d^2}{dt^2}\left(\dfrac{\partial L}{\partial \ddot{q}}\right)=-\dfrac{m\ddot{q}}{2}\]

And so, from E(L)=0, adding the above last equations, you also get in the second order formalism





Thus, the theories with L_1 and L_3, equivalently, L_{HO} and L_{HO}^{HO}, are completely equivalent at the level of the EOM, since they are related by a gauge transformation, or they differ by total time derivative. It is also related to (non) canonical transformations in phase space. But this will be treated in a future classical mechanics thread…

In conclusion:


is a higher (second) order lagrangian giving us the EOM of a single harmonic oscillator, and it is related to the canonical standard HO lagrangian via a gauge transformation (a time derivative of a function f(q,\dot{q})).

Remark (I): You can generalize this to field theory as well.

Remark (II): The theory of equivalent lagrangians and higher mechanics is subtle, but it exists.

Liked it? Take a second to support amarashiki on Patreon!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.