# Calculate the limit of $\frac{n^{n+1}}{n!}\int_0^xe^{-nt}t^n\,\mathrm dt$

Set $$R_n(x)$$ the quantity in the title, for $$n\in\mathbb{N}$$ and $$x > 0$$.

I'm trying to prove that if $$x < 1$$, then $$R_n(x)\underset{n\rightarrow +\infty}{\longrightarrow} 0$$, if $$x > 1$$, then $$R_n(x)\underset{n\rightarrow +\infty}{\longrightarrow} 1$$ and if $$x = 1$$, then $$R_n(x)\underset{n\rightarrow +\infty}{\longrightarrow} \frac{1}{2}$$. (I got these limits with Python.)

My approach is to make a substitution in the integral, $$u = nt$$. I get then $$R_n(x) = \displaystyle\frac{1}{n!}\int_0^{nx}e^{-u}u^n\,\mathrm du$$. I recognize the (incomplete) Gamma function, and know that $$\Gamma(n+1) = n!$$ but don't know how to proceed (I tried many other substitutions, without success).

Could I get some help on the matter? Thanks.

You want $$\lim_{n\to\infty}\frac{n^{n+1}}{n!}\int_0^x e^{-nt}t^ndt=\lim_{n\to\infty}\frac{1}{n!}\int_0^{nx}e^{-y}y^ndy.$$A bit of calculus gvies the quadratic approximation $$n\ln y-y\approx n\ln n-n-\frac{(y-n)^2}{2n}$$, so$$\int_0^{nx}e^{-y}y^ndy\approx n^ne^{-n}\int_0^{nx}e^{-(y-n)^2/(2n)}dy\approx\frac{n!}{\sqrt{2\pi n}}\int_{-n}^{n(x-1)}e^{-z^2/(2n)}dz,$$where the second $$\approx$$ uses the Stirling approximation. So we want$$\lim_{n\to\infty}\frac{1}{\sqrt{2\pi n}}\int_{-n}^{n(x-1)}e^{-z^2/(2n)}dz.$$If $$x>1$$, the integral $$\approx\int_{-\infty}^\infty e^{-z^2/(2n)}dz=\sqrt{2\pi n}$$, so the limit is $$1$$. If $$x=1$$, we lose the $$z>0$$ half of the integral, halving the result; if $$x<1$$, the upper limit $$\to-\infty$$, making the limit $$0$$.
A probabilistic proof: Apply the central limit theorem to independent exponentially distributed random variables $$X_1,X_2,\dots\sim\operatorname{Exp}(\lambda=1)$$. Note that $$X_1+\dots+X_n\sim \operatorname{Gamma}(\alpha=n, \beta=1)$$ has mean $$n$$ and variance $$n$$. So $$R_n(x)=\mathbb{P}(X_1+\dots+X_n\leq nx)\simeq\Phi((x-1)\sqrt{n})\to\begin{cases} 0 & x<1\\ 1 & x>1\\ \frac12 & x=1 \end{cases}.$$
If you don't like probability, you can directly appeal to asymptotic expansions such as $$\frac{\gamma(n+1,a+y(2n)^{1/2})}{\Gamma(n+1)} =\frac12\operatorname{erfc}(-y)-\frac13\left(\frac2{n\pi}\right)^{1/2}(1+y^2)\exp(-y^2)+O(n^{-1})\quad (y\in\mathbb{R}, n\to\infty)$$ found by Tricomi in 1950.