You could do it in various ways.
One method (ultimately justified by the multi-variable chain rule) is to regard one x as varying, the others constant, and then add the results:
\frac{dy}{dx}=(3x)^{x^{2}}+3x^{3}(3x)^{x^{2}-1}+2x^{2}(3x)^{x^{2}}\ln(3x)
To do this properly, we may define:
H(u,v,w)=uv^{w}, U(x)=x, V(x)=3x, W(x)=x^{2}
Then, we may define the function:
h(x)=H(U(x),V(x),W(x))
and we have, by the multi-variable chain rule:
\frac{dh}{dx}=(\frac{\partial{H}}{\partial{u}}\frac{dU}{dx}+\frac{\partial{H}}{\partial{v}}\frac{dV}{dx}+\frac{\partial{H}}{\partial{w}}\frac{dW}{dx})\mid_{(u,v,w)=(U(x),V(x),W(x)}