Convergence of Riemann sums for improper integrals

I was considering whether or not the limit of Riemann sums converges to the value of an improper integral on a bounded interval. This appears to be true in some cases when the sum avoids points where the function is not defined.

For example, the right-hand Riemann sum for $1/\sqrt{x}$ converges $$\lim \frac1{n}\sum_{i = 1}^n \sqrt{n/i} = \int_0^1 \frac{dx}{\sqrt{x}}.$$ This does not work, however, for the function $\sin(1/x)/x$ even though the improper integral is finite. I’m sure this has something to do with the function being monotone, but I am not able to find a proof.

• $\sin(1/x)/x$ is not Riemann integrable, because any partition includes a neighborhood of zero for which the upper rectangle has area greater than $1/\varepsilon$, but the lower rectangle has area less than $-1/\varepsilon$. – T.J. Gaffney Apr 15 '16 at 20:49
• @Gaffney: The OP is asking about improper integrals. $\int_0^1 x^{-1}\sin(1/x) dx = \pi/2$ as a convergent improper integral. I believe this is about convergence of sums when there is singularity at an endpoint but the function still has a finite improper integral. – RandyF Apr 15 '16 at 20:59
• There are always sequences of Riemann sums that converge to the improper integral. If the integrand is monotonic, then pretty much everything works, as long as you keep the point in the interval containing the singularity far enough away from the singularity. For oscillating integrands that blow up, like $x^{-1}\sin (1/x)$, choices are more restricted. – Daniel Fischer Apr 15 '16 at 21:02
• @RandyF $$\int_0^1 x^{-1}\sin (1/x)\,dx < \frac{\pi}{2} = \int_0^{\infty} x^{-1}\sin (1/x)\,dx.$$ That doesn't invalidate your point, of course. – Daniel Fischer Apr 15 '16 at 21:04

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

• Nicely written (+1) – Mark Viola May 4 '17 at 17:24