Finding the derivative of $x^x$ [duplicate]
Solution 1:
The $x^x$ part is indeed wrong: when you have the independent variable in both the base and the exponent, you can use logarithmic differentiation. Let $y=x^x$; then $\ln y=\ln(x^x)=x\ln x$. Now differentiate both sides with respect to $x$: $$\frac{d}{dx}(\ln y)=\frac1y\cdot\frac{dy}{dx}\;,$$ and $$\frac{d}{dx}(x\ln x)=x\cdot\frac1x+1\cdot\ln x=1+\ln x\;,$$ so $$\frac1y\cdot\frac{dy}{dx}=1+\ln x\;.$$ Now just solve this for $dy/dx$, replace $y$ by its value $x^x$, and you’ll have the derivative of $x^x$.
This if of course equivalent to rewriting $x^x$ as $e^{\ln(x^x)}=e^{x\ln x}$ and differentiating it as a composition of exponential and product; either method works fine, so take your pick.
Solution 2:
Because the exponential and logarithmic functions (with the same base) are inverse functions, $$x^x=e^{\ln(x^x)}$$ and using the log of a power property, $$x^x=e^{\ln(x^x)}=e^{x\cdot\ln x}.$$
So, you can find the derivative of $x^x$ by finding the derivative of $e^{x\cdot\ln x}$.
Solution 3:
Well you are almost right but for a term. When you wrote $\dfrac{d x^x}{dx} = x \times x^{x-1}$, you treated that the $x$ occurring in the exponent as a constant. However, since it is a variable, you need to add another term treating the other $x$ in $x^x$ as a constant. Hence, you need to add the term $x^x \ln(x)$ since $\dfrac{d a^x}{dx} = a^x \ln(a)$. In general, $$\dfrac{d \left(u(x)^{v(x)} \right)}{dx} = \underbrace{v(x) \times u(x)^{v(x)-1}}_{\text{treating } v(x) \text{ constant}} + \underbrace{u(x)^{v(x)} \log(u(x))}_{\text{treating } u(x) \text{ constant}}$$ The above follows from the chain rule. $$\left. \dfrac{d \left(u(x)^{v(x)} \right)}{dx} = \frac{\partial \left(u(x)^{v(x)} \right)}{\partial u} \frac{du}{dx} \right \rvert_{v(x)- \text{costant}} + \left. \frac{\partial \left(u(x)^{v(x)} \right)}{\partial v} \frac{dv}{dx} \right \rvert_{u(x)- \text{costant}}$$ A clear approach would be to write $x^x = e^{x \ln (x)}$, (as other have already stated) and work out the derivative.