# 23.8: Appendix 23A- Solution to Simple Harmonic Oscillator Equation

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$

( \newcommand{\kernel}{\mathrm{null}\,}\) $$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\id}{\mathrm{id}}$$

$$\newcommand{\Span}{\mathrm{span}}$$

$$\newcommand{\kernel}{\mathrm{null}\,}$$

$$\newcommand{\range}{\mathrm{range}\,}$$

$$\newcommand{\RealPart}{\mathrm{Re}}$$

$$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$

$$\newcommand{\Argument}{\mathrm{Arg}}$$

$$\newcommand{\norm}[1]{\| #1 \|}$$

$$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$

$$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\AA}{\unicode[.8,0]{x212B}}$$

$$\newcommand{\vectorA}[1]{\vec{#1}} % arrow$$

$$\newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow$$

$$\newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vectorC}[1]{\textbf{#1}}$$

$$\newcommand{\vectorD}[1]{\overrightarrow{#1}}$$

$$\newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}}$$

$$\newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}}$$

$$\newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} }$$

$$\newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$

In our analysis of the solution of the simple harmonic oscillator equation of motion, Equation (23.2.1),

$-k x=m \frac{d^{2} x}{d t^{2}} \nonumber$

we assumed that the solution was a linear combination of sinusoidal functions,

$x(t)=A \cos \left(\omega_{0} t\right)+B \sin \left(\omega_{0} t\right) \nonumber$

where $$\omega_{0}=\sqrt{k / m}$$. We shall now derive Equation (23.A.2).

Assume that the mechanical energy of the spring-object system is given by the constant E . Choose the reference point for potential energy to be the unstretched position of the spring. Let x denote the amount the spring has been compressed $$(x<0)$$ or stretched $$(x>0)$$ from equilibrium at time t and denote the amount the spring has been compressed or stretched from equilibrium at time $$t=0 \text { by } x(t=0) \equiv x_{0}$$. Let $$v_{x}=d x / d t$$ denote the x -component of the velocity at time t and denote the x -component of the velocity at time $$t=0 \text { by } v_{x}(t=0) \equiv v_{x, 0}$$. The constancy of the mechanical energy is then expressed as

$E=K+U=\frac{1}{2} k x^{2}+\frac{1}{2} m v^{2} \nonumber$

We can solve Equation (23.A.3) for the square of the x -component of the velocity,

$v_{x}^{2}=\frac{2 E}{m}-\frac{k}{m} x^{2}=\frac{2 E}{m}\left(1-\frac{k}{2 E} x^{2}\right) \nonumber$

Taking square roots, we have

$\frac{d x}{d t}=\sqrt{\frac{2 E}{m}} \sqrt{1-\frac{k}{2 E} x^{2}} \nonumber$

(why we take the positive square root will be explained below).

Let $$a_{1} \equiv \sqrt{2 E / m}$$ and $$a_{2} \equiv k / 2 E$$. It’s worth noting that $$a_{1}$$ has dimensions of velocity and w has dimensions of [length] to the power −2 . Equation (23.A.5) is separable,

$\begin{array}{l} \frac{d x}{d t}=a_{1} \sqrt{1-a_{2} x^{2}} \\ \frac{d x}{\sqrt{1-a_{2} x^{2}}}=a_{1} d t \end{array} \nonumber$

We now integrate Equation (23.A.6),

$\int \frac{d x}{\sqrt{1-a_{1} x^{2}}}=\int a_{1} d t \nonumber$

The integral on the left in Equation (23.A.7) is well known, and a derivation is presented here. We make a change of variables $$\cos \theta=\sqrt{a_{2}} x$$ with the differentials $$d \theta$$ and $$d x$$ related by $$-\sin \theta d \theta=\sqrt{a_{2}} d x$$. The integration variable is

$\theta=\cos ^{-1}(\sqrt{a_{2}} x) \nonumber$

Equation (23.A.7) then becomes

$\int \frac{-\sin \theta d \theta}{\sqrt{1-\cos ^{2} \theta}}=\int \sqrt{a_{2}} a_{1} d t \nonumber$

This is a good point at which to check the dimensions. The term on the left in Equation (23.A.9) is dimensionless, and the product $$\sqrt{a_{2}} a_{1}$$ on the right has dimensions of inverse time, $$[\text { length }]^{-1}\left[\text {length } \cdot \operatorname{time}^{-1}\right]=\left[\text {time }^{-1}\right]$$ so $$\sqrt{a_{2}} a_{1}$$ dt is dimensionless. Using the trigonometric identity $$\sqrt{1-\cos ^{2} \theta}=\sin \theta$$, Equation (23.A.9) reduces to

$\int d \theta=-\int \sqrt{a_{2}} a_{1} d t \nonumber$

Although at this point in the derivation we don’t know that $$\sqrt{a_{2}} a_{1}$$, which has dimensions of frequency, is the angular frequency of oscillation, we’ll use some foresight and make the identification

$\omega_{0} \equiv \sqrt{a_{2}} a_{1}=\sqrt{\frac{k}{2 E}} \sqrt{\frac{2 E}{m}}=\sqrt{\frac{k}{m}} \nonumber$

and Equation (23.A.10) becomes

$\int_{\theta=\theta_{0}}^{\theta} d \theta=-\int_{t=0}^{t} \omega_{0} d t \nonumber$

After integration we have

$\theta-\theta_{0}=-\omega_{0} t \nonumber$

where $$\theta_{0} \equiv-\phi$$ is the constant of integration. Because $$\theta=\cos ^{-1}(\sqrt{a_{2}} x(t))$$ Equation (23.A.13) becomes

$\cos ^{-1}(\sqrt{a_{2}} x(t))=-\left(\omega_{0} t+\phi\right) \nonumber$

Take the cosine of each side of Equation (23.A.14), yielding

$x(t)=\frac{1}{\sqrt{a_{2}}} \cos \left(-\left(\omega_{0} t+\phi\right)\right)=\sqrt{\frac{2 E}{k}} \cos \left(\omega_{0} t+\phi\right) \nonumber$

At t = 0

$x_{0} \equiv x(t=0)=\sqrt{\frac{2 E}{k}} \cos \phi \nonumber$

The x -component of the velocity as a function of time is then

$v_{x}(t)=\frac{d x(t)}{d t}=-\omega_{0} \sqrt{\frac{2 E}{k}} \sin \left(\omega_{0} t+\phi\right) \nonumber$

At t = 0,

$v_{x, 0} \equiv v_{x}(t=0)=-\omega_{0} \sqrt{\frac{2 E}{k}} \sin \phi \nonumber$

We can determine the constant $$\phi$$ by dividing the expressions in Equations (23.A.18) and (23.A.16),

$-\frac{v_{x, 0}}{\omega_{0} x_{0}}=\tan \phi \nonumber$

Thus the constant $$\phi$$ can be determined by the initial conditions and the angular frequency of oscillation,

$\phi=\tan ^{-1}\left(-\frac{v_{x, 0}}{\omega_{0} x_{0}}\right) \nonumber$

Use the identity

$\cos \left(\omega_{0} t+\phi\right)=\cos \left(\omega_{0} t\right) \cos (\phi)-\sin \left(\omega_{0} t\right) \sin (\phi) \nonumber$

to expand Equation (23.A.15) yielding

$x(t)=\sqrt{\frac{2 E}{k}} \cos \left(\omega_{0} t\right) \cos (\phi)-\sqrt{\frac{2 E}{k}} \sin \left(\omega_{0} t\right) \sin (\phi) \nonumber$

and substituting Equations (23.A.16) and (23.A.18) into Equation (23.A.22) yields

$x(t)=x_{0} \cos \omega_{0} t+\frac{v_{x, 0}}{\omega_{0}} \sin \omega_{0} t \nonumber$

agreeing with Equation (23.2.21).

So, what about the missing $$\pm$$ that should have been in Equation (23.A.5)? Strictly speaking, we would need to redo the derivation for the block moving in different directions. Mathematically, this would mean replacing $$\phi$$ by $$\pi-\phi$$ (or $$\phi-\pi$$) when the block’s velocity changes direction. Changing from the positive square root to the negative and changing $$\phi$$ to $$\pi-\phi$$ have the collective action of reproducing Equation (23.A.23).

This page titled 23.8: Appendix 23A- Solution to Simple Harmonic Oscillator Equation is shared under a not declared license and was authored, remixed, and/or curated by Peter Dourmashkin (MIT OpenCourseWare) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.