Derivative of $f(x)^{g(x)}$ Question: Find the derivative of 
$$
f(x) = \left(\frac{1}{x}\right)^{\Large\frac{1}{x}}
$$
Tip: convert $f(x)$ to $e^{g(x)}$.
How does one convert $f(x)$ to $e^{g(x)}$?
Thanks in advance
 A: Consider the simple example $y = a^x$ where $a$ is a number. We have:
$$\begin{array}{ccc}
y &=& a^x \, , \\
\ln y &=& x\ln a \, , \\
e^{\ln y} &=& e^{x\ln a} \, , \\
y &=& e^{x\ln a} \, . 
\end{array}$$
Thus, in your case $(1/x)^{1/x} \equiv e^{(1/x)\ln(1/x)} \equiv e^{-(\ln x)/x}.$ Now use the chain rule to to differentiate.
A: Hint: $$f(x)=e^{(1/x)\cdot\ln(1/x)}.$$
In your case, we can think of this as using the chain rule with $g(x)=e^{x\ln(x)}$ and $h(x)=1/x$ so that $f(x)=g\circ h(x)$. The chain rule implies that $f'(x)=g'(h(x))\cdot h'(x)$, thus 
\begin{align}
f'(x)&=\left(\frac{1}{x}\ln(\frac{1}{x})\right)'e^{(1/x)\ln(1/x)}\\ \\ &=\left(-\frac{1}{x^2}\ln(1/x)-\frac{1}{x^2}\right)e^{(1/x)\ln(1/x)}\\ \\ &=\left(-\frac{\ln(1/x)+1}{x^2}\right)\cdot\left(\frac{1}{x}\right)^{1/x}
\end{align}
A: Two ways come to mind without the rewrite... sorry I have answered the  title rather than the actual question.
Let $y(x)=f(x)^{g(x)}$. Now take the natural logarithm of both sides:
$\ln(y(x))=\ln\left(f(x)^{g(x)}\right)=g(x)\ln(f(x))$.
This may only be done where $f(x)>0$ but for $y$ to be defined in the first place we need this anyway. Now differentiate both sides implicitly with respect to $x$ using power rule:
$\frac{1}{y(x)}\cdot\frac{dy}{dx}=g(x)\frac{1}{f(x)}\cdot f'(x)+g'(x)\cdot\ln(f(x))$.
Now multiply across by $y(x)$
$\frac{dy}{dx}=g(x)\cdot f(x)^{g(x)-1}\cdot f'(x)+f(x)^{g(x)}\cdot \ln(f(x))\cdot g'(x)$.
Alternate Solution
Let $y(f,g)=f^g$ where $f=f(x)$ and $g(x)$. Now use this Chain Rule
$\frac{d}{dt}f(x(t),y(t))=\frac{\partial f}{\partial x}\cdot\frac{dx}{dt}+\frac{\partial f}{\partial y}\cdot\frac{dy}{dt}$
Thus we have
$\frac{dy}{dx}=(gf^{g-1})\cdot \frac{df}{dx}+(f^g\ln(f))\cdot \frac{dg}{dx}$
which is of course the same answer.
A: In general, if $g(x)=\log f(x)$ then $f'(x) = g'(x) f(x)$.  So you really only need to compute the derivative of $g(x)=\log (1/x)^{1/x} = \frac{-\log x}{x}$.
A: First, recall that for $\;h(x) = e^x, h^{-1}(x) = \ln x,\;$ so $\;h(h^{-1}(x)) = x$. So, in this case, $\;f(x) = e^{\large\ln(f(x))}$
Then, to answer your question, with your function in hand: 
$$
 \begin{align} 
f(x) &=\left(\frac{1}{x}\right)^{1/x} \\ \\ 
&=e^{\ln\left((1/x)^{\large 1/x}\right)} \\ \\
&= e^{\large(1/x)\cdot\ln(1/x)} \\ \\
&= e^{\large-\large(\ln x)/x}
\end{align}
$$
Now use the chain-rule to derivate.
