Sophomore's dream is a relatively common identity, that states $$ \int _0^1 x^{-x} dx = \sum_{n = 1}^\infty n^{-n}$$ The common proof is found using the series expansion for $ e^{- x \log x} $ and switching the integral and the sum.
I have tried to find a proof of the identity using contour integration in the complex plane. I originally thought about the residue theorem, but then realized I couldn't as it only applies if there are finitely many poles. I then decided to transform the original integral as follows.
$$ \int_0^1 x^{-x} dx = \int_1^ \infty x^{-\frac 1 x - 2} dx $$ using the transform $ x \rightarrow \frac 1 x $
Then we take the integral over the half annulus with outer radius $R$ and inner radius $1$ of $ z^{-\frac 1 z - 2} $
$$ \int_C z ^ {-\frac 1 z - 2} dz = \int_1^R x ^ {-\frac 1 x - 2} dx + \int_{C_1} z ^ {-\frac 1 z - 2} dz + \int_{-R}^{-1} x ^ {-\frac 1 x - 2} dx + \int_{C_2} z ^ {-\frac 1 z - 2} dz = 0$$
where $C_1$ is the upper semicircle with radius R, and $C_2$ is the upper half of the unit circle.
$$\left| \int_{C_1} z ^ {-\frac 1 z - 2} dz \right| \le \int_{C_1} | z ^ {-\frac 1 z - 2} | dz \sim\int_0^{\pi} R ^ {- 2} dz \rightarrow 0$$
From here I am stuck with the other integrals, and I am unsure of how to proceed.