What’s the action of a simple harmonic oscillator? And how does this change depending upon the path? Some mates of mine and I worked through this recently. This is my write-up of that calculation.
While discussing special relativity recently, some friends of mine and I realised that we’d not understood the concept of action. It seems that this isn’t a well-understood concept, at least not at an intuitive level: it “just works” and most people seem happy with that. As mentioned in a Veritasium video a while ago, Euler and Lagrange gave the concept of action a firm mathematical foundation. The idea that action is minimised is known as the principle of least action.
To understand this topic better (or at least, try to), we decided to consider a simple harmonic oscillator as a toy example. Since we know the solution, we could then calculate the action for the path matching the known solution and, as a comparison, the path of a linear ramp. The idea here being that we’d find the action to be minimised over an oscillatory path and that a path differing from that would give a non-minimal action. Thus, we could develop a better intuition for the principle of least action and hence for why the Lagrangian formalism works the way it does.
Let’s look at how to calculate the action for a simple harmonic oscillator.
Setting the stage
Consider a simple harmonic oscillator (SHO) such as a mass on a spring. We wish to calculate the action for a quarter oscillation of this system to try and convince ourselves that the standard solution for the equations of motion of a SHO (in a simplified form) gives the minimal (and hence optimal) action. We will later compare this to an alternative motion with the same boundary conditions1–but following a different path between them–to see that the standard solution minimises the action. We will also show that the general solution for the action of a SHO reduces to the same value as our simplified form when considering these boundary conditions.
with
q
and
q˙
being the generalised positions and velocities of the objects in motion, and where
t
is time. The values
t1
and
t2
denote the start and end points of the interval over which we are measuring the action. The quantity
L
is the Lagrangian, which is defined by
L=T−V,
with
T
being the kinetic energy and
V
being the potential energy.
We simplify the situation by considering only motion in the
x
-direction. Hence,
q
and
q˙
reduce to
x
and
x˙
, respectively.
The kinetic energy is written in its familiar form:
T=21mv2
which, given we only consider motion in the
x
-direction, we write as:
T=21mx˙2
For motion under the influence of a conservative force,2 the potential energy is the negative of the integral of all forces in the system, i.e.
V=−∫Fdx,
where in this case we only consider forces acting in the
x
-direction. To find the potential energy of a mass on a spring, we use Hooke’s Law for the force:
F=−kx
and thus integrate over
x
. Hence we have
V=−∫Fdx
=∫kxdx
=21kx2.
Combining (4) and (9) we write the Lagrangian like so:
L=21mx˙2−21kx2.
The action is therefore
S=∫t1t2[21mx˙2−21kx2]dt.
With the general form for the action of a simple harmonic oscillator in hand, we can consider the action over different paths of motion.
Action for sinusoidal motion
For the mass-on-a-spring example we’re considering here, we choose the situation where the mass has its maximum speed (and hence maximum kinetic energy) at
t1=0
corresponding to the position
x(t1)=0
. The endpoint, at
t2
, we choose to be where the mass has maximum amplitude and hence maximum potential energy. In other words, the final position is
x(t2)=A
, where
A
is the amplitude of oscillation.
We can visualise this situation like so:
The interval over which we wish to calculate the action is thus a quarter oscillation of the SHO.
where
x(t)
is the mass’ position along the
x
-axis at time
t
,
A
is the amplitude,
ω
is the angular velocity of the oscillation and
ϕ
is the phase offset. In our situation, we’ve chosen the boundary conditions such that the phase offset can be set to zero; hence, we now have this reduced form of the equation describing the motion:
x(t)=Asin(ωt).
Differentiating this with respect to time, we obtain a relation for the velocity
x˙(t)=ωAcos(ωt).
With this information in hand, we’re now able to write the action (Equation 11) explicitly in terms of
t
S=∫t1t2[21mω2A2cos2(ωt)−21kA2sin2(ωt)]dt.
This now makes it possible to perform the integral. Before we can do that, however, we need to work out what the limits of integration are.
The boundary conditions
x(t1)=0and
x(t2)=A,
imply that the limits of integration become
t1=0and
t2=2ωπ.
The squared sine and cosine terms in (15) make performing the integral difficult. We can simplify things by using the trigonometric double-angle identities:
cos2θ=21+cos(2θ)and
sin2θ=21−cos(2θ).
Therefore, we can replace the squared sine and cosine expressions with simpler expressions only in terms of cosine. The integral calculating the action thus becomes:
Let’s now focus on only the first term in (22) and perform the integration. We begin with this expression:
S1=∫t1t2[21mω2A221+cos(2ωt)]dt,
where
S1
is the integral of the first term in (22).
We collect constants outside the integral to get:
S1=41mω2A2∫t1t21+cos(2ωt)dt.
Performing the integration, we get:
S1=41mω2A2[t+2ω1sin(2ωt)]t1t2
=41mω2A2[t+2ω1sin(2ωt)]02ωπ.
Evaluating this at the integration limits, we have:
S1=41mω2A2[t+2ω1sin(2ωt)]02ωπ
=41mω2A2[2ωπ+2ω1sin(2ω2ωπ)−0−0]
=41mω2A2[2ωπ+2ω1sin(π)]
=81πmωA2.
Focusing now on only the second term in (22), we have this expression:
S2=∫t1t2[21kA221−cos(2ωt)]dt,
where
S2
is the integral of the second term in (22).
Again, collecting constants in front of the integral, we have:
S2=41kA2∫t1t21−cos(2ωt)dt.
Integrating over
t
, we obtain this expression
S2=41kA2[t−2ω1sin(2ωt)]t1t2
=41kA2[t−2ω1sin(2ωt)]02ωπ.
Evaluating the integration limits, we get:
S2=41kA2[t−2ω1sin(2ωt)]02ωπ
=41kA2[2ωπ−2ω1sin(2ω2ωπ)−0−0]
=41kA2[2ωπ−2ω1sin(π)]
=81ωπkA2.
Combining Equations (30) and (38), we can write the equation for the action specified in (22) as:
S=81πmωA2−81ωπkA2,
which simplifies to
S=81πA2[mω−ωk].
From the solution of the differential equation describing simple harmonic oscillation, we know that
ω
can be written in terms of the spring constant
k
and the object’s mass
m
, i.e.:
ω=mk.
Substituting this value into (40), we get:
S=81πA2[mω−ωk]
=81πA2[mmk−kkm]
=81πA2[mm2k−kmk2]
=81πA2[mk−mk]
=0.
Thus, we find that the action for a simple harmonic oscillator for the boundary conditions
x(0)=0and
x(π/2ω)=A
is equal to zero. This result implies that the action is minimised over the path described by the equations of motion of a simple harmonic oscillator.
where
xa
and
xb
are the start and end points of the path, with time at
xa
being at
t=0
and the time at
xb
being
t=T
.3
Inserting the boundary conditions in our calculation from above, we have the correspondence:
x(0)=xa=0and
x(T)=xb=x(π/2ω)=A.
Therefore, we can write the general solution (49) as
S=2sin(ω2ωπ)mω[(A2+0)cos(ω2ωπ)−2A⋅0]
=2sin(2π)mω[A2cos(2π)]
=2⋅1mω[A2⋅0]
=2mω⋅0
=0.
We can see that–for the boundary conditions considered here–the general solution for the action reduces to the same result as that given by our simplified SHO solution in (13).
We’ve now convinced ourselves that the action for the simple harmonic oscillator seems to be minimised over the path given by the standard solution. What happens if we choose another path? What effect does that have on the action? Let’s look into this now.
A different path
Consider a situation other than simple sinusoidal motion. For instance, a linear ramp from zero amplitude up to maximum amplitude, progressing over the same time interval. The mass now moves with constant velocity from the beginning (
x(t=0)=0
) to the end (
x(t=π/2ω)=A
). What is the action in this situation? If the action for the simple harmonic oscillator solution is
0
(and hence minimal), then we expect this alternate path to give a larger action.
Let’s calculate everything and see. The main point about considering such a situation is that the system now takes a different path between the two boundary conditions. Whether or not the motion itself is 100% physical is irrelevant for the calculation. The goal in performing this calculation is to support our intuition about the action being minimised in the optimum situation.
As before, we write the Lagrangian like so:
L=T−V
with
T=21mv2=21mx˙2and
V=21kx2.
Because the mass moves between the start and end points with constant velocity–and we want the equations of motion to match these boundary conditions–we write the position and velocity of the mass over time as:
x(t)=t2At=π2Aωtand
x˙(t)=t2A=π2Aω(i.e. constant velocity).
The path that the mass takes can be visualised like so:
With this information, we can write the equation for the action
Collecting constants in front of the integral sign simplifies the situation somewhat:
S=π22A2ω2∫02ωπm−kt2dt.
Performing the integration, we have:
S=π22A2ω2[mt−31kt3]02ωπ
=π22A2ω2[m2ωπ−31k8ω3π3−0−0]
=πA2ω[m−31k4ω2π2]
=πA2ω[m−121kω2π2].
We remember that
ω=mk.
Although this equation follows from the sinusoidal result we derived above, we still need to use it in the linear ramp case due to our boundary conditions. This is in particular due to the expression for
t2
(Equation (19)), which is defined in terms of
ω
.
Substituting the expression for
ω
from (68) into (67), we get:
S=πA2ω[m−121kω2π2]
=πA2mk[m−121kπ2km]
=πA2mkm[1−12π2]
=πA2km[1−12π2].
Since
[1−12π2]
is greater than zero (and hence greater than the action calculated in the sinusoidal case), we can conclude that this motion is not optimal. Thus, the simple harmonic oscillation path gives the best result because it minimises the action.
In other words, it worked! We confirmed our premise from the beginning. 🎉
If you want a deeper understanding, you have to put in the work
Going through this process really helped my understanding. For instance, when I first watched the Veritasium video about action, I thought “That’s interesting”, but nothing much more. After having done the calculation above myself, I re-watched the video and was like “Oh, that’s what they were talking about!”.
Going over the material after someone has presented it to you consolidates your knowledge of the topic. Who would’ve thought? 😉
The boundary conditions must be the same when comparing the actions of two separate paths. I.e. the start and end points in space need to be the same, and the start and end times need to be the same. ↩
In other words, the work done in taking a particle between two points in space is independent of the path taken. ↩
Note that
T
here does not represent the kinetic energy; it represents the time at the end of the path between
xa
and
xb
. ↩
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)