Large $n$ asymptotic of $\int_0^\infty \left( 1 + x/n\right)^{n-1} \exp(-x) \, \mathrm{d} x$

While thinking of 71432, I encountered the following integral:
$$
\mathcal{I}_n = \int_0^\infty \left( 1 + \frac{x}{n}\right)^{n-1} \mathrm{e}^{-x} \, \mathrm{d} x
$$
Eric’s answer to the linked question implies that $\mathcal{I}_n \sim \sqrt{\frac{\pi n}{2}} + O(1)$.

How would one arrive at this asymptotic from the integral representation, without reducing the problem back to the sum ([added] i.e. expanding $(1+x/n)^{n-1}$ into series and integrating term-wise, reducing the problem back to the sum solve by Eric) ?

Thanks for reading.

Solutions Collecting From Web of "Large $n$ asymptotic of $\int_0^\infty \left( 1 + x/n\right)^{n-1} \exp(-x) \, \mathrm{d} x$"

With the change of variables $x\to(n-1)t-1$, we get
$$
\begin{align}
&\int_0^\infty\left(1+\frac{x}{n}\right)^{n-1}e^{-x}\;\mathrm{d}x\\
&=ne\left(1-\frac{1}{n}\right)^n\int_\frac{1}{n-1}^\infty e^{-(n-1)(t-\log(1+t))}\;\mathrm{d}t\tag{1}\\
\end{align}
$$
Since
$$
1+n\log\left(1-\frac{1}{n}\right)=-\frac{1}{2n}-\frac{1}{3n^2}+O\left(\frac{1}{n^3}\right)
$$
exponentiating and multiplying by $n$, we get
$$
\begin{align}
ne\left(1-\frac{1}{n}\right)^n
&=ne^{-\frac{1}{2n}-\frac{1}{3n^2}+O\left(\frac{1}{n^3}\right)}\\
&=n-\frac{1}{2}-\frac{5}{24n}+O\left(\frac{1}{n^2}\right)\tag{2}
\end{align}
$$
Note that
$$
\begin{align}
\int_0^\frac{1}{n-1} e^{-(n-1)(t-\log(1+t))}\;\mathrm{d}t
&=\int_0^\frac{1}{n-1}\left(1-\tfrac{n-1}{2}t^2+\tfrac{n-1}{3}t^3+\tfrac{(n-1)^2}{8}t^4\right)\;\mathrm{d}t+O\left(\tfrac{1}{n^4}\right)\\
&=\frac{1}{n-1}-\frac{1}{6(n-1)^2}+\frac{13}{120(n-1)^3}+O\left(\frac{1}{n^4}\right)\\
&=\frac{1}{n}+\frac{5}{6n^2}+\frac{31}{40n^3}+O\left(\frac{1}{n^4}\right)\tag{3}
\end{align}
$$
Finally, setting $\frac{u^2}{2}=t-\log(1+t)$, so that $t=u+\frac{u^2}{3}+\frac{u^3}{36}-\frac{u^4}{270}+\frac{u^5}{4320}+\frac{u^6}{17010}+O(u^7)$, we get
$$
\begin{align}
&\int_0^\infty e^{-(n-1)(t-\log(1+t))}\;\mathrm{d}t\\
&=\int_0^\infty e^{-(n-1)u^2/2}\;\mathrm{d}t\\
&=\int_0^\infty e^{-(n-1)u^2/2}\;(1+\frac{2u}{3}+\frac{u^2}{12}-\frac{2u^3}{135}+\frac{u^4}{864}+\frac{u^5}{2835}+O(u^6))\;\mathrm{d}u\\
&=\sqrt{\tfrac{\pi}{2(n-1)}}+\tfrac{2}{3(n-1)}+\sqrt{\tfrac{\pi}{288(n-1)^3}}-\tfrac{4}{135(n-1)^2}+\sqrt{\tfrac{\pi}{165888(n-1)^5}}+\tfrac{8}{2835(n-1)^3}+O\left(\tfrac{1}{n^{7/2}}\right)\\
&=\sqrt{\tfrac{\pi}{2n}}\left(1+\tfrac{7}{12n}+\tfrac{145}{288n^2}\right)+\left(\tfrac{2}{3n}+\tfrac{86}{135n^2}+\tfrac{346}{567n^3}\right)+O\left(\tfrac{1}{n^{7/2}}\right)\tag{4}
\end{align}
$$
Combining $(3)$ and $(4)$, we get
$$
\int_\frac{1}{n-1}^\infty e^{-(n-1)(t-\log(1+t))}\;\mathrm{d}t=\sqrt{\tfrac{\pi}{2n}}\left(1+\tfrac{7}{12n}+\tfrac{145}{288n^2}\right)-\left(\tfrac{1}{3n}+\tfrac{53}{270n^2}+\tfrac{3737}{22680n^3}\right)+O\left(\tfrac{1}{n^{7/2}}\right)
$$
Including $(2)$, yields
$$
\int_0^\infty\left(1+\frac{x}{n}\right)^{n-1}e^{-x}\;\mathrm{d}x=\sqrt{\tfrac{n\pi}{2}}\left(1+\tfrac{1}{12n}+\tfrac{1}{288n^2}\right)-\left(\tfrac{1}{3}+\tfrac{4}{135n}-\tfrac{8}{2835n^2}\right)+O\left(\tfrac{1}{n^{5/2}}\right)
$$

A related result was given in the problems column of the American Mathematical Monthly not too long ago. This is problem 11353 whose solution was published in the January 2010 issue.

Let $$g(s)=\int_0^\infty \left(1+{x\over s}\right)^se^{-x}\, dx-\sqrt{s\pi\over 2}.$$
Show that $g(s)$ decreases from $1$ to $2/3$ as $s$ ranges from $0$ to $\infty$.

Note that the exponent in the integral is $s$, not $s-1$.

Interesting. I’ve got a representation
$$
\mathcal{I}_n = n e^n \int_1^\infty t^{n-1} e^{- nt}\, dt
$$
which can be obtained from yours by the change of variables $t=1+\frac xn$. After some fiddling one can get
$$
2\mathcal{I}_n= n e^n \int_0^\infty t^{n-1} e^{- nt}\, dt+o(\mathcal{I}_n)=
n^{-n} e^n \Gamma(n+1)+\ldots=\sqrt{2\pi n}+\ldots.
$$

I shifted the function by a unit since it won’t effect the asymptotics and I’d like the global maximum to occur at $x=0$.

$$ \mathcal{I}_n \sim \int^{\infty}_0 \left( 1 + \frac{x-1}{n} \right)^{n-1} e^{-(x-1) } dx $$

$$\left( 1 + \frac{ x-1}{n} \right)^{n-1} e^{-(x-1) } = e \left( 1 – \frac{1}{n} \right)^{n-1} \left( 1 – \frac{x^2}{2(n-1)} + \cdots \right)$$

$$ \approx e \left(1 – \frac{1}{n} \right)^{n-1} \exp\left(\frac{-x^2}{2(n-1)} \right) $$

so $$ \mathcal{I}_n \sim e\left( 1 -\frac{1}{n}\right)^{n-1} \int^{\infty}_0 \exp\left( \frac{-x^2}{2(n-1)} \right) dx $$

$$ = e\left( 1 -\frac{1}{n}\right)^{n-1} \sqrt{\pi(n-1)/2} \sim \sqrt{\pi n/2}$$