Given. An undamped oscillator with natural frequency $\omega_0=2$, forced simultaneously at its own frequency ($3\cos2t$, resonant) and at a different frequency ($4\cos3t$, non-resonant).
Find. The general solution $x(t)$.
Approach. Solve the homogeneous equation, then find a particular solution for each forcing term separately (superposition), using the resonant trial $t(A\cos2t+B\sin2t)$ for the $2\cos t$-frequency term and the ordinary trial $C\cos3t+D\sin3t$ for the other.
Resonant particular solution (for $3\cos2t$). Since $\cos2t$ solves the homogeneous equation, try $x_{p1}=t(A\cos2t+B\sin2t)$. Substituting and simplifying (the $t\cos2t,\,t\sin2t$ terms cancel automatically, leaving only the terms produced by differentiating the envelope $t$ itself):
$$x_{p1}''+4x_{p1}=-4A\sin2t+4B\cos2t=3\cos2t\ \Rightarrow\ A=0,\ B=\tfrac34.$$
So $x_{p1}=\tfrac34\,t\sin2t$.
Superpose.
$$x(t)=\boxed{C_1\cos2t+C_2\sin2t+\dfrac34\,t\sin2t-\dfrac45\cos3t}$$
(Check: direct substitution of the full expression into $x''+4x$ reproduces $3\cos2t+4\cos3t$ exactly.)