Derivative rule for a function raised to the power of another function eg $(3x^2+5)^{\arctan{x}}$ I am working some older final exams for my calc 1 class at university. There are several "find the derivative" questions, and while I am normally quite good at these, I got the wrong answer on one, according to wolfram alpha.
I applied exponential derivative rules to this $(3x^2+5)^{\arctan{x}}$ but that doesn't give a correct result. It is only one question of this type and was on a final exam from years ago, so we are unlikely to get a similar one on our final.
Someone asked me to provide the exponential derivative rule, so this is what I mean:
$f'  a^u = a^u*lna*u'$
Nevertheless, I would like to know how it's done. Please kindly provide a step by step and explain the template for finding the derivative of $f(x)^{g(x)}$
Thank you.
 A: Most calculus textbooks would put this in a subsection of the chain rule or implicit differentiation sections. There are multiple equivalent ways to approach it, but I generally have my students use log differentiation. Let $y=f(x)^{g(x)}$ and then take the natural log of both sides: $$\ln(y)= g(x)\ln(f(x))$$ and then differentiate both sides with respect to $x$ and solve for $y’$. 
A: The other answer provided the method to calculate the derivative. I will point out a way to remember the answer. 
Recall that for constant $m$ or $n$, $$\dfrac d{dx} f(x)^m = mf(x)^{m-1}f'(x) \quad \text{and} \quad \dfrac d{dx} n^{g(x)} = n^{g(x)}g'(x) \log n.$$
If $f$ is a positive differentiable function it turns out that you can combine these rules as follows:
$$\frac d{dx} f(x)^{g(x)} = g(x) f(x)^{g(x) - 1}f'(x) + f(x)^{g(x)}g'(x) \log f(x)$$
which reduces to the basic rules above when either $f$ or $g$ is constant.
A: I'm introducing the function
$${\rm pot}(u,v):=u^v\qquad(u>0, \ v\in{\mathbb R})\ .\tag{1}$$
This function of two variables is playing a rôle in your $h(x):=f(x)^{g(x)}$. In fact
$$h(x)={\rm pot}\bigl(f(x),g(x)\bigr)\ .$$
By the chain rule
$$h'(x)={\rm pot}_u\bigl(f(x),g(x)\bigr)f'(x)+{\rm pot}_v\bigl(f(x),g(x)\bigr)g'(x)\ .\tag{2}$$
From $(1)$ one gets
$${\rm pot}_u(u,v)=v\,u^{v-1},\qquad{\rm pot}_v(u,v)=\log u\cdot u^v\ .$$
Inserting this into $(2)$ we obtain
$$h'(x)=g(x) \cdot f(x)^{g(x)-1}\cdot f'(x)+\log\bigl(f(x)\bigr)\cdot f(x)^{g(x)}\cdot g'(x)\ .$$
