Simple Harmonic Oscillator
Discussion
Trust me. It's simple.
Start with a spring resting on a horizontal, frictionless (for now) surface. Fix one end to an unmovable object and the other to a movable object. Start the system off in an equilibrium state — nothing moving and the spring at its relaxed length.
Now, disturb the equilibrium. Pull or push the mass parallel to the axis of the spring and stand back. You know what happens next. The system will oscillate side to side (or back and forth) under the restoring force of the spring. (A restoring force acts in the direction opposite the displacement from the equilibrium position.) If the spring obeys Hooke's law (force is proportional to extension) then the device is called a simple harmonic oscillator (often abbreviated sho) and the way it moves is called simple harmonic motion (often abbreviated shm).
Begin the analysis with Newton's second law of motion.
∑F = ma
There is only one force — the restoring force of the spring (which is negative since it acts opposite the displacement of the mass from equilibrium). Replace net force with Hooke's law. Replace acceleration with the second derivative of displacement.
− kx = m  d^{2}x 
dt^{2} 
Rearrange things a bit.
−  k  x =  d^{2}x 
m  dt^{2} 
This is a second order, linear differential equation. On the left side we have a function with a minus sign in front of it (and some coefficients). On the right side we have the second derivative of that function. The solution for this equation is a function whose second derivative is itself with a minus sign. We have two possible functions that satisfy this requirement — sine and cosine — two functions that are essentially the same since each is just a phase shifted version of the other. When a trig function is phase shifted, it's derivative is also phase shifted. Nothing else is affected, so we could pick sine with a phase shift or cosine with a phase shift as well.
function  1st derivative  2nd derivative  








I think I'll go with the sine function and add an arbitrary phase shift or phase angle or phase (φ, "phi") so that our analysis covers sine (φ = 0), cosine (φ = ^{π}_{2}), and everything in between (φ = whatever). From a physical standpoint, we need a phase term to accommodate all the possible starting positions — at the equilibrium moving one way (φ = 0), at the equilibrium moving the other way (φ = π), all the way over to one side (φ = ^{π}_{2}), all the way over to the other side (φ = ^{3π}_{2}), and everything in between (φ = whatever).
physical description  phase shift  

starting at equilibrium, moving forward 
none (initial phase) 
0 radian 
all the way over to one side, stopped instantaneously 
quarter cycle 
^{π}_{2} radian 
return to equilibrium, moving backward 
half cycle 
π radian 
all the way over to the other side, stopped instantaneously 
three‑quarter cycle 
^{3π}_{2} radian 
return to equilibrium, moving forward 
complete cycle 
2π radian 
We also need coefficients to handle the units. The solution to our differential equation is an algebraic equation — position as a function of time (x(t)) — that is also a trigonometric equation. All the trig functions are ratios, which makes them dimensionless (the more precise mathematical term) or unitless (the term I prefer). The only unit you can really put into a trig function is the radian. From the mathematical definition, an angle (φ) is the ratio of arc length (s) to radius (r). Using SI units would give us meters over meters, which dimensional analysis reduces to nothing. In a sense, a radian is a unit of nothing.
φ =  s  ⇒  ⎡ ⎣ 
rad =  m  = "unitless"  ⎤ ⎦ 
r  m 
The way around this is to add a coefficient that changes our input variable (time) into something a trig function can handle (radians). That thing is called angular frequency, which in this case is the rate of change of the phase angle (φ) with time (t). Its symbol is lowercase omega (ω).
ω =  dφ 
dt 
The SI unit of angular frequency is the radian per second, which reduces to an inverse second since the radian is dimensionless.
⎡ ⎣ 
rad  =  1  = s^{−1}  ⎤ ⎦ 
s  s 
I personally hate this quantity. It has no physical meaning — in this context. Angular frequency is great for systems that rotate (spin) or revolve (travel around a circle), but our system is oscillating (moving back and forth). How does one thing relate to another? Since the short answer is "abstractly" the reasonable thing to do is to avoid ω altogether and use a coefficient grounded in physical reality.
A periodic system is one in which the time between repeated events is constant. (A system where the time between repeated events is not constant is said to be aperiodic.) The time between repeating events in a periodic system is called a period. Mathematically, it's the time (t) per number of events (n). The symbol for period is a capital italic T although some professions prefer capital italic P.
T =  t 
n 
The SI unit of period is the second, since the number of events is unitless.
⎡ ⎣ 
s =  s  ⎤ ⎦ 
1 
Frequency is the rate at which a periodic event occurs. Mathematically, it's the number of events (n) per time (t). The symbol for frequency is a long f but a lowercase italic f will also do. (These characters are often identical in some fonts.)
f =  n 
t 
The SI unit of frequency is the inverse second, which is called a hertz (Hz) in honor of Heinrich Hertz, the 19th century German physicist who confirmed the existence of radio waves.
⎡ ⎣ 
Hz =  1  = s^{−1}  ⎤ ⎦ 
s 
Period and frequency are inverses of one another. Of course they are also inversely proportional, but this misses the point. They are inversely proportional with a coefficient of proportionality of one (with no unit). Therefore, no coefficient is needed to make their inverses equal. They are absolutely and perfectly reciprocal.
f =  1  ⇔  T =  1 
T  f 
Back to the differential equation. It's solution is sine with a phase shift. Time is the input variable into a trig function. Trig functions can't accept numbers with units. The fix is to use angular frequency (ω). Angular frequency has no physical reality. Frequency (f) does, however. Angular frequency counts the number of radians per second. Frequency counts the number of events per second. A sequence of events that repeats itself is called a cycle. The sine function repeats itself after it has "moved" through 2π radians of mathematical abstractness. The motion of a simple harmonic oscillator repeats itself after it has moved through one complete cycle of simple harmonic motion.
ω =  φ  =  2π radian 
t  1 period 
f =  n  =  1 cycle 
t  1 period 
Divide one equation by the other…
=  2π radian  =  2π radian  
ω  1 period  
f  1 cycle  1 cycle  
1 period 
Recall that both radians and cycles are unitless quantities, which means…
ω  =  2π radian  =  2π 
f  1 cycle  1 
…and thus…
ω = 2πf
Multiplying either side of this equation by time eliminates the unit from the input side of the equation. But what about the output side? The output of the sine function is a unitless number that varies from +1 to −1. Our differential equation needs to generate an algebraic equation that spits out a position between two extreme values, say +A and −A. I like the symbol A since the extreme value of an oscillating system is called its amplitude and amplitude begins withe the letter a. Amplitude uses the same units as displacement for this system — meters [m], centimeters [cm], etc. Multiply the sine function by A and we're done. Here's the general form solution to the simple harmonic oscillator (and many other second order differential equations).
x = A sin(2πft + φ)
where…
x =  position [m, cm, etc.] 
A =  amplitude [m, cm, etc.] 
f =  frequency [Hz] 
t =  time [s] 
φ =  phase [rad] 
I said that this algebraic equation was a solution to our differential equation, but I never proved it. I should probably do that. Doing so will show us something interesting. Begin with the equation…
x = A sin(2πft + φ)
Find its first derivative…
dx  = 2πfA 
dt 
…so we can find its second derivative…
d^{2}x  = −4π^{2}f^{2}A 
dt^{2} 
Feed the equation and its second derivative back into the differential equation…
−  k  x =  d^{2}x 
m  dt^{2} 
…like this…
−  k  A 
m 
…then simplify. Both variables cancel out (along with a lot of other stuff) which implies that we have found a good solution. We are left with this…
k  =  4π^{2}f^{2} 
m 
Now the interesting part. Solve for frequency…
f =  1  √  k 
2π  m 
And while we're at it, invert frequency to get period…
T = 2π√  m 
k 
Simple harmonic motion evolves over time like a sine function with a frequency that depends only upon the stiffness of the restoring force and the mass of the mass in motion. A stiffer spring oscillates more frequently and a larger mass oscillates less frequently. You could also describe these conclusions in terms of the period of simple harmonic motion. A heavier mass oscillates with a longer period and a stiffer spring oscillates with a shorter period. Frequency and period are not affected by the amplitude. An sho oscillating with a large amplitude will have the same frequency and period as an identical sho oscillating with a smaller amplitude.
phase angle
Position and time are some variables that describe motion (in this case, shm). Frequency and period are properties of periodic systems (in this case, an sho). Amplitude and phase are coefficients that are found in equations of periodic motion that are determined by the initial conditions (in this case, the initial position and initial velocity of an sho).
Begin with the equation for position. Substitute in any arbitrary initial position x_{0} (ex nought), but for convenience call the initial time zero.
x = A sin(2πft + φ) x_{0} = A sin φ 
Next, do something similar with the first derivative of position — better known as velocity. Substitute in any arbitrary initial velocity v_{0} (vee nought)
v = 2πfA cos(2πft + φ) v_{0} = 2πfA cos φ 
Divide initial position by initial velocity.
x_{0}  =  A sin φ  =  tan φ 
v_{0}  2πfA cos φ  2πf 
Phase angle is related to the ratio of initial position to initial velocity like so…
tan φ = 2πf  x_{0} 
v_{0} 
Recall that frequency is determined by the spring constant and the mass.
f =  1  √  k 
2π  m 
Phase angle can also be written like this…
tan φ =  x_{0}  √  k 
v_{0}  m 
and even like this…
tan φ = √  kx_{0}^{2} 
mv_{0}^{2} 
Look familiar? How about if I do this?
tan φ = √  ½kx_{0}^{2} 
½mv_{0}^{2} 
The phase angle is related to the ratio of the initial elastic potential energy to the initial kinetic energy.
tan φ = √  U_{0} 
K_{0} 
Almost, but not quite. When I moved the initial position and initial velocity under the radical sign I squared them. This is not quite correct. When I did that I destroyed the sign information in the two initial conditions. (Kinetic and elastic potential energies are always positive.) Those signs are used to determine which quadrant the phase angle lies in.
−v_{0}  +v_{0}  

+x_{0}  2nd quadrant 090°–180° 
1st quadrant 00°–90° 
−x_{0}  3rd quadrant 180°–270° 
4th quadrant 270°–360° 