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

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(x\right)=\frac{1}{5}{x}^{2}$ between $x=2$ and $x=6$.
Using definite integral notation, we can represent the exact area:
${\int }_{2}^{6}\frac{1}{5}{x}^{2}\phantom{\rule{0.167em}{0ex}}dx$
We can approximate this area using Riemann sums. Let $R\left(n\right)$ 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(4\right)$. You can see it's an overestimation of the actual area.
We can make our approximation better by dividing our area into further rectangles that are smaller in width, i.e. by using $R\left(n\right)$ 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$:
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=\mathrm{\infty }$ because infinity isn't an actual number, but you might recall we have a way of taking something to infinity...
Limits!
Specifically, this limit:
$\underset{n\to \mathrm{\infty }}{lim}R\left(n\right)$
Amazing fact #1: This limit really gives us the exact value of ${\int }_{2}^{6}\frac{1}{5}{x}^{2}\phantom{\rule{0.167em}{0ex}}dx$.
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(n\right)$ 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 $\mathrm{\Delta }x$, the constant $\text{width}$ of any rectangle, and ${x}_{i}$, the $x$-value of the right edge of the ${i}^{\text{th}}$ rectangle. Then, $f\left({x}_{i}\right)$ will give us the $\text{height}$ of each rectangle.
$\begin{array}{rl}\mathrm{\Delta }x& =\frac{6-2}{n}=\frac{4}{n}\\ \\ {x}_{i}& =2+\mathrm{\Delta }x\cdot i=2+\frac{4}{n}i\\ \\ f\left({x}_{i}\right)& =\frac{1}{5}\left({x}_{i}{\right)}^{2}=\frac{1}{5}{\left(2+\frac{4}{n}i\right)}^{2}\end{array}$
So the area of the ${i}^{\text{th}}$ rectangle is $\frac{4}{n}\cdot \frac{1}{5}{\left(2+\frac{4}{n}i\right)}^{2}$, and we sum that for values of $i$ from $1$ to $n$:
$R\left(n\right)=\sum _{i=1}^{n}{\left(2+\frac{4i}{n}\right)}^{2}\cdot \frac{4}{5n}$
Now we can represent the actual area as a limit:
$\begin{array}{rl}& \phantom{=}{\int }_{2}^{6}\frac{1}{5}{x}^{2}\phantom{\rule{0.167em}{0ex}}dx\\ \\ & =\underset{n\to \mathrm{\infty }}{lim}R\left(n\right)\\ \\ & =\underset{n\to \mathrm{\infty }}{lim}\sum _{i=1}^{n}{\left(2+\frac{4i}{n}\right)}^{2}\cdot \frac{4}{5n}\end{array}$

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 $\left[a,b\right]$, denoted by ${\int }_{a}^{b}f\left(x\right)dx$, is the limit of a Riemann sum as the number of subdivisions approaches infinity. That is,
${\int }_{a}^{b}f\left(x\right)dx=\underset{n\to \mathrm{\infty }}{lim}\sum _{i=1}^{n}\mathrm{\Delta }x\cdot f\left({x}_{i}\right)$
where $\mathrm{\Delta }x=\frac{b-a}{n}$ and ${x}_{i}=a+\mathrm{\Delta }x\cdot i$.

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.
${\int }_{\pi }^{2\pi }\mathrm{cos}\left(x\right)\phantom{\rule{0.167em}{0ex}}dx$
First, let's find $\mathrm{\Delta }x$:
$\begin{array}{rl}\mathrm{\Delta }x& =\frac{b-a}{n}\\ \\ & =\frac{2\pi -\pi }{n}\\ \\ & =\frac{\pi }{n}\end{array}$
Now that we have $\mathrm{\Delta }x$, we can find ${x}_{i}$:
$\begin{array}{rl}{x}_{i}& =a+\mathrm{\Delta }x\cdot i\\ \\ & =\pi +\frac{\pi }{n}\cdot i\\ \\ & =\pi +\frac{\pi i}{n}\end{array}$
Therefore,
${\int }_{\pi }^{2\pi }\mathrm{cos}\left(x\right)\phantom{\rule{0.167em}{0ex}}dx=\underset{n\to \mathrm{\infty }}{lim}\sum _{i=1}^{n}\frac{\pi }{n}\cdot \mathrm{cos}\left(\pi +\frac{\pi i}{n}\right)$

Practice writing Riemann sums from definite integrals

Problem 1
${\int }_{0}^{3}{e}^{x}\phantom{\rule{0.167em}{0ex}}dx=\phantom{\rule{0.167em}{0ex}}?$

Problem 2
${\int }_{1}^{e}\mathrm{ln}x\phantom{\rule{0.167em}{0ex}}dx=\phantom{\rule{0.167em}{0ex}}?$

Common mistake: Getting the wrong expression for $\mathrm{\Delta }x$‍

For example, in Problem 2, we can imagine how a student might define $\mathrm{\Delta }x$ to be $\frac{e}{n}$ or $\frac{1}{n}$ instead of $\frac{e-1}{n}$. Another example is simply using $dx$ for $\mathrm{\Delta }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 ${x}_{i}$‍

A student might forget to add $a$ to $\mathrm{\Delta }x\cdot i$, resulting in a wrong expression. For example, in Problem 2, a student might define ${x}_{i}$ to be $\frac{e-1}{n}\cdot i$ instead of $1+\frac{e-1}{n}\cdot 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:
$\underset{n\to \mathrm{\infty }}{lim}\sum _{i=1}^{n}\mathrm{ln}\left(2+\frac{5i}{n}\right)\cdot \frac{5}{n}$
This means we need to find the interval of integration $\left[a,b\right]$ and the integrand $f\left(x\right)$. Then, the corresponding definite integral will be ${\int }_{a}^{b}f\left(x\right)\phantom{\rule{0.167em}{0ex}}dx$.
We know that every Riemann sum has two parts: a width $\mathrm{\Delta }x$ and a height $f\left({x}_{i}\right)$ for each rectangle in the sum. Looking at this specific limit, we can make reasonable choices for both parts.
$\underset{n\to \mathrm{\infty }}{lim}\sum _{i=1}^{n}\mathrm{ln}\left(2+\frac{5i}{n}\right)\cdot \frac{5}{n}$
Rectangles of uniform width: The expression $\frac{5}{n}$ is a reasonable choice for the width of our rectangles, $\mathrm{\Delta }x$, because it doesn't depend on the index $i$. This means that $\mathrm{\Delta }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 $\mathrm{ln}\left(2+\frac{5i}{n}\right)$ depends on $i$, which makes it a good choice to represent the height, $f\left({x}_{i}\right)$. The most natural choice for ${x}_{i}$ is $2+\frac{5i}{n}$, so let's go with that, which means that the function we're integrating is $f\left(x\right)=\mathrm{ln}\left(x\right)$.
To figure out the bounds of integration, $a$ and $b$, let's think back to the general definitions of $\mathrm{\Delta }x$ and ${x}_{i}$ in relation to the definite integral.
As defined above, . In this specific problem, ${x}_{i}=2+\frac{5i}{n}$, which can be written as $2+\frac{5}{n}i$, so $a$ must equal $2$.
As defined above, . In this specific problem, $\mathrm{\Delta }x=\frac{5}{n}$. Both denominators are $n$, so the numerators must be equal: $b-a=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:
${\int }_{2}^{7}\mathrm{ln}\left(x\right)\phantom{\rule{0.167em}{0ex}}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:
$\underset{n\to \mathrm{\infty }}{lim}\sum _{i=1}^{n}{\left(3+\frac{4i}{n}\right)}^{2}\cdot \frac{4}{n}$
What is $\mathrm{\Delta }x$ in this expression?

Common struggle: Difficulty finding $\mathrm{\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 $\mathrm{\Delta }x$.
Remember that $\mathrm{\Delta }x$ must be a factor of the summed expression, in the form $\frac{k}{n}$, 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 $\mathrm{\Delta }x=\frac{4}{n}$ told us that $b-a=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}_{i}=3+\frac{4i}{n}$.
A common mistake is to immediately assume that if, for example, $\mathrm{\Delta }x=\frac{4}{n}$, then the limits of integration are $\left[0,4\right]$.

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 $\frac{k}{n}$ (where $k$ doesn't contain the summation index $i$) and one that is a function of $i$. The first will give you $\mathrm{\Delta }x$ and the other will give you $f\left({x}_{i}\right)$.
Problem 4
$\underset{n\to \mathrm{\infty }}{lim}\sum _{i=1}^{n}\sqrt{4+\frac{5i}{n}}\cdot \frac{5}{n}=\phantom{\rule{0.167em}{0ex}}?$

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.
• Our teacher said, limit value of Riemann sum when n goes infinity is not proper definition for definite integral because when n goes infinity, not every rectangle get thinner. So What did he mean by that?
• That makes no sense. If n is bigger, then there are more subdivisions, and so the subdivisions themselves are smaller.
• 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.
• 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.