# Derivatives

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

### Question

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

### Solution 1

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

### Solution 2

• Note that ${\displaystyle x=e^{\ln x}}$, so ${\displaystyle x^{x}=(e^{\ln x})^{x}=e^{x\ln x}}$.
• Applying the chain rule, ${\displaystyle {\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, ${\displaystyle {\frac {d}{dx}}x\ln x=1\cdot \ln x+x\cdot {\frac {1}{x}}=\ln x+1}$.
• Therefore ${\displaystyle {\frac {d}{dx}}x^{x}=e^{x\ln x}(\ln x+1)=x^{x}(\ln x+1)}$.

# Integrals

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

### Question

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

### Solution

• We can write ${\displaystyle x^{x}}$ as ${\displaystyle (e^{\ln x})^{x}=e^{x\ln x}}$.
• Consider the series expansion of ${\displaystyle e^{x\ln x}}$:
   ${\displaystyle 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
   ${\displaystyle \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

## The limit of ${\displaystyle \lim _{x\rightarrow 0^{+}}x^{x}}$

### Question

What is ${\displaystyle \lim _{x\rightarrow 0^{+}}x^{x}}$?

### Solution

• Note that ${\displaystyle x=e^{\ln x}\,so\x^{x}=(e^{\ln x})^{x}=e^{x\ln x}}$.
• We can further rewrite this as ${\displaystyle x^{x}=e^{x\ln x}=e^{\frac {\ln x}{\frac {1}{x}}}}$.
• As long as ${\displaystyle f}$ is continuous and the limit of ${\displaystyle g}$ exists at the point in question, the limit will commute with composition:

${\displaystyle \lim _{x\rightarrow t}f(g(x))=f(\lim _{x\rightarrow t}g(x)).}$ In our case, ${\displaystyle e(\cdot )}$ is continuous, so ${\displaystyle \lim _{x\rightarrow 0^{+}}x^{x}=e^{\lim _{x\rightarrow 0^{+}}{\frac {\ln x}{\frac {1}{x}}}}.}$

• The question, then, is what is $\displaystyle \lim_{x \tendsto 0^+} \frac{\ln x}{\frac{1}{x}}$ .
• As $\displaystyle x \tendsto 0^+$ , $\displaystyle \ln x \tendsto -\infty, \frac{1}{x} \tendsto +\infty$ . In this situation we can apply l'Hôpital's rule:

$\displaystyle \lim_{x \tendsto 0^+} \frac{\ln x}{\frac{1}{x}} = \lim_{x \tendsto 0^+} \frac{\frac{d}{dx} \ln x}{\frac{d}{dx} \frac{1}{x}} = \frac{\frac{1}{x}}{-\frac{1}{x^2}} = \frac{\frac{1}{x} \cdot x^2}{-\frac{1}{x^2} \cdot x^2} = -x.$

• Hence $\displaystyle \lim_{x \tendsto 0^+} x^x = e^0 = 1$ .

## The limits of $\displaystyle \lim_{x \tendsto +\infty} x \sin \frac{1}{x}$ and $\displaystyle \lim_{x \tendsto -\infty} x \sin \frac{1}{x}$

### Question

What are $\displaystyle \lim_{x \tendsto +\infty} x \sin \frac{1}{x}$ and $\displaystyle \lim_{x \tendsto -\infty} x \sin \frac{1}{x}$ ?

### Solution

• Let us rewrite ${\displaystyle x\sin {\frac {1}{x}}\as\{\frac {\sin {\frac {1}{x}}}{\frac {1}{x}}}}$.
• As $\displaystyle x \tendsto +\infty, \frac{1}{x} \tendsto 0$ and $\displaystyle x \sin \frac{1}{x} \tendsto 0$ .
• We have ${\displaystyle {\frac {0}{0}}}$, so we can apply l'Hôpital's rule.
• Differentiating the numerator in ${\displaystyle {\frac {\sin {\frac {1}{x}}}{\frac {1}{x}}}}$, we obtain ${\displaystyle \left(\cos {\frac {1}{x}}\right)\left(-{\frac {1}{x^{2}}}\right)}$.
• Differentiating the denominator in ${\displaystyle {\frac {\sin {\frac {1}{x}}}{\frac {1}{x}}}}$, we obtain ${\displaystyle -{\frac {1}{x^{2}}}}$.
• Thus

$\displaystyle \lim_{x \tendsto +\infty} x \sin \frac{1}{x} = \lim_{x \tendsto +\infty} \frac{\sin \frac{1}{x}}{\frac{1}{x}} = \lim_{x \tendsto +\infty} \frac{\left(\cos \frac{1}{x}\right) \left(-\frac{1}{x^2}\right)}{-\frac{1}{x^2}} = \lim_{x \tendsto +\infty} \cos \frac{1}{x} = 1.$

• Similarly we can find that $\displaystyle \lim_{x \tendsto -\infty} x \sin \frac{1}{x} = 1$ .