# Recognizing a certain limit as the Riemann sum of an integral

I am having trouble understanding the solution for this problem: Evaluate $\displaystyle \lim_{n\to\infty} \sum\limits_{i=1}^{n^2} \frac{e^{i/n}}{ne^n}$.

Here's the solution:

$$\lim_{n\to\infty} \sum\limits_{i=1}^{n^2} \frac{e^{i/n}}{ne^n} = \lim_{n\to\infty} \frac{1}{n}\sum\limits_{i=1}^{n^2} e^{i/n-n}=\int\limits_{-\infty}^{0} e^x dx=1$$

How did they get from the Riemann sum to the integral? In other words how is the sum a Riemann sum for $\int\limits_{-\infty}^{0} e^x dx$ ?

• is the summation index n or k ? – hamam_Abdallah Jun 28 '17 at 16:06
• @Salahamam_Fatima Probably neither -- it should be $i$. – Clement C. Jun 28 '17 at 16:07
• It is i sorry. I mistyped the problem – chrismc Jun 28 '17 at 16:11
• @ClementC. i could be complex. – hamam_Abdallah Jun 28 '17 at 16:24
• There is no need for Riemann sums since $\sum_{i=1}^{n^2}e^{i/n}$ is the sum of a geometric progression, that can be computed in a explicit way. – Jack D'Aurizio Jun 28 '17 at 16:30

If you want (or need) to do it as a Riemann sum, your best bet is to change the index of summation, letting $k=n^2-i$, which runs (backwards) from $0$ to $n^2-1$ as $i$ runs from $1$ to $n^2$. Since $i=n^2-k$, we have $i/n-n=(n^2-k)/n-n=-k/n$, so that we get

$$\lim_{n\to\infty}{1\over n}\sum_{k=0}^{n^2-1}e^{-k/n}=\int_0^\infty e^{-x}dx$$

If you really need the result in the form given, you can let $k=i-n^2$ instead, so that $k$ runs from $1-n^2$ to $0$, and write

$$\lim_{n\to\infty}{1\over n}\sum_{k=1-n^2}^0e^{k/n}=\int_{-\infty}^0 e^xdx$$

(Ah, I just now noticed Clement C's comment below the OP, which says exactly the same thing.)

Added later, in response to the OP's question in comments: This is not a standard Riemann sum, in which the interval is fixed and it's just the partition that's getting finer and finer. In this case, $\Delta x={1\over n}$ as usual, but, because $k$ runs from $0$ to $n^2-1$ (in the first displayed equation -- the second one is analogous), $x=k/n$ takes values from $0$ to $n-{1\over n}\approx n$. The upshot is that, for any given (large) $n$, we should (and do) have

$${1\over n}\sum_{k=0}^{n^2-1}e^{-k/n}\approx\int_0^ne^{-x}dx$$

Because it's a somewhat nonstandard Riemann sum, some extra care is technically called for in proving that it converges to the (improper) integral $\int_0^\infty e^{-x}dx$. This is what zhw. does in his/her answer.

• How does this work as the width of each rectangle is (1/n). Shouldn't the limits of integration be 0 to 1 (or some other pair of limits with length 1)? – chrismc Jun 29 '17 at 3:34

I did it this way: Define

$$S_n = \sum_{k=1}^{n^2}e^{k/n}\frac{1}{n}.$$

This is a Riemann sum approximating $\int_0^n e^x\, dx.$ Now $e^x$ is increasing. Thus, in the usual way, we can estimate $S_n$ from either side with an integral. Specifically we see

$$\int_0^n e^x\,dx < S_n < \int_{1/n}^{n+1/n} e^x\,dx.$$

The integrals equal $e^n-1$ and $e^{n+1/n}-e^{1/n}$ respectively. Dividing everything by $e^n$ then gives

$$\frac{e^n-1}{e^n} < \frac{S_n}{e^n} < \frac{e^{n+1/n}-e^{1/n}}{e^n}.$$

The limits on the left and right are $1.$ By the squeeze theorem, $S_n/e^n \to 1,$ and this is the desired limit.