Convergence of Riemann sums for improper integrals
Solution 1:
We can prove that sequences of right- or left-hand Riemann sums will converge for a monotone function with a convergent improper integral.
Suppose WLOG $f:(0,1] \to \mathbb{R}$ is nonnegative and decreasing. Suppose further that there is a singularity at $x =0$ but $f$ is Riemann integrable on $[c,1]$ for $c > 0$ and the improper integral is convergent:
$$\lim_{c \to 0+}\int_c^1 f(x) \, dx = \int_0^1 f(x) \, dx.$$
Take a uniform partition $P_n = (0,1/n, 2/n, \ldots, (n-1)/n,1).$ Since $f$ is decreasing we have $$\frac1{n}f\left(\frac{k}{n}\right) \geqslant \int_{k/n}^{(k+1)/n}f(x) \, dx \geqslant \frac1{n}f\left(\frac{k+1}{n}\right), $$
and summing over $k = 1,2, \ldots, n-1$
$$\frac1{n}\sum_{k=1}^{n-1}f\left(\frac{k}{n}\right) \geqslant \int_{1/n}^{1}f(x) \, dx \geqslant \frac1{n}\sum_{k=2}^nf\left(\frac{k}{n}\right). $$ Hence,
$$ \int_{1/n}^{1}f(x) \, dx +\frac{1}{n}f(1) \leqslant \frac1{n}\sum_{k=1}^{n}f\left(\frac{k}{n}\right) \leqslant \int_{1/n}^{1}f(x) \, dx+ \frac{1}{n}f \left(\frac{1}{n} \right).$$
Note that as $n \to \infty$ we have $f(1) /n \to 0$ and since the improper integral is convergent,
$$\lim_{n \to \infty} \int_{1/n}^{1}f(x) \, dx = \int_0^1 f(x) \, dx, \\ \lim_{n \to \infty}\frac{1}{n}f \left(\frac{1}{n} \right) = 0.$$
The second limit follows from monotonicity and the Cauchy criterion which implies that for any $\epsilon > 0$ and all $n$ sufficiently large
$$0 \leqslant \frac{1}{n}f \left(\frac{1}{n} \right) \leqslant 2\int_{1/2n}^{1/n}f(x) \, dx < \epsilon.$$
By the squeeze theorem we have
$$\lim_{n \to \infty}\frac1{n}\sum_{k=1}^nf\left(\frac{k}{n}\right) = \int_0^1 f(x) \, dx.$$
This proof can be generalized for non-uniform partitions. For oscillatory functions like $g(x) = \sin(1/x)/x$, the failure of the sequence of right-hand Riemann sums to converge is, non-monotonicity notwithstanding, related to non-convergence as $n \to \infty$ of
$$ \frac{1}{n}g \left(\frac{1}{n} \right) = \sin n. $$
This particular case appears to have been covered nicely by @Daniel Fischer in
Improper integrals and right-hand Riemann sums