52
$\begingroup$

I'm trying to find $\int x^x \, dx$, but the only thing I know how to do is this:

Let $u=x^x$.

$\begin{align} \int x^x \, dx&=\int u \, du\\[6pt] &=\frac{u^2}{2}\\[6pt] &=\dfrac{\left(x^x\right)^2}{2}\\[6pt] &=\frac{x^{2x}}{2} \end{align}$

But it's certain that this isn't the correct way to evaluate that, and the answer must be wrong.

6 Answers 6

58

As noted in the comments, your derivation contains a mistake.

To answer the question, this function can not be integrated in terms of elementary functions. So there is no "simple" answer to your question, unless you are willing to consider a series approximation, obtained by expanding the exponential as a series:

$\int{x^xdx} = \int{e^{\ln x^x}dx} = \int{\sum_{k=0}^{\infty}\frac{x^k\ln^k x}{k!}}dx$

  • 0
    @Vedvart1 It's an infinity sum. Splitting it up could lead to trouble.2017-09-11
31

If you are willing to put bounds on your integral, it is possible to compute that $\int_0^1 x^x\,dx = \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^n}.$ Indeed, if you start like nbubis suggests, and make the substitution $u = -\log x$, you get that $\int_0^1 x^x\,dx = \sum_{k=0}^\infty \frac{1}{k!}\int_0^1x^k(\log x)^k\,dx = \sum_{k=0}^\infty \frac{(-1)^k}{k!}\int_0^\infty e^{u(k+1)}u^k\,du$$ = \sum_{k=0}^\infty \frac{(-1)^k}{k!}\frac{1}{(k+1)^k}\int_0^\infty e^{u(k+1)}[(k+1)u]^k\,du.$ If you then make the substitution $t = (k+1)u$ this becomes $\sum_{k=0}^\infty \frac{(-1)^k}{k!}\frac{1}{(k+1)^k}\int_0^\infty e^tt^k\,dt = \sum_{k=0}^\infty \frac{(-1)^k}{(k+1)!}\frac{1}{(k+1)^k}\Gamma(k+1),$ where $\Gamma$ is the usual Gamma function. Since $\Gamma(k+1) = k!$, the final expression is $ \sum_{k=0}^\infty \frac{(-1)^k}{(k+1)^{k+1}} = \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^n}.$ Similarly you can derive $\int_0^1 x^{-x}\,dx = \sum_{n=1}^\infty n^{-n}$. In don't think any further simplification is possible.

  • 5
    These identities for $\int_0^1 x^{-x}\ dx$ and $\int_0^1 x^x\ dx$ are sometimes called the "sophomore's dream". Look that up on Wikipedia.2012-05-09
17

let ${x}^{x} = {\left({e}^{\ln {x}} \right)}^{x} = {e}^{x \ln {x}}. $

By the series expansion of ${e}^{x}$: ${e}^{x \ln {x}} = \sum _{ n=0 }^{ \infty }{ \frac { { \left( x \ln{x} \right) }^{ n } }{ n! } }$

Thus $\int _{ 0 }^{ 1 }{ { x }^{ x } } dx=\sum _{ n=0 }^{ \infty }{ \int _{ 0 }^{ 1 }{ \frac { { { x }^{ n }\left( \ln {x} \right) }^{ n } }{ n! } } }=\sum _{ n=0 }^{ \infty }{ \frac { 1 }{ n! } \int _{ 0 }^{ 1 }{ { x }^{ n } } { \left( \ln { x } \right) }^{ n }dx }$

Let $u = {\left(\ln {x} \right)}^{n} $, $dv = {x}^{n} dx $, $du = \frac{{n \left(\ln {x} \right)}^{n-1}}{x} dx$ and $v=\frac{{x}^{n+1}}{n+1}$, then using integration by parts, we arrive at

$\lim _{ a\rightarrow 0 }{ \int _{ a }^{ 1 }{ { x }^{ n } } { \left( \ln { x } \right) }^{ n }dx } =\lim _{ a\rightarrow 0 }{ { \left[ \frac { { x }^{ n+1 } }{ n+1 } { \left( \ln { x } \right) }^{ n } \right] }_{ a }^{ 1 } } -\lim _{ a\rightarrow 0 }{ \int _{ a }^{ 1 }{ { \frac { n }{ n+1 } x }^{ n } } { \left( \ln { x } \right) }^{ n-1 } } dx$

which becomes $\lim _{ a\rightarrow 0 }{ \int _{ a }^{ 1 }{ { x }^{ n } } { \left( \ln { x } \right) }^{ n }dx } =-\int _{ 0 }^{ 1 }{ { \frac { n }{ n+1 } x }^{ n } } { \left( \ln { x } \right) }^{ n-1 }dx = \frac{{(-1)}^{n}n!}{{(n+1)}^{n+1}}$

Therefore $\int _{ 0 }^{ 1 }{ { x }^{ x } } dx=\sum _{ n=1 }^{ \infty }{ \frac { { \left( -1 \right) }^{ n-1 } }{ { n }^{ n } } }$

  • 6
    Great answer, sandeep. Don't let these elitist comments get you down.2018-05-01
5

On can find a compendium of properties of the special function : $\text{Sphd}(\alpha\:;\:x)=\int_0^x t^{\alpha\:t}dt$ and the particular case : $\int x^x dx = \text{Sphd}(1\:;\:x) +\text{constant}$ in : https://fr.scribd.com/doc/34977341/Sophomore-s-Dream-Function

3

Many people have pointed out that the integral you are looking for is equivalent to,

$\sum_{n}^{\infty} \frac{1}{n!} \int_{0}^{x}x^{n}ln(x)^ndx$

But the integral within this equation can be simplified to

$\int_{0}^{x}x^{n}ln(x)^ndx = \left(-1\right)^n\left(n+1\right)^{-1-n}\Gamma \left(n+1,\left(n+1\right)\ln \left(\frac{1}{x}\right)\right)$

Where

$\Gamma \left(n+1,\left(n+1\right)\ln \left(\frac{1}{x}\right)\right) = n!e^{\left(n+1\right)\ln \left(x\right)}\sum _{k=0}^{n}\frac{\left(n+1\right)^k\ln \left(\frac{1}{x}\right)^k}{k!}$

Is the incomplete Gamma function. Simplify the first equation, and you will get,

$\int_{0}^{x}x^{x}dx = \sum _{n=0}^{\infty}\left(\frac{\left(-1\right)^n \Gamma \left(n+1,-\left(n+1\right)\ln\left({x}\right)\right)}{n!\left(n+1\right)^{(n+1)}}\right)$

A demonstration of this function may be found on the desmos graphing calculator: https://www.desmos.com/calculator/2nfxrv0iba

1

Start from the opposite task.

If $\displaystyle \int x^x \, dx=F(x)$ then $\displaystyle F'(x)=x^x$

First we need to find asymptotic evaluation of the integral. Let us take it in the form

$F(x)=x^xg(x)$

So it has to be:

$F'(x)=x^x((1+\ln(x))g(x)+g'(x))=x^x$

From there it is sufficient to take $g(x) \sim \frac{1}{1+\ln(x)}$

So we can start our journey:

$F(x)=x^x(\frac{1}{1+\ln(x)}+f(g(x)))$

If you calculate the derivative of this you have

$g'(x)f'(g(x))-\frac{1}{x(\ln(x)+1)^2}+(\ln(x)+1)f(g(x))=0$

For the purpose of cancellation if it best to take

$g'(x)=\ln(x)+1$

meaning

$g(x)=x\ln(x)$

Now we continue using the steps that are revealing the integral structure.

$F(x)=x^x(\frac{1}{\ln(x)+1}+f(x\ln(x)))$

Take derivative once more and you have got $f(x\ln(x))=\frac{1}{x(1+\ln(x))^3}-f'(x\ln(x))$ or $F(x)=x^x(\frac{1}{\ln(x)+1}+\frac{1}{x(\ln(x)+1)^3}-f'(x\ln(x)))$

We can then write:

$F(x)=x^x(\frac{1}{\ln(x)+1}+\sum_{n=1}^{\infty}f_n(x))$

where

$\displaystyle f_{n}=-\frac{f_{n-1}'}{1+\ln(x)},\,f_0=\frac{1}{1+\ln(x)}$

From $x=0$ to $1$ you can use probably more suitably $F(x)=xg(\ln(x))$

The derivation is similar to the one given above.