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.

# Definite integral as the limit of a Riemann sum

AP.CALC:
LIM‑5 (EU)
,
LIM‑5.B (LO)
,
LIM‑5.B.1 (EK)
,
LIM‑5.B.2 (EK)
,
LIM‑5.C (LO)
,
LIM‑5.C.1 (EK)
,
LIM‑5.C.2 (EK)
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, left parenthesis, x, right parenthesis, equals, start fraction, 1, divided by, 5, end fraction, x, squared between x, equals, 2 and x, equals, 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:
integral, start subscript, 2, end subscript, start superscript, 6, end superscript, start fraction, 1, divided by, 5, end fraction, x, squared, d, x
We can approximate this area using Riemann sums. Let R, left parenthesis, n, right parenthesis 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, left parenthesis, 4, right parenthesis. 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, equals, 2 and x, equals, 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, left parenthesis, n, right parenthesis 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, equals, infinity because infinity isn't an actual number, but you might recall we have a way of taking something to infinity...
Limits!
Specifically, this limit:
limit, start subscript, n, \to, infinity, end subscript, R, left parenthesis, n, right parenthesis
Amazing fact #1: This limit really gives us the exact value of integral, start subscript, 2, end subscript, start superscript, 6, end superscript, start fraction, 1, divided by, 5, end fraction, x, squared, d, x.
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, left parenthesis, n, right parenthesis 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 start color #1fab54, delta, x, end color #1fab54, the constant start color #1fab54, start text, w, i, d, t, h, end text, end color #1fab54 of any rectangle, and start color #11accd, x, start subscript, i, end subscript, end color #11accd, the x-value of the right edge of the i, start superscript, start text, t, h, end text, end superscript rectangle. Then, start color #e07d10, f, left parenthesis, start color #11accd, x, start subscript, i, end subscript, end color #11accd, right parenthesis, end color #e07d10 will give us the start color #e07d10, start text, h, e, i, g, h, t, end text, end color #e07d10 of each rectangle.
\begin{aligned} \greenD{\Delta x}&=\dfrac{6-2}{n}=\greenD{\dfrac4n} \\\\ \blueD{x_i}&=2+\Delta x\cdot i=\blueD{2+\dfrac4n i} \\\\ \goldD{f(\blueD{x_i})}&=\dfrac15(x_i)^2=\goldD{\dfrac15\left(\blueD{2+\dfrac4n i}\right)^2} \end{aligned}
So the area of the i, start superscript, start text, t, h, end text, end superscript rectangle is start color #1fab54, start fraction, 4, divided by, n, end fraction, end color #1fab54, dot, start color #e07d10, start fraction, 1, divided by, 5, end fraction, left parenthesis, start color #11accd, 2, plus, start fraction, 4, divided by, n, end fraction, i, end color #11accd, right parenthesis, squared, end color #e07d10, and we sum that for values of i from 1 to n:
R, left parenthesis, n, right parenthesis, equals, sum, start subscript, i, equals, 1, end subscript, start superscript, n, end superscript, left parenthesis, 2, plus, start fraction, 4, i, divided by, n, end fraction, right parenthesis, squared, dot, start fraction, 4, divided by, 5, n, end fraction
Now we can represent the actual area as a limit:
\begin{aligned} &\phantom{=}\displaystyle\int_2^6 {\dfrac15x^2\,}{dx} \\\\ &=\displaystyle\lim_{n\to\infty}R(n) \\\\ &=\displaystyle\lim_{n\to\infty}\sum_{i=1}^{n}\left(2+\dfrac{4i}{n}\right)^2\cdot\dfrac{4}{5n} \end{aligned}

## 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 open bracket, a, comma, b, close bracket, denoted by integral, start subscript, a, end subscript, start superscript, b, end superscript, f, left parenthesis, x, right parenthesis, d, x, is the limit of a Riemann sum as the number of subdivisions approaches infinity. That is,
integral, start subscript, a, end subscript, start superscript, b, end superscript, f, left parenthesis, x, right parenthesis, d, x, equals, limit, start subscript, n, \to, infinity, end subscript, sum, start subscript, i, equals, 1, end subscript, start superscript, n, end superscript, start color #1fab54, delta, x, end color #1fab54, dot, start color #e07d10, f, left parenthesis, start color #11accd, x, start subscript, i, end subscript, end color #11accd, right parenthesis, end color #e07d10
where start color #1fab54, delta, x, end color #1fab54, equals, start fraction, b, minus, a, divided by, n, end fraction and start color #11accd, x, start subscript, i, end subscript, equals, a, plus, delta, x, dot, i, end color #11accd.

## 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.
integral, start subscript, pi, end subscript, start superscript, 2, pi, end superscript, cosine, left parenthesis, x, right parenthesis, d, x
First, let's find start color #1fab54, delta, x, end color #1fab54:
\begin{aligned} \greenD{\Delta x}&=\dfrac{ b- a}{n} \\\\ &=\dfrac{{2\pi}- \pi}{n} \\\\ &=\greenD{\dfrac{\pi}{n}} \end{aligned}
Now that we have start color #1fab54, delta, x, end color #1fab54, we can find start color #11accd, x, start subscript, i, end subscript, end color #11accd:
\begin{aligned} \blueD{x_i}&= a+\greenD{\Delta x}\cdot i \\\\ &= \pi+\greenD{\dfrac{\pi}{n}}\cdot i \\\\ &=\blueD{\pi+\dfrac{\pi i}{n}} \end{aligned}
Therefore,
integral, start subscript, pi, end subscript, start superscript, 2, pi, end superscript, cosine, left parenthesis, x, right parenthesis, d, x, equals, limit, start subscript, n, \to, infinity, end subscript, sum, start subscript, i, equals, 1, end subscript, start superscript, n, end superscript, start color #1fab54, start fraction, pi, divided by, n, end fraction, end color #1fab54, dot, start color #e07d10, cosine, left parenthesis, start color #11accd, pi, plus, start fraction, pi, i, divided by, n, end fraction, end color #11accd, right parenthesis, end color #e07d10

### Practice writing Riemann sums from definite integrals

Problem 1
integral, start subscript, 0, end subscript, cubed, e, start superscript, x, end superscript, d, x, equals, question mark

Problem 2
integral, start subscript, 1, end subscript, start superscript, e, end superscript, natural log, x, d, x, equals, question mark

### Common mistake: Getting the wrong expression for $\Delta x$delta, x

For example, in Problem 2, we can imagine how a student might define delta, x to be start fraction, e, divided by, n, end fraction or start fraction, 1, divided by, n, end fraction instead of start fraction, e, minus, 1, divided by, n, end fraction. Another example is simply using d, x for delta, x. Remember that d, x 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 $x_i$x, start subscript, i, end subscript

A student might forget to add a to delta, x, dot, i, resulting in a wrong expression. For example, in Problem 2, a student might define x, start subscript, i, end subscript to be start fraction, e, minus, 1, divided by, n, end fraction, dot, i instead of 1, plus, start fraction, e, minus, 1, divided by, n, end fraction, dot, i.

## 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:
limit, start subscript, n, \to, infinity, end subscript, sum, start subscript, i, equals, 1, end subscript, start superscript, n, end superscript, natural log, left parenthesis, 2, plus, start fraction, 5, i, divided by, n, end fraction, right parenthesis, dot, start fraction, 5, divided by, n, end fraction
This means we need to find the interval of integration open bracket, start color #aa87ff, a, end color #aa87ff, comma, start color #aa87ff, b, end color #aa87ff, close bracket and the integrand start color #e07d10, f, left parenthesis, x, right parenthesis, end color #e07d10. Then, the corresponding definite integral will be integral, start subscript, start color #aa87ff, a, end color #aa87ff, end subscript, start superscript, start color #aa87ff, b, end color #aa87ff, end superscript, start color #e07d10, f, left parenthesis, x, right parenthesis, end color #e07d10, d, x.
We know that every Riemann sum has two parts: a width start color #1fab54, delta, x, end color #1fab54 and a height start color #e07d10, f, left parenthesis, start color #11accd, x, start subscript, i, end subscript, end color #11accd, right parenthesis, end color #e07d10 for each rectangle in the sum. Looking at this specific limit, we can make reasonable choices for both parts.
limit, start subscript, n, \to, infinity, end subscript, sum, start subscript, i, equals, 1, end subscript, start superscript, n, end superscript, start color #e07d10, natural log, left parenthesis, start color #11accd, 2, plus, start fraction, 5, i, divided by, n, end fraction, end color #11accd, right parenthesis, end color #e07d10, dot, start color #1fab54, start fraction, 5, divided by, n, end fraction, end color #1fab54
Rectangles of uniform width: The expression start color #1fab54, start fraction, 5, divided by, n, end fraction, end color #1fab54 is a reasonable choice for the width of our rectangles, start color #1fab54, delta, x, end color #1fab54, because it doesn't depend on the index i. This means that start color #1fab54, delta, x, end color #1fab54 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 start color #e07d10, natural log, left parenthesis, start color #11accd, 2, plus, start fraction, 5, i, divided by, n, end fraction, end color #11accd, right parenthesis, end color #e07d10 depends on i, which makes it a good choice to represent the height, start color #e07d10, f, left parenthesis, start color #11accd, x, start subscript, i, end subscript, end color #11accd, right parenthesis, end color #e07d10. The most natural choice for start color #11accd, x, start subscript, i, end subscript, end color #11accd is start color #11accd, 2, plus, start fraction, 5, i, divided by, n, end fraction, end color #11accd, so let's go with that, which means that the function we're integrating is start color #e07d10, f, left parenthesis, x, right parenthesis, end color #e07d10, equals, start color #e07d10, natural log, left parenthesis, x, right parenthesis, end color #e07d10.
To figure out the bounds of integration, a and b, let's think back to the general definitions of start color #1fab54, delta, x, end color #1fab54 and start color #11accd, x, start subscript, i, end subscript, end color #11accd in relation to the definite integral.
As defined above, start color #11accd, x, start subscript, i, end subscript, end color #11accd, equals, start color #aa87ff, a, end color #aa87ff, plus, start color #1fab54, delta, x, end color #1fab54, dot, i, space. In this specific problem, start color #11accd, x, start subscript, i, end subscript, end color #11accd, equals, start color #11accd, 2, plus, start fraction, 5, i, divided by, n, end fraction, end color #11accd, which can be written as start color #aa87ff, 2, end color #aa87ff, plus, start color #1fab54, start fraction, 5, divided by, n, end fraction, end color #1fab54, i, so start color #aa87ff, a, end color #aa87ff must equal start color #aa87ff, 2, end color #aa87ff.
As defined above, start color #1fab54, delta, x, end color #1fab54, equals, start fraction, b, minus, a, divided by, n, end fraction, space. In this specific problem, start color #1fab54, delta, x, end color #1fab54, equals, start fraction, 5, divided by, n, end fraction. Both denominators are n, so the numerators must be equal: b, minus, a, equals, 5. We already know start color #aa87ff, a, equals, 2, end color #aa87ff, so we can conclude that start color #aa87ff, b, equals, 7, end color #aa87ff.
Putting everything together, here's a definite integral that equals the limit of the Riemann sum:
integral, start subscript, start color #aa87ff, 2, end color #aa87ff, end subscript, start superscript, start color #aa87ff, 7, end color #aa87ff, end superscript, start color #e07d10, natural log, left parenthesis, x, right parenthesis, end color #e07d10, d, x

### 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:
limit, start subscript, n, \to, infinity, end subscript, sum, start subscript, i, equals, 1, end subscript, start superscript, n, end superscript, left parenthesis, 3, plus, start fraction, 4, i, divided by, n, end fraction, right parenthesis, squared, dot, start fraction, 4, divided by, n, end fraction
What is delta, x in this expression?

### Common struggle: Difficulty finding $\Delta x$delta, 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 delta, x.
Remember that delta, x must be a factor of the summed expression, in the form start fraction, k, divided by, n, end fraction, 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 delta, x, equals, start fraction, 4, divided by, n, end fraction told us that b, minus, a, equals, 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 x, start subscript, i, end subscript, equals, 3, plus, start fraction, 4, i, divided by, n, end fraction.
A common mistake is to immediately assume that if, for example, delta, x, equals, start fraction, 4, divided by, n, end fraction, then the limits of integration are open bracket, 0, comma, 4, close bracket.

### 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 start fraction, k, divided by, n, end fraction (where k doesn't contain the summation index i) and one that is a function of i. The first will give you start color #1fab54, delta, x, end color #1fab54 and the other will give you start color #11accd, f, left parenthesis, start color #e07d10, x, start subscript, i, end subscript, end color #e07d10, right parenthesis, end color #11accd.
Problem 4
limit, start subscript, n, \to, infinity, end subscript, sum, start subscript, i, equals, 1, end subscript, start superscript, n, end superscript, square root of, 4, plus, start fraction, 5, i, divided by, n, end fraction, end square root, dot, start fraction, 5, divided by, n, end fraction, equals, question mark

Want more practice? Try this exercise.

## Want to join the conversation?

• How do we know that the right Riemann sum ended at x = b (upper bound) if the number of rectangles -> infinity ?
• We don't know how many rectangles are there but for sure, the right Riemann sum's last rectangle on the right will have its right side as x=b because we started drawing rectangles from x=b leftwards and so no matter how thin the rectangles are, the rightmost rectangle's right side is x=b.
• How would you write a Riemann sum in definite integral form when the given upper and lower limits of summation are not n and i=1 respectively?
For example, my professor gave us this Riemann sum:
lim n→∞ 1/n3 [∑3n, i=n+1 i√(n2 + i2)]

Then he solved the definite integral and got 5√5 - 2√2

However, when he worked it in class, he didn't explain how he did this, and none of us have been able to figure it out
• Ask him to explain it. Actually, he should.
(1 vote)
• I am a little confused about the process of writing integrals from Riemann sums. For example,

lim​​​ ​∑ ​​​(3+​(4i/n)​​)^​2​​ * 4/n

why could it not potentially be

S[6, 2] (x+1)^2 dx

?

Thank you!
• If by S[6,2] you mean the integral from x = 2 to x = 6, rather than the integral from x = 6 to x = 2, then it could indeed be that integral.
I think what they're aiming for here is the "most obvious" equivalent integral, so that the article can avoid going into the subject of translations along the x-axis.
• My issue is I never know how to get Xi. Can someone explain Xi to me, please?
(1 vote)
• Xi is defined in the text.
• This is irrelevant, but what does the function In(x) Mean?
(1 vote)
• ln is the natural logarithm function which is the inverse of the exponential function e^x (where e is Euler's number).
• How can I use this to intregate 2x ?(The answer should be x^2 ,isnt it ?)
(1 vote)
• on this stage of progress you need limits of integration. but later on you will see that the undefined integral of 2x is x^2
• How can we figure out if the given definite integral is a left Riemann sum or right Riemann sum?
(1 vote)
• This question does not quite make sense. A given definite integral itself is neither a left nor a right Riemann sum. The definite integral can be expressed as the limit of left Riemann sums, and can be expressed as the limit of right Riemann sums. Think of left and right Riemann sums as approximations of the value of a definite integral.
• is ∑ f(xi)∙∆x = ∆x∙∑ f(xi)? Basically can you factor out the ∆x since its constant. Lets assume I don't want it to convert into an integral
(1 vote)
• Yes, you can do that because ∆x is constant.
∑(∆x)/(x_0 + i*∆x)