I plugged in this integral on desmos $$\int_{1}^\infty \frac{x!}{x^x}dx$$ and it said it was undefined. I see no reason this should be undefined because $\frac{x!}{x^x}$ goes to 0. What is this integral or is it just undefined?
-
1Maybe it does not recognize $x!$ for non integer values of $x$. – Crostul Mar 21 '22 at 01:06
-
2The factorial function is only defined on the integers, so this integrand is undefined for most values. You can try replacing it with $\Gamma(x+1)$, though I'm not sure Desmos will be able to handle it. – Brian Tung Mar 21 '22 at 01:07
-
How do you define the factorial of, say, $\pi$? – Arturo Magidin Mar 21 '22 at 01:07
-
It probably doesn’t know how to interpret $x!$ for non-integer $x$. If you replace that with $\Gamma(x+1)$ it will likely work. – User8128 Mar 21 '22 at 01:07
-
"because the integrand goes to 0" this really isn't a good justification considering $\lim_{x\to\infty}\frac{1}{x}=0$ but $\int^\infty_0 \frac{1}{x},dx\to\infty$. – Kyan Cheung Mar 21 '22 at 01:17
-
2By Stirling's formula, $\frac{{x!}}{{x^x }} \sim \sqrt {2\pi x} e^{ - x}$, so the integral converges fast. I do not think there is a simple closed form for it though. Its numerical value is $1.33056689850038\ldots$. It may also be expressed as $$ \int_0^{ + \infty } {\frac{{(1 + t - \log t)t}}{{(t - \log t)^2 }}e^{ - t} dt} . $$ – Gary Mar 21 '22 at 01:28
-
Yeah, I do know that the integral converges, just pointing out that the justification provided is invalid. I do know that $\sum^\infty_{n=1}\frac{n!}{n^n}=\int^1_0\frac{1}{(1+x\ln x)^2}$, but I can't figure out how to use similar methods to get a closed form for the integral, even while using special functions. – Kyan Cheung Mar 21 '22 at 01:35
-
@Kyky My message was to the OP. Your point is perfectly valid. – Gary Mar 21 '22 at 01:43
1 Answers
As @Gary commented, using Stirling approximation, we have $$\frac {x!}{x^x}\sim\sqrt{2 \pi }\, e^{-x} \sum_{n=0}^p \frac {a_n}{x^{n-\frac 12}}$$ $$\int x^{-n+\frac 12}\,e^{-x}\,dx\sim-\Gamma \left(\frac{3}{2}-n,x\right)$$ $$\int_1^\infty x^{-n+\frac 12}\,e^{-x}\,dx=\Gamma \left(\frac{3}{2}-n,1\right)$$ $$\int_1^\infty \frac {x!}{x^x}\,dx\sim\sqrt{2 \pi }\,\sum_{n=0}^p {a_n}\,\Gamma \left(\frac{3}{2}-n,1\right)$$ Using the first $a_n$ $$\left\{1,\frac{1}{12},\frac{1}{288},-\frac{139}{51840},-\frac{571}{2488320}, \frac{163879}{209018880},\frac{5246819}{75246796800},-\frac{534703531}{9029 61561600},\cdots\right\}$$ leads to a value of $1.330533$
Edit
If we write $$\frac {x!}{x^x}\sim \sqrt{2 \pi x}\,\exp\Big[-x+\frac{a}{ x} \Big]$$ the antiderivative of the rhs write in terms of exponentials and complementary error functions and the definite integral is $$\frac{e^{-1-2 i \sqrt{a}} \left(e \pi \left(\left(1+2 i \sqrt{a}\right) \text{erfc}\left(1-i \sqrt{a}\right)+\left(1-2 i \sqrt{a}\right) e^{4 i \sqrt{a}} \text{erfc}\left(1+i \sqrt{a}\right)\right)+4 \sqrt{\pi } e^{a+2 i \sqrt{a}}\right)}{2 \sqrt{2}}$$ For $a=0$ the result is $$\frac{\pi \text{erfc}(1)}{\sqrt{2}}+\frac{\sqrt{2 \pi }}{e}=1.27157$$ and for $a=\frac 1 {12}$ $$\frac{\sqrt{2 \pi }}{e^{11/12}}+\frac{\left(3+i \sqrt{3}\right) e^{-\frac{i}{\sqrt{3}}} \pi \text{erfc}\left(1-\frac{i}{2 \sqrt{3}}\right)+\left(3-i \sqrt{3}\right) e^{\frac{i}{\sqrt{3}}} \pi \text{erfc}\left(1+\frac{i}{2 \sqrt{3}}\right)}{6 \sqrt{2}}=1.33139$$
- 289,558
-
-
@Gary. I know but I thought that it could be better than $\frac{\pi \text{erfc}(1)}{\sqrt{2}}+\frac{\sqrt{2 \pi }}{e}=1.27157$ – Claude Leibovici Mar 21 '22 at 07:01
-
Yes but then your equalities are meaningless. After integrating from $1$ it is not even an asymptotic series anymore since there is no large variable in it. That numerical series diverges to infinity. – Gary Mar 21 '22 at 07:22