Skip to main content

Section Riemann Sums and Definite Integrals

You know how to compute the areas of certain shapes (rectangles, triangles, etc.) using formulas, but what about unusual shapes like the area trapped under a curve and above the x-axis or the area trapped between two curves? If we have a function that is always above the \(x\)-axis on the interval \([a,b]\text{,}\) then Riemann sums give us a way to compute the area that is between the vertical lines \(x=a\) and \(x=b\text{,}\) above the \(x\)-axis, and under the curve.

Example 4.1.

Determine the area under the curve \(f(x) = x^2+1,\) above the x-axis, and between the vertical lines \(x=0\) and \(x=2.\)

Graph \(f\) and subdivide \([0,2]\) into 4 intervals each of width \(\frac{1}{2}\) and with bases,

\begin{equation*} [0,\frac{1}{2}], [\frac{1}{2},1], [1,\frac{3}{2}], \mbox{ and } [\frac{3}{2},2]. \end{equation*}

Each has width \(\frac{1}{2}.\) These intervals are the bases of 4 rectangles. Make the height of each rectangle the value of \(f\) at the right end point of the base of that rectangle. Let's call the sum of the areas of these four rectangles \(U_4.\) (If you are unfamiliar with summation notation, \(\sum\text{,}\) see the appendix Summation Formulas  for a review.)

The sum of these rectangles is given by:

\begin{align*} U_4 \amp = \frac{1}{2} \left( (\frac{1}{2})^2 + 1 \right) + \frac{1}{2} \left( (\frac{2}{2})^2 + 1 \right) + \frac{1}{2} \left( (\frac{3}{2})^2 + 1 \right) + \frac{1}{2} \left( (\frac{4}{2})^2 + 1 \right)\\ \amp = \frac{1}{2} \left[ \left( (\frac{1}{2})^2 + 1 \right) + \left( (\frac{2}{2})^2 + 1 \right) + \left( (\frac{3}{2})^2 + 1 \right) + \left( (\frac{4}{2})^2 + 1 \right) \right]\\ \amp = \frac{1}{2} \sum_{i=1}^4 \left( (\frac{i}{2})^2 + 1 \right) = \frac{23}{4} = 5.75 \end{align*}

This estimate is too large because each rectangle we chose had area larger than the portion of the curve it approximated. Therefore, we make an estimate that is too small and average the two! An estimate that would be too small would have four rectangles each with the same bases, but with height the value of \(f\) at the left endpoint of its base. Let's call the sum of the areas of these four rectangles \(L_4.\)

\begin{align*} L_4 \amp = \frac{1}{2} \left( (\frac{0}{2})^2 + 1 \right) + \frac{1}{2} \left( (\frac{1}{2})^2 + 1 \right) + \frac{1}{2} \left( (\frac{2}{2})^2 + 1 \right) + \frac{1}{2} \left( (\frac{3}{2})^2 + 1 \right)\\ \amp = \frac{1}{2} \left[ \left( (\frac{0}{2})^2 + 1 \right) + \left( (\frac{1}{2})^2 + 1 \right) + \left( (\frac{2}{2})^2 + 1 \right) + \left( (\frac{3}{2})^2 + 1 \right) \right]\\ \amp = \frac{1}{2} \sum_{i=0}^3 \left( (\frac{i}{2})^2 + 1 \right) = \frac{15}{4} = 3.75 \end{align*}

What you have just computed are referred to as upper and lower Riemann sums, respectively. Our estimate based on averaging the two would yield

\begin{equation*} \frac{U_4+L_4}{2} = 4.75. \end{equation*}
Problem 4.2.

Let \(f(x) = x^2 + 1.\) Divide the interval \([0,2]\) into eight equal divisions,

\begin{equation*} \{0,\frac{1}{4}, \frac{1}{2}, \frac{3}{4}, 1, \dots , \frac{7}{4}, 2 \} \end{equation*}

and compute the upper and lower Riemann sums of \(f.\)

Subdividing an interval in this way is called partitioning the interval and the sub-intervals created via a partition may be of differing widths as indicated in the next definition.

Definition 4.3.

A partition of the interval [a,b] is a collection of points, \(\{ x_0, x_1, \dots, x_n \}\) satisfying, \(a = x_0 \lt x_1 \lt x_2 \lt \dots \lt x_{n-1} \lt x_n = b.\)

Definition 4.4.

If \(f\) is a function defined on the interval \([a,b]\) and \(P=\{x_0, x_1, \dots, x_n \}\) is a partition of \([a,b],\) then a Riemann sum of f over [a,b] is defined by

\begin{gather*} R(P,f) = \sum_{i=1}^n (x_i - x_{i-1}) \cdot f(\hat{x_i}) \end{gather*}

where \(\hat{x_i} \in [x_{i-1},x_i].\)

In the definition of Riemann sum, \(\hat{x}_i\) can be any value in the interval \([x_{i-1}, x_i].\) But look back at our example. When we computed \(U_4\) we always chose \(\hat{x}_i\) so that \(f(\hat{x}_i)\) was the maximum for \(f\) on this interval to assure that our approximation was more than the desired area. When \(\hat{x}\) is chosen in this manner, we call our sum an upper Riemann sum. When we computed \(L_4\) we always chose \(\hat{x}_i \in [x_{i-1}, x_i]\) so that \(f(\hat{x}_i)\) was the minimum for \(f\) on that interval to assure that our approximation was less than the desired area. When \(\hat{x}\) is chosen in this manner, we call our sum a lower Riemann sum.

Problem 4.5.

Compute upper and lower Riemann sums for \(g(x) = x^2 + 3x\) on \([0,1]\) using the partition, \(P = \{0,\frac{1}{3}, \frac{2}{3}, 1\}.\)

Problem 4.6.

Compute upper and lower Riemann sums for \(g(x) = -3x^3 + 3x\) over \([0,1]\) using the partition, \(P = \{0,\frac{1}{4}, \frac{1}{2}, \frac{3}{4}, 1 \}.\) The heights of our rectangles do not always occur at the endpoints of the sub-intervals of our partition.

Returning to \(f(x) = x^2+1\) on \([0,2]\text{,}\) continue to subdivide our interval into \(n\) subdivisions of equal length, letting \(n = 10, n=100, n=1000, \dots\) and labeling our partitions as \(P_{10}, P_{100}, P_{1,000}, \dots.\) If we label our lower sums corresponding to these partitions as \(L_{10}, L_{100}, L_{1,000}, \dots\) and label our upper sums as \(U_{10}, U_{100}, U_{1,000}, \dots\text{,}\) then we would have

\begin{equation*} L_4 \lt L_{10} \lt L_{100} \lt L_{1,000} \lt \dots \lt U_{1,000} \lt U_{100} \lt U_{10} \lt U_4. \end{equation*}

Furthermore, \(L_{1,000}\) and \(U_{1,000}\) should be very close together and very close the area we desire to compute.

By increasing the number of rectangles and taking the limit as the number of rectangles tends to infinity, we will determine the exact area. Our notation for this area is:

\begin{equation*} \dsp \mbox{ Area } =\int_0^2 x^2+1 \ dx = \lim_{n \to \infty} U_n = \lim_{n \to \infty} L_n. \end{equation*}

For our function, these two limits are equal, but there are functions where these limits are not equal. When they are equal, we say \(f\) is integrable over the interval. If they are not equal, we say that \(f\) is not integrable. We refer to \(\int_0^2 x^2+1 \ dx\) as “the definite integral from 0 to 2 of \(x^2+1\text{.}\)

Problem 4.7.

Give an example of a function and an interval where the function will not be integrable over that interval.

We now the consider the upper Riemann sum for \(f(x) = x^2 + 1,\) above the x-axis, and between the vertical lines \(x=0\) and \(x=2\) assuming \(n\) equal divisions of the interval \([0,2].\) Our partition of \(n\) divisions is now,

\begin{equation*} P = \big\{ 0 , \frac{2}{n}, \frac{4}{n}, \dots , \frac{2(n-1)}{n}, 2 \big\}, \end{equation*}

and our upper Riemann sum \(U_n\) that approximates the area is given by:

\begin{align*} U_n \amp =\frac{2}{n} \sum_{i=1}^n \left( (\frac{2i}{n})^2 + 1 \right)\\ \amp =\frac{2}{n} \left[ \sum_{i=1}^n \frac{4i^2}{n^2} +\sum_{i=1}^n 1 \right]\\ \amp =\frac{2}{n} \sum_{i=1}^n \frac{4i^2}{n^2} + \frac{2}{n} \sum_{i=1}^n 1\\ \amp =\frac{8}{n^3} \sum_{i=1}^n i^2 + \frac{2}{n} \cdot n \,\,\, \mbox{Summation Formula}\\ \amp =\frac{8}{n^3}\frac{n(n+1)(2n+1)}{6} + 2\\ \amp =\frac{4n(n+1)(2n+1)}{3n^3} + 2\\ \amp =\frac{8n^3 + 12n^2 + 4n}{3n^3} + 2\\ \amp =\frac{8n^3}{3n^3} + \frac{12n^2}{3n^3} + \frac{4n}{3n^3} + 2\\ \amp =\frac{8}{3} + \frac{12}{3n} + \frac{4}{3n^2} + 2 \end{align*}

Now take the limit of the Riemann sums as the number of divisions tends to infinity to get the exact area under the curve.

\begin{align*} \mbox{ Area } \amp = \int_0^2 x^2+1 \ dx\\ \amp = \lim_{n \rightarrow \infty} U_n\\ \amp = \lim_{n \rightarrow \infty} \frac{8}{3} + \frac{12}{3n} + \frac{4}{3n^2} + 2\\ \amp = \lim_{n \rightarrow \infty} \frac{8}{3} + \lim_{n \rightarrow \infty}\frac{12}{3n} + \lim_{n \rightarrow \infty} \frac{4}{3n^2} + \lim_{n \rightarrow \infty} 2\\ \amp = \frac{8}{3} + 2\\ \amp = 4 \frac{2}{3} \end{align*}

Look back at your answers from Problem 4.2 (\(U_8\) and \(L_8\)) and the solutions from our Example (\(U_4\) and \(L_4\)). Just as we expect,

\begin{equation*} L_4 \lt L_8 \lt 4 \frac{2}{3} \lt U_8 \lt U_4. \end{equation*}

We denote the number \(4 \frac{2}{3}\) by \(\dsp \int_0^2 x^2 + 1 \; dx\) and call this the definite integral of \(x^2 + 1\) from \(x=0\) to \(x=2.\) What we have just done motivates the following definition of the definite integral.

Definition 4.8.

If \(f\) is a function defined on \([a,b]\) so that \(lim_{n \rightarrow \infty} L_n\) and \(lim_{n \rightarrow \infty} U_n\) both exist and are equal, then we say \(f\) is integrable on [a,b] and we define the definite integral by \(\int_a^b f(x) \; dx = \lim_{n \rightarrow \infty} L_n.\) We refer to \(a\) as the lower limit of integration and \(b\) as the upper limit of integration.

For each of the next few problems, you will require some of the summation formulas from the appendix Summation Formulas .

Problem 4.9.

Repeat this procedure, but compute the area using lower Riemann sums. That is, compute and simplify \(L_n\) (the lower Riemann sum of \(f(x) = x^2+1\) on the interval \([0,2]\) assuming \(n\) equal divisions) and then compute \(lim_{n \rightarrow \infty} L_n.\)

Problem 4.10.

Compute each integral using Definition 4.8 (Riemann sums).

  1. \(\dsp \int_0^1 2x \; dx\)

  2. \(\dsp \int_0^1 x^3 \; dx\)

  3. \(\dsp \int_0^2 2x^2 - 3 \; dx\)

Problem 4.11.

Compute the area trapped between the curves \(y=x\) and \(y=x^2\) using Definition 4.8.

Which functions are integrable? That is a question better-suited for a course called Advanced Calculus or Real Analysis, but let's give the quick-and-dirty answer without proof. By Definition 4.8 a function is integrable if a certain limit exists, but this can be difficult to compute. It can be shown that every differentiable function is continuous and every continuous function is integrable. Thus,

\begin{equation*} f \mbox{ is differentiable } \Rightarrow f \mbox{ is continuous } \Rightarrow f \mbox{ is integrable} . \end{equation*}

The next two theorems state this formally.

We defined integrals in terms of Riemann sums and Riemann sums in terms of partitions of the interval. Therefore the integral \(\int_a^b f(x) \ dx\) (see Definition 4.8) is only defined when \(a \lt b.\) The following definitions define definite integrals where the lower limit of integration is larger than the upper limit of integration or the two endpoints of integration are equal.

Definition 4.14.

If \(a\) and \(b\) are numbers with \(a\lt b\) and \(f\) is integrable on \([a,b]\) then:

  1. \(\dsp \int_b^a f(x) \; dx = - \int_a^b f(x) \; dx\) and

  2. \(\dsp \int_a^a f(x) \; dx = 0.\)

The next theorem we discuss can be proved via Riemann sums, but we will leave that for your first course in Real Analysis as well. That's where the real fun begins.

Problem 4.16.

Compute each of the following integrals using Definition 4.8 (Riemann Sums). This illustrates Theorem 4.15, the Sum Rule for definite integrals.

  1. \(\dsp \int_0^1 x^2 \; dx\)

  2. \(\dsp \int_1^2 x^2 \; dx\)

  3. \(\dsp \int_0^2 x^2 \; dx\)