For what values of $p>0$ is $\lim_{n\rightarrow\infty}\int_0^n\frac{(1-\frac{x}{n})^ne^x}{n^p}dx=0$? For what values of $p>0$ is $\lim_{n\rightarrow\infty}\int_0^n\frac{(1-\frac{x}{n})^ne^x}{n^p}dx=0$?
My thoughts: We know that $(1-\frac{x}{n})^n\leq e^x$, so the numerator is $\leq e^{2x}$.  So, we can play with $\frac{e^{2x}}{n^p}$.  From here, I am not quite sure what to do.  I would really like to be able to find the supremum over $n$, but I can't really minimize the denominator to be able to replace $n$ with something in terms of $x$, because I only have $n^p$ down there.  On the other hand, I feel like I should be splitting up the integral from $0$ to $1$ and then from $1$ to $\infty$ based on the denominator.  Then, fix some $x$, and just use $p$ integral properties to get that $p\in(0,1)$, but I am not quite sure.  Any help is greatly appreciated!
A quick edit: I realize that I made a big mistake above by overlooking the minus sign, so instead the integrand is bounded above by $\frac{1}{n^p}\leq 1$ as $n\rightarrow \infty$, and so we can use DCT and then treat it like a $p$ integral.
A second edit: For Sangchul Lee, I edited the integral to make the upper bound $n$ so he can expand on how he got his approximation.  Thank you!
 A: To answer the question, it is sufficient to show:
$$ \color{navy}{ \lim_{n\to\infty} \frac{1}{\sqrt{n}} \int_{0}^{n} \left(1-\frac{x}{n}\right)^n e^x \, \mathrm{d}x = \sqrt{\frac{\pi}{2}} \qquad\text{as}\quad n\to\infty. } $$
Indeed, substitute $x = \sqrt{n}u$ to find that
\begin{align*}
\frac{1}{\sqrt{n}} \int_{0}^{n} \left(1-\frac{x}{n}\right)^n e^x \, \mathrm{d}x
&= \int_{0}^{\sqrt{n}} \Bigl(1 - \frac{u}{\sqrt{n}}\Bigr)^n e^{\sqrt{n}u} \, \mathrm{d}u \\
&= \int_{0}^{\infty} \Bigl(1 - \frac{u}{\sqrt{n}}\Bigr)^n e^{\sqrt{n}u} \mathbf{1}_{[0, \sqrt{n})}(u) \, \mathrm{d}u
\end{align*}
To analyze the integral in the right-hand side, we note that
$$ 1 - t = e^{\log(1-t)} = e^{-\sum_{k=1}^{\infty} t^k/k} \leq e^{-t-t^2/2} $$
holds for $ t \in [0, 1)$. Using this, we find that
$$ \Bigl(1 - \frac{u}{\sqrt{n}}\Bigr)^n e^{\sqrt{n}u} \mathbf{1}_{[0, \sqrt{n})}(u) \leq e^{-u^2/2} $$
for $u \geq 0$. It is a easy to check that
$$\lim_{n\rightarrow\infty}\Bigl(1 - \frac{u}{\sqrt{n}}\Bigr)^n e^{\sqrt{n}u} \mathbf{1}_{[0, \sqrt{n})}(u)=e^{-u^2/2}$$
So by the dominated convergence theorem,
\begin{align*}
\lim_{n\to\infty} \frac{1}{\sqrt{n}} \int_{0}^{n} \left(1-\frac{x}{n}\right)^n e^x \, \mathrm{d}x
&= \int_{0}^{\infty} \lim_{n\to\infty} \Bigl(1 - \frac{u}{\sqrt{n}}\Bigr)^n e^{\sqrt{n}u} \mathbf{1}_{[0, \sqrt{n})}(u) \, \mathrm{d}u \\
&= \int_{0}^{\infty} e^{-u^2/2} \, \mathrm{d}u \\
&= \sqrt{\frac{\pi}{2}}.
\end{align*}
A: If the upper limit is $n$ with $n>0$
$$I_n=\int_{0}^{n}\left(1-\frac{x}{n}\right)^n e^x\,dx=n\int_{0}^{1} (1-t)^n\,e^{n t}\,dt=e^n n^{-n} \Big[\Gamma (n+1)-\Gamma (n+1,n)\Big]$$
$$I_n=e^n n^{-n}\Gamma (n+1)\Big[1-\frac {\Gamma (n+1,n)}{\Gamma (n+1)}\Big]$$
If, for large $n$, we make the approximation
$$\Gamma (n+1,n)\sim \Gamma (n+1,n+1)$$ (have a look at $8.11.12$ here)
$$\Gamma (n+1,n)\sim   \frac{1}{24} e^{-(n+1)} (n+1)^n \left(\frac{\sqrt{2 \pi } (12   n+13)}{\sqrt{n+1}}-8\right)$$
$$\log\Big[\frac {\Gamma (n+1,n)}{\Gamma (n+1)}\Big]=-\log (2)-\frac{1}{3} \sqrt{\frac{2}{\pi n}} -\frac{1}{9 \pi 
   n}+O\left(\frac{1}{n^{3/2}}\right)$$
$$I_n=e^n n^{-n}\Gamma (n+1)\Big[\frac{1}{2}+\frac{1}{3 \sqrt{2 \pi n
   }}+O\left(\frac{1}{n^{3/2}}\right) \Big]$$
Finishing with Stirling approximation
$$I_n=\sqrt{\frac{\pi n}{2}} +\frac{1}{3}+\frac{1}{12} \sqrt{\frac{\pi }{2n}}-\frac{1}{6 n}+O\left(\frac{1}{n^{3/2}}\right) $$
Edit
Using, as @Gary commented
$$\Gamma (n + 1,n) = n\Gamma (n,n) + n^n e^{ - n}$$ and the expansion given in 1
$$I_n=\sqrt{\frac{\pi n }{2}} -\frac 23+\frac{1}{12} \sqrt{\frac{\pi }{2n}}+\frac{4}{135 n}+\frac{1}{288} \sqrt{\frac{\pi }{2n^3}} +O\left(\frac{1}{n^{2}}\right) $$ which is almost exact
$$\left(
\begin{array}{ccc}
n & \text{approximation} & \text{solution} \\
 5  & 2.18885 & 2.18867 \\
 10 & 3.33279 & 3.33275 \\
 15 & 4.21642 & 4.21640 \\
 20 & 4.96321 & 4.96320 \\
 25 & 5.62201 & 5.62201
\end{array}
\right)$$
A: Assume that $n \ge 2$.
Let
$$I_n := \int_0^n \left(1 - \frac{x}{n}\right)^n \mathrm{e}^x \,\mathrm{d} x.$$
Using $\ln(1 + u) \le u$ for all $u > -1$, we have, for all $0 \le x < n$,
\begin{align*}
 \ln\left(1 - \frac{x}{n}\right)
 &= \ln \left(1 - \frac{\sqrt n}{n}\right) + \ln\left(1 - \left(1 - \frac{\sqrt n}{n}\right)^{-1}\frac{x - \sqrt n}{n}\right)\\[6pt]
 &\le - \frac{\sqrt n}{n} - \left(1 - \frac{\sqrt n}{n}\right)^{-1}\frac{x - \sqrt n}{n}\\
 &= - \frac{x}{n - \sqrt n} + \frac{1}{n - \sqrt n}.
\end{align*}
Thus, we have
\begin{align*}
 I_n &\le \mathrm{e}^{n/(n - \sqrt n)}\int_0^n \mathrm{e}^{- nx/(n - \sqrt n) + x}\, \mathrm{d} x\\
 &= \mathrm{e}^{n/(n - \sqrt n)}
 (\sqrt n - 1)(1 - \mathrm{e}^{-n/(\sqrt n - 1)})\\
 &\le \mathrm{e}^{4}\sqrt n.
\end{align*}
On the other hand, we have, for all $x \in [0, \sqrt n)$,
$$\left(1 - \frac{x}{n}\right) \mathrm{e}^{x/n}
\ge \left(1 - \frac{x}{n}\right)\left(1 + \frac{x}{n}\right)
= 1 - \frac{x^2}{n}\cdot \frac{1}{n}
\ge \left(1 - \frac{x^2}{n}\right)^{1/n}$$
where we have used $\mathrm{e}^u \ge 1 + u$ for all $u\ge 0$,
and Bernoulli inequality $(1 + v)^r \le 1 + vr$ for all $0 < r \le 1$ and $v > -1$.
Thus, we have
\begin{align*}
 I_n &\ge \int_0^{\sqrt n} \left(1 - \frac{x}{n}\right)^n \mathrm{e}^x \,\mathrm{d} x\\
 &\ge \int_0^{\sqrt n} \left(1 - \frac{x^2}{n}\right)  \,\mathrm{d} x\\
 &= \frac23 \sqrt n.
\end{align*}
Thus, we have
$$\frac23 \sqrt n \le I_n \le \mathrm{e}^4 \sqrt{n}, \quad \forall n\ge 2.$$
Thus, $\lim_{n\to \infty} \frac{I_n}{n^p} = 0$ if and only if $p > 1/2$.
