$ 3^{3\cos x(1+\sin^2 x)}-3^{\cos x(4-\sin^2 x)}=6\cos 3x$
$ 3^{3\cos x(1+\sin^2 x)}\left(1-\dfrac{3^{\cos x(4-\sin^2 x)}}{3^{3\cos x(1+\sin^2 x)}}\right)=6\cos 3x$
$ 3^{3\cos x(1+\sin^2 x)}(1-3^{(4\cos x-\cos x\sin^2 x)-(3\cos x+3\cos x\sin^2 x)})=6\cos 3x$
$ 3^{3\cos x(1+\sin^2 x)}(1-3^{(4\cos x-\cos x(1-\cos^2 x))-(3\cos x+3\cos x(1-\cos^2 x))})=6\cos 3x$
$ 3^{3\cos x(1+\sin^2 x)}(1-3^{(4\cos x-\cos x+\cos^3 x)-(3\cos x+3\cos x-3\cos^3 x)})=6\cos 3x$
$ 3^{3\cos x(1+\sin^2 x)}(1-3^{4\cos^3 x-3\cos x})=6\cos 3x$
$ 3^{3\cos x(1+\sin^2 x)}(1-3^{\cos 3x})=6\cos 3x$
$ 3^{3\cos x(1+\sin^2 x)}(1-3^{\cos 3x})(1-3^{\cos 3x})=6\cos 3x(1-3^{\cos 3x})$
$ \dfrac{3^{3\cos x(1+\sin^2 x)}(1-3^{\cos 3x})^2}{6}=\cos 3x(1-3^{\cos 3x})$ (*)Since $y=f(x)(1-3^{f(x)})\le 0$ for all $x$, the RHS of the equation above (*) is always less than or zero to zero for all $x$
But notice that on the LHS of the equation (*), we have
1. A squared term on the LHS that is always greater than or equal to zero: $(1-3^{\cos 3x})^2\ge 0$,
2. $\dfrac{3^{3\cos x(1+\sin^2 x)}}{6}$ that is always greater than zero.
That means the equation holds iff both sides equal to zero, and that happens when:
$\cos 3x=0$
$3x=\dfrac{\pi}{2}+n\pi$.
$\therefore x=\dfrac{\pi}{6}+\dfrac{n\pi}{3}$ for integer $n$.