Lecture Notes, Phy112, 2025-2026/II
1 Lagrangian dynamics : basics
We begin with a discussion on Lagrangian dynamics. First of all, note that the applications of this method goes
far beyond physics, to many areas of Biology, Economics and other varied subjects. So this should not be thought
of only as a method to simplify problem solving (although it does so in many cases). Rather, it opens up a deep
structure of dynamics without taking recourse to Newton’s laws. Let us recapitulate the basic features of the latter.
In Newtonian dynamics, we are given a system of particles, and we need to quantify the motion of all particles
that are under the action of forces. These forces can be internal in nature or external. Consider for example a disc
rolling down an inclined plane. If you consider the disc + plane to be your system, then the internal forces are the
normal and frictional forces and the external force is gravity. So the idea in Newtonian mechanics is to write all
forces, use Newton’s second and third laws to obtain equations of motion and then integrate them under suitable
boundary conditions to get the solutions which can be position as a function of time, or maybe a trajectory.
In Lagrangian mechanics we start from a different viewpoint. For a moment totally forget about forces. Suppose
we are given that a system has dynamics such that it goes from point A to point B. These points are fixed in the
sense that their positions and time are fixed. Let us denote the position by q, and time by t, so that our system
goes from qA , tA to qB , tB with all the endpoint values fixed, see Figure 1. Now, the main idea (called Hamilton’s
Figure 1: Some different paths between two fixed points A and B.
principle) is the following. Suppose we construct a quantity called the Lagrangian, which is given by the difference
between the kinetic energy T and the potential energy V of the system. If there is only one coordinate q, then we
have the Lagrangian
L = T (q(t), q̇(t)) − V (q(t)) . (1)
The idea is that once we write the Lagrangian, we can form the action (do not confuse with action/reaction in
Newton’s laws, this is just a name) :
Z B
S= L(q(t), q̇(t))dt . (2)
A
This tells you that once you have some q(t), from which you can calculate q̇, then you can put this in the La-
grangian, make it entirely a function of t, and then the action S gives you a number, upon integration. S is
then called a functional. It is a mapping from the space of functions q(t) to the space of real numbers. Remember
that an ordinary function is a mapping from the space of numbers to the space of numbers. This is a different object.
Now once you have computed the number S, you can think of computing this number for some nearby paths
shown in Figure 1. It turns out that the action is either a maximum or a minimum or a saddle point for the actual
path (dashed line) compared to neighbouring paths (solid lines). The mathematical way to say this is that S is an
extremum for the actual path compared to different neighbouring paths, that is the actual path must satisfy
δS = 0 (3)
This is historically called as the principle of least action in physics. But remember that the actual paths extremises
the action and does not necessarily minimise it. Well now how do you go about actually finding this actual path
1
? Well, start from S and simply extremise it. This should give you the required correct path. Remember how you
extremise a function. That is given from a Taylor series expansion. Say we have a function of two variables, then
∂f ∂f
f (x0 + δx, y0 + δy) = f (x0 , y0 ) + δx + δy + O((δx)2 , (δy)2 , δxδy)
∂x (x0 ,y0 ) ∂y (x0 ,y0 )
∂f ∂f
=⇒ δf = f (x0 + δx, y0 + δy) − f (x0 , y0 ) = δx + δy . (4)
∂x (x0 ,y0 ) ∂y (x0 ,y0 )
An extremum of f is reached when δf = 0. In the same sense, let us try to extremise the action, but this time
we are varying the paths, i.e., our variation is taking one path (the dashed line in Figure 1) to neighbouring paths
(solid lines in Figure 1). What you operationally do is the following : say we have the actual path (the dashed line).
Draw a slightly distorted path near it (any of the solid lines). The difference between the coordinates of the actual
and the displaced paths will give you δq at all points, which is a function of time and we write this as δq(t).
Z B Z B
δS = δ L(q(t), q̇(t))dt = δ [L(q(t), q̇(t))] dt
A A
Z B
∂L ∂L
= dt δq + δ q̇
A ∂q ∂ q̇
Z B Z B
∂L ∂L d ∂L d ∂L d ∂L
= dt δq + (δq) = dt δq + δq − δq . (5)
A ∂q ∂ q̇ dt A ∂q dt ∂ q̇ dt ∂ q̇
| {z }
Term 2
Now look carefully at Term 2. This is
Z B B
d ∂L ∂L
dt δq = δq =0, (6)
A dt ∂ q̇ ∂ q̇ A
since the endpoints are fixed, so δq A
= δq B
= 0. So now we set δS = 0 and find that this means
Z B
∂L d ∂L
− δqdt = 0 . (7)
A ∂q dt ∂ q̇
Now, δq is arbitrary, i.e., you can choose any δq to go to any neighbouring path. And of course q and q̇ are arbitrary
functions of time. So if δS = 0 for all neighbouring paths, then you must have the integrand to vanish and we get
the Euler-Lagrange equation
d ∂L ∂L
= . (8)
dt ∂ q̇ ∂q
Let me pause and justify the various steps in Equation (5). In step one, I have taken the δ action inside the
integral. How is this justified ? Well what we are actually doing is to vary the path and not time. So it is okay
to take the variation inside the integral which is over time. This argument is okay to begin with, but if you want
something more mathematically rigorous, I will give it next. You can skip the blue coloured part below if you are
not interested in the rigour.
Let us consider the actual path q(t) and a nearby path
q(α, t) = q(t) + αξ(t) (9)
where ξ(t) is any smooth function satisfying ξ(tA ) = ξ(tB ) = 0, and α is a continuous parameter varying which takes
you to nearby paths, with α = 0 being the actual path. So then when I am varying paths, S becomes a function of
α since time is integrated out, and I am actually looking at
Z B
dS d
δS = δα = δα L(q(α, t), q̇(α, t)dt . (10)
dα α=0 dα A α=0
2
Now we apply Leibnitz integral theorem which tells you that if the endpoints of integration is fixed, then we have
Z b Z b
d ∂f (x, t)
f (x, t)dt = dt . (11)
dx a a ∂x
Apply this to Equation (10) and since δα is not a function of time we can put it inside the integral to obtain
Z B Z B
∂L(q(α, t), q̇(α, t))
δS = δα dt ≡ δLdt . (12)
A ∂α α=0 A
This is why we can put the δ inside the integral in step one of Equation (5). You can now follow this argument.
Expand the first relation in Equation (12) to get
Z B
∂L(q(α, t), q̇(α, t))
∂q(α, t) ∂L(q(α, t), q̇(α, t)) ∂ q̇(α, t)
δS = δα + δα dt
A ∂q(α, t) ∂α ∂ q̇(α, t) ∂α α=0
Z B
∂L(q(α, t), q̇(α, t)) ∂L(q(α, t), q̇(α, t))
= δq(α, t) + δ q̇(α, t) dt . (13)
A ∂q(α, t) ∂ q̇(α, t) α=0
This is the second step of Equation (5).
d
Next, in the last line of Equation (5), I have written δ q̇ = dt (δq). Again this can be simply understood by seeing
that δ q̇ is a path variation of a point q at a given instant of time, so it is okay to take the time derivative outside.
d
That is, the dt is like moving along a curve and δ is like moving between different curves, so it does not matter if
we interchange their effects at a given q. But if you would like a more mathematical argument, there is one below
(again you can skip the blue colored part below if you want).
Let us recall Equation (9)
˙ ∂ q̇(α, t) ˙
q(α, t) = q(t) + αξ(t) =⇒ q̇(α, t) = q̇(t) + αξ(t) =⇒ δ q̇(α, t) = δα = ξ(t)δα . (14)
∂α
On the other hands, between neighbouring paths, we have
∂q(α, t) d ˙
δq(α, t) = δα = ξ(t)δα =⇒ δq(α, t) = ξ(t)δα . (15)
∂α α=0 dt
Hence we have shown that
d
δ q̇ = (δq) . (16)
dt
Okay so now that we have obtained the fact that the original path of our system will necessarily follow the Euler
Lagrange (EL) equation of Equation (8). How does this connect to Newton’s laws ? Let us take the elementary
example of a particle of mass M moving in a one dimensional potential V (x). Use T = 21 M ẋ2 to write the Lagrangian
L = 21 M ẋ2 − V (x). So the EL equation gives you M ẍ = − dV
dx .
How do you write the EL equation if you have more than one coordinate ? The answer is simple, you vary all
the coordinates independently. The EL equation will hold for any coordinate and denoting the coordinates by qi ,
we get the general EL equation valid for any number of coordinates as
d ∂L ∂L
= . (17)
dt ∂ q˙i ∂qi
So what are these qi s ? Should we always think of them as Cartesian or spherical polar or coordinate systems like
that ? The answer is no and that is precisely the power of Lagrangian mechanics.
In Lagrangian dynamics qi represents a minimal set of independent variables that can
uniquely specify the system. These are called generalized coordinates (representing the sys-
tem’s degrees of freedom) and need not correspond to any specific coordinate system.
3
Figure 2: A spring pendulum in the vertical plane
2 Example 1 : The spring pendulum
As a specific example, let us consider a pendulum whose bob of mass M is attached to a massless spring with spring
constant k and unstreteched length L, as shown in Figure 2. We will assume that the motion takes place in the
vertical plane only. Let the angle between the string and the vertical be θ and the extension of the spring be x.
This system has been discussed as a worked example in David Morin’s book Chapter 6, but I will go a little further.
Here, the generalised coordinates (the qi in Equation (17)) are θ and x because these specify the system completely.
First let us write the Lagrangian. The kinetic and potential energies and the Lagrangian are
1 1 1
T = M ẋ2 + M (L + x)2 θ̇2 , V = −M g(L + x) cos θ + kx2
2 2 2
1 1 1 2
L = M ẋ2 + 2 2
M (L + x) θ̇ + M g(L + x) cos θ − kx . (18)
2 2 2
This gives rise to two EL equations, one for x and the other for θ. These are :
M ẍ = M (L + x)θ̇2 − kx + M g cos θ ,
M (L + x)θ̈ = −2M ẋθ̇ − M g sin θ (19)
These are non-linear equations. If you want to solve them without any approximation, you need to apply numerical
methods. I have generated the full solution of this system and some others by the software Mathematica. The
motion which can be visualised by clicking on this link. In this .mp4 file, the initial conditions that I have chosen
at time t = 0 are :
x = 0.2 , ẋ = 0 , θ = 0.01c , θ̇ = 0 (20)
You can see that the trajectory is “chaotic,” it does not follow a simple pattern.
If you apply a small angle approximation, then what happens ? We can address this directly from the EL
equations, but first we will need to define the equilibrium appropriately. For that, in the EL equation, set ẋ = θ̇ =
θ = 0, so that we obtain xeq = Mkg as expected. This means the new effective length of the pendulum at rest is
Leq = L + xeq = L + Mkg . Now we will assume that the system fluctuates slightly around this resting state. Let
the radial stretch be x(t) = xeq + ξ(t), where ξ(t) is a small displacement. Therefore, the acceleration is ẍ = ξ. ¨ We
also assume the angle θ(t) is small. If we apply the small-angle approximations cos θ = 11 and sin θ = θ and further
discard any non-linear terms (products of infinitesimally small quantities like θ̇2 , η θ̈, or η̇ θ̇), then the system splits
into two independent simple harmonic oscillators. The radial equation becomes :
k
M η̈ = −kη =⇒ η̈ +
η=0
M
q
k
This represents simple harmonic motion with frequency ωr = M . Further, the angular equation is now :
g
(L + xeq )θ̈ + gθ = 0 =⇒ Leq θ̈ + gθ = 0 =⇒ θ̈ + θ=0
Leq
4
q
g
This represents simple harmonic motion with a swinging frequency of ωθ = Leq .
As a further application, let us say that we have a motor that is making the pendulum rod go around with a
constant angular speed θ̇ = Ω. Can we find the solution ? Well first let us look at the x equation in Equation (19),
which is now
M ẍ = M (L + x)Ω2 − kx + M g cos θ =⇒ M ẍ + k − M Ω2 x = M LΩ2 + M g cos θ
(21)
k
Dividing by the mass M and defining the natural frequency of the unforced spring as ω02 = M, we can rearrange
the terms into a linear, second-order, inhomogeneous differential equation:
ẍ + (ω02 − Ω2 )x = LΩ2 + g cos(Ωt) (22)
To find the steady-state motion, we assume a particular solution of the form xp (t) = C +D cos(Ωt). Substituting
this into the differential equation and equating coefficients yields the constant centrifugal stretch and the oscillating
gravity-driven stretch:
LΩ2 g
C= 2 2
, D= 2 (23)
ω0 − Ω ω0 − 2Ω2
Thus, the particular solution is:
LΩ2 g
xp (t) = + cos(Ωt) (24)
ω02− Ω2 ω02 − 2Ω2
To account for the system’s natural transient oscillations, we solve the homogeneous equation ẍh +(ω02 −Ω2 )xh =
0. Assuming
p a stiff spring where ω0 > Ω, this acts as a simple harmonic oscillator with an effective frequency
ωeff = ω02 − Ω2 , yielding the homogeneous solution:
q q
xh (t) = A cos 2 2
ω0 − Ω t + B sin 2 2
ω0 − Ω t (25)
By the principle of superposition, the complete physical solution x(t) = xh (t) + xp (t) is:
LΩ2
q q
2 2 2 2
g
x(t) = A cos ω0 − Ω t + B sin ω0 − Ω t + 2 2
+ 2 cos(Ωt) (26)
ω0 − Ω ω0 − 2Ω2
where the constants A and B are determined by the initial conditions of the system, x(0) and ẋ(0). Note the two
ω0
“resonances” at Ω = √ 2
and Ω = ω0 . In both cases, it looks like x → ∞. However far before this happens, Hooke’s
law will cease to be valid and these are mathematical artefacts which probably is not possible in practise. The
solution in Equation (26), with some particular initial conditions is animated at this link. The initial conditions are
M = 2, L = 10, k = 5, Ω = 0.5 so that ωeff = 1.5. You see the nice pattern as ωeff /Ω = 3 (an integer) which means
that each time the bob comes back to its original position, it has oscillated thrice due to the spring.
3 Example 2 : Gravitating spring-mass system
Figure 3: Bob attached to mass in the horizontal plane.
Now we come to the next problem. Say we have two masses M ≫ m attached by a massless rod. There is a
massless spring of spring constant k and unstretched length r0 joining M and m. The whole system is in outer
space and gravity acts via Newton’s law of gravitation. No other forces act on the masses. Assume that the heavy
mass M is fixed in position. The lighter mass m is given a small push. What is the resulting dynamics ?
If the spring and rod were not there, this is your classic central force problem. In this case, is the force central
? The answer is yes, and that is because I have taken the rod to be massless. At first sight, it might seem to you
that in order to move the mass m sideways, the rod must exert some “sideways” force on it. But note that in that
5
case, the mass will also exert back a sideways force, due to which there will be an infinite angular acceleration of
the rod, resulting in unbalanced torques. To avoid this, there cannot be a sideways force on the mass m. Hence the
forces are due to only the spring and gravity, and is central. Let us go ahead and solve this system using Lagrangian
methods.
We will assume that the motion is planar as with all central forces, and use plane polar coordinates (r, θ). The
Lagrangian is
1 2 2 2 1 2 GM m
L = m(ṙ + r θ̇ ) − k(r − r0 ) − . (27)
2 2 r
Applying the EL equation for θ:
d ∂L ∂L d
− = 0 =⇒ (mr2 θ̇) = 0 . (28)
dt ∂ θ̇ ∂θ dt
This yields the conservation of angular momentum, l = mr2 θ̇, as you would expect for a central force.
Next, the EL equation for the radial coordinate r gives :
d ∂L ∂L
− =0, (29)
dt ∂ ṙ ∂r
GM m
mr̈ − mrθ̇2 + k(r − r0 ) − =0. (30)
r2
l
Substituting θ̇ = mr2
, we obtain the radial equation of motion in terms of the effective potential :
l2 GM m dVeff
mr̈ = − k(r − r0 ) − =− , (31)
mr3 r2 dr
where the effective potential is
l2 1 GM m
Veff (r) = 2
+ k(r − r0 )2 − . (32)
2mr 2 r
Let us look first at circular orbits. For this, we first find the equilibrium radius re for a steady circular orbit by
setting r̈ = 0:
′ l2 GM m
Veff (re ) = − 3 + k(re − r0 ) + =0. (33)
mre re2
What is the frequency of small oscillation if I perturb this slightly in the radial direction ? We introduce a small
radial displacement ξ(t) such that r(t) = re + ξ(t). Expanding the effective potential around re to second order in
ξ:
′ 1 ′′
Veff (r) ≈ Veff (re ) + Veff (re )ξ + Veff (re )ξ 2 . (34)
2
′ (r ) = 0, the equation of motion for the perturbation x(t) becomes that of a simple harmonic oscillator:
Since Veff e
′′
mξ¨ ≈ −Veff (re )ξ . (35)
Evaluating the second derivative of the effective potential at re :
′′ 3l2 2GM m
Veff (re ) = 4
+k− . (36)
mre re3
l2 GM m
Using the equilibrium condition, we can substitute mre3
= k(re − r0 ) + re2
into the first term:
′′ 3 GM m 2GM m
Veff (re )
= k(re − r0 ) + 2
+k− ,
re re re3
′′ 3kr0 GM m
=⇒ Veff (re ) = 4k − + (37)
re re3
6
q ′′ (r )
Veff e
Thus, the frequency of small radial oscillations, ωr = m , is given by:
k 3r0 GM
ωr2 = 4− + (38)
m re re3
Wait – shouldn’t this frequency go to zero if we switch off gravity, i.e. set G = 0 ? Not really, because even without
gravity, rotation itself produces a centrifugal barrier if you look at Equation (32). In order to recover the pure
spring case you must necessarily stop the rotation (check this).
What about the general motion ? Well you can solve it just like you did for central forces. An animation setting
G = 1, with initial conditions at t = 0 given by r = 5, ṙ = 1, θ = 0, θ̇ = 1.2 can be viewed by clicking on this link.
You might ask, since the force is central, and the components are the 1/r and r2 forces, should the orbits not be
closed by Bertrand’s theorem ? The answer is no. You will get closed orbits for purely 1/r or purely r2 potentials,
but a combination does not imply that Bertrand’s theorem will hold. If you look at the animation carefully, you
will see the emergence of a forbidden circle. That is precisely what the centrifugal barrier does.