A.1 Clas­si­cal La­grangian me­chan­ics

La­grangian me­chan­ics is a way to sim­plify com­pli­cated dy­nam­i­cal prob­lems. This note gives a brief overview. For de­tails and prac­ti­cal ex­am­ples you will need to con­sult a good book on me­chan­ics.

A.1.1 In­tro­duc­tion

As a triv­ial ex­am­ple of how La­grangian me­chan­ics works, con­sider a sim­ple mol­e­c­u­lar dy­nam­ics sim­u­la­tion. As­sume that the forces on the par­ti­cles are given by a po­ten­tial that only de­pends on the po­si­tions of the par­ti­cles.

The dif­fer­ence be­tween the net ki­netic en­ergy and the net po­ten­tial en­ergy is called the “La­grangian.” For a sys­tem of par­ti­cles as con­sid­ered here it takes the form

{\cal L}= \sum_j {\textstyle\frac{1}{2}} m_j \vert\vec v_j\vert^2 - V({\skew0\vec r}_1,{\skew0\vec r}_2,\ldots)

where $j$ in­di­cates the par­ti­cle num­ber and $V$ the po­ten­tial of the at­trac­tions be­tween the par­ti­cles and any ex­ter­nal forces.

It is im­por­tant to note that in La­grangian dy­nam­ics, the La­grangian must math­e­mat­i­cally be treated as a func­tion of the ve­loc­i­ties and po­si­tions of the par­ti­cles. While for a given mo­tion, the po­si­tions and ve­loc­i­ties are in turn a func­tion of time, time de­riv­a­tives must be im­ple­mented through the chain rule, i.e. by means of to­tal de­riv­a­tives of the La­grangian.

The canon­i­cal mo­men­tum $p^{\rm {c}}_{j,i}$ of par­ti­cle $j$ in the $i$ di­rec­tion, (with $i$ $\vphantom0\raisebox{1.5pt}{$=$}$ 1, 2, or 3 for the $x$, $y$, or $z$ com­po­nents re­spec­tively), is de­fined as

p^{\rm {c}}_{j,i} \equiv \frac{\partial{\cal L}}{\partial v_{j,i}}

For the La­grangian above, this is sim­ply the nor­mal mo­men­tum $mv_{j,i}$ of the par­ti­cle in the $i$-​di­rec­tion.

The La­grangian equa­tions of mo­tion are

\frac{{\rm d}p^{\rm {c}}_{j,i}}{{\rm d}t} = \frac{\partial{\cal L}}{\partial r_{j,i}}

This is sim­ply New­ton’s sec­ond law in dis­guise: the left hand side is the time de­riv­a­tive of the lin­ear mo­men­tum of par­ti­cle $j$ in the $i$-​di­rec­tion, giv­ing mass times ac­cel­er­a­tion in that di­rec­tion; the right hand side is the mi­nus the spa­tial de­riv­a­tive of the po­ten­tial, which gives the force in the $i$ di­rec­tion on par­ti­cle $j$. Ob­vi­ously then, use of La­grangian dy­nam­ics does not help here.

A.1.2 Gen­er­al­ized co­or­di­nates

One place where La­grangian dy­nam­ics is very help­ful is for macro­scopic ob­jects. Con­sider for ex­am­ple the dy­nam­ics of a Fris­bee. No­body is go­ing to do a mol­e­c­u­lar dy­nam­ics com­pu­ta­tion of a Fris­bee. What you do is ap­prox­i­mate the thing as a solid body, (or more ac­cu­rately, a rigid body). The po­si­tion of every part of a solid body can be fully de­ter­mined us­ing only six pa­ra­me­ters, in­stead of the count­less po­si­tion co­or­di­nates of the in­di­vid­ual atoms. For ex­am­ple, know­ing the three po­si­tion co­or­di­nates of the cen­ter of grav­ity of the Fris­bee and three an­gles is enough to fully fix it. Or you could just choose three ref­er­ence points on the Fris­bee: giv­ing three po­si­tion co­or­di­nates for the first point, two for the sec­ond, and one for the third is an­other pos­si­ble way to fix its po­si­tion.

Such pa­ra­me­ters that fix a sys­tem are called “gen­er­al­ized co­or­di­nates.” The word gen­er­al­ized in­di­cates that they do not need to be Carte­sian co­or­di­nates; of­ten they are an­gles or dis­tances, or rel­a­tive co­or­di­nates or an­gles. The num­ber of gen­er­al­ized co­or­di­nates is called the num­ber of de­grees of free­dom. It varies with the sys­tem. A bunch of solid bod­ies mov­ing around freely will have six per solid body; but if there are link­ages be­tween them, like the bars in your car’s sus­pen­sion sys­tem, it re­duces the num­ber of de­grees of free­dom. A rigid wheel spin­ning around a fixed axis has only one de­gree of free­dom, and so does a solid pen­du­lum swing­ing around a fixed axis. At­tach a sec­ond pen­du­lum to its end, maybe not in the same plane, and the re­sult­ing com­pound pen­du­lum has two de­grees of free­dom.

If you try to de­scribe such sys­tems us­ing plain old New­ton­ian me­chan­ics, it can get ugly. For each solid body you can ap­ply that the sum of the forces must equal mass times ac­cel­er­a­tion of the cen­ter of grav­ity, and that the net mo­ment around the cen­ter of grav­ity must equal the rate of change of an­gu­lar mo­men­tum, which you then pre­sum­ably de­duce us­ing the prin­ci­pal axis sys­tem.

In­stead of mess­ing with all that com­plex vec­tor al­ge­bra, La­grangian dy­nam­ics al­lows you to deal with just a sin­gle scalar, the La­grangian. If you can merely fig­ure out the net ki­netic and po­ten­tial en­ergy of your sys­tem in terms of your gen­er­al­ized co­or­di­nates and their time de­riv­a­tives, you are in busi­ness.

If there are link­ages be­tween the mem­bers of the sys­tem, the ben­e­fits mag­nify. A brute-force New­ton­ian so­lu­tion of the three-di­men­sion­al com­pound pen­du­lum would in­volve six lin­ear mo­men­tum equa­tions and six an­gu­lar ones. Yet the thing has only two de­grees of free­dom; the an­gu­lar ori­en­ta­tions of the in­di­vid­ual pen­du­lums around their axes of ro­ta­tion. The rea­son that there are twelve equa­tions in the New­ton­ian ap­proach is that the sup­port forces and mo­ments ex­erted by the two axes add an­other 10 un­knowns. A La­grangian ap­proach al­lows you to just write two equa­tions for your two de­grees of free­dom; the sup­port forces do not ap­pear in the story. That pro­vides a great sim­pli­fi­ca­tion.

A.1.3 La­grangian equa­tions of mo­tion

This sec­tion de­scribes the La­grangian ap­proach to dy­nam­ics in gen­eral. As­sume that you have cho­sen suit­able gen­er­al­ized co­or­di­nates that fully de­ter­mine the state of your sys­tem. Call these gen­er­al­ized co­or­di­nates $q_1$, $q_2$, ...and their time de­riv­a­tives $\dot{q}_1$, $\dot{q}_2$, .... The num­ber of gen­er­al­ized co­or­di­nates $K$ is the num­ber of de­grees of free­dom in the sys­tem. A generic canon­i­cal co­or­di­nate will be in­di­cated as $q_k$.

Now find the ki­netic en­ergy $T$ and the po­ten­tial en­ergy $V$ of your sys­tem in terms of these gen­er­al­ized co­or­di­nates and their time de­riv­a­tives. The dif­fer­ence is the La­grangian:

\lefteqn{{\cal L}(q_1,q_2,\ldots,q_K,\dot q_1,\dot q_2,\ldots...
...,\dot q_1,\dot q_2,\ldots,\dot q_K,t)
- V(q_1,q_2,\ldots,q_K,t)

Note that the po­ten­tial en­ergy de­pends only on the po­si­tion co­or­di­nates of the sys­tem, but the ki­netic en­ergy also de­pends on how fast they change with time. Dy­nam­ics books give lots of help­ful for­mu­lae for the ki­netic en­ergy of the solid mem­bers of your sys­tem, and the po­ten­tial en­ergy of grav­ity and within springs.

The canon­i­cal mo­menta are de­fined as

p^{\rm {c}}_k \equiv \frac{\partial{\cal L}}{\partial \dot q_k} %
\end{displaymath} (A.1)

for each in­di­vid­ual gen­er­al­ized co­or­di­nate $q_k$. The equa­tions of mo­tion are
\frac{{\rm d}p^{\rm {c}}_k}{{\rm d}t} = \frac{\partial{\cal L}}{\partial q_k}
+ Q_k %
\end{displaymath} (A.2)

There is one such equa­tion for each gen­er­al­ized co­or­di­nate $q_k$, so there are ex­actly as many equa­tions as there are de­grees of free­dom. The equa­tions are sec­ond or­der in time, be­cause the canon­i­cal mo­menta in­volve first or­der time de­riv­a­tives of the $q_k$.

The $Q_k$ terms are called gen­er­al­ized forces, and are only needed if there are forces that can­not be mod­eled by the po­ten­tial $V$. That in­cludes any fric­tional forces that are not ig­nored. To find the gen­er­al­ized force $Q_k$ at a given time, imag­ine that the sys­tem is dis­placed slightly at that time by chang­ing the cor­re­spond­ing gen­er­al­ized co­or­di­nate $q_k$ by an in­fin­i­tes­i­mal amount $\delta{q}_k$. Since this dis­place­ment is imag­i­nary, it is called a vir­tual dis­place­ment. Dur­ing such a dis­place­ment, each force that is not mod­elled by $V$ pro­duces a small amount of “vir­tual work.” The net vir­tual work di­vided by $\delta{q}_k$ gives the gen­er­al­ized force $Q_k$. Note that fric­tion­less sup­ports nor­mally do not per­form work, be­cause there is no dis­place­ment in the di­rec­tion of the sup­port force. Also, fric­tion­less link­ages be­tween mem­bers do not per­form net work, since the forces be­tween the mem­bers are equal and op­po­site. Sim­i­larly, the in­ter­nal forces that keep a solid body rigid do not per­form work.

The bot­tom line is that nor­mally the $Q_k$ are zero if you ig­nore fric­tion. How­ever, any col­li­sions against rigid con­straints have to be mod­eled sep­a­rately, just like in nor­mal New­ton­ian me­chan­ics. For an in­fi­nitely rigid con­straint to ab­sorb the ki­netic en­ergy of an im­pact re­quires in­fi­nite force, and $Q_k$ would have to be an in­fi­nite spike if de­scribed nor­mally. Of course, you could in­stead con­sider de­scrib­ing the con­straint as some­what flex­i­ble, with a very high po­ten­tial en­ergy penalty for vi­o­lat­ing it. Then make sure to use an adap­tive time step in any nu­mer­i­cal in­te­gra­tion.

It may be noted that in rel­a­tivis­tic me­chan­ics, the La­grangian is not the dif­fer­ence be­tween po­ten­tial and ki­netic en­ergy. How­ever, the La­grangian equa­tions of mo­tion (A.1) and (A.2) still ap­ply.

The gen­eral con­cept that ap­plies both non­rel­a­tivis­ti­cally and rel­a­tivis­ti­cally is that of “ac­tion.” The ac­tion ${\cal S}$ is de­fined as the time in­te­gral of the La­grangian:

{\cal S}\equiv \int_{t_1}^{t_2} {\cal L}{\,\rm d}t
\end{displaymath} (A.3)

Here $t_1$ and $t_2$ are suit­ably cho­sen start­ing and end­ing times that en­close the time in­ter­val of in­ter­est. The ac­tion is un­changed by in­fin­i­tes­i­mal imag­i­nary dis­place­ments of the sys­tem. It turns out that that is all that is needed for the La­grangian equa­tions of mo­tion to ap­ply.

See {D.3.1} for a de­riva­tion of the above claims.

A.1.4 Hamil­ton­ian dy­nam­ics

For a sys­tem with $K$ gen­er­al­ized co­or­di­nates the La­grangian ap­proach pro­vides one equa­tion for each gen­er­al­ized co­or­di­nate $q_k$. These $K$ equa­tions in­volve sec­ond or­der time de­riv­a­tives of the $K$ un­known gen­er­al­ized co­or­di­nates $q_k$. How­ever, if you con­sider the time de­riv­a­tives $\dot{q}_k$ as $K$ ad­di­tional un­knowns, you get $K$ first or­der equa­tions for these $2K$ un­knowns. An ad­di­tional $K$ equa­tions are:

\qquad \frac{{\rm d}q_k}{{\rm d}t} = \dot q_k

These are no longer triv­ial be­cause they now give the time de­riv­a­tives of the first $K$ un­knowns in terms of the sec­ond $K$ of them. This trick is of­ten needed when us­ing canned soft­ware to in­te­grate the equa­tions, be­cause canned soft­ware typ­i­cally only does sys­tems of first or­der equa­tions.

How­ever, there is a much neater way to get $2K$ first or­der equa­tions in $2K$ un­knowns, and it is par­tic­u­larly close to con­cepts in quan­tum me­chan­ics. De­fine the “Hamil­ton­ian” as

H(q_1,q_2,\ldots,q_K,p^{\rm {c}}_1,p^{\rm {c}}_2,\ldots,p^{... L}(q_1,q_2,\ldots,q_K,\dot q_1,\dot q_2,\ldots,\dot q_K,t)
\end{displaymath} (A.4)

In the right hand side ex­pres­sion, you must rewrite all the time de­riv­a­tives $\dot{q}_k$ in terms of the canon­i­cal mo­menta

p^{\rm {c}}_k \equiv \frac{\partial {\cal L}}{\partial \dot q_k}

be­cause the Hamil­ton­ian must be a func­tion of the gen­er­al­ized co­or­di­nates and the canon­i­cal mo­menta only. (In case you are not able to read­ily solve for the $\dot{q}_k$ in terms of the $p^{\rm {c}}_k$, things could be­come messy. But in prin­ci­ple, the equa­tions to solve are lin­ear for given val­ues of the $q_k$.)

In terms of the Hamil­ton­ian, the equa­tions of mo­tion are

\frac{{\rm d}q_k}{{\rm d}t} = \frac{\partial H}{\partial p^...
...{c}}_k}{{\rm d}t} = - \frac{\partial H}{\partial q_k}
+ Q_k %
\end{displaymath} (A.5)

where the $Q_k$, if any, are the gen­er­al­ized forces as be­fore.

If the Hamil­ton­ian does not ex­plic­itly de­pend on time and the gen­er­al­ized forces are zero, these evo­lu­tion equa­tions im­ply that the Hamil­ton­ian does not change with time at all. For such sys­tems, the Hamil­ton­ian is the con­served to­tal en­ergy of the sys­tem. In par­tic­u­lar for a non­rel­a­tivis­tic sys­tem, the Hamil­ton­ian is the sum of the ki­netic and po­ten­tial en­er­gies, pro­vided that the po­si­tion of the sys­tem only de­pends on the gen­er­al­ized co­or­di­nates and not also ex­plic­itly on time.

See {D.3.2} for a de­riva­tion of the above claims.

A.1.5 Fields

The pre­vi­ous sub­sec­tions dis­cussed dis­crete me­chan­i­cal ob­jects like mol­e­cules, Fris­bees, and pen­du­lums. How­ever, the La­grangian and Hamil­ton­ian for­malisms can be gen­er­al­ized to fields like the elec­tro­mag­netic field. That is mainly im­por­tant for ad­vanced physics like quan­tum field the­o­ries; these are not re­ally cov­ered in this book. But since it does ap­pear in one ad­vanced ad­den­dum, {A.22}, this sub­sec­tion will sum­ma­rize the main points.

The sim­plest clas­si­cal field is the elec­tro­sta­tic po­ten­tial $\varphi$. How­ever, there may be more than one po­ten­tial in a sys­tem. For ex­am­ple, in elec­tro­dy­nam­ics there are also vec­tor po­ten­tials. So the generic po­ten­tial will be in­di­cated as $\varphi_\alpha$, where the in­dex $\alpha$ in­di­cates what par­tic­u­lar po­ten­tial it is. A sin­gle po­ten­tial $\varphi_\alpha$ is still char­ac­ter­ized by in­fi­nitely many vari­ables: there is a value of the po­ten­tial at each po­si­tion.

In ad­di­tion there may be dis­crete vari­ables. Elec­tro­mag­net­ics would be pretty bor­ing if you would not have some charged par­ti­cles around. A generic co­or­di­nate of such a par­ti­cle will be in­di­cated as $q_k$. For ex­am­ple, if there is just one charged par­ti­cle, $q_1$, $q_2$, and $q_3$ could rep­re­sent the $x$, $y$, and $z$ com­po­nents of the po­si­tion of the par­ti­cle. If there are more par­ti­cles, just keep in­creas­ing $k$.

Un­der the above con­di­tions, the La­grangian will in­volve an in­te­gral:

{\cal L}= \Lag_0 + \int \pounds {\,\rm d}^3{\skew0\vec r}

Here $\pounds $ is called the “La­grangian den­sity.” It is es­sen­tially a La­grangian per unit vol­ume. The in­te­gral is over all space.

The first part $\Lag_0$ is as be­fore. It will de­pend on the dis­crete vari­ables and their time de­riv­a­tives:

\Lag_0 = \Lag_0(\ldots; q_k,\dot{q}_k;\ldots)

The dot in­di­cates the time de­riv­a­tive of the vari­able.

The La­grangian den­sity $\pounds $ will de­pend on both the fields and the dis­crete co­or­di­nates:

\pounds = \pounds (\ldots;\varphi_\alpha,\varphi_\alpha\str...

Here the sub­scripts on the field in­di­cate par­tial de­riv­a­tives:

\varphi_\alpha\strut_t = \frac{\partial\varphi_\alpha}{\par...
...phi_\alpha\strut_z = \frac{\partial\varphi_\alpha}{\partial z}

In prin­ci­ple, there is no rea­son why the La­grangian could not con­tain higher or­der de­riv­a­tives, but for­tu­nately you do not see such things in quan­tum field the­o­ries.

This brings up one prac­ti­cal point. Con­sider a con­tri­bu­tion such as the po­ten­tial en­ergy of a par­ti­cle called ${\rm {P}}$ with charge $\bar{q}_{\rm {P}}$ in an elec­tro­sta­tic field $\varphi$. As­sum­ing that the par­ti­cle is a point charge, that po­ten­tial en­ergy is $\bar{q}_{\rm {P}}\varphi_{\rm {P}}$ where $\varphi_{\rm {P}}$ is the po­ten­tial eval­u­ated at the po­si­tion ${\skew0\vec r}_{\rm {P}}$ of the par­ti­cle. But po­ten­tials eval­u­ated at a point are prob­lem­atic. You would re­ally want the po­ten­tials to al­ways ap­pear in­side in­te­grals. To achieve that, you can as­sume that the par­ti­cle is not re­ally a point charge. That its charge is spread out just a lit­tle bit around the nom­i­nal po­si­tion ${\skew0\vec r}_{\rm {P}}$. In that case, the po­ten­tial en­ergy takes the form:

\int \bar{q}_{\rm {P}} \delta^3_\varepsilon({\skew0\vec r}-...
...}\approx \bar{q}_{\rm {P}} \varphi({\skew0\vec r}_{\rm {P}};t)

Here $\delta^3_\varepsilon({\skew0\vec r}-{\skew0\vec r}_{\rm {P}})$ is some cho­sen func­tion that is zero ex­cept within some small dis­tance $\varepsilon$ of ${\skew0\vec r}_{\rm {P}}$, and that in­te­grates to one. Be­cause this func­tion is zero ex­cept very close to ${\skew0\vec r}_p$, you can ap­prox­i­mate $\varphi({\skew0\vec r};t)$ by $\varphi({\skew0\vec r}_{\rm {P}};t)$ and then take it out of the in­te­gral. That gives the orig­i­nal ex­pres­sion for the po­ten­tial en­ergy. But the in­te­gral is eas­ier to use in the La­grangian. Its in­te­grand be­comes part of the La­grangian den­sity. And you can al­ways take the limit $\varepsilon\to0$ at the end of the day to get point charges.

The La­grangian equa­tions for the dis­crete pa­ra­me­ters are ex­actly the same as be­fore, but of course now the La­grangian in­cludes the in­te­gral, {D.3.3}:

\frac{{\rm d}}{{\rm d}t} \left(\frac{\partial \Lag_0}{\part...
...rac{\partial \pounds }{\partial q_k} {\,\rm d}^3{\skew0\vec r}
\end{displaymath} (A.6)

There is one such equa­tion for each dis­crete pa­ra­me­ter $q_k$, valid at any time.

The La­grangian equa­tions for the field are based on the La­grangian den­sity in­stead of the La­grangian it­self. That is why you re­ally want to have the terms in­volv­ing the field as in­te­grals. The equa­tions are

\frac{\partial}{\partial t}
\left(\frac{\partial\pounds }{...
= \frac{\partial\pounds }{\partial\varphi_\alpha}
\end{displaymath} (A.7)

There is one such equa­tion for each field $\varphi_\alpha$, valid at any po­si­tion and time.

The canon­i­cal mo­menta are now

p^{\rm {c}}_k \equiv \frac{\partial \Lag_0}{\partial \dot{q...
...\equiv \frac{\partial\pounds }{\partial\varphi_\alpha\strut_t}
\end{displaymath} (A.8)

Note that the field mo­men­tum $\pi^{\rm {c}}_\alpha$ is per unit vol­ume.

The Hamil­ton­ian is

H = \sum_k p^{\rm {c}}_k \dot{q}_k +
\sum_\alpha \int \pi^...
...ha \varphi_\alpha\strut_t {\,\rm d}^3{\skew0\vec r}
- {\cal L}\end{displaymath} (A.9)

The time de­riv­a­tives $\dot{q}_k$ and $\varphi_\alpha\strut_t$ must again be ex­pressed in terms of the cor­re­spond­ing canon­i­cal mo­menta.

Hamil­ton’s equa­tions for dis­crete vari­ables are as be­fore:

\frac{{\rm d}q_k}{{\rm d}t} = \frac{\partial H}{\partial p^...
...d}p^{\rm {c}}_k}{{\rm d}t} = - \frac{\partial H}{\partial q_k}
\end{displaymath} (A.10)

The equa­tions for the fields are a bit tricky. If there are no dis­crete vari­ables, there is no prob­lem. Then the Hamil­ton­ian can be writ­ten in terms of a Hamil­ton­ian den­sity $h$ as

H = \int h {\,\rm d}^3{\skew0\vec r}

In that case Hamil­ton’s equa­tions are

\frac{\partial\varphi_\alpha}{\partial t}
= \frac{\partial...
...\left(\frac{\partial h}{\partial\varphi_\alpha\strut_z}\right)

Un­for­tu­nately, if there are dis­crete pa­ra­me­ters, prod­ucts of in­te­grals will ap­pear. Then there is no Hamil­ton­ian den­sity. So the only thing you can do do is dif­fer­en­ti­ate the full Hamil­ton­ian $H$ in­stead of a Hamil­ton­ian den­sity $h$. At the end of every dif­fer­en­ti­a­tion, you will then need to drop an $\int$ and a ${\rm d}^3{\skew0\vec r}$. In par­tic­u­lar, dif­fer­en­ti­ate the Hamil­ton­ian $H$ un­til you have to start dif­fer­en­ti­at­ing in­side an in­te­gral, like, say,

\frac{\partial}{\partial\varphi_\alpha}\int{\pounds }{\,\rm d}^3{\skew0\vec r}

At that time, make the sub­sti­tu­tion

\frac{\partial}{\partial\varphi_\alpha}\int{\pounds }{\,\rm...
\frac{\partial\pounds }{\partial\varphi_\alpha}

This will pro­duce the right an­swer, al­though the left hand side above is math­e­mat­i­cally com­plete non­sense.

See {D.3.3} for a jus­ti­fi­ca­tion of this pro­ce­dure and the other claims in this sub­sec­tion.