If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Definite integral as the limit of a Riemann sum

Riemann sums help us approximate definite integrals, but they also help us formally define definite integrals. Learn how this is achieved and how we can move between the representation of area as a definite integral and as a Riemann sum.
Definite integrals represent the area under the curve of a function, and Riemann sums help us approximate such areas. The question remains: is there a way to find the exact value of a definite integral?

Riemann sums with "infinite" rectangles

Imagine we want to find the area under the graph of f(x)=15x2 between x=2 and x=6.
Function f is graphed. The x-axis goes from negative 1 to 8. The graph is a smooth curve. The curve starts in quadrant 2, moves downward to a relative minimum at (0, 0), moves upward and ends in quadrant 1. The region between the curve and the x-axis, between x = 2 and x = 6, is shaded.
Using definite integral notation, we can represent the exact area:
2615x2dx
We can approximate this area using Riemann sums. Let R(n) be the right Riemann sum approximation of our area using n equal subdivisions (i.e. n rectangles of equal width).
For example, this is R(4). You can see it's an overestimation of the actual area.
The graph of function f has the region under the curve divided into 4 rectangles of width 1. Each rectangle touches the curve at the top right corner.
The area under the curve of f between x=2 and x=6 is approximated using 4 rectangles of equal width.
We can make our approximation better by dividing our area into further rectangles that are smaller in width, i.e. by using R(n) for larger values of n.
You can see how the approximation gets closer to the actual area as the number of rectangles goes from 1 to 100:
The graph of function f is animated. The shaded region is divided into more and more rectangles of equal width, from 1 to 100. The areas becomes smaller, from R of 1 = approximately 28.8 to R of 100 = approximately 13.99.
Created with Geogebra.
Of course, using even more rectangles will get us even closer, but an approximation is always just an approximation.
What if we could take a Riemann sum with infinite equal subdivisions? Is that even possible? Well, we can't set n= because infinity isn't an actual number, but you might recall we have a way of taking something to infinity...
Limits!
Specifically, this limit:
limnR(n)
Amazing fact #1: This limit really gives us the exact value of 2615x2dx.
Amazing fact #2: It doesn't matter whether we take the limit of a right Riemann sum, a left Riemann sum, or any other common approximation. At infinity, we will always get the exact value of the definite integral.
(The rigorous proof of these facts is too elaborate to cover in this article, but that's okay because we're just interested in the intuition behind connecting Riemann sums and definite integrals.)
So far we've used R(n) as a placeholder for the right Riemann sum approximation with n subdivisions. Now let's find the actual expression.
Quick review: We are looking for Δx, the constant width of any rectangle, and xi, the x-value of the right edge of the ith rectangle. Then, f(xi) will give us the height of each rectangle.
Δx=62n=4nxi=2+Δxi=2+4nif(xi)=15(xi)2=15(2+4ni)2
So the area of the ith rectangle is 4n15(2+4ni)2, and we sum that for values of i from 1 to n:
R(n)=i=1n(2+4in)245n
Now we can represent the actual area as a limit:
=2615x2dx=limnR(n)=limni=1n(2+4in)245n

By definition, the definite integral is the limit of the Riemann sum

The above example is a specific case of the general definition for definite integrals:
The definite integral of a continuous function f over the interval [a,b], denoted by abf(x)dx, is the limit of a Riemann sum as the number of subdivisions approaches infinity. That is,
abf(x)dx=limni=1nΔxf(xi)
where Δx=ban and xi=a+Δxi.

If we're asked to write a Riemann sum from a definite integral...

Imagine we've been asked to write the following definite integral as the limit of a Riemann sum.
π2πcos(x)dx
First, let's find Δx:
Δx=ban=2ππn=πn
Now that we have Δx, we can find xi:
xi=a+Δxi=π+πni=π+πin
Therefore,
π2πcos(x)dx=limni=1nπncos(π+πin)

Practice writing Riemann sums from definite integrals

Problem 1
03exdx=?
Choose 1 answer:

Problem 2
1elnxdx=?
Choose 1 answer:

Common mistake: Getting the wrong expression for Δx

For example, in Problem 2, we can imagine how a student might define Δx to be en or 1n instead of e1n. Another example is simply using dx for Δx. Remember that dx is only used in the integral notation, not in the sum. It tells us that the integration is with respect to x.

Another common mistake: Getting the wrong expression for xi

A student might forget to add a to Δxi, resulting in a wrong expression. For example, in Problem 2, a student might define xi to be e1ni instead of 1+e1ni.

If we're asked to write a definite integral from the limit of a Riemann sum...

Imagine we're being asked to find a definite integral that's equivalent to this limit:
limni=1nln(2+5in)5n
This means we need to find the interval of integration [a,b] and the integrand f(x). Then, the corresponding definite integral will be abf(x)dx.
We know that every Riemann sum has two parts: a width Δx and a height f(xi) for each rectangle in the sum. Looking at this specific limit, we can make reasonable choices for both parts.
limni=1nln(2+5in)5n
Rectangles of uniform width: The expression 5n is a reasonable choice for the width of our rectangles, Δx, because it doesn't depend on the index i. This means that Δx will be the same for each term in the sum, which is what we'd expect from a Riemann sum where each rectangle has the same width.
Rectangles of varying height: The expression ln(2+5in) depends on i, which makes it a good choice to represent the height, f(xi). The most natural choice for xi is 2+5in, so let's go with that, which means that the function we're integrating is f(x)=ln(x).
To figure out the bounds of integration, a and b, let's think back to the general definitions of Δx and xi in relation to the definite integral.
As defined above, xi=a+Δxi . In this specific problem, xi=2+5in, which can be written as 2+5ni, so a must equal 2.
As defined above, Δx=ban . In this specific problem, Δx=5n. Both denominators are n, so the numerators must be equal: ba=5. We already know a=2, so we can conclude that b=7.
Putting everything together, here's a definite integral that equals the limit of the Riemann sum:
27ln(x)dx

Practice writing definite integrals from Riemann sums

Problem 3.A
Problem set 3 will walk you through the steps of finding the definite integral that is represented by this expression:
limni=1n(3+4in)24n
What is Δx in this expression?
Choose 1 answer:

Common struggle: Difficulty finding Δx in the Riemann sum expression

When the summed expression is elaborate and includes many fractions, it can be hard to identify which part of it is Δx.
Remember that Δx must be a factor of the summed expression, in the form kn, where k doesn't contain the summation index i.

Another common struggle: Difficulty finding the limits of integration

Notice how in Problem set 3, the fact that Δx=4n told us that ba=4. This is helpful, but without finding a we will not know what a and b are. We were able to find a by using the fact that xi=3+4in.
A common mistake is to immediately assume that if, for example, Δx=4n, then the limits of integration are [0,4].

One last common struggle: General difficulty analyzing the expression

Some students simply don't know where to begin.
Begin with the summed expression. You should be able to identify two factors: One of the form kn (where k doesn't contain the summation index i) and one that is a function of i. The first will give you Δx and the other will give you f(xi).
Problem 4
limni=1n4+5in5n=?
Choose 1 answer:

Want more practice? Try this exercise.

Want to join the conversation?