If you dont understand the above way this might help.
using y = a^x
x = log a y (a base)
so in this question
let y = 3^x
x = log 3 y (3 is the base)
change base to e as you are going to need to dy/dx later on.
x = lny / ln3
lny = x.ln3
Therefor using x = log a y (a base)
y = a^x
Hence in this question:
x.ln3 = lny
y = e^(x.ln3)
Now dy/dx of this = ln3.e^(x.ln3)
However in the beggining we let y = 3^x, and futher on we got y = e^(x.ln3), hence they are the same so the answer is:
= ln3.y
= ln3.3^x
If ive made any mistakes please correct me. Thats how i always do it, its more time consuming but always works for me.