Riemann Sums
Approximating Area Under a Curve
Graphically, we can consider a definite integral, such as
to be the area "under the curve", which might be better said as the area that lies between the line the -axis and the curve In order to find this area, we can begin with a familiar geometric object: the rectangle. In this case, we wish to find an area above the interval from to . In order to approximate this, we can divide the interval into, say shorter intervals of equal length. Let's call this length , and since they are all the same length, we know that the length of each will be
However, in order to define an area, our rectangles require a height as well as a width. Most often, calculus teachers will use the function's value at the left or right endpoint for the height of each rectangle, although we could also choose the minimum or maximum value of on each interval, or perhaps the value at the midpoint of each interval.
Let's approximate this area first using left endpoints. Notice that our leftmost interval is so the height at the left endpoint is This means the area of our leftmost rectangle is
Continuing, the adjacent interval is Now, our left endpoint is , and our area is
The next interval to the right is and as such the left endpoint is so the area is
Finally, we have the rightmost rectangle, whose base is the interval This has as its left endpoint, so its area is
Adding these four rectangles up with sigma notation, we can approximate the area under the curve as
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{array}{rcl} S & = & {\displaystyle \sum_{i=1}^{4}f\left(x_{i}\right)\cdot\Delta x}\\ \\ & = & {\displaystyle 0+\frac{1}{64}+\frac{1}{16}+\frac{9}{64}}\\ \\ & = & {\displaystyle \frac{14}{64}}\\ \\ & = & {\displaystyle \frac{7}{32}.} \end{array} }
Of course, we could also use right endpoints. In this case, we would use the endpoints and for the height above each interval from left to right to find
Note that in this case, one is an overestimate and one is an underestimate. This approximation through the area of rectangles is known as a Riemann sum.
Additional Examples with Fixed Numbers of Rectangles
Example 1. Approximate the area under the curve of from to using Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle n=4 } rectangles and left endpoints.
Solution. Note that our Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x } -values range from Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle -1 } to Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 3 } , so our length is actually Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 3-(-1)=4. } Thus each rectangle will have a base of
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \Delta x\,=\,{\displaystyle \frac{b-a}{n}\,=\,\frac{3-(-1)}{4}\,=\,\frac{4}{4}\,=\,1.} }
This is our first step. This means our intervals from left to right are Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle [-1,0],\,[0,1],\,[1,2] } and Choosing left endpoints, we have
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{array}{rcl} S & = & {\displaystyle \sum_{i=1}^{4}f(x_{i})\cdot\Delta x}\\ \\ & = & f(-1)\cdot1+f(0)\cdot1+f(1)\cdot1+f(2)\cdot1\\ \\ & = & -2+0+0+6\\ \\ & = & 4. \end{array} }
Here is where the idea of "area under the curve" becomes clearer. We actually have a signed area, where area below the Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x } -axis is negative, while area above the Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x } -axis is positive.
Example 2. Approximate the area under the curve of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f(x)=x^{3}-x } from Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle -4 } to Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 4 } using Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle n=4 } rectangles and midpoints.
Solution. Here, our Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x } -values range from Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle -4 } to Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 4, } so
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \Delta x\,=\,{\displaystyle \frac{b-a}{n}\,=\,\frac{4-(-4)}{4}\,=\,\frac{8}{4}\,=\,2.} }
As a result, our intervals from left to right are Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle [-4,-2],\,[-2,0],\,[0,2] } and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle [2,4]. } More importantly, our midpoints occur at Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle -3,\,-1,\,1 } and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 3 } respectively; this is where we will evaluate the height of each rectangle. Thus
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{array}{rcl} S & = & {\displaystyle \sum_{i=1}^{4}f(x_{i})\cdot\Delta x}\\ \\ & = & f(-3)\cdot2+f(-1)\cdot2+f(1)\cdot2+f(3)\cdot2\\ \\ & = & (-24)\cdot2+0\cdot2+0\cdot2+24\cdot2\\ \\ & = & 0. \end{array} }
Defining the Integral as a Limit
Although associating the area under the curve with four rectangles gives us a really rough approximation, there's no reason we can't continue to divide (partition) the interval into smaller pieces, and then get closer to the actual area. The graphic on the right shows precisely the idea. We can keep making the base of each rectangle, or Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \Delta x, } smaller and smaller, and we'll get a better approximation. More importantly, we can continue this idea as a limit, leading to the following definition.
Definition. We define the Definite Integral of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f(x) } on Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle [a,b], } written
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\displaystyle \int_{a}^{b}f(x)\, dx}, }
to be
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle {\displaystyle \int_{a}^{b}f(x)\, dx\,=\,\lim_{n\rightarrow\infty}\sum_{i=1}^{n}f(x_{i})\cdot\Delta x_{i}.} }
For an introductory course, we usually have Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \Delta x_{i}=\Delta x={\displaystyle \frac{b-a}{n},} } so each rectangle has exactly the same base.
Using the Definition to Evaluate a Definite Integral
Frequently, students will be asked questions such as: Using the definition of the definite integral, find the area under the curve of the function Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle f(x)=x^{2} } on the interval Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle [0,3] } using right endpoints.
Rather than using "easier" rules, such as the power rule and the Fundamental Theorem of Calculus, this requires us to use the the definition just listed. The first step is to set up our sum. We have Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle a=0,\, b=3 } and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle n } is just an arbitrary natural (or counting) number. This tells us that
- Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \Delta x\,=\,{\displaystyle \frac{b-a}{n}\,=\,\frac{3-0}{n}\,=\,\frac{3}{n}}. }
For a given , our leftmost interval would start at and be of length This describes the interval On the other hand, our next interval would start where the leftmost stopped, or , and it's length would also be This is the interval
If we call the leftmost interval then we would have Similarly, our second interval would be If we were to continue this rule, we would have that for any we could write This allows us to determine where to choose our height for each interval. Since we are asked to use right endpoints, we would want for for and finally for
This allows us to build the sum. For an arbitrary we would have
Using this result, we now have
Now, we have several important sums explained on another page. These are the sum of the first numbers, the sum of the first squares, and the sum of the first cubes:
Moreover, we have some basic rules for summation. These rules that make sense in simpler notation, such as
- or
work the same way in Sigma notation, meaning
and
Before worrying about the limit as , when we write both and the in the denominator are just constants, like the in As a result we have
where we applied the rule for the first squares. Finally, we can look at this as being approximately for large so the limit as is Thus
A Left Point of View
What would change if we approached the above integral through left endpoints, instead of right? We would only be changing our value for For example, the leftmost interval is so our left endpoint is On the other hand, our second interval is so our left endpoint is For the interval our left endpoint is Let's apply the same process as the last section to this value. for height. We then have
From here, we use the special sums again. This means that
Thus our choice of endpoints makes no difference in the resulting value.
A More Advanced Example
For most Riemann Sum problems in an integral calculus class, will always be the same width, and we will need to use the special sums to evaluate the limit. However, what can we do if we wish to determine the value of
Using rectangles of the same width as shown in the earlier animation would result in a very messy sum which contains a lot of square roots! This makes finding the limit nearly impossible. Instead, we could consider the inverse function to the square root, which is squaring. Instead of choosing let's consider and let
For example, while In particular, since we indexed the leftmost point as this means that
Each will be a different width, but either endpoint would be a square, so taking will not leave a square root in our sum.
Now we have all the pieces. Let's use right endpoints for the height of each rectangle, so Then
You will NEVER see something like this in a first year calculus class, but it is just a reminder that the definition includes the indexed for a reason; the rectangles don't need to be all of the same width!