A.7 Summary: Riemann Sums

On this screen we summarize the work we have done in this Section so far, and then generalize to define the all-important "Riemann Sum."

Throughout this Section we have explored how to handle accumulation when the rate at which the quantity of interest changes varies. The techniques we've used were pioneered by Bernhard Riemann, who was on a quest to devise a rigorous method to recover a function 𝑓(𝑥) based on its derivative 𝑓′(𝑥). For instance, in Context 3 we were working to determine skydiving Gabriel's position 𝑦(𝑡) based on his velocity 𝑣(𝑡) =𝑦′(𝑡), the reverse process of our earlier work when we found an object's velocity by taking the derivative of its position versus time. In the language we have been using, Riemann was working to develop a method to accumulate little bits of change that vary in size as determined by the instantaneous rate function, all with the goal of determining what the original function was.

Let's now look across our previous work to find commonalities, and then we'll generalize the mathematical structure that we see.

Looking Across the Contexts

We have used the same basic 2-step process for each of our accumulation procedures:

1. Approximate the accumulation during each subinterval:

Approx accumulationduring subinterval 𝑖:(representative function value for subinterval)⋅(subinterval duration)

2. Sum accumulations for all of the subintervals.

Notice that we subdivided an overall interval of interest corresponding to the input variable of the function we were given, as illustrated by the following table. (Tapping on the Context name in each row will open that page in a separate browser tab if you'd like to review.)

ContextInput interval of interest we subdividedWe split the interval up into
1. Liquid filling a tanktime t in the flowrate function
𝐹(𝑡) =6 −90211𝑡
3 subintervals: [0,1],[1,2],[2,3]
2. Force exerted on a water towerdepth d in the pressure function 𝑃(𝑑) =62.4𝑑5 subintervals: [0,3],[3,6],[6,9],[9,12],[12,15]
3. Distance fallen during skydivetime t in the velocity function 𝑣(𝑡) =√9.8⋅720.24 ⋅tanh⁡(𝑡⋅√9.8⋅720.24)5 subintervals: [0,2],[2,4],[4,6],[6,8],[8,10]
4. Upper and lower sumsx in the bell-curve function 𝑦(𝑥) =𝑒−𝑥2/64 subintervals: [ −2, −0.5],[ −0.5,1],[1,2.5],[2.5,4]
GeneralInput x in the function 𝑓(𝑥)n subintervals: [𝑥0,𝑥1],[𝑥1,𝑥2],…,[𝑥𝑛−2,𝑥𝑛−1],[𝑥𝑛−1,𝑥𝑛] where
𝑎 =𝑥0 <𝑥1 <𝑥2 <⋯ <𝑥𝑛 =𝑏

Note that in the last row of the table we are generalizing to any function 𝑓(𝑥), any input-interval [𝑎,𝑏], and any number of subintervals n.

Remember the fundamental "this is Calculus!" step we then take: To approximate the accumulation over each subinterval, we assume (pretend) that the rate at which the quantity accumulates is constant over that subinterval. That is, we use a single representative rate for each subinterval, a move which produces some unknown amount of error between our approximate value and the true, actual amount accumulated.

Reflection Question: Constant rate assumption

Why do we start these calculations by assuming that the accumulation rate is constant over each subinterval?

The following table summarizes how we developed our sum for each of the Contexts:

ContextHow we quantified the accumulation
over each subinterval
How we quantified the total accumulation:
The All-Important Sum(!)
Liquid filling a tankFlowrate at a representative moment during the subinterval, multiplied by the subinterval time-duration: 𝐹𝑖 ⋅Δ𝑡𝑖Total accumulated water that flows out:
𝐹1 ⋅Δ𝑡1 +𝐹2 ⋅Δ𝑡2 +⋯ +𝐹𝑛 ⋅Δ𝑡𝑛
Force exerted on a water towerPressure at a representative depth, multiplied by the strip-width over which that pressure acts: 𝑃𝑖 ⋅Δ𝑑𝑖Total force on water tower's walls:
2𝜋𝑟 ⋅(𝑃1 ⋅Δ𝑑1 +𝑃2 ⋅Δ𝑑2 +⋯ +𝑃𝑛 ⋅Δ𝑑𝑛)
Distance fallen during skydiveVelocity at a representative moment during the subinterval, multiplied by the subinterval time-duration: 𝑣𝑖 ⋅Δ𝑡𝑖Total distance Gabriel falls in 10 seconds:
𝑣1 ⋅Δ𝑡1 +𝑣2 ⋅Δ𝑡2 +⋯ +𝑣𝑛 ⋅Δ𝑡𝑛
Upper and Lower SumsMaximum value 𝑀𝑖, or minimum value 𝑚𝑖, on the subinterval, multiplied by the subinterval-widthTotal accumulation for bell curve function: Upper Sum: 𝑀1⋅Δ𝑥1+𝑀2⋅Δ𝑥2+⋯+𝑀𝑛⋅Δ𝑥𝑛Lower Sum: 𝑚1⋅Δ𝑥1+𝑚2⋅Δ𝑥2+⋯+𝑚𝑛⋅Δ𝑥𝑛
GeneralThe function evaluated at some point in the subinterval, multiplied by the subinterval-width: 𝑓(𝑥∗𝑖) ⋅Δ𝑥𝑖𝑓(𝑥∗1) ⋅Δ𝑥1 +𝑓(𝑥∗2) ⋅Δ𝑥2 +⋯ +𝑓(𝑥∗𝑛) ⋅Δ𝑥𝑛
which we represent in sigma notation as
𝑛∑𝑖=1𝑓(𝑥∗𝑖)⋅Δ𝑥𝑖

The last row again generalizes the ideas to apply to any function 𝑓(𝑥), any input-interval [𝑎,𝑏], and any number of subintervals n.

Important Notation: In that final row, the function's input value is written with a superscript "star" or asterisk, like 𝑥∗𝑖. This quantity is pronounced "ex-sub-i star," and communicates that we're evaluating the function at some point we choose that's within the subinterval, giving us the representative value 𝑓(𝑥∗𝑖). For instance, sometimes we choose 𝑥∗𝑖 to be the subinterval's smallest input-value (Left Sum); at other times we use the subinterval's largest input-value (Right Sum); and at yet other times we use an input-value that lies somewhere between those two values (e.g., Midpoint Sum). When you see the "*", think: "some representative input-value that lies within the subinterval."

The generalized sum in the table's final entry is known as the famous Riemann Sum (pronounced "Ree-mahn sum"):

DEFINITION
Riemann Sum

Given a real-valued function 𝑓(𝑥) on the closed interval [𝑎,𝑏], we define the Riemann Sum by

𝑛∑𝑖=1𝑓(𝑥∗𝑖)⋅Δ𝑥𝑖

where the interval [𝑎,𝑏] is partitioned into 𝑛 subintervals

[𝑥0,𝑥1],[𝑥1,𝑥2],…,[𝑥𝑛−2,𝑥𝑛−1],[𝑥𝑛−1,𝑥𝑛]

and where each subinterval is non-zero such that

𝑎=𝑥0<𝑥1<𝑥2<⋯<𝑥𝑛=𝑏.

That compact definition for S packs a lot of information in it, since it encapsulates the 2-step procedure we've been developing and then using over the previous screens. Please don't lose sight of the meaning just because the definition looks (perhaps) abstract: it is simply a representation of the types of sums you have been creating, using a general process that we hope is starting to feel routine for you.

Left, Right, and Midpoint Sums

Let's summarize our work with Left, Right, and Midpoint Sums. Remember that these sums are convenient for us to use because we can easily define a list of 𝑥∗𝑖 based on the first point of the interval 𝑎, and the interval width Δ𝑥. The following question contains some review, and will then develop the general expression for each sum.

Review and Generalization of Left, Right and Midpoint Sums

Summarizing the discussion in the preceding animations, as long as we have partitioned the interval [𝑎,𝑏] into equal subdivisions (so each subinterval has the same width Δ𝑥 ), we can write the three sums as:

DEFINITION
Left, Right and Midpoint Sums
Left Sum:𝑆𝐿=𝑛∑𝑖=1𝑓(𝑎+(𝑖−1)⋅Δ𝑥)⋅Δ𝑥Right Sum:𝑆𝑅=𝑛∑𝑖=1𝑓(𝑎+(𝑖+0)⋅Δ𝑥)⋅Δ𝑥Midpoint Sum:𝑆mid=𝑛∑𝑖=1𝑓(𝑎+(𝑖−12)⋅Δ𝑥)⋅Δ𝑥

Note that in each sum, the terms still have the form (representative function value) • (subinterval width), which is the important characteristic of the Riemann sum. The only difference is where in the subinterval we evaluate the function: for a left sum we evaluate the function at the beginning of the interval (𝑖 −1); for a right sum we evaluate it at the end of the interval (𝑖 +0); and for a midpoint sum we evaluate it halfway through the interval (𝑖 −12).

As part of our summarizing here, the following interactive graph lets you choose which sum to display and calculate, and you can set the number of subintervals n using the slider beneath the graph. Please make sure that the heights of rectangles make sense to you for the different sum types.

Note that we are not showing "error bound" boxes on the graph above because we are not guaranteed that the Left and Right (or Midpoint) Sums give us a valid overestimate or underestimate. For instance, with n = 6 and looking at the Left Sum, you see that while the subintervals i = 1, 2, and 3 are using the function's minimum value on each subinterval, while subintervals 4, 5, and 6 are using the function's maximum value on each subinterval. We thus can't use the resulting sum value to bound anything at all. (Which isn't to say it isn't useful . . . as we'll see in a few screens.) But this limitation brings us to Darboux Sums.

Darboux sums

Because the Left, Right (and Midpoint) Sums fail to give us a guaranteed underestimate or overestimate, in Context 4 introduced a new approach and chose 𝑥∗𝑖 in each subinterval to yield a maximum or minimum value 𝑓(𝑥∗𝑖) for that subinterval. We were then able to find the largest possible overestimate given the function's values, and the smallest possible underestimate.

When 𝑥∗𝑖 is chosen such that 𝑓(𝑥∗𝑖) =max 𝑓(𝑥) =𝑀𝑖 over each subinterval Δ𝑥𝑖, then we have the Upper Darboux Sum. Conversely, when 𝑥∗𝑖 is chosen such that 𝑓(𝑥∗𝑖) =min 𝑓(𝑥) =𝑚𝑖 over each subinterval Δ𝑥𝑖, then we have the Lower Darboux Sum.

DEFINITION
Darboux Sums, or Upper and Lower Sums
Upper Sum:𝑆upper=𝑛∑𝑖=1𝑀𝑖⋅Δ𝑥𝑖Lower Sum:𝑆lower=𝑛∑𝑖=1𝑚𝑖⋅Δ𝑥𝑖

where 𝑀𝑖 is the function's maximum value on subinterval i, and 𝑚𝑖 is the function's minimum value on subinterval i.

The graph below duplicates the one in Context 4 to produce those sums for the value of n subintervals you set, except we've set the interval to [ −3,4] to match the one in the calculator above. (As a reminder, your browser is finding the values of 𝑀𝑖 and 𝑚𝑖 for each subinterval, and hence computing the values of U and L may take a while — and will take longer as you increase n. Please be patient.)

Let's consider a brief Reflection Question now that we're clear on the various choices we currently have for 𝑥∗𝑖.

Reflection Question: Choice of 𝑥∗𝑖

Does it matter where 𝑓(𝑥∗𝑖) is evaluated along each subinterval? If we picked a random value for 𝑥∗𝑖 in each subinterval, would we still have a meaningful approximation for the accumulation?

Riemann and Darboux Sums

Note that a Riemann Sum can use any value 𝑥∗𝑖 in each subinterval. Hence when we write S without any subscript (like 𝑆𝐿 or 𝑆mid,) we are not specifying which particular 𝑥∗𝑖 values we are using, unlike when we write 𝑆𝐿, in which case we know we're using the leftmost point, and so forth.

With this notational distinction in mind, let's think about how the Upper and Lower Sum values compare to the value of any Riemann Sum.

Check Question: Inequality Among Darboux and Riemann Sums

The insight of the preceding Check Question — that any Riemann Sum value will lie between the Upper and Lower Sum values, or be equal to one of them — will be of great importance in a few screens. Please keep it in mind as we proceed.

As a preview of what's to come, which probably won't surprise you: In exploring the calculations above, you may have noticed that as you increased the number of subintervals n (which decreases the subinterval size Δ𝑥), the various sum values all get closer and closer to each other. This isn't a coincidence. . . .

Before we take the next natural step with that insight, let's address one last bit regarding these sum computations.

Unequal Subinterval Widths

Reflection Question: Unequal Subinterval Widths

So far we have always subdivided our overall interval [𝑎,𝑏] into equally-sized subintervals Δ𝑥𝑖 =𝑏−𝑎𝑛. Let's consider: could we use different-sized subinterval widths? What comes to mind as you consider the following questions?

  1. Could we partition the overall interval into different-sized subintervals Δ𝑥𝑖 and still compute a meaningful sum?
  2. Why is it generally convenient to use a uniform Δ𝑥𝑖 =Δ𝑥, the same width for each subinterval?

Problems that require you to use subintervals with unequal spacing are common on exams, so we've included several for you to practice with on the next screen.

For now, we've completed our work developing what a Riemann Sum is. At the start of the next Section we'll take the enormous step of turning the Riemann Sum into an integral. Before then, now that you've seen this summary of the work we've done so far to develop Riemann Sums, what thoughts and questions do you have? Please let us know over on the Forum!


The Upshot

  1. We have now defined the Riemann Sum: Given a real-valued function 𝑓(𝑥) on the closed interval [𝑎,𝑏], we define the Riemann Sum as 𝑆=𝑛∑𝑖=1𝑓(𝑥∗𝑖)⋅Δ𝑥𝑖 where the interval [𝑎,𝑏] is subdivided (partitioned) into n subintervals [𝑥0,𝑥1],[𝑥1,𝑥2],…,[𝑥𝑛−2,𝑥𝑛−1],[𝑥𝑛−1,𝑥𝑛] where each subinterval is non-zero such that 𝑎 =𝑥0 <𝑥1 <𝑥2 <⋯ <𝑥𝑛 =𝑏. (Note that the Riemann Sum does not require that the subintervals be of equal width.)
  2. Over the course of this Section we developed the following types of Riemann Sums: Left Sum:𝑆𝐿=𝑛∑𝑖=1𝑓(𝑎+(𝑖−1)⋅Δ𝑥)⋅Δ𝑥Right Sum:𝑆𝑅=𝑛∑𝑖=1𝑓(𝑎+(𝑖+0)⋅Δ𝑥)⋅Δ𝑥Midpoint Sum:𝑆𝑀=𝑛∑𝑖=1𝑓(𝑎+(𝑖−12)⋅Δ𝑥)⋅Δ𝑥Upper Sum:𝑆upper=𝑛∑𝑖=1𝑀𝑖⋅Δ𝑥𝑖Lower Sum:𝑆lower=𝑛∑𝑖=1𝑚𝑖⋅Δ𝑥𝑖
  3. We are guaranteed that the actual accumulation value lies between the bounds of the Lower and Upper Sums. Furthermore, because the Upper and Lower Sums get closer and closer to each other the more terms n we use, we can estimate the actual accumulation to whatever accuracy we like by choosing n sufficiently large.

The last point there suggests that we take lim𝑛→∞, which we'll do at the start of the next Section!