The oscillatory motion of a system around a stable point is one of the most important single examples in physics. It is the basis for understanding a wide range of systems and phenomena including mechanical oscillations, electrical circuits, resonance, and is even at the heart of the basic theory of photons — quantum field theory. Show If the equations are the same, the analogy is good. This makes the mass on a spring of great value in studying any kind of oscillations. What's going on in an oscillationThere are three core ideas to the idea of oscillation:
The combination of stable point, restoring force, and overshoot are the components needed to create an oscillation. The horizontal mass/spring systemThe essence of an oscillation is a restoring force and the overshoot arising from inertia. As a result, the simplest example we can construct is a spring — that provides a linear restoring force that vanishes at the stable resting point — and a mass — that provides the inertia that keeps the mass going. To set this up physically, we will imagine a small massive cart rolling on (those famous) frictionless wheels attached to a (n equally famous) massless spring.* We show a representation of the system in the figure at the right.* We are OK to ignore the mass of the spring if the cart is much more massive than the spring. Also, it helps conceptually to separate the force idea and the inertia idea in separate objects. We could in fact include the mass of the spring, but it makes the problem mathematically rather difficult and what we are looking for here is a simple example that helps us think about what's happening when a system oscillates. In order to make our model as simple as possible (while still retaining the 3 key elements of oscillation), we'll assume that the mass of the cart is much greater than the mass of the spring, that the wheels have negligible friction, and that the spring is well approximated (at least for the stretches we intend to consider), by Hooke's law: T = kΔL, where ΔL is the amount the spring is stretched away from its rest length. To simplify the math, we will choose our coordinate system so that the 0 of our position coordinate is when the cart is at the rest length. Now we have to create the equation that provides a mathematical model for our motion — building an equation from the physics. Here's what we have to do:
$$v = \frac{dx}{dt} \quad \quad a = \frac{F^{net}}{m}$$ Think through a situation in which the cart is pulled out to a positive position where $x > 0$ but $v = 0$. When the cart is released, what happens? Follow it through one full oscillation. The math of the harmonic oscillatorThe basic principle is N2, so we need make a freebody diagram for our cart. The vertical forces (weight and normal force) cancel leaving only the force of the spring acting on the cart. This force is proportional to the amount the spring is stretched or squeezed. And the way we have set up the coordinate system gives us that $F^{net} = kx$ with the negative sign indicating that when the cart is extended to the right (spring is stretched) the force is to the left and vice versa. The result is that N2 becomes the equation$$a = \frac{F^{net}}{m} = \frac{kx}{m} = \bigg(\frac{k}{m}\bigg) x$$ or, since the acceleration is the second derivative of the position, $$\frac{d^2x}{dt^2} = \bigg(\frac{k}{m}\bigg) x$$ So this tells us that the second derivative of $x$ is proportional to $x$ times a constant. What kind of object is this constant? We can see from the structure of the equation that it has to look like the product of two inverse times: the second derivative of $x$ is an acceleration so it is a rate of change of velocity — a change in (change in position per unit time) per unit time. We expect it to have a dimensionality 1/T2. Let's check to see that this works. Here are the dimensionalities of the various quantities involved:[$m$] = M [$k$] = [$F/x$] = [$ma/x$] = ML/(LT2) = M/T2 [$k/m$] = M/(MT2) = 1/T2 In physics we often give quantities names that clue us in as to what kind of quantity a parameter looks like, that is, what dimensions it has. We have a couple of choices here  we could define a time period, but it turns out to be more convenient to treat this combination like the square of an angular velocity. An angular velocity has units of radian/sec (dimensionality of 1/T). Angular velocity is often given the symbol "omega" ($ω$) so we will define $$\omega_0 = \sqrt{\frac{k}{m}}$$ We put a subscript "0" on it to show it is a value, not a variable. With this definition, Newton's second law becomes: $$\frac{d^2x}{dt^2} = \omega_0^2 x$$ or $$\frac{1}{\omega_0^2}\frac{d^2x}{dt^2} =  x$$ So up to a constant, $x$ is a function of $t$ whose second derivative looks like the negative of itself. You've seen this in your calculus course. We can make it look more like calculus by combining the $ω_0$ with the time to get a dimensionless variable, $τ = ω_0t$. (Check the dimensions of this for yourself. Our equation then becomes: $$\frac{d^2x}{d\tau^2} = x$$ This is pretty simple. It looks like the calculus equation "$d^2f/dx^2 = f$" (but with different independent and dependent variables). It tells us we are looking for some function (of tau) whose second derivative is the negative of itself. You should recognize that both the sine and cosine functions satisfy this. We'll work with cosine for now, but in general we could have any sum of the two. So our first guess at a solution is $x = \cos{τ}$. This doesn't quite work because the left and right side have different units. On the left, $x$ is a distance, while the right side is unitless. This suggests to us that a better answer would be$ x = A \cos{τ}$ where A is some distance. This would give us a final solution to Newton's law of motion: $$x(t) = A \cos{\omega_0 t}$$ (The "$(t)$" after the $x$ just reminds us that $x$ is being considered as a function of $t$.) This is a satisfactory solution as far as units go: $ω_0t$ is dimensionless so it can be an angle (and you have to take cosine of a dimensionless quantity), and the result is a length. Now let's see how to interpret them physically. Interpreting the solutionThe result of our analysis gives a graph of the position that looks like this: just a cosine curve (but since $t$ can get arbitrarily large, it doesn't stop at $2\pi$ but keeps oscillating). But we need to interpret the physical parameters of what the mass is doing. Telling the story of the motionClearly, at $t = 0$, $x$ is positive and at its maximum value. And since the slope ($v = dx/dt$) at $t = 0$ is 0, the physical system that this equation is describing must be that the mass has been pulled out, held at rest and released. It then oscillates down to 0, continues through and goes to compress the spring by an equal amount that it was stretched and comes back. Then it continues to repeat. Let's name the various parameters of the motion.The amplitudeFrom looking at our equation, and knowing that cos oscillates between 1 and +1, we can see that x will vary from A to A. Our parameter A is therefore the amplitude of the oscillation — the maximum extension it travels from rest in both directions. The periodThat's the spatial parameter. What about the temporal one? Since cosine continues to oscillate as its argument gets larger and larger (see Trig functions for any value of the argument) it repeats the same motion over and over. This makes sense since after one oscillation the same initial conditions are repeated and, since we are assuming no friction or loss of energy, once we come back to our starting point the forces will make it do the same thing once again. Therefore, the time it takes to complete one oscillation is an important parameter. This is called the period and is marked on the figure at $T$. But we don't have a $T$ in our equation that describes the motion. We'll have to do a little more work to figure how it relates. For $\cos{θ}$ to go through one full oscillation, $θ$ has to vary from 0 to $2π$ (in radians). Our argument of cosine must do the same thing to go through one full oscillation; so as $t$ goes from 0 to $T$, $ω_0t$ has to go from 0 to $2π$. This tells us that we must have $$\omega_0 T = 2\pi$$ or $$T = 2π/ω_0.$$ This tells us what $ω_0$ is really doing for us — it's setting the period of the oscillation. Putting in our value for ω0 in terms of the original parameters, we get $$T = \frac{2\pi}{\omega_0} = 2\pi \sqrt{\frac{m}{k}} $$ This makes good sense, since if we have a bigger mass (bigger $m$), we expect the cart to move more slowly and have a longer period, and if we have a stronger spring (bigger $k$) we expect it to move more quickly and have a shorter period. The phase shiftWe have to deal with one more issue: we don't always get to start the mass at its maximum positive displacement at time $t = 0$. Sometimes we have a data collection device with a builtin time delay and we can't start is precisely when we want to. We might wind up with something like the graph below: In this case, we had the oscillation starting near its negative maximum. We don't get to the maximum $x$ value of $+A$ until the time indicated by $t_0$. How should we write our equation then? The answer is to subtract $t_0$ from $t$, like this: $$x(t) = A \cos{(ω_0(t  t_0))}.$$ Since both $ω_0$ and $t_0$ are constants, we can combine them by defining $ω_0t_0 = φ$ ("phi") and get $$x(t) = A \cos{(ω_0(t  t_0))} = A \cos{(ω_0t  ω_0 t_0)} = A \cos{(ω_0t  φ}.)$$ The constant $φ$ is called the phase shift. Thus, the three parameters in our expression for the position of the oscillator as a function of time, $x(t) = A \cos{(ω_0t  φ)}$ tell us:
