If you are having difficulty understanding this article, you might wish to learn more about algebra, functions, and mathematical limits.
In a branch of mathematics known as real analysis, the Riemann integral is a simple way of viewing the integral of a function on an interval as the area under the curve.
Table of contents 
2 Step functions 3 Lower and upper sums 4 Results about the Riemann integral 
Overview
Figure 1: Illustration of Riemann integration as a converging sequence

Figure 2 
Let f(x) be a realvalued function of the interval [a,b], so that for all x, f(x)≥0 (f is nonnegative.) Further let S=S_{f}:={(x,y)0≤y≤f(x)} (see Figure 2) be the region of the plane under the function f(x) and above the interval [a,b]. We are interested in measuring the area of S if that is possible, and we denote this area by ∫_{a}^{b}f(x)dx. In case several variables appear in f, the dx will serve to specify the variable of integration. If the variable of integration and interval of integration are understood, the notation can be simplified to ∫f.
Once we have succeeded in evaluating the integral of f for certain f which are nonnegative, we can extend the integral to functions which may take negative values by linearity. Some functions have no clear Riemann integral, but especially, the interactions of limits and the Riemann integral are difficult to study. An improvement is to use the Lebesgue integral which both succeeds at integrating a broader variety of functions, as well as better describing the interactions of limits and integrals.
Historically, Riemann designed this theory first and gave some evidence for the fundamental theorem of calculus. The theory of Lebesgue integration arrived much later, when the weaknesses of the Riemann integral were better understood.
The basic idea of the Riemann integral is to use very simple and unambiguous approximations for the area of S. We find an approximate area which we are certain is less than the area of S, and we find an approximate area which we are certain is more than the area of S. If these approximations can be made arbitrarily close to one another, then we can assign an area to S.
Because of the geometric nature of the Riemann integral, it allows us to formulate many problems of nature as a problem of integration. It also provides some hints for methods of numerical integration, for evaluating definite integrals on computers to an acceptable degree of precision. However, for exact calculations for given formulae, the Riemann integral does not suggest a suitable approach.
For certain functions, the theory of antiderivatives provides exact results for definite integrals. While the Riemann integration theory justifies taking limits and provides a geometric point of view, the antiderivative theory of integration gives tools for integrating certain formulae precisely.
The fact that the seemingly disparate theories of Riemann integration and antiderivatives are essentially talking about the same subject is contained in the fundamental theorem of calculus.
Step functions
These functions are our starting point, and we should agree that
for any interval [c,d] in [a,b] and any constant z≥0. Indeed, in this case, the area under the curve is a rectangle with base [c,d] and height z.Likewise, some geometric experimentation with such functions suggests that if f_{1}, f_{2}, ..., f_{n} are n indicating functions of intervals, are scalars, then the area under
We will take a shortcut now by stating that the preceding formula will be used even if some (or all) of the coefficients a_{j} are negative.
A crucial difference between the Riemann integral and the Lebesgue integral is that the step functions of the Lebesgue integral are linear combinations of indicating functions of sets which are not necessarely intervals. Of course, work is then required to calculate the integral of this larger class of step functions. Also note that the Lebesgue integral does not use upper sums, and that nonnegative functions are dealt with first, before extending to functions which may take negative values.
Lower and upper sums
simply by seeing that the area S_{f} is a subset of S_{g} (at least in the case of nonnegative functions, this is clear.) We call this requirement monotonicity.Given the integral of step functions and the monotonicity requirement, we can get a first stab at integrating arbitrary nonnegative functions. Let f(x) be a realvalued function of [a,b] and let l(x) be a step function such that l(x)≤f(x) for all x. Furthermore, let u(x) be a step function such that u(x)≥f(x) for all x. If we are to assign a value to ∫f consistent with the monotonicity requirement, then we need that
 ∫l≤∫f≤∫u
 sup_{l}∫l≤∫f≤inf_{u}∫u
If the supremum and infimum are equal, then there is only one choice left for ∫f. It may not happen that the supremum is larger than the infimum (this is by our construction, as the reader may check.) However, it may happen that the supremum is less, and not equal to, the infimum. For instance, the reader may check that, for the indicating function
 X_{Q}
The collection of functions whose lower sum and upper sum are equal and finite is the set of Riemann integrable functions. By contrast, functions that have differing upper and lower sums are said to be nonRiemann integrable. In the context of this article, we will say integrable or nonintegrable with the understanding that we are speaking of Riemann integrability.
One also checks that a step function's integral is equal to is lower and upper sums.
Results about the Riemann integral
Lemma 1: Let [a,b] be an interval. The map I:f→∫f which maps f to its integral from a to b is a linear map. That is, for any integrable functions f and g, and any real number a, I(af+g)=aI(f)+I(g).
This can be shown from first principles, from the construction of the Riemann integral.
Theorem 2: Any realvalued continuous function of the interval [a,b] is integrable.
The proof relies on the fact that any continuous function of an interval is necessarely uniformly continuous.
Corollary 3: If f is continuous everywhere in [a,b] except perhaps for finitely many points of discontinuity, and f is bounded, then f is integrable.
The boundedness requirement can not be dropped.
Theorem 4: If f_{k} is a sequence of integrable functions over [a,b], and if f_{k} converge uniformly to a function f, then f is integrable, and the integrals ∫f_{k} converge to ∫f.
Corollary 5: Let C(a,b) be the Banach space of continuous functions over [a,b] with the uniform norm. Then I:f→∫f is continuous. Together with Lemma 1, this says that the integral is a continuous functional of C(a,b).
The hypotheses of theorem 4 (uniform convergence on a fixed, bounded interval) are very strong. A primary failing of the Riemann integral is the difficulty we face when attempting to relax these hypotheses. In fact, the numerical sequence ∫f_{k} will converge to the number ∫f a lot more often than is suggested by the theorem, but it is very difficult to prove so in this setting. The correct way of getting a stronger theorem is to use the Lebesgue integral.
Another problem with the Riemann integral is that it does not extend to unbounded intervals very succesfully. If we wish to integrate a function f from ∞ to +∞, we can naively calculate
 lim_{n→+∞} ∫_{n}^{n}f(x)dx