Skip to main content
\(\require{cancel}\newcommand{\highlight}[1]{{\color{blue}{#1}}} \newcommand{\apex}{A\kern -1pt \lower -2pt\mbox{P}\kern -4pt \lower .7ex\mbox{E}\kern -1pt X} \newcommand{\colorlinecolor}{blue!95!black!30} \newcommand{\bwlinecolor}{black!30} \newcommand{\thelinecolor}{\colorlinecolor} \newcommand{\colornamesuffix}{} \newcommand{\linestyle}{[thick, \thelinecolor]} \newcommand{\bmx}[1]{\left[\hskip -3pt\begin{array}{#1} } \newcommand{\emx}{\end{array}\hskip -3pt\right]} \newcommand{\ds}{\displaystyle} \newcommand{\fp}{f'} \newcommand{\fpp}{f''} \newcommand{\lz}[2]{\frac{d#1}{d#2}} \newcommand{\lzn}[3]{\frac{d^{#1}#2}{d#3^{#1}}} \newcommand{\lzo}[1]{\frac{d}{d#1}} \newcommand{\lzoo}[2]{{\frac{d}{d#1}}{\left(#2\right)}} \newcommand{\lzon}[2]{\frac{d^{#1}}{d#2^{#1}}} \newcommand{\lzoa}[3]{\left.{\frac{d#1}{d#2}}\right|_{#3}} \newcommand{\plz}[2]{\frac{\partial#1}{\partial#2}} \newcommand{\plzoa}[3]{\left.{\frac{\partial#1}{\partial#2}}\right|_{#3}} \newcommand{\inflim}[1][n]{\lim\limits_{#1 \to \infty}} \newcommand{\infser}[1][1]{\sum_{n=#1}^\infty} \newcommand{\Fp}{F\primeskip'} \newcommand{\Fpp}{F\primeskip''} \newcommand{\yp}{y\primeskip'} \newcommand{\gp}{g\primeskip'} \newcommand{\dx}{\Delta x} \newcommand{\dy}{\Delta y} \newcommand{\ddz}{\Delta z} \newcommand{\thet}{\theta} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \newcommand{\vnorm}[1]{\left\lVert\vec #1\right\rVert} \newcommand{\snorm}[1]{\left|\left|\ #1\ \right|\right|} \newcommand{\la}{\left\langle} \newcommand{\ra}{\right\rangle} \newcommand{\dotp}[2]{\vec #1 \cdot \vec #2} \newcommand{\proj}[2]{\text{proj}_{\,\vec #2}{\,\vec #1}} \newcommand{\crossp}[2]{\vec #1 \times \vec #2} \newcommand{\veci}{\vec i} \newcommand{\vecj}{\vec j} \newcommand{\veck}{\vec k} \newcommand{\vecu}{\vec u} \newcommand{\vecv}{\vec v} \newcommand{\vecw}{\vec w} \newcommand{\vecx}{\vec x} \newcommand{\vecy}{\vec y} \newcommand{\vrp}{\vec r\, '} \newcommand{\vsp}{\vec s\, '} \newcommand{\vrt}{\vec r(t)} \newcommand{\vst}{\vec s(t)} \newcommand{\vvt}{\vec v(t)} \newcommand{\vat}{\vec a(t)} \newcommand{\px}{\partial x} \newcommand{\py}{\partial y} \newcommand{\pz}{\partial z} \newcommand{\pf}{\partial f} \newcommand{\mathN}{\mathbb{N}} \newcommand{\zerooverzero}{\ds \raisebox{8pt}{\text{``\ }}\frac{0}{0}\raisebox{8pt}{\textit{ ''}}} \newcommand{\deriv}[2]{\myds\frac{d}{dx}\left(#1\right)=#2} \newcommand{\myint}[2]{\myds\int #1\ dx= {\ds #2}} \DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\csch}{csch} \newcommand{\primeskip}{\hskip.75pt} \newcommand{\plotlinecolor}{blue} \newcommand{\colorone}{blue} \newcommand{\colortwo}{red} \newcommand{\coloronefill}{blue!15!white} \newcommand{\colortwofill}{red!15!white} \newcommand{\abs}[1]{\left\lvert #1\right\rvert} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section5.3Riemann Sums

In the previous section we defined the definite integral of a function on \([a,b]\) to be the signed area between the curve and the \(x\)–axis. Some areas were simple to compute; we ended the section with a region whose area was not simple to compute. In this section we develop a technique to find such areas.

A fundamental calculus technique is to first answer a given problem with an approximation, then refine that approximation to make it better, then use limits in the refining process to find the exact answer. That is exactly what we will do here.

Consider the region given in Figure 5.3.1, which is the area under \(y=4x-x^2\) on \([0,4]\text{.}\) What is the signed area of this region — i.e., what is \(\int_0^4(4x-x^2)\ dx\text{?}\)

<<SVG image is unavailable, or your browser cannot render it>>

Figure5.3.1A graph of \(f(x) = 4x-x^2\text{.}\) What is the area of the shaded region?

We start by approximating. We can surround the region with a rectangle with height and width of 4 and find the area is approximately 16 square units. This is obviously an over–approximation; we are including area in the rectangle that is not under the parabola.

<<SVG image is unavailable, or your browser cannot render it>>

Figure5.3.2Approximating area under a curve with one rectangle

We have an approximation of the area, using one rectangle. How can we refine our approximation to make it better? The key to this section is this answer: use more rectangles.

Let's use 4 rectangles of equal width of 1. This partitions the interval \([0,4]\) into 4 subintervals, \([0,1]\text{,}\) \([1,2]\text{,}\) \([2,3]\) and \([3,4]\text{.}\) On each subinterval we will draw a rectangle.

There are three common ways to determine the height of these rectangles: the Left Hand Rule, the Right Hand Rule, and the Midpoint Rule. The Left Hand Rule says to evaluate the function at the left–hand endpoint of the subinterval and make the rectangle that height. In Figure 5.3.3, the rectangle drawn on the interval \([2,3]\) has height determined by the Left Hand Rule; it has a height of \(f(2)\text{.}\) (The rectangle is labeled “LHR.”)

<<SVG image is unavailable, or your browser cannot render it>>

Figure5.3.3Approximating \(\int_0^4(4x-x^2)\ dx\) using rectangles. The heights of the rectangles are determined using different rules.

The Right Hand Rule says the opposite: on each subinterval, evaluate the function at the right endpoint and make the rectangle that height. In the figure, the rectangle drawn on \([0,1]\) is drawn using \(f(1)\) as its height; this rectangle is labeled “RHR.”.

The Midpoint Rule says that on each subinterval, evaluate the function at the midpoint and make the rectangle that height. The rectangle drawn on \([1,2]\) was made using the Midpoint Rule, with a height of \(f(1.5)\text{.}\) That rectangle is labeled “MPR.”

These are the three most common rules for determining the heights of approximating rectangles, but one is not forced to use one of these three methods. The rectangle on \([3,4]\) has a height of approximately \(f(3.53)\text{,}\) very close to the Midpoint Rule. It was chosen so that the area of the rectangle is exactly the area of the region under \(f\) on \([3,4]\text{.}\) (Later you'll be able to figure how to do this, too.)

The following example will approximate the value of \(\int_0^4 (4x-x^2)\ dx\) using these rules.

Example5.3.4Using the Left Hand, Right Hand and Midpoint Rules

Approximate the value of \(\int_0^4 (4x-x^2)\ dx\) using the Left Hand Rule, the Right Hand Rule, and the Midpoint Rule, using 4 equally spaced subintervals.

Solution

Subsection5.3.1Summation Notation

It is hard to tell at this moment which is a better approximation: 10 or 11? We can continue to refine our approximation by using more rectangles. The notation can become unwieldy, though, as we add up longer and longer lists of numbers. We introduce summation notation to ameliorate this problem.

Suppose we wish to add up a list of numbers \(a_1\text{,}\) \(a_2\text{,}\) \(a_3\text{,}\) …, \(a_9\text{.}\) Instead of writing \begin{equation*} a_1+a_2+a_3+a_4+a_5+a_6+a_7+a_8+a_9, \end{equation*} we use summation notation and write \(\sum_{i=1}^9 a_i\text{.}\) The upper case sigma, \(Sigma\) represents the term ``sum.'' The index (counter) of summation in this example is $i$; any symbol can be used. By convention, the index takes on only the integer values between (and including) the lower and upper bounds. To the right of \(\Sigma\text{,}\) the expression \(a_i\) is called the summand. It tells us what we are summing. This is summarized in Equation (5.3.1). \begin{equation} \sum_{\underbrace{i=1}_{i \text{-index of summation}}}^{\overbrace{9}^\text{upper bound}} \underbrace{a_i}_\text{summand} \label{eq_sigmanotation}\tag{5.3.1} \end{equation}

Let's practice using this notation.

Example5.3.8Using summation notation

Let the numbers \(\{a_i\}\) be defined as \(a_i = 2i-1\) for integers \(i\text{,}\) where \(i\geq 1\text{.}\) So \(a_1 = 1\text{,}\) \(a_2 = 3\text{,}\) \(a_3 = 5\text{,}\) etc. (The output is the positive odd integers). Evaluate the following summations:

  1. \(\ds \sum_{i=1}^6 a_i \)
  2. \(\ds \sum_{i=3}^7 (3a_i-4) \)
  3. \(\ds \sum_{i=1}^4 (a_i)^2 \)

Solution

It might seem odd to stress a new, concise way of writing summations only to write each term out as we add them up. It is. The following theorem gives some of the properties of summations that allow us to work with them without writing individual terms. Examples will follow.

So \(x_{10} = x_1 + 9(4/16) = 2.25\text{.}\)

If we had partitioned \([0,4]\) into 100 equally spaced subintervals, each subinterval would have length \(\Delta x=4/100 = 0.04\text{.}\) We could compute \(x_{32}\) as \begin{equation*} x_{32} = x_1 + 31(4/100) = 1.24. \end{equation*}

(That was far faster than creating a sketch first.)

Given any subdivision of \([0,4]\text{,}\) the first subinterval is \([x_1,x_2]\text{;}\) the second is \([x_2,x_3]\text{;}\) the \(i^\text{ th }\) subinterval is \([x_i,x_{i+1}]\text{.}\)

When using the Left Hand Rule, the height of the \(i^\text{ th }\) rectangle will be \(f(x_i)\text{.}\)

When using the Right Hand Rule, the height of the \(i^\text{ th }\) rectangle will be \(f(x_{i+1})\text{.}\)

When using the Midpoint Rule, the height of the \(i^\text{ th }\) rectangle will be \(\ds f\left(\frac{x_i+x_{i+1}}2\right)\text{.}\)

Thus approximating \(\int_0^4(4x-x^2)\ dx\) with 16 equally spaced subintervals can be expressed as follows, where \(\Delta x = 4/16 = 1/4\text{:}\) Left Hand Rule: \(\ds \sum_{i=1}^{16} f(x_i)\Delta x\) Right Hand Rule: \(\ds \sum_{i=1}^{16} f(x_{i+1})\Delta x\) Midpoint Rule: \(\ds \sum_{i=1}^{16} f\left(\frac{x_i+x_{i+1}}2\right)\Delta x\) We use these formulas in the next two examples. The following example lets us practice using the Right Hand Rule and the summation formulas introduced in Theorem 5.3.9.

Example5.3.10Approximating definite integrals using sums

Approximate \(\int_0^4(4x-x^2)\ dx\) using the Right Hand Rule and summation formulas with 16 and 1000 equally spaced intervals.

Solution

Before the above example, we stated what the summations for the Left Hand, Right Hand and Midpoint Rules looked like. Each had the same basic structure, which was:

  1. each rectangle has the same width, which we referred to as \(\Delta x\text{,}\) and

  2. each rectangle's height is determined by evaluating \(f\) at a particular point in each subinterval. For instance, the Left Hand Rule states that each rectangle's height is determined by evaluating \(f\) at the left hand endpoint of the subinterval the rectangle lives on.

One could partition an interval \([a,b]\) with subintervals that did not have the same size. We refer to the length of the first subinterval as \(\Delta x_1\text{,}\) the length of the second subinterval as \(\Delta x_2\text{,}\) and so on, giving the length of the \(i^\text{ th }\) subinterval as \(\Delta x_i\text{.}\) Also, one could determine each rectangle's height by evaluating \(f\) at any point in the \(i^\text{ th }\) subinterval. We refer to the point picked in the first subinterval as \(c_1\text{,}\) the point picked in the second subinterval as \(c_2\text{,}\) and so on, with \(c_i\) representing the point picked in the \(i^\text{ th }\) subinterval. Thus the height of the \(i^\text{ th }\) subinterval would be \(f(c_i)\text{,}\) and the area of the \(i^\text{ th }\) rectangle would be \(f(c_i)\Delta x_i\text{.}\)

Summations of rectangles with area \(f(c_i)\Delta x_i\) are named after mathematician Georg Friedrich Bernhard Riemann, as given in the following definition.

Definition5.3.12Riemann Sum

Let \(f\) be defined on the closed interval \([a,b]\) and let \(\Delta x\) be a partition of \([a,b]\text{,}\) with \begin{equation*} a=x_1 \lt x_2 \lt \ldots \lt x_n \lt x_{n+1}=b. \end{equation*}

Let \(\Delta x_i\) denote the length of the \(i^\text{ th }\) subinterval \([x_i,x_{i+1}]\) and let \(c_i\) denote any value in the \(i^\text{ th }\) subinterval.

The sum \begin{equation*} \sum_{i=1}^n f(c_i)\Delta x_i \end{equation*} is a Riemann sum of \(f\) on \([a,b]\text{.}\)

<<SVG image is unavailable, or your browser cannot render it>>

Figure5.3.13An example of a general Riemann sum to approximate \(\int_0^4(4x-x^2)\ dx\text{.}\)

Figure 5.3.13 shows the approximating rectangles of a Riemann sum of \(\int_0^4(4x-x^2)\ dx\text{.}\) While the rectangles in this example do not approximate well the shaded area, they demonstrate that the subinterval widths may vary and the heights of the rectangles can be determined without following a particular rule.

“Usually” Riemann sums are calculated using one of the three methods we have introduced. The uniformity of construction makes computations easier. Before working another example, let's summarize some of what we have learned in a convenient way.

Key Idea5.3.14Riemann Sum Concepts

Consider \(\ds \int_a^b f(x) \ dx \approx \sum_{i=1}^n f(c_i)\Delta x_i\text{.}\)

  1. When the \(n\) subintervals have equal length, \(\ds \Delta x_i = \Delta x = \frac{b-a}n\text{.}\)

  2. The \(i^\text{ th }\) term of the partition is \(x_i = a + (i-1)\Delta x\text{.}\) (This makes \(x_{n+1} = b\text{.}\))

  3. The Left Hand Rule summation is: \(\ds \sum_{i=1}^n f(x_i)\Delta x\text{.}\)

  4. The Right Hand Rule summation is: \(\ds \sum_{i=1}^n f(x_{i+1})\Delta x\text{.}\)

  5. The Midpoint Rule summation is: \(\ds \sum_{i=1}^n f\left(\frac{x_i+x_{i+1}}{2}\right)\Delta x\text{.}\)

Let's do another example.

Example5.3.15Approximating definite integrals with sums

Approximate \(\int_{-2}^3 (5x+2)\ dx\) using the Midpoint Rule and 10 equally spaced intervals.

Solution

Notice in the previous example that while we used 10 equally spaced intervals, the number “10” didn't play a big role in the calculations until the very end. Mathematicians love to abstract ideas; let's approximate the area of another region using \(n\) subintervals, where we do not specify a value of \(n\) until the very end.

Example5.3.17Approximating definite integrals with a formula, using sums

Revisit \(\int_0^4(4x-x^2)\ dx\) yet again. Approximate this definite integral using the Right Hand Rule with \(n\) equally spaced subintervals.

Solution

This section started with a fundamental calculus technique: make an approximation, refine the approximation to make it better, then use limits in the refining process to get an exact answer. That is precisely what we just did.

Let's practice this again.

Example5.3.18Approximating definite integrals with a formula, using sums

Find a formula that approximates \(\int_{-1}^5 x^3\ dx\) using the Right Hand Rule and \(n\) equally spaced subintervals, then take the limit as \(n\to\infty\) to find the exact area.

Solution

Subsection5.3.2Limits of Riemann Sums

We have used limits to evaluate exactly given definite limits. Will this always work? We will show, given not–very–restrictive conditions, that yes, it will always work.

The previous two examples demonstrated how an expression such as \begin{equation*} \sum_{i=1}^n f(x_{i+1})\Delta x \end{equation*} can be rewritten as an expression explicitly involving \(n\text{,}\) such as \(32/3(1-1/n^2)\text{.}\)

Viewed in this manner, we can think of the summation as a function of \(n\text{.}\) An \(n\) value is given (where \(n\) is a positive integer), and the sum of areas of \(n\) equally spaced rectangles is returned, using the Left Hand, Right Hand, or Midpoint Rules.

Given a definite integral \(\int_a^b f(x)\ dx\text{,}\) let:

  • \(\ds S_L(n) = \sum_{i=1}^n f(x_i)\Delta x\text{,}\) the sum of equally spaced rectangles formed using the Left Hand Rule,

  • \(\ds S_R(n) = \sum_{i=1}^n f(x_{i+1})\Delta x\text{,}\) the sum of equally spaced rectangles formed using the Right Hand Rule, and

  • \(\ds S_M(n) = \sum_{i=1}^n f\left(\frac{x_i+x_{i+1}}{2}\right)\Delta x\text{,}\) the sum of equally spaced rectangles formed using the Midpoint Rule.

Recall the definition of a limit as \(n\to\infty\text{:}\) \(\lim\limits_{n\to\infty}S_L(n) = K\) if, given any \(\varepsilon>0\text{,}\) there exists \(N>0\) such that \begin{equation*} \abs{S_L(n)-K} \lt \varepsilon \text{ when } n\geq N. \end{equation*}

The following theorem states that we can use any of our three rules to find the exact value of a definite integral \(\int_a^b f(x)\ dx\text{.}\) It also goes two steps further. The theorem states that the height of each rectangle doesn't have to be determined following a specific rule, but could be \(f(c_i)\text{,}\) where \(c_i\) is any point in the \(i^\text{ th }\) subinterval, as discussed before Riemann Sums where defined in Definition 5.3.12.

The theorem goes on to state that the rectangles do not need to be of the same width. Using the notation of Definition 5.3.12, let \(\Delta x_i\) denote the length of the \(i^\text{ th }\) subinterval in a partition of \([a,b]\text{.}\) Now let \(\norm{\Delta x}\) represent the length of the largest subinterval in the partition: that is, \(\norm{\Delta x}\) is the largest of all the \(\Delta x_i\)'s. If \(\norm{\Delta x}\) is small, then \([a,b]\) must be partitioned into many subintervals, since all subintervals must have small lengths. “Taking the limit as \(\norm{\Delta x}\) goes to zero” implies that the number \(n\) of subintervals in the partition is growing to infinity, as the largest subinterval length is becoming arbitrarily small. We then interpret the expression \begin{equation*} \lim_{\norm{\Delta x}\to 0}\sum_{i=1}^nf(c_i)\Delta x_i \end{equation*} as “the limit of the sum of rectangles, where the width of each rectangle can be different but getting small, and the height of each rectangle is not necessarily determined by a particular rule.” The theorem states that this Riemann Sum also gives the value of the definite integral of \(f\) over \([a,b]\text{.}\)

We summarize what we have learned over the past few sections here.

  • Knowing the “area under the curve” can be useful. One common example is: the area under a velocity curve is displacement.

  • We have defined the definite integral, \(\int_a^b f(x)\ dx\text{,}\) to be the signed area under \(f\) on the interval \([a,b]\text{.}\)

  • While we can approximate a definite integral many ways, we have focused on using rectangles whose heights can be determined using: the Left Hand Rule, the Right Hand Rule and the Midpoint Rule.

  • Sums of rectangles of this type are called Riemann sums.

  • The exact value of the definite integral can be computed using the limit of a Riemann sum. We generally use one of the above methods as it makes the algebra simpler.

We first learned of derivatives through limits then learned rules that made the process simpler. We know of a way to evaluate a definite integral using limits; in the next section we will see how the Fundamental Theorem of Calculus makes the process simpler. The key feature of this theorem is its connection between the indefinite integral and the definite integral.

Subsection5.3.3Exercises