Sophomore's Dream

Using IBP or otherwise prove that:

\displaystyle \int_0^\infty x^n e^{-x} \mathrm dx = n!

for n \ge 0.

Hence evaluate:

\displaystyle \int_0^1 x^n (\log x)^n \mathrm dx

Hence show that:

\displaystyle \int_0^1 x^{-x} \mathrm dx = \sum_{n = 1}^\infty \frac 1 {n^n}

Also evaluate:

\displaystyle \int_0^1 x^x \mathrm dx

leaving your answer in a similar form.

You can ignore complications exchanging sums and integrals.

We will need this simple lemma for the solution. It is quite obvious, but I will still provide a proof :

Lemma: Given a function f: \Bbb Z^+_0 \to \Bbb R, if some recurrence relation u_n satisfies, for non-negative integer n, u_n=f(n)u_{n-1}, u_0=k \in \Bbb R then \displaystyle u_n=k\prod^n_{r=1}f(r)

Proof: By induction on n.

base case: When n=1, u_1=f(1)u_0=kf(0)

Suppose the statement is true for some n=k. Consider n=k+1:
\displaystyle u_{k+1}=f(k+1)u_k=f(k+1)k\prod^k_{r=1}f(r)=k\prod^{k+1}_{r=1}f(r)
By induction, the lemma holds. \blacksquare


Let \displaystyle u=x^n, v'=e^{-x} then u'=nx^{n-1}, v=-e^{-x}
Let I_n=\displaystyle \int_0^\infty x^n e^{-x} \mathrm dx
\displaystyle I_n=[-x^ne^{-x}]^\infty_0-n\int^\infty_0-x^{n-1} e^{-x} \mathrm dx
\displaystyle I_n=nI_{n-1}, I_0=1
By the lemma, we have I_n=n!.

For the next part I have appended an alternative method that does not need the usage of the first result for anyone interested. The intended method is included here, due to the usage of “hence”, rather than “hence or otherwise”:

use the substitution y=-(n+1)\log x \iff e^{-\frac y{n+1}}=x so dx=-\frac1{n+1}e^{-\frac y{n+1}}dy

\displaystyle \therefore\int^1_0x^n(\log x)^n \mathrm dx=-\frac1{n+1}\int^0_\infty\left(-\frac y{n+1}\right)^n(e^{-\frac {ny}{n+1}})e^{-\frac y{n+1}}\mathrm dy

\displaystyle=\frac{(-1)^n}{(n+1)^{n+1}}\int_0^\infty y^ne^{-y}\mathrm dy


Let x \in \Bbb R^+ then:

x^{-x}=e^{-x\log x}

\displaystyle e^x=\sum^\infty_0\frac{x^n}{n!}, \ x \in \Bbb R
\displaystyle \therefore e^{-x\log x}=x^{-x}=\sum^\infty_{n=0} (-1)^n\frac{(x\log x)^n}{n!}, \ x \in \Bbb R^+

\displaystyle \int^1_0x^{-x} \ \mathrm dx=\int^1_0\sum^\infty_{n=0} (-1)^n\frac{(x\log x)^n}{n!} \mathrm dx

\displaystyle =\sum^\infty_{n=0} \frac{(-1)^n(-1)^nn!}{(n+1)^{n+1}n!}



x^x=e^{x\log x}
\displaystyle \therefore x^x=\sum^\infty_{n=0} \frac{(x\log x)^n}{n!}, \ x \in \Bbb R^+

\displaystyle \int^1_0x^{x} \ \mathrm dx=\int^1_0\sum^\infty_{n=0} \frac{(x\log x)^n}{n!} \mathrm dx



Alternative Method for the Second Integral:

We can derive the second result directly by being a little clever with the recurrence relation. However, do note that the question uses “hence” rather than “hence or otherwise” so this method would (strictly speaking) not be valid for the purposes of the question. Or perhaps I’m being pedantic due to STEP.

Let \displaystyle J_r=\int^1_0x^n(\log x)^r \mathrm dx, r \in \Bbb Z^+
Consider integration by parts on J_r with u=(\log x)^r, v'=x^n.
\displaystyle u'=\frac rx(\log x)^{r-1}, v=\frac{x^{n+1}}{n+1}

\displaystyle\therefore J_r=\left[\frac{x^{n+1}(\log x)^r}{n+1}\right]^1_0-\int^1_0\frac{rx^n(\log x)^{r-1}}{n+1}\mathrm dx

\displaystyle J_r=-\frac r{n+1}J_{r-1}, \ J_0=\frac1{n+1}

\displaystyle J_r=\frac {(-1)^rr!}{(n+1)^{r+1}}

\displaystyle\therefore \ J_n=\frac {(-1)^nn!}{(n+1)^{n+1}}