# 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)}$?

-
$$y = z^a \implies \ln y = \ln (z^a) = a \ln z \implies y = e^{a \ln z}$$ –  JavaMan Jan 11 '13 at 21:52
possible duplicate of Differentiation of $x^{\sqrt{x}}$, how? –  MJD Feb 3 '14 at 19:30

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.

-
Why do you use $\equiv$ instead of $=$? –  xavierm02 Jan 11 '13 at 23:12
@xavierm02 The symbol $\equiv$ is used for an identity, i.e. an equation that holds for all values. For example $\cos^2\theta+\sin^2\theta \equiv 1$. That's because the left-hand side and right-hand side are equal for all values of $\theta$. On the other hand, $\sin\theta = 0$ only holds for some values of $\theta$. Hope this helps. –  Fly by Night Jan 11 '13 at 23:41

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}

-
I am a little slow to follow but should it not be $h(x)=1/x\ln(x)$ and $g(x)=e^x$? second or third line? –  007resu Jan 12 '13 at 1:45
@Freddy: If $h(x)=-(1/x)\ln(x)$ instead, then what you have works just fine. The problem is that we need two $x^{-1}$ and your equation only gives one. –  Clayton Jan 12 '13 at 2:50

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.

-

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.

-

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}$.

-