# Harmonic Oscillator

## Alexei Gilchrist

### 1 Equation of motion

In 1-D, what is the simplest mathematical form a force on an object can take? Well, ok, \(F=0\), but that’s trivial—there is no force, and the object will move at a constant velocity. The next simplest would be \(F=k\) where \(k\) is a constant. In this case Newton’s second law would read \(m a = k\), in other words such a force would produce motion under constant acceleration and it would lead to the kinematic equations.

Arguably the next simplest form would be write \(F = k x\) where \(k\) is a positive constant. Now, if the object moves a little in the positive \(x\) direction the force with push it increasingly hard in that direction and the object will fly off to \(+\infty\) with its acceleration increasing linearly with distance from the origin. The same holds if the object moves a little in the negative direction. Now the force becomes increasingly strong and negative so the object flies off to \(-\infty\). Still rather boring behaviour as objects go.

However if the constant is *negative*, or alternatively if the force has the form

*back*to the origin. Now Newton’s second law reads

A great example to have in mind is a mass on a spring. If we extend or compress the spring by a distance \(x\) from its equilibrium position then by Hooke’s law the spring will exhert a force \(F_s = -k x\), where \(k\) is the spring constant.

This is exactly in the form that we have been considering and the equation of motion from considering Newton’s second law will be

### 2 Solution

Equation \eqref{eq:eqmotion} is an example of a *second order linear homogeneous differential equation* and we are in luck because we can write a closed solution for such an equation. The general solution to such an equation is

There are a number of equivalent ways of writing this solution:

- \(x(t) = A \cos(\omega_0 t + \phi_1)\),
- \(x(t) = B \sin(\omega_0 t + \phi_2)\),
- \(x(t) = C \cos(\omega_0 t) + D \sin(\omega_0 t)\),
- \(x(t) = E e^{i \omega_0 t} + E^* e^{-i \omega_0 t}\), for \(E\) complex where \(^*\equiv\) complex conjugation.

Note that in each case there are *two* real constants that need to be determined by the initial conditions. This is a consequence of the equation of motion being second order. Which form you choose to use is a matter of convenience.

### 3 Velocity and Acceleration

Since we have \(x(t)\) we can just differentiate once to get the velocity and twice to get the acceleration. Notice that the solutions are all cosines of the same frequency, only the amplitude and phase changes:

Using Euler’s formula:

### 4 Energy

There is another, and very insightful, way of looking at the motion of the simple oscillator and that is to examine the energy. The mechanical energy is going to be made up of the kinetic energy and the potential energy.

The kinetic energy is simply

The potential energy is