In real analysis, the Riemann integral is a rigorous definition of the integral of a function on an interval. It defines the integral by approximating the region under the graph of a function by finite sums of areas of vertical rectangles. For suitable functions, including every continuous function on a closed bounded interval, these Riemann sums approach a single limiting value as the partitions of the interval become finer. That limiting value defines the integral, and Riemann sums that are suitably close to the limit can be used as numerical approximations.

Bernhard Riemann introduced the integral in work presented to the faculty at the University of Göttingen in 1854 and published in 1868.The Riemann integral was introduced in Bernhard Riemann's paper "Über die Darstellbarkeit einer Function durch eine trigonometrische Reihe" (On the representability of a function by a trigonometric series; i.e., when can a function be represented by a trigonometric series). This paper was submitted to the University of Göttingen in 1854 as Riemann's Habilitationsschrift (qualification to become an instructor). It was published in 1868 in Abhandlungen der Königlichen Gesellschaft der Wissenschaften zu Göttingen (Proceedings of the Royal Philosophical Society at Göttingen), vol. 13, pages 87-132. (Available online here.) For Riemann's definition of his integral, see section 4, "Über den Begriff eines bestimmten Integrals und den Umfang seiner Gültigkeit" (On the concept of a definite integral and the extent of its validity), pages 101–103. It is the integral most commonly introduced in elementary calculus, although in advanced analysis it is often replaced by more general notions such as the Lebesgue integral.

Overview Consider a curve on a graph which stays above the -axis, beginning at and ending at . The area under that curve, from to , is what we want to find. This area can be described as the set of all points on the graph that follow these rules: (the -coordinate is between and ) and (the -coordinate is between 0 and the height of the curve ). Mathematically, this region can be expressed in set-builder notation as

To measure this area, we use a Riemann integral, which is written as:

This notation means “the integral of from to ,” and it represents the exact area under the curve and above the -axis, between and .

The idea behind the Riemann integral is to break the area into small, simple shapes (like rectangles), add up their areas, and then make the rectangles smaller and smaller to get a better estimate. In the end, when the rectangles are infinitely small, the sum gives the exact area, which is what the integral represents.

If the curve dips below the -axis, the integral gives a signed area. This means the integral adds the part above the -axis as positive and subtracts the part below the -axis as negative. So, the result of can be positive, negative, or zero, depending on how much of the curve is above or below the -axis.

Definition Partitions of an interval

A partition of an interval is a finite sequence of numbers of the form

Each 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 of an interval is a partition together with a choice of a sample point within each sub-interval: that is, numbers with for each . The mesh of a tagged partition is the same as that of an ordinary partition.

A partition is said to refine a partition if the intervals in the partition are all subintervals of the intervals in the partition , so that the points marking the partition in include those of and possibly others making it finer. A refinement of a tagged partition is defined so that each tag of is a tag of some interval in .

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.

Riemann sum

Let be a real-valued function defined on the interval . The Riemann sum of with respect to a tagged partition of is

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 and width . The Riemann sum is the (signed) area of all the rectangles.

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 on each sub-interval:

If 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 on each subinterval. (When 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.

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.

One important requirement is that the mesh of the partitions must become smaller and smaller, so that it has the limit 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 exists and equals if the following condition holds:

For all , there exists such that for any tagged partition and 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 exists and equals if the following condition holds:

For all , there exists a tagged partition and such that for any tagged partition and which is a refinement of and , we have

Both of these mean that eventually, the Riemann sum of with respect to any partition gets trapped close to . Since this is true no matter how close we demand the sums be trapped, we say that the Riemann sums converge to . 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, works in the first definition if and only if 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 , and any refinement of this partition will also have mesh less than , so the Riemann sum of the refinement will also be within of .

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 such that the lower and upper Darboux sums with respect to this partition are within of the value of the Darboux integral. Let

If , then is the zero function, which is clearly both Darboux and Riemann integrable with integral zero. Therefore, we will assume that . If , then we choose such that

If , then we choose to be less than one. Choose a tagged partition and with mesh smaller than . We must show that the Riemann sum is within of .

To see this, choose an interval . If this interval is contained within some , then

where and are respectively, the infimum and the supremum of f on . 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 . This is the case when , so the proof is finished in that case.

Therefore, we may assume that . In this case, it is possible that one of the is not contained in any . Instead, it may stretch across two of the intervals determined by . (It cannot meet three intervals because is assumed to be smaller than the length of any one interval.) In symbols, it may happen that

(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 times.

To handle this case, we will estimate the difference between the Riemann sum and the Darboux sum by subdividing the partition at . The term in the Riemann sum splits into two terms:

Suppose, without loss of generality, that . Then

so this term is bounded by the corresponding term in the Darboux sum for . To bound the other term, notice that

It follows that, for some (indeed any) ,

Since this happens at most times, the distance between the Riemann sum and a Darboux sum is at most . Therefore, the distance between the Riemann sum and is at most .

Examples Let be the function which takes the value 1 at every point. Any Riemann sum of on will have the value 1, therefore the Riemann integral of on is 1.

Let be the indicator function of the rational numbers in ; that is, 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 and be a tagged partition (each is between and ). Choose . The have already been chosen, and we can't change the value of at those points. But if we cut the partition into tiny pieces around each , we can minimize the effect of the . 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 of the , and we want their total effect to be less than . If we confine each of them to an interval of length less than , then the contribution of each to the Riemann sum will be at least and at most . This makes the total sum at least zero and at most . So let be a positive number less than . If it happens that two of the are within of each other, choose smaller. If it happens that some is within of some , and is not equal to , choose smaller. Since there are only finitely many and , we can always choose sufficiently small.

Now we add two cuts to the partition for each . One of the cuts will be at , and the other will be at . If one of these leaves the interval [0, 1], then we leave it out. will be the tag corresponding to the subinterval

If is directly on top of one of the , then we let 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 . 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 , 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.