Question: Sophomore's dream is the identity that states 

\begin{equation}
\int\_0^1 x^x dx = \sum\limits\_{n=1}^\infty (-1)^{n+1}n^{-n}
\end{equation}

The proof is found using the series expansion for $e^{-x\log(x)}$ and switching the integral and the sum. But I have a problem : I don't understand why I can replace $x^x$ in the integral by the series expansion of $e^{-x\log(x)}$ because the series is not defined in $x=0$. 

In understand that in the integral, we can extend the function $x^x$ in $x=0$ because the limit is finite but then the extended function doesn't admit a series expansion for $x=0$.

What is the easiest way to solve this issue ?

Thank you !

Answer: 
Let $$I(k,n)=\int\limits\_0^1x^k\ln^nxdx.$$
Thus, $$I(k,n)=\int\limits\_0^1x^k\ln^nxdx=\frac{x^{k+1}\ln^nx}{k+1}\big|\_0^1-\frac{n}{k+1}\int\limits\_0^1x^k\ln^{n-1}xdx=-\frac{nI(k,n-1)}{k+1}.$$
Thus, 
$$I(k,n)\prod\_{i=2}^{n}I(k,i-1)=I(k,n)\prod\_{i=1}^{n-1}I(k,i)=\prod\_{i=1}^nI(k,i)=$$
$$=\prod\_{i=1}^{n}\left(-\frac{i}{k+1}I(k,i-1)\right)=\frac{(-1)^nn!}{(k+1)^n}\prod\_{i=2}^{n}I(k,i-1)I(k,0)=$$
$$=\frac{(-1)^nn!}{(k+1)^n}\prod\_{i=2}^{n}I(k,i-1)\int\limits\_0^1x^kdx=\frac{(-1)^nn!}{(k+1)^{n+1}}\prod\_{i=2}^{n}I(k,i-1),$$
which gives
$$I(k,n)=\frac{(-1)^nn!}{(k+1)^{n+1}},$$ 
$$I(k,k)=\frac{(-1)^kk!}{(k+1)^{k+1}}$$ and
$$\int\limits\_{0}^1x^xdx=\int\limits\_0^1e^{x\ln{x}}dx=\sum\_{k=0}^{+\infty}\int\limits\_0^1\frac{x^k\ln^kx}{k!}dx=\sum\_{k=0}^{+\infty}\frac{1}{k!}\int\limits\_0^1x^k\ln^kxdx=$$
$$=\sum\_{k=0}^{+\infty}\left(\frac{1}{k!}\cdot\frac{(-1)^kk!}{(k+1)^{k+1}}\right)=\sum\_{k=0}^{+\infty}\frac{(-1)^k}{(k+1)^{k+1}}=\sum\_{n=1}^{+\infty}\frac{(-1)^{n+1}}{n^n}.$$
Done!
Define

$$ f(x) = \begin{cases} x^x & 0 < x \leq 1, \\
1 & x = 0. \end{cases},
g(x) = \begin{cases} x \ln x & 0 < x \leq 1, \\
0 & x = 0. \end{cases} $$

Both $f,g$ are continuous on $[0,1]$ and we have $f(x) = e^{g(x)}$ for all $x \in [0,1]$. The image of $g$ is a compact subset of $\mathbb{R}$ so it lies in some interval $[-N,N]$. The power series of $e^x$ converges uniformly on any closed interval so if we plug $g$ into the power series of $e^x$ (obtaining a function series, not a power series!), we still have an identity and uniform convergence. Namely,

$$ f(x) = e^{g(x)} = \sum\_{x = 0}^{\infty} \frac{g(x)^n}{n!} $$

where the sum on the right hand side converges uniformly on $[0,1]$ to $e^{g(x)} = f(x)$.