Find the value of $l = \lim \limits_{k \to \infty} \int_{0}^{k} \left(1-\frac{x}{k}\right)^k \cdot e^{\frac{x}{3}} dx$ . This is a question from a mock exam of national engineering test in my country.
Firstly, we can't take limit inside the integral as the limits of integral are not independent.
I also tried applying the property:
$$\int_{a}^{b}f(x)dx=\int_{a}^{b}f(a+b-x)dx$$
but that also doesn't give anything significant which can help in simplifying the problem further.
Leibniz integral rule also doesn't seem to give anything useful. I would be grateful if I could get more ideas from the community on how to approach this.
 A: Actually you can exchange $\lim$ and $\int$.
The sequence of non-negative functions
$$ g_k(x) = \left\{\begin{array}{rcl}\left(1-\frac{x}{k}\right)^k&\text{if}&0\leq x\leq k\\0&\text{if}&x\geq k\end{array}\right. $$
converges monotonically to $e^{-x}$.  By the dominated/monotone convergence theorem it follows that
$$ \lim_{k\to +\infty}\int_{0}^{+\infty} g_k(x) e^{x/3}\,dx =\int_{0}^{+\infty}e^{-2x/3}\,dx=\color{red}{\frac{3}{2}}.$$

Provided that $g_k(x)\leq e^{-x}$, we can also study how fast the sequence converges to $\frac{3}{2}$. Indeed
$$ \int_{0}^{+\infty}(e^{-x}-g_k(x))e^{x/3}\,dx = \int_{0}^{k}\left((e^{-x/k})^k-\left(1-\frac{x}{k}\right)^k\right)e^{x/3}\,dx + \int_{k}^{+\infty}e^{-2x/3}\,dx $$
where the last integral in the RHS equals $\frac{3}{2}e^{-2k/3}$ and the first one is
$$ I_k=k\int_{0}^{1}\left(\left(e^{-x}\right)^k-(1-x)^k\right) e^{kx/3}\,dx. $$
Over $[0,1]$ we have $e^{-x}-(1-x)\leq \frac{1}{2}x^2$, and $a\geq b\geq 0$ implies
$$ a^n-b^n = (a-b)(a^{n-1}+\ldots+b^{n-1}) \leq n(a-b)a^{n-1}, $$
so $I_k\geq 0$ is bounded by
$$ k^2\int_{0}^{1}\frac{x^2 e^x}{2}e^{-kx} e^{kx/3}\,dx\leq \frac{ek^2}{2}\int_{0}^{1}x^2 e^{kx/3-kx}\,dx\leq\frac{ek^2}{2}\int_{0}^{+\infty}x^2 e^{-2kx/3}\,dx $$
i.e.
$$ I_k \leq \frac{ek^2}{2}\cdot\frac{27}{4k^3}=O\left(\frac{1}{k}\right). $$
A: For $x\le k$, Bernoulli's Inequality yields
$$
\begin{align}
\frac{\left(1-\frac x{k+1}\right)^{k+1}}{\left(1-\frac xk\right)^k}
&=\left(1-\frac xk\right)\left(\frac{k+1-x}{k-x}\frac{k}{k+1}\right)^{k+1}\\
&=\left(1-\frac xk\right)\left(1+\frac{x}{(k-x)(k+1)}\right)^{k+1}\\[3pt]
&\ge\left(1-\frac xk\right)\left(1+\frac{x}{k-x}\right)\\[6pt]
&=1
\end{align}
$$
That is, $\left(1-\frac xk\right)^k$ is increasing. Thus, using either monotone convergence or dominated convergence (with $e^{-2x/3}$ as the dominating function) gives
$$
\begin{align}
\lim_{k\to\infty}\int_0^k\left(1-\frac xk\right)^ke^{x/3}\,\mathrm{d}x
&=\lim_{k\to\infty}\int_0^\infty\overbrace{[0\le x\le k]\left(1-\frac xk\right)^k}^\text{monotonically increases to $e^{-x}$}e^{x/3}\,\mathrm{d}x\\
&=\int_0^\infty e^{-2x/3}\,\mathrm{d}x\\
&=\frac32
\end{align}
$$
where $[\cdots]$ are Iverson brackets.
A: Tl;dr: I tried it by “elementary methods”, it didn’t work out (at least till now) I kinda did it, though not convincing.

Applying the property you mentioned, we get $$I=\int_0^k\left(1-\frac xk\right)^k\cdot e^{\tfrac x3}dx= \int_0^k\left(\frac xk\right)^k\cdot e^{\tfrac {k-x}{3}}dx $$$$= \dfrac{e^{\tfrac k3}}{k^k}\int_0^k\left(x\right)^k\cdot e^{-\tfrac x3}dx$$ Let $-\dfrac x3=u$. Then $dx=-3du$ so that we have $$-\frac13I= \dfrac{(-3)^ke^{\tfrac k3}}{k^k}\int_{-\frac k3}^0\left(u\right)^k\cdot e^udu$$
Now I believe it would do you good to remember that $$\displaystyle \int e^u\cdot p(u) du=e^u\sum _{n=0}^k(-1)^np^{(n)}(u)+C$$ where $p(u)$ is a polynomial function and $p^{(n)}(u)$ is the $n$th derivative of $p(u)$, with $p^{(0)}(u)=p(u)$. You can actually prove this by repeated use of Integration by Parts.
Now use another formula: the $n$th derivative of $p(u)=u^k, n<k $ is $$p^{(n)}(u)=\frac{k!}{(k-n)!}u^{k-n}$$ so we get a huge expression: $$-\frac13 I= \dfrac{(-3)^ke^{\tfrac k3}}{k^k} e^u\sum _{n=0}^k(-1)^n \frac{k!}{(k-n)!}u^{k-n}\Bigg|_{-\tfrac k3}^0$$$$= \dfrac{(-3)^ke^{\tfrac k3}}{k^k} \left((-1)^kk!-e^{-\tfrac k3}\sum _{n=0}^k(-1)^n \frac{k!}{(k-n)!}\left(\frac{-k}{3}\right)^{k-n}\right)  $$$$=  \dfrac{3^kk!e^{\tfrac k3}}{k^k} - \dfrac{(-3)^k}{k^k} \sum _{n=0}^k(-1)^n \frac{k!}{(k-n)!}\left(\frac{-k}{3}\right)^{k-n}  $$$$ =\dfrac{(3)^kk!e^{\tfrac k3}}{k^k} - \sum _{n=0}^k(-1)^n \frac{k!}{(k-n)!}\left(\frac{-k}{3}\right)^{-n}  $$$$=\dfrac{3^kk!e^{\tfrac k3}}{k^k} - \sum _{n=0}^kn!\ ^kC_n \left(\frac{3}{k}\right)^{n}  $$
Therefore $$I=3\left(\sum _{n=0}^kn!\ ^kC_n \left(\frac{3}{k}\right)^{n}-\dfrac{3^kk!e^{\tfrac k3}}{k^k} \right).$$ By these two posts (this and this), there exists no closed form. Also, from the comments to this question, you indeed have to evaluate the error term as k increases arbitrarily: the sum approximates the second term.
UPDATE: So $$I=3\dfrac{e^{\tfrac k3}k!}{(k/3)^k}\left(e^{-\tfrac k3}\sum _{n=0}^k\frac{(k/3)^n}{n!}-1\right).$$
Then, (special thanks to user @Ant), you can use this post and this post, you can find $$|l|=\dfrac 32.$$
I feel that this is the best one can go by using elementary methods.
