Integration using Riemann Sums I want to prove some basic integration facts using Riemann Sums, such as 
$$\int_a^b x \;dx = \frac{b^2 - a^2}{2}$$
I feel comfortable with the overall concept of lower and upper sums (as seen in Spivak) but when it comes to actual application, things feel a little clumsy. Here's my process:
I let $P_n$ denote the partition which divides $[a,b]$ into $n$ equal subintervals, $P_n = \{ t_0, t_1, t_2, \dots, t_n \}$. We of course note that $t_0 = a, t_n = b$. Now, the lower/upper sums are given by:
\begin{align*}
L(f,P_n) = \sum_{i=1}^n m_i(t_i - t_{i-1}) \\
U(f,P_n) = \sum_{i=1}^n M_i(t_i - t_{i-1}) \\
\end{align*}
Where
\begin{align*}
m_i &= \inf(\{f(x)\,|\,t_{i-1}\leq x \leq t_i \}) = t_{i-1} \\
M_i &= \sup(\{f(x)\,|\,t_{i-1}\leq x \leq t_i \}) = t_i
\end{align*}
So, I can say:
$$L(f,P_n) = \frac{b-a}{n}\sum_{i=1}^nm_i = \frac{b-a}{n}(a + \dots+t_{n-1}) 
= \frac{b^2 - a^2}{n}+\dots$$
From here, I feel a little stuck. Any help would be appreciated.
 A: with Lower sum
For $i=0,1,2...n $,
$$t_i=a+i\frac {b-a}{n}=a+ih .$$
the lower sum is
$$L (f,P_n)=h\Bigl(a+(a+h)+(a+2h)+... (a+(n-1)h)\Bigr) $$
$$=h \Bigl(na+h\frac {n (n-1)}{2}\Bigr) $$
$$=(b-a)\Bigl(a+(b-a)\frac {n-1}{2n} \Bigr)$$
Thus
$$\int_a^b x dx=\sup_{n>0}\{L (f,P_n\}=$$
$$\lim_{n\to+\infty}L (f,P_n)=
(b-a)(a+\frac {b-a}{2})=$$
$$\frac {b^2-a^2}{2}$$
Do it for the Upper sum.
A: You don't need the upper and lower sums (which are used in the definition of Darboux integrals) for the Riemann sum. 
A Riemann sum for $\int_a^bf(x)\,dx$ is of the form
$$
\sum_{k=1}^nf(x_k^*)(x_k-x_{k-1}).
$$
It could be $\sum_{k=1}^nf(x^*_k)\cdot\frac{b-a}{n}$  when the partition is chosen with equal space. Now chose for instance $x^*_k$ as the right end point of the interval, which can be written in terms of $a,b,n$ and $k$.
Drawing a picture would be helpful.  
A: I'm going to give a summary of the differences between the Darboux and Riemann approaches to the integral, that explain how we can get to the notion of using one particular sort of partition to compute integrals. Let's recall some definitions.


*

*A partition of the interval $[a,b]$ is a list $P=\{ x_i \}_{i=0}^n$, where $a=x_1 < x_2 < \dotsb < x_n = b$. The mesh of the partition is $\Delta P = \max_{i} (x_i-x_{i-i})$.

*A tagged partition $T = (P,T) $ is a partition $P$ along with a set of tags, $T=\{t_i\}_{i=1}^n$, so $x_{i-1} < t_i < x_i$.


Given a function $f: [a,b] \to \mathbb{R}$, the Riemann integral is defined using Riemann sums:


*

*Given a tagged partition $(P,T)$ of $[a,b]$ and a function $f$, the Riemann sum $S(f,P,T)$ is given by
$$ S(f,P,T) = \sum_{i} f(t_i) (x_i-x_{i-1}) $$

*A function is called Riemann-integrable on $[a,b]$ if
$$ \lim_{\Delta P \to 0} S(f,P,T) $$
exists, i.e. there is $\ell$ so that given any $\varepsilon>0$, there is $\delta>0$ so that any tagged partition with $\Delta P < \delta$ has $\lvert S(f,P,T) - \ell \rvert < \varepsilon $; then $\ell $ is called the Riemann integal of $f$ over $[a,b]$, and is written $\int_a^b f$ or $\int_a^b f(x) \, dx$.
However, this is quite a difficult condition to check: there's a lot of possible tagged partitions. Moreover, somehow it feels like the tags are an extra complication beyond what is necessary, since they barely feature in the sum. Darboux's idea was to look at a simpler set of integrals, by using a different sort of sum.


*

*Given a partition $P$ of $[a,b]$, the upper and lower sums associated with $P$ are given by
$$ U(f,P) = \sum_i \Big(\sup_{[x_{i-1},x_{i}]} f\Big) (x_i-x_{i-1}) \\
L(f,P) = \sum_i \Big(\inf_{[x_{i-1},x_{i}]} f\Big) (x_i-x_{i-1}). $$

*We define the upper and lower integrals by
$$ \overline{\int}_a^b f = \lim_{\Delta P \to 0} U(f,P) \\
\underline{\int}_a^b f = \lim_{\Delta P \to 0} L(f,P). $$
These always exist; indeed, it turns out that $\overline{\int}_a^b f = \inf_{P} U(f,P)$ and $\underline{\int}_a^b f = \sup_P L(f,P)$.

*For any $P$, we always have
$$ U(f,P) \geq \overline{\int}_a^b f \geq \underline{\int}_a^b f \geq L(f,P). $$
If the middle inequality is in fact equality, $f$ is called Darboux-integrable and the common value is called the Darboux integral of $f$ on $[a,b]$; we could write it as $\displaystyle {D \mkern-10pt \int}_a^b f$, or $\int_a^b f \quad (D)$, but it turns out this doesn't matter:

With these definitions, $f:[a,b] \to \mathbb{R}$ is Darboux-integrable if and only if it is Riemann-integrable, and the values of the integrals coincide.



*

*$D \implies R$ is easy: we have $U(f,P) \geq S(f,P,T) \geq L(f,P)$ for any tagged partition $(P,T)$, so if the upper and lower sums converge to $\ell$ as $\Delta P \to 0$, so too must the Riemann sums.

*$R \implies D$: The key here is that for given $P$, there is a set of tags $T_U$ so that $U(f,P)-S(f,P,T_U)<\varepsilon$, and another set $T_L$ so that $S(f,P,T_L)-L(f,P) < \varepsilon$. In particular, we use this to show that $$\overline{\int}_a^b f = \limsup_{\Delta P \to 0} S(f,P,T) \\
\underline{\int}_a^b f = \liminf_{\Delta P \to 0} S(f,P,T),  $$
and of course the left-hand sides coincide if $f$ is Darboux-integrable, the right if $f$ is Riemann-integrable.



This suggests that we should use Darboux's definition when actually computing the things: the main question is how many partitions we have to investigate to actually show that the integral exists. Thankfully, the answer is that if we can find a sequence $P_m$ of partitions  with $\Delta P_m \to 0$ and $U(f,P_m)-L(f,P_m) \to 0$ as $m \to \infty$, then $f$ is Darboux integrable.
(This appeals to the idea of minimising/maximising sequences: if we want to show that $\inf A \leq \ell$, it suffices to find a sequence $ \{ a_m \}_{m = 1}^{\infty} \subset A $ with $a_m \to \ell $. Likewise, $ \sup B \geq \ell $ if there is $ \{ b_m \}_{m = 1}^{\infty} \subset B $ with $b_m \to \ell$. If we already know that $\inf A \geq \sup B$, then we must have $\inf A = \sup B = \ell$.)

To finally get to your question, the obvious partition to take is $P_n = \{ a + (b-a)i/n \}_{i=0}^n $. This is nice and evenly spaced, and we know instantly that $\Delta P_n = x_i-x_{i-1} = (b-a)/n$, so it will suffice to take the limit of the upper and lower sums as $n \to \infty$. Since $f(x)=x$ is increasing, the upper sum contains $f(x_i) = a + (b-a)i/n $ and the lower sum contains $f(x_{i-1}) = a + (b-a)(i-1)/n$. So we have
$$ U(f,P_n) = \frac{b-a}{n}\sum_{i=1}^n  a+\frac{(b-a)i}{n} \\
L(f,P_n) = \frac{b-a}{n}\sum_{i=1}^n  a+\frac{(b-a)(i-1)}{n} $$
Of course, the sums can be evaluated using $\sum_{i=1}^k 1 = k$ and $\sum_{i=1}^k k = k(k+1)/2$ to give
$$ U(f,P_n) = \frac{b-a}{n}\left( na + (b-a)\frac{n(n+1)}{2n} \right) = \frac{(b-a)(b+a)}{2}+\frac{(b-a)^2}{2n} \\
L(f,P_n) = \frac{b-a}{n}\left( na + (b-a)\frac{n(n-1)}{2n} \right) = \frac{(b-a)(b+a)}{2}-\frac{(b-a)^2}{2n}, $$
and of course both of these tend to $(b^2-a^2)/2$ as $n \to \infty$.

An alternative that makes the sums much easier to compute for positive $a$ and $b$ (the negative part is easy to separate and do similarly) is to use a geometric progression as a partition instead of an arithmetic one, namely
$$ Q_n = \{ a(b/a)^{i/n} \}_{i=0}^n. $$
Then the mesh is given by $b-(b/a)^{1-1/n} \to 0$ as $n \to \infty$, and
$$ U(f,Q_n) = \sum_{i=1}^n a\left(\frac{b}{a}\right)^{i/n} a\left(\left(\frac{b}{a}\right)^{i/n}- \left(\frac{b}{a}\right)^{(i-1)/n}\right) \\
L(f,Q_n) = \sum_{i=1}^n a\left(\frac{b}{a}\right)^{(i-1)/n} a\left(\left(\frac{b}{a}\right)^{i/n}- \left(\frac{b}{a}\right)^{(i-1)/n}\right), $$
all of which can be computed using just the geometric series formula; the limit can be taken using L'Hôpital. This idea dates back at least to Dirichlet, and works on a general power (it is interesting to try it on $\int_1^x dt/t$, for example).
