A similar approach would be the annihilator method.
We are given the ODE:
(1) $\displaystyle y'''+9y'=18\sin(3x)+9$
$\displaystyle \frac{1}{9}D^2+1$ annihilates $\displaystyle 18\sin(3x)$
$\displaystyle D$ annihilates $\displaystyle 9$
and so:
$\displaystyle A\equiv D\left(\frac{1}{9}D^2+1 \right)$ annihilates $\displaystyle 18\sin(3x)+9$
Thus, applying $A$ to both sides of (1) gives us:
$\displaystyle D\left(\frac{1}{9}D^2+1 \right)(D^3+9D)[y]=0$
(2) $\displaystyle (D(D^2+9))^2[y]=0$
The characteristic roots are then:
$\displaystyle r=0,\,\pm3i$ where all 3 roots are of multiplicity 2.
Hence, the general solution to (2) is:
(3) $\displaystyle y(x)=c_1+c_2x+(c_3+c_4x)\cos(3x)+(c_5+c_6x)\sin(3x)$
Now, recall that a general solution to (1) is of the form $\displaystyle y(x)=y_h(x)+y_p(x)$. Since every solution to (1) is also a solution to (2), then $\displaystyle y(x)$ must have the form displayed on the right-hand side of (3). But, we recognize that:
$\displaystyle y_h(x)=c_1+c_3\cos(3x)+c_5\sin(3x)$
and so there must exist a particular solution of the form:
$\displaystyle y_p(x)=x\left(c_2+c_4\cos(3x)+c_6\sin(3x) \right)$
Now it is just a matter of using the method of undetermined coefficients as Fernando did to obtain the particular solution that satisfies (1). First, we compute:
$\displaystyle y_p'(x)=c_2+(c_2+3c_6x)\cos(3x)+(c_6-3c_4x)\sin(3x)$
$\displaystyle y_p'''(x)=-27((c_4+c_6x)\cos(3x)+(c_6-c_4x)\sin(3x))$
Now, substitute into (1):
$\displaystyle -27((c_4+c_6x)\cos(3x)+(c_6-c_4x)\sin(3x))+9(c_2+(c_2+3c_6x)\cos(3x)+(c_6-3c_4x)\sin(3x))=0\cos(3x)+18\sin(3x)+9$
$\displaystyle 9c_2+(9c_2-27c_4)\cos(3x)+(-18c_6)\sin(3x)=(0)\cos(3x)+(18)\sin(3x)+9$
Equating coefficients, we obtain the system:
$\displaystyle 9c_2=9\,\therefore\,c_2=1$
$\displaystyle 9c_2-27c_4=0\,\therefore\,c_4=\frac{1}{3}$
$\displaystyle -18c_6=18\,\therefore\,c_6=-1$
And so we have:
$\displaystyle y_p(x)=x\left(1+\frac{1}{3}\cos(3x)-\sin(3x) \right)$
Hence, the general solution to (1) is:
$\displaystyle y(x)=y_h(x)+y_p(x)=c_1+c_2\cos(3x)+c_3\sin(3x)+x \left(1+\frac{1}{3}\cos(3x)-\sin(3x) \right)$