Example (resonance)

Solve $$ \ddot y + \omega_0^2 y = \sin\omega_0 t. $$

We have the general complimentary function $$ y_c(t) = A\sin\omega_0t + B\cos\omega_0t $$ so the forcing term is a complimentary function.

Therefore we write a detuned equation $$ \ddot y + \omega_0^2 y = \sin\omega t. $$ Trying particular integral $y_p(t) = C\sin\omega t$, $$\begin{align*} -C\omega^2 \sin\omega t + C \omega_0^2 \sin\omega t &= \sin \omega t \\ C &= \frac{1}{\omega_0^2 - \omega ^2}. \end{align*}$$ Note that $y_p$ does not converge as $\omega\to\omega_0$, so we will add a complimentary function to regularise the limit: $$ y_p(t) = \frac{\sin\omega t - \sin\omega_0 t}{\omega_0^2 - \omega^2}. $$

Evaluating the limit, $$\begin{align*} \lim_{\omega\to\omega_0} y_p(t)&= \lim_{\omega\to\omega_0} \frac{t\cos\omega t}{-2\omega} && \text{L'Hopital's rule} \\ &= -\frac{t\cos\omega_0 t}{2\omega_0}. \end{align*}$$ Therefore a particular solution of our original equation is $$ y_p(t) = -\frac{1}{2\omega_0} t\cos\omega_0 t. $$