Tutorials › Calculus I › Predicting Cumulative Totals From Sampled Rates

Calculus-Based Model Construction · Tutorial 1480 of 1495

Predicting Cumulative Totals From Sampled Rates

Use sampled rates to estimate accumulated change, choose an appropriate approximation, and interpret how the spacing of measurements affects the result.

Advanced 10 min read

What You'll Learn

  • Distinguish left-rectangle, right-rectangle, and trapezoidal estimates of accumulated change.
  • Apply the formulas when sampling intervals are equal or unequal.
  • Keep rate, time, and accumulated-change units consistent.
  • Explain why finer sampling usually improves estimates under suitable smoothness conditions.
  • Use a bound on the trapezoidal error when the rate has a bounded second derivative.

From Rate Measurements to Cumulative Change

A rate describes how quickly a quantity changes. If the rate is known continuously over a time interval, accumulated change is represented by the integral of that rate. In practice, measurements are often available only at selected times. The rate between those times is not directly recorded, so the total change must be estimated.

The basic strategy is to approximate the rate between observations by a simple shape. A rectangle treats the rate as constant over an interval; a trapezoid treats it as changing linearly between the measured endpoint rates. The estimated accumulated change is then the area of the chosen shapes.

Definition: Suppose rate measurements \(r_i=r(t_i)\) are recorded at times \(t_0<t_1<\cdots<t_n\). An estimate of accumulated change from \(t_0\) to \(t_n\) is obtained by approximating the rate on each interval \([t_i,t_{i+1}]\), multiplying the representative rate by the interval length, and adding the resulting changes.

If the quantity is a stock \(C(t)\), its estimated value at the final time is the initial stock plus the estimated change. The rate and time units must combine to give the units of the accumulated quantity: for example, litres per minute multiplied by minutes gives litres.

Rectangle and Trapezoid Formulas

Write \(h_i=t_{i+1}-t_i\) for the length of interval \(i\). The left-rectangle method uses the rate measured at the interval's left endpoint; the right-rectangle method uses the right endpoint. The trapezoidal method uses the average of the two endpoint rates.

$$ L=\sum_{i=0}^{n-1} r_i h_i,\qquad R=\sum_{i=0}^{n-1} r_{i+1}h_i,\qquad T=\sum_{i=0}^{n-1}\frac{r_i+r_{i+1}}{2}h_i. $$

Here \(L\), \(R\), and \(T\) denote estimates of accumulated change, not rates. If rates can be negative, these formulas estimate net change: positive and negative contributions are added with their signs. If all rates are nonnegative, the estimates represent nonnegative accumulated change.

For equally spaced measurements, every interval has the same length \(h\), so the formulas simplify. In particular, the trapezoidal estimate can be written as \(h\) times half the first rate, all interior rates, and half the last rate:

$$ T=h\left(\frac{r_0}{2}+r_1+\cdots+r_{n-1}+\frac{r_n}{2}\right). $$

When intervals are unequal, use each interval's own length \(h_i\). A single average interval length cannot generally replace those individual widths: a rate measured across a longer interval contributes over more time.

Worked Example: Comparing Estimates on Equal Intervals

A production rate is measured in litres per minute at the times below. Estimate the production from minute 0 to minute 6 using left rectangles, right rectangles, and trapezoids.

$$ \begin{array}{c| ოთხ} t\text{ (min)}&0&2&4&6\\ r(t)\text{ (L/min)}&3&5&4&2 \end{array} $$

Each interval has length \(h=2\) min. The left-rectangle estimate uses the rates at minutes 0, 2, and 4:

$$ L=(3+5+4)(2)=12(2)=24\text{ L}. $$

The right-rectangle estimate uses the rates at minutes 2, 4, and 6:

$$ R=(5+4+2)(2)=11(2)=22\text{ L}. $$

For trapezoids, compute each interval's average rate and multiply by its width:

$$ T=\frac{3+5}{2}(2)+\frac{5+4}{2}(2)+\frac{4+2}{2}(2) =8+9+6=23\text{ L}. $$

As an arithmetic check, the trapezoidal estimate is the average of the left and right estimates here: \((24+22)/2=23\) L. This relationship holds on an equally spaced grid because each interior rate appears once in each rectangle sum, while the two endpoint rates appear in only one. The units also check: \((\text{L/min})(\text{min})=\text{L}\).

Why the Trapezoidal Formula Works

The trapezoidal method corresponds to a specific assumption about the unobserved rate: on each interval, the rate varies linearly between its endpoint measurements. For an interval \([a,b]\), with endpoint rates \(r(a)\) and \(r(b)\), the line joining those values has average height \(\bigl(r(a)+r(b)\bigr)/2\). Its area is therefore the average height times the width.

Derivation: The linear function joining the endpoint values is \(p(t)=r(a)+\frac{r(b)-r(a)}{b-a}(t-a)\). Integrating this line gives \(\int_a^b p(t)\,dt=\frac{r(a)+r(b)}{2}(b-a)\). Thus the trapezoidal contribution is exactly the accumulated change under the linearly interpolated rate.

This derivation explains both the formula and its limitation. A trapezoid is exact for a rate that is linear on the interval, but a real rate may curve or vary irregularly between observations. The measured endpoints alone do not reveal precisely what happened in between.

Worked Example: Unequal Sampling Intervals

Suppose a service process has rates measured in jobs per hour as follows. Estimate its accumulated work from time 0 to time 4 with left rectangles, right rectangles, and trapezoids.

$$ \begin{array}{c|cccc} t\text{ (h)}&0&1&3&4\\ r(t)\text{ (jobs/h)}&10&14&8&12 \end{array} $$

The interval lengths are \(1\), \(2\), and \(1\) hours. For the left estimate, use the rate at the start of each interval:

$$ L=10(1)+14(2)+8(1)=10+28+8=46\text{ jobs}. $$

For the right estimate, use the rate at the end of each interval:

$$ R=14(1)+8(2)+12(1)=14+16+12=42\text{ jobs}. $$

For trapezoids, average the endpoint rates separately on each interval, then multiply by that interval's length:

$$ T=\frac{10+14}{2}(1)+\frac{14+8}{2}(2)+\frac{8+12}{2}(1) =12+22+10=44\text{ jobs}. $$

The units are jobs because each rate in jobs per hour is multiplied by an interval in hours. If we assume the rate is linear on each interval, the trapezoidal calculation is not merely an estimate: it is the exact accumulated work under that piecewise-linear rate model. For example, on the two-hour interval from time 1 to time 3, the assumed average rate is \((14+8)/2=11\) jobs per hour, giving \(11(2)=22\) jobs.

How the Sampling Interval Affects an Estimate

Shorter intervals generally give the approximation more opportunities to track changes in the rate. They do not, by themselves, guarantee that a particular estimate moves closer to the true total: the shape of the rate between observations matters. Under a smoothness assumption, however, the effect can be quantified for trapezoids.

Theorem: Let \(r\) have a continuous second derivative on each sampling interval. If \(\lvert r''(t)\rvert\le M\) throughout \([t_0,t_n]\), the composite trapezoidal estimate satisfies \(\left|\int_{t_0}^{t_n}r(t)\,dt-T\right|\le\frac{M}{12}\sum_{i=0}^{n-1}h_i^3\). For equal spacing \(h\), this gives \(\left|\int_{t_0}^{t_n}r(t)\,dt-T\right|\le\frac{M(t_n-t_0)h^2}{12}\).

To justify the bound on one interval \([a,b]\), let \(p\) be the line through the endpoint values. The interpolation remainder for a twice-differentiable function gives, at each interior \(t\), \(r(t)-p(t)=\frac{r''(\xi)}{2}(t-a)(t-b)\) for some \(\xi\) between \(a\) and \(b\). Consequently, if \(\lvert r''\rvert\le M\), then \(\lvert r(t)-p(t)\rvert\le\frac{M}{2}(t-a)(b-t)\). Integrating this inequality over the interval gives

$$ \left|\int_a^b r(t)\,dt-\int_a^b p(t)\,dt\right| \le \frac{M}{2}\int_a^b(t-a)(b-t)\,dt =\frac{M(b-a)^3}{12}. $$

The integral of \(p\) is the trapezoidal contribution. Applying the one-interval bound to every interval and adding the bounds proves the stated composite estimate. With equal spacing, there are \(n=(t_n-t_0)/h\) intervals; thus \(nMh^3/12=M(t_n-t_0)h^2/12\). The bound shows why reducing the spacing can reduce the possible trapezoidal error when the curvature stays bounded. It does not apply without the stated smoothness and derivative bound.

Worked Example: Comparing Coarse and Fine Sampling

Consider the rate \(r(t)=t^2\) on \(0\le t\le2\), measured in units per hour, with \(t\) in hours. This known rate lets us compare sampled estimates with the exact accumulated change.

Using only the endpoint measurements, \(r(0)=0\) and \(r(2)=4\), the trapezoidal estimate is

$$ T_{\text{coarse}}=\frac{0+4}{2}(2)=4\text{ units}. $$

The exact change is \(\int_0^2t^2\,dt=[t^3/3]_0^2=8/3\) units, so the coarse estimate is high by \(4-8/3=4/3\) units.

Now add a measurement at \(t=1\), where \(r(1)=1\). The two trapezoidal contributions are

$$ T_{\text{fine}}=\frac{0+1}{2}(1)+\frac{1+4}{2}(1) =\frac12+\frac52=3\text{ units}. $$

The fine estimate is high by \(3-8/3=1/3\) unit, less than the coarse estimate's error. The error bound also checks: \(r''(t)=2\), so take \(M=2\). With one interval of width 2, the bound is \(2(2^3)/12=4/3\) units; with two intervals of width 1, it is \(2(1^3+1^3)/12=1/3\) unit. In this example both bounds equal the actual errors.

Choosing and Reporting an Estimate

A rectangle estimate can be informative when there is a meaningful reason to treat the rate as constant over each interval, or when a one-sided estimate is specifically useful. If the rate is increasing, left rectangles fall below the accumulated change and right rectangles rise above it; if the rate is decreasing, the roles reverse. These comparisons require monotonicity throughout the intervals, not just a visual trend between a few measurements.

The trapezoidal estimate uses both endpoint measurements and often gives a reasonable approximation when the rate changes gradually. Yet it is not automatically more accurate for every set of data. In particular, knowing that endpoint values differ does not show whether the rate between them is nearly linear, sharply curved, or variable in some other way. More frequent measurements reduce the width over which such unobserved behavior can occur, but no method can recover details that the observations and assumptions do not determine.

When reporting a cumulative prediction, state the method and the sampling intervals, include units, and distinguish estimated change from the final cumulative total. For instance, if a stock begins at \(C(t_0)\), its estimated final value is \(C(t_0)+T\) when \(T\) is the trapezoidal estimate of net change. Do not report the estimate with unjustified precision: the arithmetic may be exact while the approximation of the unmeasured rate remains uncertain.

A Common Calculation Error

A frequent mistake is to average endpoint rates for a trapezoid but forget to multiply by the time interval. In the first example, the three average rates are \(4\), \(4.5\), and \(3\) L/min. Adding them gives \(11.5\), but this is still a sum of rates, not a volume. Each interval is two minutes long, so the correct calculation is

$$ 4(2)+4.5(2)+3(2)=8+9+6=23\text{ L}. $$

Always multiply a representative rate by its own interval length before adding interval contributions. This also prevents a second error: using one common width when the measurement times are unevenly spaced.

Check Your Understanding

Try each question before checking the formulas above.

  1. For rates \(2\), \(6\), and \(4\) units per minute measured at minutes 0, 1, and 3, calculate the left-rectangle, right-rectangle, and trapezoidal estimates.
  2. Why must the trapezoidal calculation use separate interval lengths when measurement times are not equally spaced?
  3. Under what assumption is a trapezoidal contribution exact for the rate on an interval?
  4. For an increasing rate throughout an interval, which rectangle estimate is above the true accumulated change, and which is below?
  5. What information about the rate is needed to apply the stated trapezoidal error bound?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon