Answer
$y_p(x)=xe^{-x}[(A x^2+Bx+C)\cos 3x+(D x^2+Ex+F)\sin 3x]$
Work Step by Step
Consider $G(x)=e^{\alpha x} A(x) \sin mx $ or $G(x)=e^{\beta x} A(x) \cos mx $
The trial solution for the method of undetermined coefficients is defined as:
$y_p(x)=e^{\alpha x} B(x) \sin mx +e^{\beta x} C(x) \cos mx$
When the sum of the coefficients of a differential equation is zero.
Then, we have $y_p(x)=x e^{\alpha x} B(x)$
On comparing the above equation with the given equation, we get $m=k=1$
Thus, the trial solution for the method of undetermined coefficients is:
$y_p(x)=xe^{-x}(A x^2+Bx+C)\cos 3x+xe^{-x}(D x^2+Ex+F)\sin 3x$
Hence, we have $y_p(x)=xe^{-x}[(A x^2+Bx+C)\cos 3x+(D x^2+Ex+F)\sin 3x]$