The differential equation describing the motion of a damped, driven simple-harmonic oscillator is \begin{equation}\label{eq:DDSHO} m\ddot{x} + b\dot{x} + m\omega_0^2 x = F_0(t) \end{equation} where \(b\) is the linear damping constant and \(m\omega_0^2 = k\) is the spring constant. Dividing through by the mass and letting \(\beta \equiv b/2m\), we get \begin{equation}\label{eq:DDSHO2} \ddot{x} + 2\beta \dot{x} + \omega_0^2 x = \frac{F_0(t)}{m} \end{equation}
In Engineering 79, you may have solved this equation using Laplace transforms. Here, we will use the Fourier transform.
To take the Fourier transform, let us first take the transform of \(\dot{x}\): \[ \int_{-\infty}^{\infty} \dot{x} e^{i\omega t} \dd{t} = x e^{i\omega t} \bigg|_{-\infty}^{\infty} - \int_{-\infty}^{\infty} (i\omega) x e^{i\omega t}\dd{t} \] Assuming that \(x(t)\) goes to zero as \(t \to \pm \infty\), the integrated term vanishes and we get \[ \text{FT} (\dot{x}) = -i\omega \tilde{x}(\omega) \] You can readily verify that each time derivative brings down another factor of \((-i\omega)\), so that the Fourier transform of Eq. (\ref{eq:DDSHO2}) is \begin{equation}\label{eq:FTDDSHO} [(-i\omega)^2 - 2 \beta i \omega + \omega_0^2] \tilde{x}(\omega) = \frac1m \tilde{F}_0(\omega) \end{equation} Solving for \(\tilde{x}\), we have \begin{equation}\label{eq:xtilde} \tilde{x}(\omega) = \frac{\tilde{F_0}/m}{\omega_0^2 - \omega^2 - 2 \beta i \omega} = \tilde{F}_0(\omega) \tilde{G}(\omega) \end{equation} where \[ \tilde{F}_0(\omega) = \int_{-\infty}^{\infty} F_0(t) e^{i\omega t}\dd{t} \qquad\text{and}\qquad \tilde{G}(\omega) = \frac{1/m}{\omega_0^2 - \omega^2 - 2 \beta i \omega} \]
Equation (\ref{eq:xtilde}) gives the Fourier transform of the oscillator’s position in terms of the Fourier transform of the forcing function \(F_0(t)\). To see the behavior of the oscillator in the time domain, we now need to take the inverse Fourier transform: \begin{align} x(t) &= \frac{1}{2\pi} \int_{-\infty}^\infty e^{-i\omega t} \int_{-\infty}^{\infty} \frac{F_0(t’)/m}{\omega_0^2 - \omega^2 - 2 \beta i \omega} e^{i\omega t’} \dd{t’} \dd{\omega} \\ &= \int_{-\infty}^{\infty}\dd{t’} F_0(t’) \; \underbrace{ \frac{1}{2\pi m} \int_{-\infty}^{\infty} \dd{\omega} \frac{e^{-i\omega(t-t’)}}{\omega_0^2 - \omega^2 - 2 \beta i \omega}}_{G(t-t’)} \end{align} where I have interchanged the order of integration. To perform the integration over \(\omega\), we can use a contour that closes on a semicircle at \(R \to \infty\), either in the upper half-plane (if \(t' > t\)) or the lower half-plane (if \(t' < t\)).
Where are the poles? At the zeros of \(\omega^2 + 2 \beta i \omega - \omega_0^2\), which are \[ \omega_{\pm} = -i\beta \pm \sqrt{-\beta^2 + \omega_0^2} \] Let \(\omega_1 \equiv \sqrt{\omega_0^2 - \beta^2}\). For an under-damped system, the radical is real, so the poles lie in the LHP at \(-i\beta \pm \omega_1\).
Hence, if \(t' > t\), we can close in the UHP and get \(G(t'-t) = 0\). On the other hand, if \(t > t'\), we must close the contour in the LHP, which means that we traverse the contour in the negative direction and that we enclose the two poles. Hence, for \(t > t'\) we get \begin{equation}\label{eq:G} G(t-t’) = \frac{-2 \pi i}{2\pi m} \times \sum \text{residues} \end{equation} We may write the integrand as \[ -\frac{e^{-i\omega(t-t’)}}{(\omega - \omega_+)(\omega - \omega_-)} \] from which we infer that the residues are \[ -\frac{e^{-i\omega_+(t-t’)}}{(\omega_+ -\omega_-)} = -\frac{e^{-\beta(t-t’)} e^{-i\omega_1(t-t’) }}{2\omega_1} \qquad\text{and}\qquad -\frac{e^{i\omega_-(t-t’)}}{\omega_- - \omega_+} = \frac{e^{-\beta(t-t’)} e^{i\omega_1(t-t’)}}{2\omega_1} \] with sum \[ \frac{e^{-\beta(t-t’)}}{\omega_1} \frac{e^{i\omega_1(t-t’)} - e^{-i\omega_1(t-t’)}}{2} = i \frac{e^{-\beta(t-t’)}}{\omega_1} \sin\big[\omega_1(t-t’)\big] \] so that \begin{equation} G(t-t’) = \begin{cases} \displaystyle\frac{e^{-\beta(t-t’)}}{m\omega_1} \sin\big[\omega_1(t-t’)\big] & t > t’ \\ 0 & t < t’ \end{cases} \end{equation} and \begin{equation}\label{eq:convo} x(t) = \int_{-\infty}^{t} F_0(t’) G(t-t’) \dd{t’} \end{equation}
In other words, the actual response of the oscillator, \(x(t)\), is the convolution of \(F_0\) and \(G\). The Green’s function, \(G(t-t')\) describes the contribution to the motion of the oscillator at time \(t\) after it has been given a unit impulse at (the earlier) time \(t'\).
Let’s say that at \(t = 0\) an oscillatory forcing function begins and operates for \(N\) cycles: \[ F(t) = \begin{cases} F_0 \sin(\Omega t) & 0 < t < \frac{2 \pi N}{\Omega} \equiv T \\ 0 & \text{otherwise} \end{cases} \] Note that \(T\) is the time when the forcing function ceases. The Fourier transform of \(F(t)\) is \begin{align} \tilde{F}(\omega) &= \int_{0}^{T} F_0 \frac{e^{i\Omega t} - e^{-i\Omega t}}{2i} e^{i\omega t}\dd{t} = \frac{F_0}{2i} \int_0^{T} \left(e^{i(\omega+\Omega)t} - e^{i(\omega-\Omega)t} \right)\dd{t} \\ &= \frac{F_0}{2i} \bigg[ \frac{e^{i(\omega+\Omega)t}}{i(\omega+\Omega)} - \frac{e^{i(\omega-\Omega)t}}{i(\omega-\Omega)} \bigg]_0^{T} \\ &= -\frac{F_0}{2} \bigg[ \frac{e^{i\omega T}-1}{\omega+\Omega} - \frac{e^{i\omega T}-1}{\omega - \Omega} \bigg] \\ &= -\frac{F_0}{2} (e^{i\omega T}-1)\bigg[ \frac{\omega-\Omega - \omega - \Omega}{\omega^2 - \Omega^2} \bigg] \\ &= F_0 \Omega \frac{e^{i \omega T}-1}{\omega^2 - \Omega^2} \end{align}
By the convolution theorem, then, \begin{align} x(t) &= \frac{1}{2\pi} \int_{-\infty}^{\infty} \frac{F_0 \Omega}{m} \frac{e^{-i\omega t}}{\omega_0^2-\omega^2-2\beta i \omega} \frac{e^{i\omega T} - 1}{\omega^2 - \Omega^2} \dd{\omega} \notag \end{align}
Evaluating this integral is somewhat tricky. Let’s first clean up the integrand slightly by shifting the denominator to have positive \(\omega^2\) in the first term and flipping the sign of the final numerator: \begin{equation} x(t) = \frac{F_0 \Omega}{2 \pi m} \int_{-\infty}^{\infty} \frac{e^{-i\omega t} - e^{-i\omega(t-T)}} {(\omega-\omega_{+})(\omega-\omega_{-})(\omega-\Omega)(\omega+\Omega)} \dd{\omega} \end{equation} where \(\omega_{\pm} = \pm\omega_1 - i\beta\). Writing the integrand this way shows that it has four first-order poles, two on the real axis on the path of integration, and two in the lower half-plane.
We can close the contour without adding anything to the integral with a giant semicircle in the upper half-plane. The poles at \(\omega=\omega_\pm\) are in the LHP, so they contribute nothing. At \(\omega = \pm \Omega\), the numerator vanishes because \(e^{\pm i\Omega T} = e^{\pm i \, 2\pi N} = 1\). Hence, \(x(t) = 0\) for \(t < 0\). That’s reassuring: we haven’t started forcing the oscillator yet!
Now we must close the contour in the lower half-plane. By the same argument as for case 1, we get no contribution from the poles that lie on the real axis because the numerator vanishes. However, our contour now encloses the two poles in the LHP, so we will need to evaluate them.
In this case we must separate the terms in the numerator, since for the first one we must close in the LHP while for the second we must close in the UHP. For the first, we go around in the clockwise (negative) direction; for the second, we go around counterclockwise.
First, let’s simplify the denominator: \[ (\omega_{\pm}^2 - \Omega^2) = \omega_1^2 \mp 2 \omega_1 \beta i - \beta^2 -\Omega^2 \] It will be convenient to express this value in polar representation, so define \begin{equation}\label{eq:polars1} \Gamma \equiv \omega_1^2 - \beta^2 - \Omega^2 \qquad \Delta \equiv \sqrt{\Gamma^2 + 4\beta^2 \omega_1^2} \qquad \tan\varphi \equiv \frac{2\beta\omega_1}{\Gamma} \end{equation} which gives \[ (\omega_{\pm}^2 - \Omega^2) = \Delta e^{\mp i \varphi} \]
Noting that \((\omega_+ - \omega_-) = 2 \omega_1\), the residues are \begin{equation}\label{eq:res1} a_{-1}(\omega_+) = \frac{ e^{-i\omega_+ t} - e^{-i\omega_+(t-T)}} {\Delta e^{-i\varphi} (2\omega_1)} \end{equation} and \begin{equation}\label{eq:res2} a_{-1}(\omega_-) = \frac{ e^{-i\omega_- t} - e^{-i\omega_-(t-T)}} {\Delta e^{i\varphi} (-2\omega_1)} \end{equation} Summing these gives \begin{align} a_{-1}(\omega_+) + a_{-1}(\omega_-) &= \frac{1}{2 \omega_1 \Delta} \bigg[ e^{-i(\omega_+ t - \varphi)} - e^{-i(\omega_- t + \varphi )} e^{-i(\omega_-(t-T) + \varphi)} - e^{-i(\omega_+(t-T)-\varphi)} \bigg] \notag \\ &= \frac{1}{2 \omega_1 \Delta} \bigg[ e^{-\beta t} \left( e^{-i(\omega_1 t - \varphi)} - e^{i(\omega_1 t - \varphi)} \right) \notag \\ &\qquad\qquad + e^{-\beta(t-T)}\left( e^{i(\omega_1 (t-T) - \varphi)} - e^{-i(\omega_1 (t-T) - \varphi)} \right) \bigg] \notag \\ &= \frac{1}{2 \omega_1 \Delta} \bigg[ e^{-\beta t}(-2i) \sin(\omega_1 t-\varphi) + e^{-\beta(t-T)}(2i)\sin(\omega_1 (t-T) - \varphi) \bigg] \notag \\ &= \frac{-i}{\omega_1 \Delta} \bigg[ e^{-\beta t} \sin(\omega_1 t - \varphi) - e^{-\beta(t-T)} \sin(\omega_1(t-T) - \varphi) \bigg] \end{align} Since we close in the LHP, we traverse the contour in the negative direction, so these poles contribute \(-2\pi i\) times the sum of the residues. Hence, \begin{align} x(t) &= \frac{F \Omega}{2\pi m}(-2\pi i) \frac{-i}{\omega_1 \Delta} \bigg[ e^{-\beta t} \sin(\omega_1 t - \varphi) - e^{-\beta(t-T)} \sin(\omega_1(t-T) - \varphi) \bigg] \notag \\ &= \frac{F \Omega}{m \omega_1 \Delta} \bigg[ e^{-\beta t} \sin(\omega_1 t - \varphi) - e^{-\beta(t-T)} \sin(\omega_1(t-T) - \varphi) \bigg] \label{eq:case2} \end{align} This is the entire solution for case 2, since we get nothing from the poles on the real axis.
When \(0 < t < T\), we get a contribution from the two poles in the LHP from the term proportional to \(e^{-i\omega t}\) and nothing from the other exponential, whose contour we close in the UHP. So, the poles in the LHP yield Eq. \eqref{eq:case2} without the term involving \(t-T\), to which we must add the contributions from the poles on the real axis.
Now we need to consider the poles at \(\omega \to \pm \Omega\). First, let’s work on the term proportional to \(e^{-i\omega t}\): \[ a_{-1}(\Omega) = \frac{e^{-i\Omega t}}{2\Omega \big[ \Omega^2 - \omega_0^2 + 2 \beta \Omega i\big]} \] Once again, let’s represent the term in brackets in polars by defining \begin{equation}\label{eq:moredefs} \gamma \equiv \Omega^2 - \omega_0^2 \qquad \delta \equiv \sqrt{\gamma^2 + 4 \beta^2 \Omega^2} \qquad \tan \psi \equiv \frac{2 \beta \Omega}{\gamma} \end{equation} so \[ a_{-1}(\Omega) = \frac{e^{-i(\Omega t + \psi)}}{2 \Omega \delta} \] Similarly, the residue at \(\omega \to -\Omega\) is \[ a_{-1}(-\Omega) = \frac{e^{i(\Omega t + \psi)}}{-2\Omega\delta} \] Summing these gives \[ a_{-1}(-\Omega) + a_{-1}(\Omega) = -i \frac{\sin(\Omega t + \psi)}{\Omega \delta} \] which we need to multiply by \(-\pi i\), since it is on the path of integration and because we traverse the contour in the negative sense. We get \[ a_{-1}(-\Omega) + a_{-1}(\Omega) = i \frac{\sin(\Omega(t-T) + \psi)}{\Omega \delta} \] which we must multiply by \(\pi i\), since we close this one in the UHP and traverse the contour in the positive sense. Before finishing that algebra, we can simplify a bit: \[ \sin(\Omega(t-T)+ \psi) = \sin(\Omega t + \psi - \omega T) = \sin(\Omega t + \psi) \] since shifting the argument of the sine by \(2\pi N\) doesn’t change the value. So, the two sums yield identical values.
Let’s reprise the definitions we’ve made: \begin{align} \beta &= \frac{b}{2m} &\qquad \omega_0 &= \sqrt{k/m} \notag \\ T &= \frac{2\pi N}{\Omega} &\qquad \omega_1 &= \sqrt{\omega_0^2 - \beta^2} \notag \\ \omega_{\pm} &= -i\beta \pm \omega_1 &\qquad \Gamma &= \omega_1^2 - \Omega^2 - \beta^2 \notag \\ \Delta &= \sqrt{\Gamma^2 + 4 \omega_1^2 + \beta^2} &\qquad \tan \varphi &= \frac{2 \beta \omega_1}{\Gamma} \notag \\ \gamma &= \Omega^2 - \omega_0^2 &\qquad \delta &= \sqrt{\gamma^2 + 4 \beta^2 \Omega^2} \notag \\ \tan \psi &= \frac{2 \beta \Omega}{\gamma} \notag \end{align}
In terms of these definitions, the solution for \(x(t)\) is \begin{equation}\label{eq:amazing} x(t) = \begin{cases} 0 & t < 0 \\ -\frac{F_0}{m}\bigg[ \frac{\Omega}{\Delta\omega_1} e^{-\beta t}\sin(\omega_1 t - \varphi) + \frac{\sin(\Omega t + \psi)}{\delta} \bigg] & 0 \le t \le T \\ \frac{F_0 \Omega}{m \omega_1 \Delta}\bigg[ e^{-\beta(t-T)} \sin\big[\omega_1(t-T)-\varphi\big] - e^{-\beta t} \sin(\omega_1 t - \varphi) \bigg] & t > T \end{cases} \end{equation}