# Riemann integral

*If you are having difficulty understanding this article, you might wish to learn more about algebra, functionss, and mathematical limits.*

In a 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

Figure 2

Let *f*(*x*) be a non-negative real-valued function of the interval [*a*,*b*], and let S = { (*x*, *y*) | 0 ≤ *y* ≤ *f*(*x*) } be the region of the plane under the function *f*(*x*) and above the interval [*a*,*b*] (see Figure 2). We are interested in measuring the area of *S*. Once we have measured it, we will denote it by ∫_{a}^{b} *f*(*x*) d*x*.

The basic idea of the Riemann integral is to use very simple and unambiguous 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 under the curve.

It turns out that it is just as easy to jump right into the case where *f* can be both positive and negative. However, in this case the integral corresponds to *signed area*, that is, the area above the *x*-axis minus the area below the *x*-axis.

numbers in the upper right are the areas of the grey rectangles.

They converge to the integral of function.

## Definition of the Riemann integral

### Partitions of an interval

A partition of an interval [*a*, *b*] is a finite sequence *a* = *x*_{0} < *x*_{1} < *x*_{2} < ... < *x*_{n} = *b*. Each [*x _{i}*,

*x*] is called a

_{i+1}*subinterval*of the partition. The

*mesh*of a partition is defined to be the length of the longest subinterval [

*x*,

_{i}*x*], that is, it is max

_{i+1}_{0≤i≤n-1}

*x*-

_{i+1}*x*.

_{i}
A *tagged partition of an interval* is a partition of an interval together with a finite sequence of number *t _{0}*, ...,

*t*subject to the conditions that for each

_{n-1}*i*,

*x*≤

_{i}*t*≤

_{i}*x*. 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.

_{i+1}
Suppose that *x _{0}*,...,

*x*together with

_{n}*t*,...,

_{0}*t*are a tagged partition of [

_{n-1}*a*,

*b*], and that

*y*,...,

_{0}*y*together with

_{m}*s*,...,

_{0}*s*are another tagged partition of [

_{m-1}*a*,

*b*]. We say that

*y*,...,

_{0}*y*and

_{m}*s*,...,

_{0}*s*together are a

_{n-1}*refinement*of

*x*,...,

_{0}*x*together with

_{n}*t*,...,

_{0}*t*if for each integer

_{n-1}*i*with 0≤

*i*≤

*n*, there is an integer

*r(i)*such that

*x*=

_{i}*y*and such that

_{r(i)}*t*=

_{i}*s*for some j with

_{j}*r(i)*≤

*j*≤

*r(i+1)*. Said more simply, a refinement of a tagged partition takes the starting partition and adds more cuts, but does not take any away, 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

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(t*and length

_{i})*x*-

_{i+1}*x*. The Riemann sum is the signed area under all the rectangles.

_{i}### The Riemann integral

However, there is an unfortunate problem with this definition: it's very difficult to work with. So we will make an alternate definition of the Riemann integral. We say that the Riemann integral of*f*equals

*s*if the following condition holds:

- For all ε>0, there exists a tagged partition
*x*,...,_{0}*x*and_{n}*t*,...,_{0}*t*such that for any refinement_{n-1}*y*,...,_{0}*y*and_{m}*s*,...,_{0}*s*of_{m-1}*x*,...,_{0}*x*and_{n}*t*,...,_{0}*t*, we have ._{n-1}

*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.

These two definitions are, as it turns out, 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 ε, and choose a δ that satisfies the condition. Choose any tagged partition whose mesh is less than δ. Its Riemann sum is within ε of *s*, and any refinement of this partition will also have mesh less than δ, so the Riemann sum of the refinement will also be within ε 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}*,...,

*x*such that the lower and upper Darboux sums with respect to this partition are within ε/2 of the value

_{n}*s*of the Darboux integral. Let

*r*equal max

_{0≤i≤n-1}

*M*-

_{i}*m*, where

_{i}*M*and

_{i}*m*are the supremum and infimum, respectively, of

_{i}*f*on [

*x*,

_{i+1}*x*], and let δ be less than both ε/(2*

_{i}*r**

*n*) and min

_{0≤i≤n-1}

*x*-

_{i+1}*x*. Then it is not hard to see that the Riemann sum of

_{i}*f*with respect to any tagged partition of mesh less than δ will be within ε/2 of the upper or lower Darboux sum, so it will be within ε of

*s*.

## Examples

Let *I*_{Q}:[0,1]→**R** be the indicator function of the rational numbers in [0,1]; that is, *I*_{Q} 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}*,...,

*x*and

_{n}*t*,...,

_{0}*t*be a tagged partition. Choose ε>0. The

_{n-1}*t*have already been chosen, and we can't change the value of

_{i}*f*at those points. But if we cut the partition into tiny pieces around each

*t*, we can minimize the effect of the

_{i}*t*. Then, by carefully choosing the new tags, we can make the value of the Riemann sum turn out to be within ε of either zero or one—our choice!

_{i}
Our first step is to cut up the partition. There are *n-1* of the *t _{i}*, and we want their total effect to be less than ε. If we confine each of them to an interval of length less than ε/(

*n*-1), then the contribution of each

*t*to the Riemann sum will be at least 0*ε/(n-1) and at most 1*ε/(n-1). This makes the total sum at least zero and at most ε. So let δ be a positive number less than ε/(n-1). If it happens that two of the

_{i}*t*are within δ of each other, choose δ smaller. If it happens that some

_{i}*t*is within δ of some

_{i}*x*, and

_{j}*t*is not equal to

_{i}*x*, choose δ smaller. Since there are only finitely many

_{j}*t*and

_{i}*x*, we can always choose δ sufficiently small.

_{j}
Now we add two cuts to the partition for each *t _{i}*. One of the cuts will be at

*t*-δ/2, and the other will be at

_{i}*t*+δ/2. If one of these leaves the interval [0,1], then we leave it out.

_{i}*t*will be the tag corresponding to the subinterval [

_{i}*t*-δ/2,

_{i}*t*+δ/2]. If

_{i}*t*is directly on top of one of the

_{i}*x*, then we let '\'t

_{j}_{i}

*be the tag for both [*t

_{i}

*-δ/2,*x

_{j}

*] and [*x

_{j,ti''+δ/2]. 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-ε. 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 ε.}

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.

## Things that masquerade as 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*for all

_{i}*i*, and in a right-hand Riemann sum,

*t*=

_{i}*x*for all

_{i+1}*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*. 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.

_{i}
Another popular restriction is the use of regular subdivisions of an interval. For example, the *n*'th regular subdivision of [0,1] consists of the intervals [0,1/*n*], [1/*n*,2/*n*], ..., [(*n*-1)/*n*,1]. 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 integrable, then this technique will give the correct value of the integral. But under these conditions the indicator function *I*_{Q} will appear to be integrable with integral equal to one: Every endpoint of every interval is a rational number, so the function will always be evaluated at rational numbers, and hence it will appear to always equal one. In fact, any function on [0,1] can be changed in any way you please outside of the rational numbers and, under these restrictions on the tagged partitions, the function's integral will appear to not change.

## Facts about the Riemann integral

A real-valued function *f* on [*a*,*b*] is Riemann-integrable if and only if it is continuous almost everywhere.

If {*f _{n}*} is a uniformly convergent sequence with limit

*f*, then ∫

*f*dx = lim ∫

*f*dx.

_{n}## Generalizations of the Riemann integral

It is easy to extend the Riemann integral to functions with values in the Euclidean vector space **R**^{n} for any *n*. The integral is defined by linearity; in other words, if **f** = (*f _{1}*, ...,

*f*), ∫

_{n}*f*= (∫

*f*, ... ∫

_{1}*f*). In particular, since the complex numbers are a real vector space, this allows the integration of complex valued functions.

_{n}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:

*f*(

*x*) = sin

*x*. sin

*x*is an odd function, so ∫

_{-x}

^{x}sin

*t*dt = 0 for all

*x*. But if we shift sin

*x*to the left by π/2 units, it becomes cos

*x*, an even function, and now the integral does not converge, but instead wobbles up and down forever.

Additionally, the Riemann integral no longer commutes with uniform limits. For example, let *f _{n}*(x) = 1/n on [0,n] and 0 everywhere else.

*f*converges uniformly to the zero function, but ∫

_{n}*f*dx = 1 for all

_{n}*n*. Consequently ∫

*f*dx ≠ lim ∫

*f*dx.

_{n}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.

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 _{i}*-

*x*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.

_{i+1}