# Derivative as first order variation in output?

In reference to method shown at 4:00 of this video,

Consider,

$$f(x) = x^x$$

Then,

$$f(x+h) = (x+h)^{x+h} = x^{x+h} ( 1 + \frac{h}{x})^{x+h}$$

Now, consider right most term in brackets,

$$( 1 + \frac{h}{x})^{x+h} = 1+ (x+h) \frac{h}{x} + \frac{ (x+h)(x+h-1)}{2!} ( \frac{h}{x})^2...= 1+h+ stuff$$

This suggests derivative of $$x^x$$ is $$x^x$$ which is wrong! So, how would I prove the derivative using this 'perturbation method'

• Why would you leave out the $x^{x+h}$ when this factor also involves $h$ ? – Learn'd Astronomer Nov 12 '20 at 8:31
• That one's limit is evaluatable easily if you have product of two limits which is defined individually then you can distribute limits – Buraian Nov 12 '20 at 8:35
• I see. Now, I am not familiar with this method, and I might be missing something here. However, it seems that the idea behind this way of finding the derivative is to write out the Taylor series of the function and look at the first order term. The factor that you are now considering individually is no longer a function where $x+h$ is the argument. Can you see why? Maybe that is the fallacy. – Learn'd Astronomer Nov 12 '20 at 8:43
• Your argument shows $f(x+h)=x^{x+h}\left(1+h + O(h^2)\right) = x^x x^h (1+h + O(h^2))$. Ok, fine so far, but now what? How did you deduce (incorrectly) from here that the derivative is $x^x$? The end goal is that you must get something like $f(x+h)=f(x)+\alpha h + o(h)$ for some real number $\alpha$; so you must work slightly to rewrite $x^h$. – peek-a-boo Nov 12 '20 at 8:55

## 2 Answers

You are neglecting the $$x^{x+h}$$ too fast: $$x^{x+h} = x^x + (x^x\log x)h + \cdots$$

• This was very unexpected. – Buraian Nov 12 '20 at 9:19
• @Buraian, your mistake is extremely interesting and illuminating. Much better than many correct (and boring) calculations... – Martín-Blas Pérez Pinilla Nov 12 '20 at 9:31

May be, logarithmic differentiation would me life easier $$f(x)=x^x \implies \log(f(x))=x \log(x)\implies \frac {f'(x)}{f(x)}=\big[x \log(x) \big]'$$ Now, consider $$g(x)=x \log(x)$$ $$g(x+h)=(x+h)\log(x+h)=(x+h)\big[\log(x)+\log \left(1+\frac{h}{x}\right) \big]$$ Since $$h$$ is small, using equivalents (or Taylor series) $$\log \left(1+\frac{h}{x}\right)\sim \frac{h}{x}$$ Replacing $$g(x+h)\sim (x+h)\big[\log(x)+\frac{h}{x} \big]$$ Expanding $$g(x+h)\sim x \log(x) + x\frac{h}{x}+h \log(x) + h\frac{h}{x}=x \log(x)+h+h \log(x) + \frac{h^2}{x}$$

$$\frac{g(x+h)-g(x)}h\sim\frac{h+h \log(x) + \frac{h^2}{x} }h=1+\log(x) + \frac{h}{x}$$ $$\lim_{h\to 0} \, \frac{g(h+x)-g(x)}{h}=1+\log(x)$$ $$\frac {f'(x)}{f(x)}=1+\log(x)\implies f'(x)=f(x)\times\frac {f'(x)}{f(x)}= \big[1+\log(x)\big]\,x^x$$