๐Ÿงฎ Brain Teaser

The Integral That Knows Its Own Name

Evaluate the definite integral

I=โˆซ01xxโ€‰dx+โˆซ01xโˆ’xโ€‰dx.I = \int_0^1 x^x \, dx + \int_0^1 x^{-x} \, dx.

Express your answer as an infinite series in closed form.

seriespower seriesgamma functionsubstitutionx^x

Answer: Sophomore's Dream Integral

Key Idea / Intuition

The trick is to expand xx=exlnโกxx^x = e^{x \ln x} as a power series in xlnโกxx \ln x, then integrate term by term. Each resulting integral โˆซ01xn(lnโกx)nโ€‰dx\int_0^1 x^n (\ln x)^n \, dx can be evaluated by the substitution x=eโˆ’tx = e^{-t}, turning it into a Gamma integral. The two integrals โˆซ01xxdx\int_0^1 x^x dx and โˆซ01xโˆ’xdx\int_0^1 x^{-x} dx combine beautifully into a sum known as the Sophomore's Dream, named after Johann Bernoulli (1697).


Formal Proof / Solution

Step 1: Expand xxx^x as a series

xx=exlnโกx=โˆ‘n=0โˆž(xlnโกx)nn!x^x = e^{x \ln x} = \sum_{n=0}^\infty \frac{(x \ln x)^n}{n!}

So: โˆซ01xxโ€‰dx=โˆ‘n=0โˆž1n!โˆซ01xn(lnโกx)nโ€‰dx.\int_0^1 x^x \, dx = \sum_{n=0}^\infty \frac{1}{n!} \int_0^1 x^n (\ln x)^n \, dx.

Step 2: Evaluate โˆซ01xn(lnโกx)nโ€‰dx\int_0^1 x^n (\ln x)^n \, dx

Substitute x=eโˆ’tx = e^{-t}, so lnโกx=โˆ’t\ln x = -t, dx=โˆ’eโˆ’tdtdx = -e^{-t} dt, and the limits go from t=โˆžt = \infty to t=0t = 0:

โˆซ01xn(lnโกx)nโ€‰dx=โˆซโˆž0eโˆ’nt(โˆ’t)n(โˆ’eโˆ’t)โ€‰dt=(โˆ’1)nโˆซ0โˆžtneโˆ’(n+1)tโ€‰dt.\int_0^1 x^n (\ln x)^n \, dx = \int_\infty^0 e^{-nt}(-t)^n (-e^{-t}) \, dt = (-1)^n \int_0^\infty t^n e^{-(n+1)t} \, dt.

Now substitute u=(n+1)tu = (n+1)t:

=(โˆ’1)nโ‹…1(n+1)n+1โˆซ0โˆžuneโˆ’uโ€‰du=(โˆ’1)nโ‹…n!(n+1)n+1.= (-1)^n \cdot \frac{1}{(n+1)^{n+1}} \int_0^\infty u^n e^{-u} \, du = (-1)^n \cdot \frac{n!}{(n+1)^{n+1}}.

Step 3: Sum the series for โˆซ01xxโ€‰dx\int_0^1 x^x \, dx

โˆซ01xxโ€‰dx=โˆ‘n=0โˆž1n!โ‹…(โˆ’1)nโ‹…n!(n+1)n+1=โˆ‘n=0โˆž(โˆ’1)n(n+1)n+1=โˆ‘n=1โˆž(โˆ’1)nโˆ’1nn.\int_0^1 x^x \, dx = \sum_{n=0}^\infty \frac{1}{n!} \cdot (-1)^n \cdot \frac{n!}{(n+1)^{n+1}} = \sum_{n=0}^\infty \frac{(-1)^n}{(n+1)^{n+1}} = \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^n}.

That is:

โˆซ01xxโ€‰dx=1โˆ’122+133โˆ’144+โ‹ฏ\int_0^1 x^x \, dx = 1 - \frac{1}{2^2} + \frac{1}{3^3} - \frac{1}{4^4} + \cdots

Step 4: Handle โˆซ01xโˆ’xโ€‰dx\int_0^1 x^{-x} \, dx

Similarly, xโˆ’x=eโˆ’xlnโกxx^{-x} = e^{-x \ln x}, so:

โˆซ01xโˆ’xโ€‰dx=โˆ‘n=0โˆž(โˆ’1)nn!โˆซ01xn(lnโกx)nโ€‰dx=โˆ‘n=0โˆž(โˆ’1)nn!โ‹…(โˆ’1)nโ‹…n!(n+1)n+1=โˆ‘n=0โˆž1(n+1)n+1.\int_0^1 x^{-x} \, dx = \sum_{n=0}^\infty \frac{(-1)^n}{n!} \int_0^1 x^n (\ln x)^n \, dx = \sum_{n=0}^\infty \frac{(-1)^n}{n!} \cdot (-1)^n \cdot \frac{n!}{(n+1)^{n+1}} = \sum_{n=0}^\infty \frac{1}{(n+1)^{n+1}}.

So:

โˆซ01xโˆ’xโ€‰dx=โˆ‘n=1โˆž1nn=1+122+133+144+โ‹ฏ\int_0^1 x^{-x} \, dx = \sum_{n=1}^\infty \frac{1}{n^n} = 1 + \frac{1}{2^2} + \frac{1}{3^3} + \frac{1}{4^4} + \cdots

Step 5: Final Answer

I=โˆซ01xxโ€‰dx+โˆซ01xโˆ’xโ€‰dx=โˆ‘n=1โˆž(โˆ’1)nโˆ’1nn+โˆ‘n=1โˆž1nn\boxed{I = \int_0^1 x^x \, dx + \int_0^1 x^{-x} \, dx = \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^n} + \sum_{n=1}^\infty \frac{1}{n^n}}

Each piece individually is already a beautiful result. Numerically:

  • โˆซ01xโˆ’xโ€‰dxโ‰ˆ1.2913\int_0^1 x^{-x} \, dx \approx 1.2913
  • โˆซ01xxโ€‰dxโ‰ˆ0.7834\int_0^1 x^x \, dx \approx 0.7834
  • Their sum โ‰ˆ2.0747\approx 2.0747

These two identities together are called Sophomore's Dream โ€” a playful name because they look too clean to be true, yet follow from a surprisingly elementary calculation.

Source: Johann Bernoulli, 1697; mathematical folklore

Type: IntegrationSource: Johann Bernoulli, 1697; mathematical folkloreEdit on GitHub โ†—