Compute $\int_a^b e^x dx$ as a Riemann Sum I tried computing the integral $$\int_a^b e^x dx$$ as a Riemann sum. Therefore split the interval in to $n$ parts of the length $$\frac{b-a}{n}$$
and then took the limit of the Riemann sum.
$$\lim _{n \rightarrow \infty} \frac{b-a}{n} \sum_{k=0}^n e^{\frac{k(b-a)}{n}}$$.
When I computed this sum I got a limit, but not the right one.
$$
\begin{aligned}
& \int_a^b e^x d x=\lim _{n \rightarrow \infty} \frac{b-a}{n} \sum_{k=0}^n e^{\frac{k(b-a)}{n}} \\
& =\lim _{n \rightarrow \infty} \frac{b-a}{n} \sum_{k=0}^n\left(e^{\frac{b-a}{n}}\right)^k \\
& =\lim _{n \rightarrow \infty} \frac{b-a}{n}\left(\frac{\left(e^{\frac{b-a}{n}}\right)^{n+1}-1}{e ^{\frac{b-a}{n}}-1}\right) \\
& =\lim _{n \rightarrow \infty} \frac{(b-a)\left(\left(e^\frac{b-a}{n}\right)^{n+i}-1\right)}{n\left(e ^{\frac{b-a}{n}}-1\right)} \\
& =\lim _{n \rightarrow \infty} \frac{(b-a)\left(e^{\frac{(b-a)(n+1)}{n}}-1\right)}{n\left(\left(1+\frac{1}{n}\right)^{b-a}-1\right)} \\
& =\lim _{n \rightarrow \infty} \frac{(b-a)\left(e^{\frac{(b-a)(n+1)}{n}}-1\right)}{n\left(1+\frac{b-a}{n}-1\right)} \text { after  Taylor Expansion } \lim _{x \to 0}(1+x)^a=1+x \cdot a\\
& =\lim _{n \rightarrow \infty} e^{\frac{(b-a)(n+1)}{n}}-1 \\
& =\lim _{n \rightarrow \infty} e^{b-a}-1 \\
&
\end{aligned}
$$
Does somebody spot my mistake?
 A: When setting up the Riemann sum, instead of $\displaystyle \sum_{k=0}^n e^{k(b-a)/n}$, you should have $\displaystyle \sum_{k=0}^n e^{a+k(b-a)/n}$. Your computation should work out perfectly after that correction.
In fact, you should have $\displaystyle \sum_{k=1}^n e^{a+k(b-a)/n}$ (for a right-hand Riemann sum) or $\displaystyle \sum_{k=0}^{n-1} e^{a+k(b-a)/n}$ (for a left-hand Riemann sum); this correction won't cause a change in the final result.
A: Three mistakes :

*

*the Riemann sum is over all integers $k$ in $[0,n-1]$ or $[1,n]$, not $[0,n]$.

*When you divide $[a,b]$ in $n$ intervals with length $(b-a)/n$, the bounds of those intervals are the points $a+(k/n)(b-a)$ where $k \in [0,n]$. This is why you do not get the right answer.

*Applying Taylor expansion as you do is not rigorous. You should use
$$\frac{e^{(b-a)/n}-1}{(b-a)/n} \to \frac{\mathrm{d}}{\mathrm{d}x}(e^x) \Big|_{x=0} = 1.$$
A: $$
\begin{aligned}
\int_a^b e^x d x & =\lim _{n \rightarrow \infty} \frac{b-a}{n} \sum_{k=0}^n e^{a+\frac{k(b-a)}{n}} \\
& =e^a \lim _{n \rightarrow \infty} \frac{b-a}{n} \sum_{k=1}^n\left(e^{\frac{b-a}{n}}\right)^k \\
& =e^a \lim _{n \rightarrow \infty} \frac{b-a}{n} \cdot \frac{\left(e^{\frac{b-a}{n}}\right)^n-1}{e^{\frac{b-a}{n}}-1} \\
&  =e^a\left(e^{b-a}-1\right) \frac{1}{\lim _{x \rightarrow 0}\left(\frac{e^x-1}{x}\right)} \textrm{, where }x=\frac{b-a}{n}  \\
& =e^b-e^a 
\end{aligned}
$$
