Question referring to the exponential function defined as a limit of a sequence Suppose that $(x_n)_{n \in \mathbb{N}}$ is a sequence with $\lim_{n \to \infty} x_n = x \in \mathbb{R}$.
I want to show that
$$
\lim_{n \to \infty} \left( 1 + \frac{x_n}{n} \right)^n = \text{e}^x.
$$
My attempt: We have that
$$ 
\text{e}^x = \lim_{m \to \infty} \left( 1 + \frac{x}{m} \right)^m = \lim_{m \to \infty} \left( 1 + \frac{\lim_{n \to \infty  }x_n}{m} \right)^m = \lim_{m \to \infty}\lim_{n \to \infty  } \left( 1 + \frac{x_n}{m} \right)^m.
$$
Now I am not sure if (or why) it is allowed to replace the limits $m,n \to \infty$ by one limit $n \to \infty$.

Since $\lim\limits_{n\to \infty} (1 + \frac{x}{n})^n = e^x$, the limit in question can be proven by showing

$$\lim_{n\to \infty} \left(\dfrac{1 + \dfrac{x_n}{n}}{1 + \dfrac{x}{n}}\right)^n = 1.\tag{1}$$

Let $a_n = x_n - x$. Then 
$$\frac{1 + \dfrac{x_n}{n}}{1 + \dfrac{x}{n}} = \dfrac{1 + \dfrac{x}{n} + \dfrac{a_n}{n}}{1 + \dfrac{x}{n}} = 1 + \frac{\dfrac{a_n}{n}}{1 + \dfrac{x}{n}} = 1 + \frac{a_n}{n + x}.$$
So $(1)$ is equivalent to 

$$\lim_{n\to \infty} \left(1 + \frac{a_n}{n + x}\right)^n = 1.\tag{2}$$

Let $n > 2|x|$. By the binomial theorem and triangle inequality, 
$$\left|\left(1 + \frac{a_n}{n+x}\right)^n - 1\right| \le \sum_{k = 1}^n \binom{n}{k}\frac{|a_n|^k}{(n - |x|)^k}.$$
Since $n > 2|x|$, $n - |x| > \frac{n}{2}$. Furthermore, $\binom{n}{k} < \frac{n^k}{2^{k-1}}$ for $1\le k \le n$ since $n(n-1)\cdots (n-k+1) < n^k$ and $k! \ge 2^{k-1}$ for all such $k$. Therefore
$$\sum_{k = 1}^n \binom{n}{k}\frac{|a_n|^k}{(n - |x|)^k} <\sum_{k = 1}^n \frac{n^k}{2^{k-1}}\cdot \frac{|a_n|^k}{(n/2)^k} = 2\sum_{k=1}^n |a_n|^k.$$
Let $\epsilon > 0$, and choose a positive number $r < \min\{\frac{1}{2}, \frac{\epsilon}{4}\}$. Since $|a_n| \to 0$, there exists a positive integer $N$ such that $|a_n| < r$ for all $n > N$. So for $n > \max\{2|x|, N\}$, 
$$\left|\left(1 + \frac{a_n}{n+x}\right)^n - 1\right| \le 2\sum_{k = 1}^n |a_n|^k = 2\sum_{k = 1}^{N} |a_n|^k + 2\sum_{k = N+1}^n r^k \le 2\sum_{k = 1}^N |a_n|^k + \frac{2r^{N+1}}{1 - r}.\tag{3}$$
Since $r < \frac{1}{2}$, $r < 1 - r$ and $r^N < \frac{r}{2^{N-1}}$, so $$\frac{2r^{N+1}}{1-r} < 2r^N < \frac{r}{2^{N-2}} < \frac{\epsilon}{2^N} \le \frac{\epsilon}{2}.$$ Since $2\sum_{k = 1}^N |a_n|^k \to 0$, there exists a positive integer $N'$ for which $2\sum_{k = 1}^N |a_n|^k < \frac{\epsilon}{2}$ for all $n > N'$. Hence, for $n > \max\{2|x|, N, N'\}$, the right-most expression of $(3)$ is less than $\epsilon$. Since $\epsilon$ was arbitrary, $(2)$ holds.
