What's wrong with this derivative for $\left(1−\frac{1}{x}\right)^x$? I asked a question about how to differentiate $(1−1/x)^x$ before, for $x>1$. The derivative I was told is $$f'(x)=\left(1-\frac{1}{x}\right)^x\left[\frac{1}{1-x}+\log\left(1-\frac{1}{x}\right)\right]$$ 
However, this is negative for many $x>1$.  The function is increasing for $x>1$. So, an increasing function has a negative derivative. I just can't see what's wrong!  
 A: In the body of the OP (but not in the title), we are differentiating $\exp(x\ln(1-1/x))$. 
We use the Chain Rule. Note that the derivative of $x\ln(1-1/x)$ is
$$x(-1)(-1/x^2)\frac{1}{1-1/x}+\ln(1-1/x).$$
This simplifies to 
$$\frac{1}{x-1}+\ln(1-1/x).\tag{1}$$
l, multiply by $(1-1/x)^x$. 
Added: We can use the derivative to show that our function is increasing. It is enough to show that if $g(x)=\frac{1}{x-1}+\ln(1-1/x)$, then $g(x)$ is positive for $x\gt 1$.
We have 
$$g'(x)=-\frac{1}{(x-1)^2}+\frac{1}{x^2-x}=-\frac{1}{x(x-1)^2}.$$
So $g(x)$ is decreasing in the interval $(1,\infty)$. But $\lim_{x\to\infty} g(x)=0$. It follows that $g(x)\gt 0$ for $x\gt 1$.
A: $$\frac{d}{dx}(1-1/x)^{x^2}=\frac{d}{dx}
(e^{x^2 \log(1-1/x)}) = (1-1/x)^{x^2} (2x \log(1-1/x)+ 1/(1-1/x))$$
A: For this kind of problems, I think that logarithmic differentiation make things simpler. Let us suppose that $$f(x)=\left(1−\frac{1}{x}\right)^{a(x)}$$ So, $$\log(f(x))=a(x) \log\left(1−\frac{1}{x}\right)$$ $$\frac{f'(x)}{f(x)}=a'(x)\log\left(1−\frac{1}{x}\right)+\frac{a(x)}{(x-1) x}$$ and then $f'(x)$.
