Definitions

# Riemann integral

In the branch of mathematics known as real analysis, the Riemann integral, created by Bernhard Riemann, was the first rigorous definition of the integral of a function on an interval. While the Riemann integral is unsuitable for many theoretical purposes, it is one of the easiest integrals to define. Some of these technical deficiencies can be remedied by the Riemann-Stieltjes integral, and most of them disappear in the Lebesgue integral.

## Overview

Let $f\left(x\right)$ be a non-negative real-valued function of the interval $\left[a,b\right]$, and let $S = \left\{ \left(x, y\right) | 0 < y < f\left(x\right) \right\}$ be the region of the plane under the function $f\left(x\right)$ and above the interval $\left[a,b\right]$ (see the figure on the top right). We are interested in measuring the area of $S$. Once we have measured it, we will denote the area by:

$int_\left\{a\right\}^\left\{b\right\}f\left(x\right),dx.$

The basic idea of the Riemann integral is to use very simple approximations for the area of $S$. By taking better and better approximations, we can say that "in the limit" we get exactly the area of $S$ under the curve.

Note that where $f$ can be both positive and negative, the integral corresponds to signed area; that is, the area above the $x$-axis minus the area below the $x$-axis.

## Definition of the Riemann integral

### Partitions of an interval

A partition of an interval $\left[a,b\right]$ is a finite sequence $a = x_0 < x_1 < x_2 < cdots < x_n = b$. Each $\left[x_i, x_\left\{i+1\right\}\right]$ is called a subinterval of the partition. The mesh of a partition is defined to be the length of the longest subinterval $\left[x_i,x_\left\{i+1\right\}\right]$, that is, it is $max \left(x_\left\{i+1\right\}-x_i\right)$ where $0 le i le n - 1$. It is also called the norm of the partition.

A tagged partition of an interval is a partition of an interval together with a finite sequence of numbers $t_0, ldots, t_\left\{n-1\right\}$ subject to the conditions that for each $i$, $x_i le t_i le x_\left\{i+1\right\}$. In other words, it is a partition together with a distinguished point of every subinterval. The mesh of a tagged partition is defined the same as for an ordinary partition.

Suppose that $x_0,ldots,x_n$ together with $t_0,ldots,t_\left\{n-1\right\}$ are a tagged partition of $\left[a, b\right]$, and that $y_0,ldots,y_m$ together with $s_0,ldots,s_\left\{m-1\right\}$ are another tagged partition of $\left[a,b\right]$. We say that $y_0,ldots,y_m$ and $s_0,ldots,s_\left\{m-1\right\}$ together are a refinement of $x_0,ldots,x_n$ together with $t_0,ldots,t_\left\{n-1\right\}$ if for each integer $i$ with $0 le i le n$, there is an integer $r\left(i\right)$ such that $x_i = y_\left\{r\left(i\right)\right\}$ and such that $t_i = s_j$ for some $j$ with $r\left(i\right) le j le r\left(i+1\right)$. Said more simply, a refinement of a tagged partition takes the starting partition and adds more tags, but does not take any away.

We can define a partial order on the set of all tagged partitions by saying that one tagged partition is bigger than another if the bigger one is a refinement of the smaller one.

### Riemann sums

Choose a real-valued function $f$ which is defined on the interval $\left[a,b\right]$. The Riemann sum of $f$ with respect to the tagged partition $x_0,ldots,x_n$ together with $t_0,ldots,t_\left\{n-1\right\}$ is:

$sum_\left\{i=0\right\}^\left\{n-1\right\} f\left(t_i\right) \left(x_\left\{i+1\right\}-x_i\right)$

Each term in the sum is the product of the value of the function at a given point and the length of an interval. Consequently, each term represents the area of a rectangle with height $f\left(t_i\right)$ and length $x_\left\{i+1\right\}-x_i$. The Riemann sum is the signed area under all the rectangles.

### The Riemann integral

Loosely speaking, the Riemann integral is the limit of the Riemann sums of a function as the partitions get finer and finer. However, being precise about what is meant by "finer and finer" is somewhat tricky.

One important fact is that the mesh of the partitions must become smaller and smaller, so that in the limit, it is zero. If this were not so, then we would not be getting a good approximation to the function on certain subintervals. In fact, this is enough to define an integral. To be specific, we say that the Riemann integral of $f$ equals $s$ if the following condition holds:

For all $epsilon > 0$, there exists $delta > 0$ such that for any tagged partition $x_0,ldots,x_n$ and $t_0,ldots,t_\left\{n-1\right\}$ whose mesh is less than $delta$, we have

$left|sum_\left\{i=0\right\}^\left\{n-1\right\} f\left(t_i\right) \left(x_\left\{i+1\right\}-x_i\right) - sright| < epsilon.,$

However, there is an unfortunate problem with this definition: it is very difficult to work with. So we will make an alternate definition of the Riemann integral which is easier to work with, then prove that it is the same as the definition we have just made. Our new definition says that the Riemann integral of $f$ equals $s$ if the following condition holds:

For all $epsilon > 0$, there exists a tagged partition $x_0,ldots,x_n$ and $t_0,ldots,t_\left\{n-1\right\}$ such that for any refinement $y_0,ldots,y_m$ and $s_0,ldots,s_\left\{m-1\right\}$ of $x_0,ldots,x_n$ and $t_0,ldots,t_\left\{n-1\right\}$, we have

$left|sum_\left\{i=0\right\}^\left\{m-1\right\} f\left(s_i\right) \left(y_\left\{i+1\right\}-y_i\right) - sright| < epsilon.,$

Both of these mean that eventually, the Riemann sum of $f$ with respect to any partition gets trapped close to $s$. Since this is true no matter how close we demand the sums be trapped, we say that the Riemann sums converge to $s$. These definitions are actually a special case of a more general concept, a net.

As we stated earlier, these two definitions are equivalent. In other words, $s$ works in the first definition if and only if $s$ works in the second definition. To show that the first definition implies the second, start with an $epsilon$, and choose a $delta$ that satisfies the condition. Choose any tagged partition whose mesh is less than $delta$. Its Riemann sum is within $epsilon$ of $s$, and any refinement of this partition will also have mesh less than $delta$, so the Riemann sum of the refinement will also be within $epsilon$ of $s$. To show that the second definition implies the first, it is easiest to use the Darboux integral. First one shows that the second definition is equivalent to the definition of the Darboux integral; for this see the page on Darboux integration. Now we will show that a Darboux integrable function satisfies the first definition. Choose a partition $x_0, ldots, x_n$ such that the lower and upper Darboux sums with respect to this partition are within $frac\left\{epsilon\right\}\left\{2\right\}$ of the value $s$ of the Darboux integral. Let $r$ equal $max_\left\{0 le i le n-1\right\} M_i-m_i$, where $M_i$ and $m_i$ are the supremum and infimum, respectively, of $f$ on $\left[x_i,x_\left\{i+1\right\}\right]$, and let $delta$ be less than both $frac\left\{epsilon\right\}\left\{2rn\right\}$ and $min_\left\{0 le i le n-1\right\} x_\left\{i+1\right\}-x_i$. Then it is not hard to see that the Riemann sum of $f$ with respect to any tagged partition of mesh less than $delta$ will be within $frac\left\{epsilon\right\}\left\{2\right\}$ of the upper or lower Darboux sum, so it will be within $epsilon$ of $s$.

## Examples

Let $f:\left[0,1\right] rightarrow mathbb\left\{R\right\}$ be the function which takes the value 1 at every point. Any Riemann sum of $f$ on $\left[0,1\right]$ will have the value 1, therefore the Riemann integral of $f$ on $\left[0,1\right]$ is 1.

Let $I_\left\{mathbb\left\{Q\right\}\right\}:\left[0,1\right] rightarrow mathbb\left\{R\right\}$ be the indicator function of the rational numbers in $\left[0, 1\right]$; that is, $I_\left\{mathbb\left\{Q\right\}\right\}$ takes the value 1 on rational numbers and 0 on irrational numbers. This function does not have a Riemann integral. To prove this, we will show how to construct tagged partitions whose Riemann sums get arbitrarily close to both zero and one.

To start, let $x_0, ldots, x_n$ and $t_0, ldots, t_\left\{n-1\right\}$ be a tagged partition (each $t_i$ is between $x_i$ and $x_\left\{i+1\right\}$). Choose $epsilon > 0$. The $t_i$ have already been chosen, and we can't change the value of $f$ at those points. But if we cut the partition into tiny pieces around each $t_i$, we can minimize the effect of the $t_i$. Then, by carefully choosing the new tags, we can make the value of the Riemann sum turn out to be within $epsilon$ of either zero or one—our choice!

Our first step is to cut up the partition. There are $n$ of the $t_i$, and we want their total effect to be less than $epsilon$. If we confine each of them to an interval of length less than $epsilon/n$, then the contribution of each $t_i$ to the Riemann sum will be at least $\left(0cdotepsilon\right)/n$ and at most $\left(1cdotepsilon\right)/n$. This makes the total sum at least zero and at most $epsilon$. So let $delta$ be a positive number less than $epsilon/n$. If it happens that two of the $t_i$ are within $delta$ of each other, choose $delta$ smaller. If it happens that some $t_i$ is within $delta$ of some $x_j$, and $t_i$ is not equal to $x_j$, choose $delta$ smaller. Since there are only finitely many $t_i$ and $x_j$, we can always choose $delta$ sufficiently small.

Now we add two cuts to the partition for each $t_i$. One of the cuts will be at $t_i - delta/2$, and the other will be at $t_i + delta/2$. If one of these leaves the interval $\left[0,1\right]$, then we leave it out. $t_i$ will be the tag corresponding to the subinterval $\left[t_i - delta/2,t_i + delta/2\right]$. If $t_i$ is directly on top of one of the $x_j$, then we let $t_i$ be the tag for both $\left[t_i - delta/2,x_j\right]$ and $\left[x_j,t_i + delta/2\right]$. We still have to choose tags for the other subintervals. We will choose them in two different ways. The first way is to always choose a rational point, so that the Riemann sum is as large as possible. This will make the value of the Riemann sum at least $1-epsilon$. The second way is to always choose an irrational point, so that the Riemann sum is as small as possible. This will make the value of the Riemann sum at most $epsilon$.

Since we started from an arbitrary partition and ended up as close as we wanted to either zero or one, it is false to say that we are eventually trapped near some number $s$, so this function is not Riemann integrable. However, it is Lebesgue integrable. In the Lebesgue sense its integral is zero, since the function is zero almost everywhere. But this is a fact that is beyond the reach of the Riemann integral.

## Other concepts similar to the Riemann integral

It is popular to define the Riemann integral as the Darboux integral. This is because the Darboux integral is technically simpler and because a function is Riemann-integrable if and only if it is Darboux-integrable.

Some calculus books do not use general tagged partitions, but limit themselves to specific types of tagged partitions. If the type of partition is limited too much, some non-integrable functions may appear to be integrable.

One popular restriction is the use of "left-hand" and "right-hand" Riemann sums. In a left-hand Riemann sum, $t_i = x_i$ for all $i$, and in a right-hand Riemann sum, $t_i = x_\left\{i+1\right\}$ for all $i$. Alone this restriction does not impose a problem: we can refine any partition in a way that makes it a left-hand or right-hand sum by subdividing it at each $t_i$. In more formal language, the set of all left-hand Riemann sums and the set of all right-hand Riemann sums is cofinal in the set of all tagged partitions.

Another popular restriction is the use of regular subdivisions of an interval. For example, the $n\text{'}$th regular subdivision of $\left[0, 1\right]$ consists of the intervals $\left[0, 1/n\right], \left[1/n, 2/n\right], ldots, \left[\left(n-1\right)/n, 1\right]$. Again, alone this restriction does not impose a problem, but the reasoning required to see this fact is more difficult than in the case of left-hand and right-hand Riemann sums.

However, combining these restrictions, so that one uses only left-hand or right-hand Riemann sums on regularly divided intervals, is dangerous. If a function is known in advance to be Riemann integrable, then this technique will give the correct value of the integral. But under these conditions the indicator function $I_\left\{mathbb\left\{Q\right\}\right\}$ will appear to be integrable on $\left[0, 1\right]$ with integral equal to one: Every endpoint of every subinterval will be a rational number, so the function will always be evaluated at rational numbers, and hence it will appear to always equal one. The problem with this definition becomes apparent when we try to split the integral into two pieces. The following equation ought to hold:


int_0^{sqrt{2}-1}! I_mathbf{Q}(x) ,mathrm{d}x + int_{sqrt{2}-1}^1! I_mathbf{Q}(x) ,mathrm{d}x = int_0^1! I_mathbf{Q}(x) ,mathrm{d}x .

If we use regular subdivisions and left-hand or right-hand Riemann sums, then the two terms on the left are equal to zero, since every endpoint except 0 and 1 will be irrational, but as we have seen the term on the right will equal 1.

As defined above, the Riemann integral avoids this problem by refusing to integrate $I_\left\{mathbb\left\{Q\right\}\right\}$. The Lebesgue integral is defined in such a way that all these integrals are 0.

## Facts about the Riemann integral

The Riemann integral is a linear transformation; that is, if $f$ and $g$ are Riemann-integrable on $\left[a,b\right]$ and $alpha$ and $beta$ are constants, then

$int_\left\{a\right\}^\left\{b\right\}\left(alpha f + beta g\right),dx = alpha int_\left\{a\right\}^\left\{b\right\}f\left(x\right),dx + beta int_\left\{a\right\}^\left\{b\right\}g\left(x\right),dx.$

A real-valued function $f$ on $\left[a,b\right]$ is Riemann-integrable if and only if it is bounded and continuous almost everywhere.

If a real-valued function on $\left[a,b\right]$ is Riemann-integrable, it is Lebesgue-integrable.

If $\left\{f_n\right\}$ is a uniformly convergent sequence on $\left[a,b\right]$ with limit $f$, then

$int_\left\{a\right\}^\left\{b\right\} f, dx = int_a^b\left\{lim_\left\{n to infty\right\}\left\{f_n\right\}, dx\right\} = lim_\left\{n to infty\right\} int_\left\{a\right\}^\left\{b\right\} f_n, dx.$

If a real-valued function is monotone on the interval $\left[a,b\right],$ it is Riemann-integrable.

## Generalizations of the Riemann integral

It is easy to extend the Riemann integral to functions with values in the Euclidean vector space $mathbb\left\{R\right\}^n$ for any $n$. The integral is defined by linearity; in other words, if $mathbf\left\{f\right\} = \left(f_1, dots, f_n\right)$, then $intmathbf\left\{f\right\} = left\left(int f_1,,dots, int f_nright\right)$. In particular, since the complex numbers are a real vector space, this allows the integration of complex valued functions.

The Riemann integral is only defined on bounded intervals, and it does not extend well to unbounded intervals. The simplest possible extension is to define such an integral as a limit, in other words, as an improper integral. We could set:

$int_\left\{-infty\right\}^infty f\left(t\right),dt = lim_\left\{xtoinfty\right\}int_\left\{-x\right\}^x f\left(t\right),dt.$

Unfortunately, this does not work well. Translation invariance, the fact that the Riemann integral of the function should not change if we move the function left or right, is lost. For example, let $f\left(x\right) = 1$ for all $x > 0$, $f\left(0\right)=0$, and $f\left(x\right) = -1$ for all $x < 0$. Then,

$int_\left\{-x\right\}^x f\left(t\right),dt = int_\left\{-x\right\}^0 f\left(t\right),dt + int_0^x f\left(t\right),dt = -x + x = 0$

for all $x$. But if we shift $f\left(x\right)$ to the right by one unit to get $f\left(x-1\right)$, we get

$int_\left\{-x\right\}^x f\left(t-1\right),dt = int_\left\{-x\right\}^1 f\left(t-1\right),dt + int_1^x f\left(t-1\right),dt = -\left(x+1\right) + \left(x-1\right) = -2$

for all $x > 1$.

Since this is unacceptable, we could try the definition:

$int_\left\{-infty\right\}^infty f\left(t\right),dt = lim_\left\{ato-infty\right\}lim_\left\{btoinfty\right\}int_a^b f\left(t\right),dt.$

Then if we attempt to integrate the function $f$ above, we get $+infty$, because we take the limit as $b$ tends to $infty$ first. If we reverse the order of the limits, then we get $-infty$.

This is also unacceptable, so we could require that the integral exists and gives the same value regardless of the order. Even this does not give us what we want, because the Riemann integral no longer commutes with uniform limits. For example, let $f_n\left(x\right) = 1/n$ on $\left(0,n\right)$ and 0 everywhere else. For all $n$, $int f_n,dx = 1$. But $f_n$ converges uniformly to zero, so the integral of $lim f_n$ is zero. Consequently $int f,dx not= limint f_n,dx$. Even though this is the correct value, it shows that the most important criterion for exchanging limits and (proper) integrals is false for improper integrals. This makes the Riemann integral unworkable in applications.

A better route is to abandon the Riemann integral for the Lebesgue integral. The definition of the Lebesgue integral is not obviously a generalization of the Riemann integral, but it is not hard to prove that every Riemann-integrable function is Lebesgue-integrable and that the values of the two integrals agree whenever they are both defined. Moreover, a bounded Lebesgue-integrable function $f$ defined on a bounded interval is Riemann-integrable if and only if the set of points where $f$ is discontinuous has Lebesgue measure zero.

An integral which is in fact a direct generalization of the Riemann integral is the Henstock-Kurzweil integral.

Another way of generalizing the Riemann integral is to replace the factors $x_\left\{i+1\right\} - x_i$ in the definition of a Riemann sum by something else; roughly speaking, this gives the interval of integration a different notion of length. This is the approach taken by the Riemann-Stieltjes integral.