# 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. It was presented to the faculty at the University of Göttingen in 1854, but not published in a journal until 1868.^{[1]} For many functions and practical applications, the Riemann integral can be evaluated by the fundamental theorem of calculus or approximated by numerical integration.

Let f be a non-negative real-valued function on the interval [*a*, *b*], and let S be the region of the plane under the graph of the function f and above the interval [*a*, *b*]. See the figure on the top right. This region can be expressed in set-builder notation as

We are interested in measuring the area of S. Once we have measured it, we will denote the area in the usual way by

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.

When *f*(*x*) can take negative values, the integral equals the *signed area* between the graph of f and the x-axis: that is, the area above the x-axis minus the area below the x-axis.

A partition of an interval [*a*, *b*] is a finite sequence of numbers of the form

Each [*x _{i}*,

*x*

_{i + 1}] is called a

**sub-interval**of the partition. The

**mesh**or

**norm**of a partition is defined to be the length of the longest sub-interval, that is,

A **tagged partition** *P*(*x*, *t*) of an interval [*a*, *b*] is a partition together with a finite sequence of numbers *t*_{0}, ..., *t*_{n − 1} subject to the conditions that for each i, *t _{i}* ∈ [

*x*,

_{i}*x*

_{i + 1}]. In other words, it is a partition together with a distinguished point of every sub-interval. The mesh of a tagged partition is the same as that of an ordinary partition.

Suppose that two partitions *P*(*x*, *t*) and *Q*(*y*, *s*) are both partitions of the interval [*a*, *b*]. We say that *Q*(*y*, *s*) is a **refinement** of *P*(*x*, *t*) if for each integer i, with *i* ∈ [0, *n*], there exists an integer *r*(*i*) such that *x _{i}* =

*y*

_{r(i)}and such that

*t*=

_{i}*s*for some j with

_{j}*j*∈ [

*r*(

*i*),

*r*(

*i*+ 1)). Said more simply, a refinement of a tagged partition breaks up some of the sub-intervals and adds tags to the partition where necessary, thus it "refines" the accuracy of the partition.

We can turn the set of all tagged partitions into a directed set by saying that one tagged partition is greater than or equal to another if the former is a refinement of the latter.

Let f be a real-valued function defined on the interval [*a*, *b*]. The *Riemann sum* of f with respect to the tagged partition *x*_{0}, ..., *x _{n}* together with

*t*

_{0}, ...,

*t*

_{n − 1}is

^{[2]}

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 (signed) area of a rectangle with height *f*(*t _{i}*) and width

*x*

_{i + 1}−

*x*. The Riemann sum is the (signed) area of all the rectangles.

_{i}Closely related concepts are the *lower and upper Darboux sums*. These are similar to Riemann sums, but the tags are replaced by the infimum and supremum (respectively) of f on each sub-interval:

If f is continuous, then the lower and upper Darboux sums for an untagged partition are equal to the Riemann sum for that partition, where the tags are chosen to be the minimum or maximum (respectively) of f on each subinterval. (When f is discontinuous on a subinterval, there may not be a tag that achieves the infimum or supremum on that subinterval.) The Darboux integral, which is similar to the Riemann integral but based on Darboux sums, is equivalent to the Riemann integral.

Loosely speaking, the Riemann integral is the limit of the Riemann sums of a function as the partitions get finer. If the limit exists then the function is said to be **integrable** (or more specifically **Riemann-integrable**). The Riemann sum can be made as close as desired to the Riemann integral by making the partition fine enough.^{[3]}

One important requirement 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 *ε* > 0, there exists *δ* > 0 such that for any tagged partition *x*_{0}, ..., *x _{n}* and

*t*

_{0}, ...,

*t*

_{n − 1}whose mesh is less than δ, we have

Unfortunately, this definition is very difficult to use. It would help to develop an equivalent definition of the Riemann integral which is easier to work with. We develop this definition now, with a proof of equivalence following. Our new definition says that the Riemann integral of f equals s if the following condition holds:

For all *ε* > 0, there exists a tagged partition *y*_{0}, ..., *y _{m}* and

*r*

_{0}, ...,

*r*

_{m − 1}such that for any tagged partition

*x*

_{0}, ...,

*x*and

_{n}*t*

_{0}, ...,

*t*

_{n − 1}which is a refinement of

*y*

_{0}, ...,

*y*and

_{m}*r*

_{0}, ...,

*r*

_{m − 1}, we have

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 ε, 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 Darboux Integral article. Now we will show that a Darboux integrable function satisfies the first definition. Fix ε, and choose a partition *y*_{0}, ..., *y _{m}* such that the lower and upper Darboux sums with respect to this partition are within

*ε*/2 of the value s of the Darboux integral. Let

If *r* = 0, then f is the zero function, which is clearly both Darboux and Riemann integrable with integral zero. Therefore, we will assume that *r* > 0. If *m* > 1, then we choose δ such that

If *m* = 1, then we choose δ to be less than one. Choose a tagged partition *x*_{0}, ..., *x _{n}* and

*t*

_{0}, ...,

*t*

_{n − 1}with mesh smaller than δ. We must show that the Riemann sum is within ε of s.

To see this, choose an interval [*x _{i}*,

*x*

_{i + 1}]. If this interval is contained within some [

*y*,

_{j}*y*

_{j + 1}], then

where m_{j} and M_{j} are respectively, the infimum and the supremum of *f* on [*y _{j}*,

*y*

_{j + 1}]. If all intervals had this property, then this would conclude the proof, because each term in the Riemann sum would be bounded by a corresponding term in the Darboux sums, and we chose the Darboux sums to be near s. This is the case when

*m*= 1, so the proof is finished in that case.

Therefore, we may assume that *m* > 1. In this case, it is possible that one of the [*x _{i}*,

*x*

_{i + 1}] is not contained in any [

*y*,

_{j}*y*

_{j + 1}]. Instead, it may stretch across two of the intervals determined by

*y*

_{0}, ...,

*y*. (It cannot meet three intervals because δ is assumed to be smaller than the length of any one interval.) In symbols, it may happen that

_{m}(We may assume that all the inequalities are strict because otherwise we are in the previous case by our assumption on the length of δ.) This can happen at most *m* − 1 times.

To handle this case, we will estimate the difference between the Riemann sum and the Darboux sum by subdividing the partition *x*_{0}, ..., *x _{n}* at

*y*

_{j + 1}. The term

*f*(

*t*)(

_{i}*x*

_{i + 1}−

*x*) in the Riemann sum splits into two terms:

_{i}so this term is bounded by the corresponding term in the Darboux sum for y_{j}. To bound the other term, notice that

Since this happens at most *m* − 1 times, the distance between the Riemann sum and a Darboux sum is at most *ε*/2. Therefore, the distance between the Riemann sum and s is at most ε.

To start, let *x*_{0}, ..., *x _{n}* and

*t*

_{0}, ...,

*t*

_{n − 1}be a tagged partition (each t

_{i}is between x

_{i}and

*x*

_{i + 1}). Choose

*ε*> 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 ε of either zero or one.

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 ε. If we confine each of them to an interval of length less than *ε*/*n*, then the contribution of each t_{i} to the Riemann sum will be at least 0 · *ε*/*n* and at most 1 · *ε*/*n*. This makes the total sum at least zero and at most ε. So let δ be a positive number less than *ε*/*n*. If it happens that two of the t_{i} are within δ of each other, choose δ smaller. If it happens that some t_{i} is within δ of some x_{j}, and t_{i} is not equal to x_{j}, choose δ smaller. Since there are only finitely many t_{i} and x_{j}, we can always choose δ sufficiently small.

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

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

*t*+

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

_{i}will be the tag corresponding to the subinterval

If t_{i} is directly on top of one of the x_{j}, then we let t_{i} be the tag for both intervals:

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.

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, and in a right-hand Riemann sum,

_{i}*t*=

_{i}*x*

_{i + 1}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 nth regular subdivision of [0, 1] consists of the intervals

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.

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.

The Riemann integral is a linear transformation; that is, if f and g are Riemann-integrable on [*a*, *b*] and α and β are constants, then

Because the Riemann integral of a function is a number, this makes the Riemann integral a linear functional on the vector space of Riemann-integrable functions.

A bounded function on a compact interval [*a*, *b*] is Riemann integrable if and only if it is continuous almost everywhere (the set of its points of discontinuity has measure zero, in the sense of Lebesgue measure). This is the **Lebesgue-Vitali theorem** (of characterization of the Riemann integrable functions). It has been proven independently by Giuseppe Vitali and by Henri Lebesgue in 1907, and uses the notion of measure zero, but makes use of neither Lebesgue's general measure or integral.

The integrability condition can be proven in various ways,^{[4]}^{[5]}^{[6]}^{[7]} one of which is sketched below.

In particular, any set that is at most countable has Lebesgue measure zero, and thus a bounded function (on a compact interval) with only finitely or countably many discontinuities is Riemann integrable. Another sufficient criterion to Riemann integrability over [*a*, *b*], but which does not involve the concept of measure, is the existence of a right-hand (or left-hand) limit at *every* point in [*a*, *b*) (or (*a*, *b*]).^{[10]}

An indicator function of a bounded set is Riemann-integrable if and only if the set is Jordan measurable.^{[11]} The Riemann integral can be interpreted measure-theoretically as the integral with respect to the Jordan measure.

If a real-valued function is monotone on the interval [*a*, *b*] it is Riemann integrable, since its set of discontinuities is at most countable, and therefore of Lebesgue measure zero. If a real-valued function on [*a*, *b*] is Riemann integrable, it is Lebesgue integrable. That is, Riemann-integrability is a *stronger* (meaning more difficult to satisfy) condition than Lebesgue-integrability. The converse does not hold; not all Lebesgue-integrable functions are Riemann integrable.

The Lebesgue–Vitali theorem does not imply that all type of discontinuities have the same weight on the obstruction that a real-valued bounded function be Riemann integrable on [*a*, *b*]. In fact, certain discontinuities have absolutely no role on the Riemann integrability of the function—a consequence of the classification of the discontinuities of a function.^{[citation needed]}

If *f*_{n} is a uniformly convergent sequence on [*a*, *b*] with limit f, then Riemann integrability of all *f*_{n} implies Riemann integrability of f, and

However, the Lebesgue monotone convergence theorem (on a monotone pointwise limit) does not hold for Riemann integrals. Thus, in Riemann integration, taking limits under the integral sign is far more difficult to logically justify than in Lebesgue integration.^{[12]}

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:

This definition carries with it some subtleties, such as the fact that it is not always equivalent to compute the Cauchy principal value

For example, consider the sign function *f*(*x*) = sgn(*x*) which is 0 at *x* = 0, 1 for *x* > 0, and −1 for *x* < 0. By symmetry,

always, regardless of a. But there are many ways for the interval of integration to expand to fill the real line, and other ways can produce different results; in other words, the multivariate limit does not always exist. We can compute

In general, this improper Riemann integral is undefined. Even standardizing a way for the interval to approach the real line does not work because it leads to disturbingly counterintuitive results. If we agree (for instance) that the improper integral should always be

then the integral of the translation *f*(*x* − 1) is −2, so this definition is not invariant under shifts, a highly undesirable property. In fact, not only does this function not have an improper Riemann integral, its Lebesgue integral is also undefined (it equals ∞ − ∞).

Unfortunately, the improper Riemann integral is not powerful enough. The most severe problem is that there are no widely applicable theorems for commuting improper Riemann integrals with limits of functions. In applications such as Fourier series it is important to be able to approximate the integral of a function using integrals of approximations to the function. For proper Riemann integrals, a standard theorem states that if *f _{n}* is a sequence of functions that converge uniformly to f on a compact set [

*a*,

*b*], then

On non-compact intervals such as the real line, this is false. For example, take *f _{n}*(

*x*) to be

*n*

^{−1}on [0,

*n*] and zero elsewhere. For all n we have:

The sequence (*f _{n}*) converges uniformly to the zero function, and clearly the integral of the zero function is zero. Consequently,

This demonstrates that for integrals on unbounded intervals, uniform convergence of a function is not strong enough to allow passing a limit through an integral sign. This makes the Riemann integral unworkable in applications (even though the Riemann integral assigns both sides the correct value), because there is no other general criterion for exchanging a limit and a Riemann integral, and without such a criterion it is difficult to approximate integrals by approximating their integrands.

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 function f defined on a bounded interval is Riemann-integrable if and only if it is bounded and 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*_{k + 1} − *x*_{k} 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.

The Riemann integral is unsuitable for many theoretical purposes. Some of the technical deficiencies in Riemann integration can be remedied with the Riemann–Stieltjes integral, and most disappear with the Lebesgue integral, though the latter does not have a satisfactory treatment of improper integrals. The gauge integral is a generalisation of the Lebesgue integral that is at once closer to the Riemann integral. These more general theories allow for the integration of more "jagged" or "highly oscillating" functions whose Riemann integral does not exist; but the theories give the same value as the Riemann integral when it does exist.

In educational settings, the Darboux integral offers a simpler definition that is easier to work with; it can be used to introduce the Riemann integral. The Darboux integral is defined whenever the Riemann integral is, and always gives the same result. Conversely, the gauge integral is a simple but more powerful generalization of the Riemann integral and has led some educators to advocate that it should replace the Riemann integral in introductory calculus courses.^{[13]}