Solution to the Simple Harmonic Motion Differential Equation

Kensei S.
5 min readJun 21, 2023

--

Simple harmonic motion (SHM) is a relatively common aspect of classical mechanics and in this article I will be solving the following differential equation that illustrates SHM:

Note that this does indeed represent SHM if we recall the definition that SHM occurs when an object is subject to a force proportional and in the opposite direction of its displacement. Mathematically this can be represented as F = -kx where k is a constant and we assume our displacement is in the x-direction. Since F = ma, this can be rearranged as follows:

In the last step I replaced k/m with ω² as this will come in handy during the derivation. One common example of SHM is the motion of an object on a spring since Hooke’s law states that F= -kx, meaning that there is the desired restoring force necessary for SHM to occur. Another example would be a bob on a pendulum who’s motion can be illustrated as the following differential equation (I have derived this equation here):

If we assume that the pendulum only oscillates between small angles, then we can use the small angle approximation and let sinφ = φ which will lead to the form of the SHM differential equation.

Solving the Differential Equation

The first step in solving the differential equation is by assuming its solutions are in the form of exp(mt) where m is to be determined and t is the variable of x(t), time. This can then be substituted into the differential equation to solve for m:

Now you may see why we decided to let the constant be equal to ω² as it gets square rooted. Hence, the two solutions for x(t) are exp(iωt) and exp(-iωt). Now, since any linear combination of solutions to a differential equation will give another solution (also known as the principle of superposition), the following expression will give our general solution:

Where c₁ and c₂ are constants. We can now express this in a more convenient way by making use of Euler’s formula on the two exponentials (For the derivation of Euler’s formula check this article):

Where c₃ = c₁ + c₂ and c₄ = i(c₁ - c₂). Notice how in the third step I made of cos(-x) = cos(x) and sin(-x) = -sin(x) as cosine is an even function and sine is an odd function. Now if we let t = 0, we get x(0) = c₃ meaning that c₃ is just the initial position, x₀. Additionally, if we differentiate x(t) and let t = 0 again we get x’(0) = ωc₄, or in other words c₄ = v₀/ω where v₀ is the initial velocity. Putting these together, we get the following equation:

If we assume the object is released from rest, the sine term will disappear, leaving us with x(t) = x₀ cosωt which is quite an interesting result as it proves that the object moves sinusoidally as we would expect. However, since the two different sinusoidal functions being added together may make things confusing when visualizing the motion, an even more convenient expression can be derived using the following creative approach.

We first create another constant A, which is defined as follows:

We also notice that using this expression, A would be the hypotenuse of a right triangle with side lengths c₃ and c₄ due to Pythagorean’s Theorem as shown below:

I have also defined one of the angles as δ which will come in a bit. Now we return to the expression for x(t) with c₃ and c₄ that we had earlier and rearrange as follows:

In the third step I have used the triangle shown above and the properties of trigonometry to rewrite the fractions in terms of cosines and sines. Finally, the expression in the parentheses is in the form of the compound angle identity for cosines, and hence can be rewritten as the following to get our final expression for x(t):

This expression, I think truly encapsulates everything about SHM as it shows that SHM is simply one sinusoidal function that has an amplitude of A and a period of 2π/ω. The δ term essentially represents a ‘phase shift’ that illustrates what happens when the object is released at different positions on the path which would shift the cosine function to the left or right. Personally, the fact that this δ term appeared through a triangle is quite fascinating to me, and honestly the whole derivation of this final expression was very creative and interesting. I definitely would have never thought of rewriting c₃ and c₄ as another constant in that way.

Nonetheless, this has been the derivation for (several) solutions to the SHM differential equation, and I hope you enjoyed. Thank you for reading.

References:

Differential Equations — Basic Concepts. (2023). Lamar.edu. https://tutorial.math.lamar.edu/classes/de/SecondOrderConcepts.aspx

Taylor, J. R. (2005). Classical mechanics. University Science Books.

--

--