How to calculate the derivative of $x^x$? I'm trying to follow an example in my textbook.
$$y=x^x$$
$$\ln (y)=\ln (x) \cdot x$$
We want to calculate the derivative with respect to x
The book makes quite a leap here and states that:
$$\frac{y'}{y}=\frac{1}{x}\cdot x+1\cdot \ln(x)$$
Since $y=x^x$ this means that:
$$y'=x^x(1+\ln(x))$$
Is this correct?
If I start from the beginning then:
$$y=x^x$$
$$\ln (y)=\ln (x) \cdot x$$
Only if we want to take the derivative this expression isn't useful, we'll have to use the full expression:
$$e^{\ln (y)}=e^{\ln (x) \cdot x}$$
Now, if we take the derivative of this with respect to x we find that:
$$\frac {1}{y}\cdot e^{\ln (y)}=e^{\ln (x) \cdot x}\cdot (1+ln(x))$$
The left hand expression would simplify to $\frac {y'}{y}$, since $e^{\ln(y)}=y$ and the derivative of $y=y'$
so:
$$\frac {y'}{y}=e^{\ln (x) \cdot x}\cdot (1+\ln(x))$$
Which can be written as:
$$\frac {y'}{x^x}=x^x\cdot (1+\ln(x))$$
Which simplifies to:
$$y'=x^{2x}\cdot (1+\ln(x))$$
 A: You can just use the chain rule
$$y=x^x=e^{x \ln x}\\
\frac {dy}{dx}=e^{x \ln x}\frac d{dx}(x \ln x)\\=e^{x\ln x}(\ln x + 1)\\=x^x(1+\ln x)$$
A: The first one is the correct answer. You have made mistake in this step:

$$\frac {1}{y} \cdot e^{\ln (y)}=e^{\ln (x) \cdot x} \cdot (1+\ln(x))$$

Using chain rule, you will have $y'$ in the left.
A: You missed out $y'$ in this line:

$$\frac {1}{y}e^{\ln y}=e^{x\ln x}(1+\ln x)$$

as $$\left(e^{\ln y}\right)'=e^{\ln y}\cdot\frac1y\cdot y'=y'$$
A: You get yourself into a detour when you start writing $\ln y$ on the left-hand side of one of the equations. It is correct enough so far, but it doesn't really lead you torwards the right result.
More direct would be
$$ f(x) = x^x = \exp(x \log x) = \exp(g(x)) \quad\text{where }g(x) = x\log x $$
Then you can use the product rule (just as you already are) to get
$$ g'(x) = 1 + \log x $$
and now simply apply the chain rule to the composition of the exponential function and $g$:
$$ f'(x) = \exp'(g(x)) g'(x) = \exp(g(x)) (1+\log x)  = x^x (1+\log x)$$
A: Use the exponentiation method. The most general case would be
$$f(x)^{g(x)}$$
You can rewrite this as
$$\large f(x)^{g(x)} \equiv e^{g(x) \ln(f(x))}$$
From this, you will just have the derivative of the exponential of a function. You might call 
$$g(x) \ln(f(x)) = h(x)$$
and then you use
$$\frac{\text{d}}{\text{d}x} e^{h(x)} = e^{h(x)}\cdot h'(x)$$
In your case: 
$$\frac{\text{d}}{\text{d}x} e^{g(x)\ln(f(x))} = e^{g(x) \ln (f(x))} \cdot \left(g'(x)\ln(f(x)) + g(x) \frac{f'(x)}{f(x)}\right)$$
Now, remembering that $e^{g(x) \ln(f(x))} = f(x)^{g(x)}$ we can eventually write:
$$\large \frac{\text{d}}{\text{d}x} f(x)^{g(x)} = f(x)^{g(x)}\left(g'(x)\ln(f(x)) + g(x) \frac{f'(x)}{f(x)}\right)$$
In your case:
$$f(x) = x ~~~~~~~ g(x) = x$$
Hence
$$\large \frac{\text{d}}{\text{d}x} x^x = x^x\left(\ln(x) + x \frac{1}{x}\right)$$
$$\large \frac{\text{d}}{\text{d}x} x^x = x^x(\ln(x) + 1)$$
