I am teaching high school calculus, and I just finished my lecture on logarithmic differentiation. Of course, I showed the classic example of finding the derivative of x^x.
When teaching it, I noted that it would be incorrect to view it as either an exponential function or as a polynomial function.
I then showed that the 2 different views would produce different derivatives. If you view it as an exponential, then its derivative would be x^x*ln(x), as it has a base different from e.
If you view it as a polynomial, then using the power rule, you would get its derivative is x*x^(x-1), or x^x.
I then showed that using logarithmic differentiation, you get the actual derivative is x^x(ln(x)+1). However, I then began wondering, since you can rewrite this as x^x*ln(x) + x^x, is there something deeper going on that causes this derivative to be the sum of the two different ways of viewing the function, or is this just a total coincidence?
I'd love to hear any thoughts!
Let's formalise your observation. Constant $a$ give $(x^a)^\prime=ax^{a-1},\,(a^x)^\prime=a^x\ln a$. These results sum when $x=a$ to $a^a(\ln a+1)$, which is $(x^x)^\prime$ at $x=a$. So, why is that?
More generally, consider a binary function $f(u,\,v)$. Partial differentiation with respect to the $i$th argument is denoted with an $_i$ subscript. (We'll assume $f$ is such that both these partial derivatives exist.) At $u=a$, it becomes $f(a,\,v)$, with $v$-derivative $f_2(a,\,v)$ evaluating to $f_2(a,\,a)$ if $v=a$ too. The other way round gets $f_1(a,\,a)$. Now we evaluate a total derivative by the multivariate chain rule,$$\frac{d}{dx}f(x,\,x)=\frac{dx}{dx}f_1(x,\,x)+\frac{dx}{dx}f_2(x,\,x)=f_1(x,\,x)+f_2(x,\,x).$$So it was no coincidence at all. You can, for example, see the same thing happen with $f(u,\,v)=u+v$ or $uv^2$ or whatever you like.