You are on page 1of 5

The Simple Harmonic Oscillator

Robert Stanescu

In classical mechanics, a harmonic oscillator is a system that, when displaced from its
equilibrium position, experiences a restoring force F~ proportional to the displacement x:
F~ = −k~x, where k is a positive constant.
If F~ is the only force acting on the system, the system is called a simple harmonic
oscillator, and it undergoes simple harmonic motion: sinusoidal oscillations about the equi-
librium point, with a constant amplitude and a constant frequency (which does not depend
on the amplitude).

We begin by analyzing the motion of an object of mass m attached to an elastic spring


of spring constant k, on a frictionless surface.

O x

~a
k F~e
O m

Writing the second principle for the given system we get:

m · ~a = F~e

Projecting this on the x axis:


m · a = −Fe
Here, Fe = k · x, where x is the displacement of the spring from its equilibrium position
2
and ~a = ddt2x , since ~a is pointing in the positive direction of the x axis. Therefore,

d2 x
m· = −k · x
dt2
d2 x k
2
=− ·x (1)
dt m

1
We can see that equation (1) is a second order homogenous differential equation that we
will solve accordingly.
The general solution for a homogenous differential equation is x = A · eα·t .

x = A · eα·t
dx
= A · α · eα·t (2)
dt
d2 x
2
= A · α2 · eα·t
dt
Introducing the results from (2) in (1):

k
A · α2 · 
eα·t
= − eα·t
· A · (3)
m
k
From (3) we get α2 = − m . The solutions for this are:
r
k
α1 = +i
rm (4)
k
α2 = −i
m
We rewrite (4) as:

α1 = +iω
(5)
α2 = −iω
q
k
,where ω = m .
Thus, the solution for (1) is:

x(t) = A1 · eα1 ·t + A2 · eα2 ·t (6)

Here A1 and A2 are constants determined by the initial conditions of the system.
Rewriting (6) using (5), we get:

x(t) = A1 · e+iωt + A2 · e−iωt (7)

2
We can simplify this further by rewriting the exponential functions using Euler’s formula,
ix
e = cos(x) + i sin(x). We then get:

x(t) = A1 · [cos(ωt) + i · sin(ωt)] + A2 · [cos(ωt) − i · sin(ωt)]


= (A1 + A2 ) · cos(ωt) + i · sin(ωt) · (A1 − A2 )
 
A1 − A2 A1 − A2
= (A1 + A2 ) · cos(ωt) + i · · sin(ωt) , tan φ ≡ i ·
A1 + A2 A1 + A2
= (A1 + A2 ) · (cos(ωt) + tan φ · sin(ωt))
A1 + A2
= · (cos(ωt) · cos φ + sin φ · sin(ωt))
cos φ
A1 + A2 A1 + A2
= · cos(ωt − φ), cos φ = p
cos φ (A1 + A2 )2 − (A1 − A2 )2
p
= (A1 + A2 )2 − (A1 − A2 )2 · cos(ωt − φ)
q
= A21 + 2A1 A2 + A22 − A21 + 2A1 A2 − A22 · cos(ωt − φ)
p
= 2 A1 A2 · cos(ωt − φ)
√ √
Since A1 and A2 are constants, we can rewrite 2 A1 A2 as A, where A = 2 A1 A2 is
another constant. Moreover, φ is also a constant, which we can replace with ϕ = −φ.
Therefore, our final result is given by:

x(t) = A · cos(ωt + ϕ) (8)

We could replace A1 , A2 and φ with other constants since they are all determined by the
initial conditions of the system so the result would have√been the same, it is just simpler and
nicer to write x(t) = A · cos(ωt + ϕ) instead of x(t) = 2 A1 A2 · cos(ωt − φ). On top of that,
we can also write ϕ − π2 instead of ϕ and the solution would become x(t) = A · sin(ωt + ϕ).
The result is the same either way, it is just a matter of preference.

In conclusion, the solution for a second order homogeneous differential equation of the form

d2 x
2
= −ω 2 · x (9)
dt
is given by:
x(t) = A · sin(ωt + ϕ) (10)
We can see that this holds for any second order homogeneous differential equation of that
form and is not specific to an object attached to a spring sliding on a frictionless table.

In conclusion, any time you see a differential equation with the same form as (9) it will
imply the harmonic oscillations of x and the solution will be given by equation (10).

3
Example
Taking the example given at the beginning and given a set of initial conditions for the system
we can plot the value of the coordinate x of the object against time.

x(t) = A · sin(ωt + ϕ)
dx
v(t) = = Aω · cos(ωt + ϕ)
dt
d2 x
a(t) = 2 = −Aω 2 · sin(ωt + ϕ)
dt

Initial conditions: at t0 = 0, the displacement of the spring is x(0) = xmax and the
speed of the object is v(0) = 0.

x(0) = xmax = A · sin ϕ


 
dx
v(0) = = Aω · cos ϕ = 0
dt t0 =0
⇒ cos ϕ = 0
π
⇒ϕ=
2
⇒ A = xmax

Therefore, equation (10) becomes x(t) = xmax · sin ωt + π2 = xmax · cos(ωt) and

q
k
v(t) = −xmax ω · sin(ωt). Here, ω = m . Plotting x(t) and v(t) we get:

xmax
v(t)
x(t)
O t

4
Because x(t) is a periodic function, we can find out the period of oscillation from
x(t) = x(t+T ) .

A · sin(ωt + ϕ) = A · sin(ω(t + T ) + ϕ)
⇒ ω(t + T ) + ϕ = 
ωt
 + ϕ + 2π

⇒T =
ω
The energy of a harmonic oscillator is constant and given by:
1
E = kA2 (11)
2

You might also like