Solve the initial-value problem
\frac{d^2 x}{d t^2}+\omega^2 x=F_0 \sin \gamma t, \quad x(0)=0, \quad x^{\prime}(0)=0 (29)
where F_{0} is a constant and γ ≠ ω.
The complementary function is x_c(t)=c_1 \cos \omega t+c_2 \sin \omega t. To obtain a particular solution we assume x_p(t)=A \cos \gamma t+B \sin \gamma t so that
x_p^{\prime \prime}+\omega^2 x_p=A\left(\omega^2-\gamma^2\right) \cos \gamma t+B\left(\omega^2-\gamma^2\right) \sin \gamma t=F_0 \sin \gamma t .
Equating coefficients immediately gives A = 0 and B = F_0 /\left(\omega^2-\gamma^2\right). Therefore
x_p(t)=\frac{F_0}{\omega^2-\gamma^2} \sin \gamma t
Applying the given initial conditions to the general solution
x(t)=c_1 \cos \omega t+c_2 \sin \omega t+\frac{F_0}{\omega^2-\gamma^2} \sin \gamma t
yields c_1=0 \text { and } c_2=-\gamma F_0 / \omega\left(\omega^2-\gamma^2\right) . Thus the solution is
x(t)=\frac{F_0}{\omega\left(\omega^2-\gamma^2\right)}(-\gamma \sin \omega t+\omega \sin \gamma t), \quad \gamma \neq \omega (30)