Why the derivative of $n^{1/n}$ is $n^{1/n} \left( \frac{1}{n^2} - \frac{\log(n)}{n^2}\right)$ Why the derivative of $n^{1/n} = \sqrt[n]{n}$ is $n^{1/n} \left( \frac{1}{n^2} - \frac{\log(n)}{n^2}\right)$ (according to Maxima and other tools online)?
I have tried to applied the chain rule, but it comes something completely different:
$$\frac{1}{n} n^{\frac{1}{n} - 1} \cdot 1 = \frac{1}{n} n^\frac{1}{n}n^{-1} = \frac{1}{n^2} n^\frac{1}{n} = \frac{\sqrt[n]{n}}{n^2}$$
Sincerely, I am not seeing where that $\log$ and the rest of the stuff comes from. I have a more difficult problem that is similar and whose solution contains a $\log$ somewhere, but I am not seeing where it comes from.
 A: Write
$$
n^{1/n}=\exp\left(\frac1n\log(n)\right)
$$
Then the chain rule, followed by the product rule, says
$$
\begin{align}
\frac{\mathrm{d}}{\mathrm{d}n}n^{1/n}
&=\exp\left(\frac1n\log(n)\right)\frac{\mathrm{d}}{\mathrm{d}n}\left(\frac1n\log(n)\right)\\
&=n^{1/n}\left(\frac1{n^2}-\frac{\log(n)}{n^2}\right)
\end{align}
$$
A: The previous answers have explained how to do the calculation correctly.  I want to comment on why your method didn't work.
The reason you have the wrong answer is you haven't applied the chain rule correctly.  You started with $f(n)=n^{1/n}$, and tried to apply the chain rule.  Since your first calculation was $$\frac{d}{dn}n^{1/n}=\frac{1}{n}n^{\frac{1}{n}-1}.$$ It looks to me like you've assumed that the $\frac{1}{n}$ in the exponent is constant, allowing you to apply the power rule.  The problem is that $\frac{1}{n}$ is not constant.
By analogy, at some point you should have seen that $\frac{d}{dx}e^x=e^x$.  We could calculate the derivative of $e^{1/x}$ using the chain rule;
$$\frac{d}{dx}e^{1/x}=\frac{-1}{x^2}e^{1/x}.$$  By the incorrect method that you used earlier, by pretending that the $x$ in the exponent is constant, I would get the incorrect result $$\frac{d}{dx}e^{1/x}=0.$$
A: $$y=n^{1/n}$$
$$\log(y)=1/n\log(n)$$
$$\frac{y'}{y}=-\frac{1}{n^2}\log(n)+{1/n}(1/n)$$
multiply by $y$
$$y'=y(\frac{1}{n^2}-\frac{\log n}{n^2})$$
