How to calculate $\int_{0}^{\infty} x^{-x} \,dx$?
I am trying to solve this improper integral: $\int_{0}^{\infty} x^{-x} \,dx$.
First I replace de infinity by a another variable $y$, so: $\int_{0}^{y} x^{-x} \,dx = \int_{0}^{y} e^{\ln(x^{-x})}\,dx = \int_{0}^{y} e^{-x\ln(x)}\,dx = \int_{0}^{y} \sum_{n=0}^{\infty} \frac{(-x\ln(x))^{n}}{n!}\,dx = \sum_{n=0}^{\infty} \frac{(-1)^{n}}{n!} \int_{0}^{y} (x\ln(x))^n\, dx$.
Solving $\int (x\ln(x))^n\,dx$:
- Substitute $u=\ln(x) \implies \int u^ne^{(n+1)n}\,du $
- Substitute $v=u^{n+1} \implies \frac{1}{n+1}\int e^{(n+1)v^{\frac{1}{n+1}}}\,dv$
- Substitute $w=(n+1)^{(n+1)}v \implies \int e^{(n+1)v^{\frac{1}{n+1}}}\,dv = (n+1)^{-n-1}\int e^{w^{\frac{1}{n+1}}}\,dw$
- $\int e^{w^{\frac{1}{n+1}}}\,dw = -(n+1)(-1)^n \operatorname{\Gamma}(n+1,-w^{\frac{1}{n+1}})$
- Undo substitutions, $\int (x\ln(x))^n\,dx = \dfrac{\left(n+1\right)^{-n-1}\operatorname{\Gamma}\left(n+1,-\left(n+1\right)\ln\left(x\right)\right)}{\left(-1\right)^n}$
- $\int_{0}^{y} (x\ln(x))^n\, dx \implies \dfrac{\left(n+1\right)^{-n-1}\operatorname{\Gamma}\left(n+1,-\left(n+1\right)\ln\left(x\right)\right)}{\left(-1\right)^n} \Big|_0^y$, when $x=0$, the incomplete gamma function will be evalueate between plus infinity and plus infinity so, $\int_{0}^{y} (x\ln(x))^n\, dx = \dfrac{\left(n+1\right)^{-n-1}\operatorname{\Gamma}\left(n+1,-\left(n+1\right)\ln\left(y\right)\right)}{\left(-1\right)^n}$
- $\sum_{n=0}^{\infty} \frac{(-1)^{n}}{n!} \int_{0}^{y} (x\ln(x))^n\, dx = \sum_{n=0}^{\infty} \frac{\operatorname{\Gamma}\left(n+1,-\left(n+1\right)\ln\left(y\right)\right)}{n!(n+1)^{n+1}} = \sum_{n=1}^{\infty}\frac{Q\left(n,\ -n\ln\left(y\right)\right)}{n^n}$.
Where $Q$ is the normalized or regularized incomplete gamma function
But what's happen when $y \to \infty$? The incomplete gamma function will be evaluated between zero and minus infinity, is it valid? Is there another way to find this value? Because de the improper integral converges.
See this answer/my question:
Area under $x^{-x}$ over its real domain. What is another non-integral form of $$\int_{\Bbb R^+}x^{-x}dx$$?
In summary, here are the results:
$$\int_{\Bbb R^+}x^{-x}dx =\\ \lim_{x\to \infty}\sum_{n\ge1}\frac{Q(n,-nx)}{n^n}= \\\lim_{b,n\to \infty}\frac bn \\\sum_{k=0}^n\left(\frac{bk}{n}\right)^{-\left(\frac{bk}{n}\right)}=\\ \sum_{n\ge1}n^{-n}-\lim_{x\to\infty}\sum_{n\ge1}(-x)^n\ _1\mathrm{\tilde F}_1(n,n+1,nx) =\\ \sum_{n\ge 1}n^{-n}-\lim_{x\to \infty}\sum_{n\ge1}\sum_{k\ge1}\frac{(-x)^n(nx)^k}{(k+n)k!n!}= \\\lim_{x\to \infty}\sum_{n\ge 1}\sum_{k=0}^{n-1}\frac{(-1)^k e^{nx} n^{k-n}x^k}{k!}$$
Here is proof of the main result and @Nikos Bagis’s representation:
$$\int^{\infty}_{0}\frac{1}{t^t}\textrm{d}t=\sum_{n\geq 1}\frac{1}{n^n}-1+\int^{1}_{0}\frac{1}{t^{t^{t^{ \ldots}}}}\textrm{d}t $$
Where appears the $\,_1 \mathrm {\tilde F}_1(a,b,z) $ Confluent Regularized Hypergeometric function , Regularized Incomplete Gamma function $Q(a,z)$, and infinite tetration
Let’s see if we can use @Rounak Sarkar’s method from here to find a sum only answer.
Let me work on this to actually get some new results.
If you want here is a Mellin Transform representation:
$$\int_0^\infty x^{a-1-x}dx=\int_0^\infty x^{a-1}x^{-x} dx\implies \int_0^\infty x^{-x}dx=\mathcal{M}\{ x^{-x}\}(1)$$
I do not use Ramunajun’s Master Theorem much, but let’s try it:
$$\mathcal{M}\{f(x)\}(s)=\Gamma(s) y(-s), f(x)=\sum_{n=0}^\infty \frac{(-1)^n y(n)x^n}{n!} $$
So we need to find the “alternating” Exponential Generating function for $x^{-x}$
According to this theorem, then:
$$\int_0^\infty x^{-x} dx=\mathcal{M}\{ x^{-x}\}(1) =y(-1),x^{-x}=\sum_{n=0}^\infty\frac{(-1)^n y(n) x^n}{n!}$$
So how do we find $y(n)$?
Here is how to find $y(n)$: The coefficients are just a Taylor series for $x^{-x}$ at $x=1$ which is just OEIS A176118
Therefore: $y(n)=(-1)^n \text A176118(n)$
And experimentally:
$$\int_0^\infty x^{-x} dx \mathop=^\text{natural}_\text{extension}-\text A176118(-1) $$
But this is stretching the definition. Maybe we can use an nth derivative formula to find a closed form for the nth derivative? Please correct me and give me feedback!
Using the known identities $$\int\limits_0^1\ln^n z\,\text dz = (-1)^n n!,\tag1$$ $$\sum\limits_{j=0}^k \dfrac{a^m}{m!}=e^a\, \dfrac{\Gamma(k+1,a)}{\Gamma(k+1)},\tag2$$ one can get $$I_1(a)=\int\limits_0^a x^{-x}\text dx = a \int\limits_0^1 (ay)^{-ay} \text dy = a\int\limits_0^1 e^{-ay\ln a} e^{-ay\ln y}\text dy$$ $$= \sum\limits_{m=0}^\infty \dfrac{\ln^m a}{m!}\sum\limits_{n=0}^\infty (-1)^{m+n} \dfrac {a^{m+n+1}}{n!}\int\limits_0^1 y^{m+n}\ln^n y\,\text dy$$ $$= \sum\limits_{m=0}^\infty \dfrac{\ln^m a}{m!}\sum\limits_{n=0}^\infty (-1)^{m+n} \dfrac {a^{m+n+1}}{n!(m+n+1)^{n+1}}\int\limits_0^1 \ln^n (y^{m+n+1})\,\text dy^{m+n+1}$$ $$= \sum\limits_{m=0}^\infty \dfrac{\ln^m a}{m!}\sum\limits_{n=0}^\infty (-1)^{m+n} \dfrac {a^{m+n+1}}{n!(m+n+1)^{n+1}}\cdot(-1)^n n!$$ $$= \sum\limits_{m=0}^\infty (-1)^m\dfrac{\ln^m a}{m!}\sum\limits_{n=1}^\infty \dfrac {a^{m+n}}{(m+n)^n} = \sum\limits_{s=1}^\infty \dfrac{a^s}{s^s}\sum\limits_{m=0}^{s-1} \dfrac{(-s\ln a)^m}{m!}$$ $$I_1(a)= \sum\limits_{s=1}^\infty \dfrac{\Gamma(s,-s \ln a)}{s^s\Gamma(s)}.\tag3$$
On the other hand,
$$I_2(a)=\int\limits_a^\infty x^{-x}\text dx = a \int\limits_0^\infty (a(1+y))^{-a-ay}\text dy = a^{1-a}\int\limits_0^\infty \dfrac{a^{-ay}}{(1+y)^a} (1+y)^{-ay}\,\text dy.$$ Let $\;z=a^{-ay} = e^{-(a\ln a)y},\;$ then $\;y=-\dfrac{\ln z}{a\ln a},\;$ $$(1+y)^{-ay}=\left(1-\dfrac{\log_a z}a\right)^{\log_a z} =1 - \dfrac{(z-1)^2}{a\ln^2a}+\dfrac{(z-1)^3(2a\ln a-1)}{2a^2\ln^3a} +\dots =\dfrac{(2a^2 \ln^3a-4a\ln a+1) + z(10a\ln a-3) + z^2 (3-8a\ln a) + z^3(2a\ln a-1)}{2a^2\ln^3 a}+\dots,$$
Taking in account the integral $$\int\limits_0^\infty\dfrac{a^{-kay}}{(1+y)^a} \,\text dy =a^{ka}\operatorname E_a(ka\ln a),\tag4$$ one can get $$\begin{align} &I_2(a)\approx \dfrac1{2a\ln^3 a}\big((2a^2\ln^3a-4a\ln a+1) E_a(a\ln a) + a^a(10a\ln a-3) E_a(2 a\ln a)\\[4pt] & - a^{2a}(8\ln a-3) E_a(3a\ln a) + a^{3a}(2a\ln a-1) E_a(4a\ln a)\big). \end{align}\tag5$$ Approximation $(5)$ is not too accurate (accuracy $\;1.5\%\;$ for $\;a=e^2\;$), because only three terms of the primary series was used. However, it shows the effectiveness of the used approach.
If $\;a=e^3,\;$ then $I_1(a)\approx 1.99545\,59575\,00138\,00041\,87246\,96764\,22,$
$I_2(a)\approx 1.69475\cdot10^{-27},$
$\;I_1(a)+I_2(a)\approx 1.99545\,59575\,00138\,00041\,87246\,98458\,97.$
Numeric value is $I=1.99545\,59575\,00138\,00041\,87246\,98452\,72.$
Easily to see that the second integral increases the result accuracy.
$\color{green}{\mathbf{Edition\ of\ 23.12.21.}}$
The alternative way is
$$I_2(a)=\int\limits_a^\infty x^{-x}\text dx = a \int\limits_0^\infty (a(1+y))^{-a-ay}\text dy = a^{1-a}\int\limits_0^\infty a^{-ay}(1+y)^{-a-ay}\,\text dy.$$ Let $\;z=a^{-ay} = e^{-(a\ln a)y},\;$ then $\;y=-\dfrac{\ln z}{a\ln a},\;$ $$I_2(a)= \dfrac1{a^a\ln a}\int\limits_0^1 \left(1-\dfrac{\log_a z}a\right)^{-a+\log_a z}\text dz =\sum\limits_{n=0}^\infty c_n\ln^n z,$$ $$I_2(a) = \sum\limits_{n=0}^\infty (-1)^n n! c_n,\tag6$$ where $$\sum\limits_{n=0}^\infty c_n y^n = \dfrac 1{a^a\ln a} \left(1-\dfrac y{a \ln a}\right)^{\large-a+\frac y{\ln a}}.\tag7$$
By the direct numeric calculations, $$I_2(e^3)\approx 1.68850\,13010\,68575\,08677\,67860\,60236\,26323\,88582\cdot10^{-27}.$$ Calculations by $(6)-(7)$ by $20$-term model give $$I_2(e^3)\approx 1.68850\,13010\,38888\,76584\cdot 10^{-27},$$ i.e. ten additional correct digits of the result.