$$\frac{d}{dx}[x\frac{d}{dx}(\sin(3x))]=...$$
$3\left(-3x\sin(3x)+\cos(3x)\right)$
$9\left(-3x\cos(3x)-2\sin(3x)\right)$