Sampled Sums

Let $f$ be a continuous, real-valued function on some closed interval $[a, b]$. A sampled sum for $f$ on $[a, b]$ is the total signed area of a collection of abutting rectangles whose heights are function values of $f$. See below for definitions.



Click to select a function.

Click to select a type of sampled sum.


Click the diagram to add points to the splitting, or use the field below to create an equal-length splitting. (Clicking on an existing point removes that point from the splitting.)

Intervals = ,
Estimate = ,
Error = .


Definitions

Assume $[a, b]$ is a closed, bounded real interval and \(n\) is a positive integer. A splitting of \([a, b]\) is a finite subset \(\Pi = \{x_{i}\}_{i=0}^{n}\) of \([a, b]\) that contains both endpoints. Re-indexing if necessary, we may assume \[ a = x_{0} \lt x_{1} \lt \dots \lt x_{n-1} \lt x_{n} = b. \] For each \(i\) such that $0 \leq i < n$, call $I_{i} = [x_{i}, x_{i+1}]$ the $i$th piece, and let $\Delta x_{i} = x_{i+1} - x_{i}$ be its length.

If \(\Pi\) is a splitting of \([a, b]\), a set \(x^{*} = \{x_{i}^{*}\}_{i=0}^{n-1}\) such that \(x_{i} \leq x_{i}^{*} \leq x_{i+1}\) for each \(i\) is called a set of sample points from \(\Pi\). The corresponding sampled sum from \(\Pi\) is \[ S(f, \Pi, x^{*}) = \sum_{i=0}^{n-1} f(x_{i}^{*})\, \Delta x_{i}. \]

Geometrically, split $[a, b]$ into pieces. Select a sample point from each piece, evaluate the function $f$ at this point, and construct the rectangle of this height lying over the $i$th piece. The resulting sampled sum is the total signed area of these rectangles; that is, if $f(x_{i}^{*}) \lt 0$, we count the area of that rectangle negatively.

One other sum is represented geometrically by the signed areas of trapezoids. The average of the left- and right-hand sums, called the trapezoid sum, is the signed area enclosed by secant lines. That is, draw a dot on the graph of $f$ over each point of the splitting, and connect the dots in order. The trapezoid sum is the resulting signed area.

Relative Accuracy

If $S$ is a sampled sum for $f$ on the interval $[a, b]$, the difference \[ E = S - \int_{a}^{b} f(x)\, dx \] is called the error. An overestimate has positive error; an underestimate has negative error. The smaller the absolute error \(|E|\), the more accurate the approximation.

For twice-differentiable functions whose second derivative is continuous, and for equal-length splittings with $n$ pieces, the left-hand, right-hand, maximum, and minimum sums have error roughly proportional to $1/n$. That is, doubling the number of intervals roughly halves the error.

For the same functions and splittings, the trapezoid and midpoint methods have error roughly proportional to $1/n^{2}$. That is, doubling the number of intervals roughly quarters the error. Moreover, the midpoint error is roughly minus one-half the trapezoid error. (The weighted average \[ \texttt{PARA}(f, \Pi) = \tfrac{1}{3}\bigl(\texttt{TRAP}(f, \Pi) + 2\texttt{MID}(f, \Pi)\bigr), \] called the parabolic sum, cancels these second-order errors and is sufficiently accurate for industrial use. This program does not investigate the parabolic sum.)

Qualitative Properties

Try to establish the properties stated below; first convince yourself they are true, then give reasons based on the definitions.

  1. The maximum sum always overestimates, and the minimum sum always underestimates.
  2. If $f$ is increasing on $[a, b]$, then the left-hand sum underestimates and the right-hand sum overestimates. What can you say if $f$ is decreasing?
  3. If $f$ is convex (concave up) on $[a, b]$, then the midpoint sum underestimates and the trapezoid sum overestimates. What can you say if $f$ is concave (down)?