# Derivatives

## The derivative of ${\frac {d}{dx}}x^{x}$

### Question

What is ${\frac {d}{dx}}x^{x}$?

### Solution 1

- Let $y=x^{x}$.
- Take $\ln$ of both sides: $\ln y=x\ln x$.
- Differentiate both sides: ${\frac {d}{dx}}\ln y={\frac {d}{dx}}x\ln x$.
- Apply the chain rule on the left-hand side: ${\frac {d}{dx}}\ln y={\frac {1}{y}}\cdot {\frac {dy}{dx}}$.
- Apply the product rule on the right-hand side: ${\frac {d}{dx}}x\ln x=1\cdot \ln x+x\cdot {\frac {1}{x}}=\ln x+1$.
- Putting it together, we have ${\frac {1}{y}}\cdot {\frac {dy}{dx}}=\ln x+1$.
- Hence ${\frac {dy}{dx}}=y(\ln x+1)=x^{x}(\ln x+1)$.

### Solution 2

- Note that $x=e^{\ln x}$, so $x^{x}=(e^{\ln x})^{x}=e^{x\ln x}$.
- Applying the chain rule, ${\frac {d}{dx}}x^{x}={\frac {d}{dx}}e^{x\ln x}=e^{x\ln x}{\frac {d}{dx}}x\ln x$.
- Applying the product rule, ${\frac {d}{dx}}x\ln x=1\cdot \ln x+x\cdot {\frac {1}{x}}=\ln x+1$.
- Therefore ${\frac {d}{dx}}x^{x}=e^{x\ln x}(\ln x+1)=x^{x}(\ln x+1)$.

# Integrals

## The integral $\int x^{x}\,dx$

### Question

What is $\int x^{x}\,dx$?

### Solution

- We can write $x^{x}$ as $(e^{\ln x})^{x}=e^{x\ln x}$.
- Consider the series expansion of $e^{x\ln x}$:

$e^{x\ln x}=1+(x\ln x)+{\frac {(x\ln x)^{2}}{2!}}+{\frac {(x\ln x)^{3}}{3!}}+\ldots +{\frac {(x\ln x)^{i}}{i!}}+\ldots =\sum _{i=0}^{\infty }{\frac {(x\ln x)^{i}}{i!}}$.

- We can interchange the integration and summation (we can recognize this as a special case of the Fubini/Tonelli theorems) and write

$\int x^{x}\,dx=\int \left(\sum _{i=0}^{\infty }{\frac {(x\ln x)^{i}}{i!}}\right)\,dx=\sum _{i=0}^{\infty }\left(\int {\frac {(x\ln x)^{i}}{i!}}\,dx\right)=\sum _{i=0}^{\infty }\left({\frac {1}{i!}}\int x^{i}(\ln x)^{i}\,dx\right).$

# Limits