Consider frictionless harmonic oscillator (w/ m = 1) driven by an external force $f(t) = A\sin{\omega t} $, so that $$\frac{d^2 x}{dt^2} + \omega_0^2x = A\sin{\omega t}. $$ Show that the particular solution for $\omega \neq \omega_0 $ is $$x_p(t) = \frac{A}{\omega_0^2 - \omega^2} \sin{\omega t} $$
Method of undetermined coefficients looks like the best choice. I Acknowledged this is a second order linear nonhomegeneous equation.
Hint: Assume the particular solution $$y_p=C_1\cos w t+C_2\sin wt$$ $$x_p'=-wC_1\sin w t+wC_2\cos w t$$ $$x_p''=-w^2C_1\cos w t-w^2C_2\sin w t$$ then substitute them to get $$-w^2C_1\cos w t-w^2C_2\sin w t+w_0^2(C_1\cos w t+C_2\sin wt)=A\sin w t$$ $$(-w^2C_1+w_0^2C_1)\cos w t+(-w^2C_2+w_0^2C_2)\sin w t=0\cos w t+A\sin w t$$ $$(-w^2C_1+w_0^2C_1)=0$$ $$C_1=0$$ $$(-w^2C_2+w_0^2C_2)=A$$ $$C_2=\frac{A}{w_0^2-w^2}$$