# Sophomore's dream changing “x”

"Sophomore's Dream" says $\sum_{n=1}^{\infty}n^{-n}=\int_0^1x^{-x}$

Can you replace the $x$ and $n$ with $2x$ or $x^3$ (and $2n$ or $n^3$) or something? I would guess not, because replacing $x$ with the constant $1$ ($x^0$) doesn't work. And if this doesn't work, why does it not work? I understand its probably a basic math operation that prevents you from doing this, so thanks for any input!

The standard way of proving this identity is to write $x^{-x} = e^{-x\log x}$ and then expand $e^{-x\log x} = \sum_{n=0}^{\infty} \frac{(-x\log x)^{n}}{n!}.$ Now the integral is $$\int_{0}^{1} \sum_{n=0}^{\infty} \frac{(-x\log x)^n}{n!} \mathrm{d}x = \sum_{n=0}^{\infty} \int_{0}^{1}\frac{(-x\log x)^{n}}{n!}\mathrm{d}x= \sum_{n=0}^{\infty} \frac{(n+1)^{-n-1}}{n!}\int_{0}^{\infty} u^{n}e^{-u}\mathrm{d}u = \sum_{n=0}^{\infty} \frac{\Gamma(n+1)}{n!(n+1)^{n+1}} = \sum_{n=0}^{\infty} \frac{1}{(n+1)^{n+1}}.$$
The important steps here are interchanging the order of summation and integration (which is okay here since the power series uniformly converges), and the consequent substitution $x=e^{-u/(n+1)}.$ Replacing $x$ by $f(x),$ we would instead have $$\sum_{n=0}^{\infty} \int_{0}^{1} \frac{(-f(x)\log f(x))^n}{n!} \mathrm{d}x.$$ Generally this integral would be impossible to work out by substitution as before, but to address one of your examples:
$$\sum_{n=0}^{\infty} \int_{0}^{1} \frac{(-3x^3 \log x)^n}{n!}\mathrm{d}x = \sum_{n=0}^{\infty} \frac{(-3)^n}{n!}\int_{0}^{1}(x^3 \log x)^n\mathrm{d}x \\= \sum_{n=0}^{\infty} \frac{3^n}{n!(n+1)^{n+1}}\int_{0}^{\infty} u^{n} e^{-(3n+1)u/(n+1)}\mathrm{d}u = \sum_{n=0}^{\infty}\frac{3^n}{n!(n+1)^{n+1}}\cdot \left(\frac{n+1}{3n+1}\right)^{n+1} \int_{0}^{\infty} v^{n}e^{-v}\mathrm{d}v\\ =\sum_{n=0}^{\infty}\frac{3^n}{(3n+1)^{n+1}},$$ so as it turns out, you see that the term $n^{-n}$ doesn't directly correspond to $x$ itself, rather it varies with the exponent of $x$. Of course, this isn't precise, but you see the point.
Edit: I should be careful in saying that it varies with the exponent of $x,$ because as you can see, in the limit the term behaves like $\frac{1}{3}n^{-n},$ so it's more of that in the limit you end up with an extra factor of $1/3.$ I didn't check this for other exponents, but this derivation should work for any $x^{k},$ with a similar result.