- Solve equations for simple harmonic motion
- Solve equations for damped harmonic motion
- Solve equations for forced harmonic motion
- Apply differential equations to electrical circuits
Simple Harmonic Motion
Consider a mass suspended from a spring attached to a rigid support. This is commonly called a spring-mass system. Gravity is pulling the mass downward and the restoring force of the spring is pulling the mass upward. As shown in Figure 1, when these two forces are equal, the mass is said to be at the equilibrium position. If the mass is displaced from equilibrium, it oscillates up and down.

Let [latex]x(t)[/latex] denote the displacement of the mass from equilibrium. Note that for spring-mass systems of this type, it is customary to adopt the convention that down is positive. Thus, a positive displacement indicates the mass is below the equilibrium point, whereas a negative displacement indicates the mass is above equilibrium.
Consider the forces acting on the mass. The force of gravity is given by [latex]mg[/latex]. In the English system, mass is in slugs and the acceleration resulting from gravity is in feet per second squared. The acceleration resulting from gravity is constant, so in the English system, [latex]g=32[/latex] ft/sec². In the metric system, we have [latex]g=9.8[/latex] m/sec².
According to Hooke’s law, the restoring force of the spring is proportional to the displacement and acts in the opposite direction from the displacement, so the restoring force is given by [latex]-k(s+x)[/latex]. The spring constant is given in pounds per foot in the English system and in newtons per meter in the metric system.
Now, by Newton’s second law, the sum of the forces on the system (gravity plus the restoring force) is equal to mass times acceleration, so we have:
[latex]\begin{aligned} mx^{\prime\prime}&=-k(s+x)+mg \\ &=-ks-kx+mg \end{aligned}[/latex].
However, by the way we have defined our equilibrium position, [latex]mg=ks[/latex], the differential equation becomes:
[latex]mx^{\prime\prime}+kx=0[/latex].
It is convenient to rearrange this equation and introduce a new variable, called the angular frequency, [latex]\omega[/latex]. Letting [latex]\omega=\sqrt{k/m}[/latex], we can write the equation as:
[latex]x^{\prime\prime}+\omega^2x=0[/latex].
This differential equation has the general solution:
[latex]x(t)=c_1\cos\omega t+c_2\sin\omega t[/latex],
which gives the position of the mass at any point in time. The motion of the mass is called simple harmonic motion. The period of this motion (the time it takes to complete one oscillation) is [latex]T=\frac{2\pi}{\omega}[/latex] and the frequency is [latex]f=\frac{1}{T}=\frac{\omega}{2\pi}[/latex] (Figure 2).

Alternative Form of the Solution
Writing the general solution in the form [latex]x(t)=c_1\cos(\omega t)+c_2\sin(\omega t)[/latex] has some advantages. It is easy to see the link between the differential equation and the solution, and the period and frequency of motion are evident. This form of the function tells us very little about the amplitude of the motion, however.
In some situations, we may prefer to write the solution in the form:
[latex]x(t)=A\sin(\omega t+\phi)[/latex].
Although the link to the differential equation is not as explicit in this case, the period and frequency of motion are still evident. Furthermore, the amplitude of the motion, [latex]A[/latex], is obvious in this form of the function. The constant [latex]\phi[/latex] is called a phase shift and has the effect of shifting the graph of the function to the left or right.
To convert the solution to this form, we want to find the values of [latex]A[/latex] and [latex]\phi[/latex] such that:
[latex]c_1\cos(\omega t)+c_2\sin(\omega t)=A\sin(\omega t+\phi)[/latex].
We first apply the trigonometric identity:
[latex]\sin(\alpha+\beta)=\sin\alpha\cos\beta+\cos\alpha\sin\beta[/latex]
to get:
[latex]\begin{aligned} c_1\cos(\omega t)+c_2\sin(\omega t)&=A(\sin(\omega t)\cos\phi+\cos(\omega t)\sin\phi) \\ &=A\sin\phi(\cos(\omega t))+A\cos\phi(\sin(\omega t)) \end{aligned}[/latex].
Thus,
[latex]c_1=A\sin\phi\text{ and }c_2=A\cos\phi[/latex].
If we square both of these equations and add them together, we get:
[latex]\begin{aligned} c_1^2+c_2^2&=A^2\sin^2\phi+A^2\cos^2\phi \\ &=A^2(\sin^2\phi+\cos^2\phi) \\ &=A^2 \end{aligned}[/latex].
Thus,
[latex]A=\sqrt{c_1^2+c_2^2}[/latex].
Now, to find [latex]\phi[/latex], go back to the equations for [latex]c_1[/latex] and [latex]c_2[/latex], but this time, divide the first equation by the second equation to get:
[latex]\begin{aligned} \frac{c_1}{c_2}&=\frac{A\sin\phi}{A\cos\phi} \\ &=\tan\phi \end{aligned}[/latex].
Then,
[latex]\tan\phi=\frac{c_1}{c_2}[/latex].
We summarize this finding in the following theorem.
solution to the equation for simple harmonic motion
The function [latex]x(t)=c_1\cos(\omega t)+c_2\sin(\omega t)[/latex] can be written in the form [latex]x(t)=A\sin(\omega t+\phi)[/latex], where [latex]A=\sqrt{c_1^2+c_2^2}[/latex] and [latex]\tan\phi=\frac{c_1}{c_2}[/latex].

Express the following functions in the form [latex]A(\sin\omega t+\phi)[/latex]. What is the frequency of motion? The amplitude?
- [latex]x(t)=2\cos(3t)+\sin(3t)[/latex]
- [latex]x(t)=3\cos(2t)-2\sin(2t)[/latex]