Tutorials › Calculus II › Quadrature from Tabulated Measurements

Quadrature and Error Bounds · Tutorial 367 of 998

Quadrature from Tabulated Measurements

Learn to check a measurement table’s spacing and panel count, select a suitable quadrature rule, and calculate and check an integral estimate.

Intermediate 11 min read

What You'll Learn

  • Distinguish the number of measurements from the number of panels.
  • Check equal spacing before using composite trapezoidal or Simpson weights.
  • Apply the composite trapezoidal weights to tabulated measurements.
  • Check that the panel count is even before applying composite Simpson’s rule.
  • Combine Simpson rules appropriately when an odd panel count is handled using the three-eighths rule.
  • Keep track of the units and scope of a numerical estimate.

From a Measurement Table to an Integral Estimate

A table of measurements can describe a quantity that changes over an interval: flow rate over time, force along a distance, or concentration over a duration. If the values are measurements of a function, integrating that function gives an accumulated quantity. But a table usually does not specify the function between measured points. Quadrature provides a way to estimate the integral from the available values.

The calculation is only appropriate after checking the table’s structure. In particular, count the panels between measurements, verify whether the \(x\)-values are equally spaced, and make sure the chosen rule permits that panel count. A correctly applied formula cannot repair a mismatch between its assumptions and the data.

Key idea: For equally spaced measurements, the composite trapezoidal rule can use any positive integer number of panels. The composite Simpson rule using Simpson’s one-third weights requires an even number of panels.

Measurements, Panels, and Spacing

Suppose measurements are recorded at \(x_0,x_1,\ldots,x_n\), with corresponding values \(y_i=f(x_i)\). There are \(n+1\) measurements and \(n\) panels: panel \(i\) is the interval \([x_{i-1},x_i]\), for \(i=1,\ldots,n\). This distinction matters because Simpson’s condition is about the number of panels, not the number of measurements.

The measurements are equally spaced if the differences between consecutive \(x\)-values are all the same positive number \(h\):

$$ x_i-x_{i-1}=h \quad\text{for } i=1,\ldots,n. $$

When the table is equally spaced, the common width can be checked from the endpoints using \(h=(x_n-x_0)/n\), and then compared with each consecutive difference. The endpoint calculation alone is not enough: unequal gaps can average to the same overall width.

If the gaps differ, the standard equal-spacing composite formulas do not apply as written. The trapezoidal rule can still be applied panel by panel using each actual width; the earlier material on unequal-width trapezoidal panels gives that form. Do not insert a single average width into the equal-spacing Simpson formula.

The Composite Rules and Their Weights

For equally spaced data, the composite trapezoidal rule is

$$ \int_{x_0}^{x_n} f(x)\,dx \approx h\left[ \frac{y_0}{2} +\sum_{i=1}^{n-1}y_i +\frac{y_n}{2} \right]. $$

It gives half weight to the two endpoint measurements and full weight to each interior measurement. Equivalently, it adds the trapezoidal estimate on every panel. No even-panel condition is required; \(n\) can be any positive integer.

For an even number \(n\) of equally spaced panels, the composite Simpson one-third rule is

$$ \int_{x_0}^{x_n} f(x)\,dx \approx \frac{h}{3} \left[ y_0+y_n +4\sum_{\substack{i=1\\ i\text{ odd}}}^{n-1}y_i +2\sum_{\substack{i=2\\ i\text{ even}}}^{n-2}y_i \right]. $$

Thus the endpoints have weight \(1\), interior measurements with odd indices have weight \(4\), and interior measurements with even indices have weight \(2\), all multiplied by \(h/3\). These weights alternate across the table. The formula requires equal spacing and an even number of panels, so the number of measurements must be odd.

Why the Composite Weights Have This Pattern

The composite formulas are obtained by adding estimates on smaller intervals. This also explains their weights. On a single trapezoidal panel of width \(h\), with endpoint values \(y_{i-1}\) and \(y_i\), the estimate is \(h(y_{i-1}+y_i)/2\). Adding these expressions over all panels gives the composite trapezoidal rule.

$$ \sum_{i=1}^{n}\frac{h}{2}(y_{i-1}+y_i) = h\left[ \frac{y_0}{2} +y_1+\cdots+y_{n-1} +\frac{y_n}{2} \right]. $$

Each interior value occurs in two neighboring panels, each time with coefficient \(h/2\), so its combined coefficient is \(h\). Each endpoint occurs just once and retains coefficient \(h/2\).

For Simpson’s rule, apply the one-third rule to consecutive pairs of panels. Each two-panel block contributes \(h(y_{i-2}+4y_{i-1}+y_i)/3\), where \(i\) is even. Adding these blocks gives the composite weights: an interior odd-indexed point belongs to one block as its middle point and receives weight \(4\); an interior even-indexed point is shared by two blocks as an endpoint and receives \(1+1=2\). The first and last measurements occur only once as block endpoints. The blocks cover all panels without a leftover panel only when \(n\) is even.

Practical check: Count the gaps between the first and last measurement. If there are \(n+1\) measurements, there are \(n\) panels. For Simpson’s one-third rule, \(n\) must be even—not \(n+1\).

Worked Examples

Worked Example: Trapezoidal Estimate from Five Measurements

A flow rate \(q(t)\), measured in liters per minute, is recorded at these equally spaced times:

\(t\) (minutes)00.51.01.52.0
\(q(t)\) (liters per minute)1.01.41.81.92.1

There are \(5\) measurements, hence \(4\) panels. The consecutive time differences are all \(0.5\) minute, so \(h=0.5\). The composite trapezoidal rule applies:

$$ \int_0^2 q(t)\,dt \approx 0.5\left[ \frac{1.0}{2}+1.4+1.8+1.9+\frac{2.1}{2} \right]. $$

The bracket is \(0.5+1.4+1.8+1.9+1.05=6.65\). Therefore the estimate is \(0.5(6.65)=3.325\) liters.

Check: The four panel estimates are \(0.5(1.0+1.4)/2=0.600\), \(0.5(1.4+1.8)/2=0.800\), \(0.5(1.8+1.9)/2=0.925\), and \(0.5(1.9+2.1)/2=1.000\). Their sum is \(0.600+0.800+0.925+1.000=3.325\) liters, agreeing with the weighted formula. The time unit cancels the “per minute” in the flow-rate unit.

Worked Example: Simpson Estimate with an Even Panel Count

A measured quantity \(g(x)\), in newtons, is recorded at equally spaced positions \(x\), in meters:

\(x\) (meters)01234
\(g(x)\) (newtons)25476

There are \(5\) measurements and \(4\) panels. The spacing is \(h=1\) meter, and \(4\) is even, so Simpson’s one-third rule is permitted:

$$ \int_0^4 g(x)\,dx \approx \frac{1}{3}\left[2+6+4(5+7)+2(4)\right]. $$

The endpoint sum is \(2+6=8\); the odd-indexed interior sum is \(5+7=12\), contributing \(4(12)=48\); and the even-indexed interior contribution is \(2(4)=8\). Thus the estimate is \((8+48+8)/3=64/3\), or approximately \(21.333\) newton-meters.

Check: Applying the two-panel Simpson rule to the first pair of panels gives \((2+4(5)+4)/3=26/3\). Applying it to the second pair gives \((4+4(7)+6)/3=38/3\). Their sum is \(26/3+38/3=64/3\) newton-meters, matching the composite weights.

Worked Example: Five Panels and a Simpson Three-Eighths Block

Suppose six equally spaced measurements of a function \(r(x)\), in meters, are \(3,4,5,4,3,2\) at \(x=1,2,3,4,5,6\). There are \(6\) measurements, hence \(5\) panels, with spacing \(h=1\) meter. Simpson’s one-third rule alone is not permitted because \(5\) is odd.

The trapezoidal rule could cover all five panels. Alternatively, using the three-eighths rule for three panels and the one-third rule for the other two is valid; the odd-panel-count method was introduced earlier. Apply the one-third rule to the first two panels and the three-eighths rule to the last three:

$$ \int_1^6 r(x)\,dx \approx \frac{1}{3}(3+4(4)+5) + \frac{3}{8}(5+3(4)+3(3)+2). $$

The first block is \((3+16+5)/3=24/3=8\). In the second block, the bracket is \(5+12+9+2=28\), so its estimate is \(3(28)/8=84/8=10.5\). The total estimate is \(8+10.5=18.5\) square meters.

Check: The first block covers two panels and the second covers three; together they cover all \(5\) panels exactly once. Adding their calculated contributions gives \(18.5\), with the units \(r(x)\) times \(x\), namely square meters.

Worked Example: Detecting Unequal Spacing

Consider measurements at \(x=0,1,2.2,3\), with values \(y=2,3,5,4\). The consecutive widths are \(1\), \(1.2\), and \(0.8\), so the table is not equally spaced. Do not use the equal-spacing composite formula with an average width. For a trapezoidal estimate, use the actual width of each panel:

$$ \int_0^3 f(x)\,dx \approx \frac{1}{2}(1)(2+3) +\frac{1}{2}(1.2)(3+5) +\frac{1}{2}(0.8)(5+4). $$

The panel contributions are \(2.5\), \(4.8\), and \(3.6\), respectively. Their sum is \(2.5+4.8+3.6=10.9\) square units.

Check: The three actual intervals are \([0,1]\), \([1,2.2]\), and \([2.2,3]\); the widths used are \(1\), \(1.2\), and \(0.8\). The panel estimates sum to \(10.9\). This is a nonuniform trapezoidal estimate, not an application of the equal-spacing Simpson rule.

Common Pitfalls and Interpretation

A frequent counting error is to confuse measurements with panels. For example, a table with seven measurements has six panels, not seven. Six panels meet the even-panel condition for Simpson’s one-third rule; seven measurements are not the relevant count by themselves.

Another mistake is to use Simpson’s alternating weights on a table with an odd number of panels. For five panels, the one-third rule does not cover the whole interval in two-panel blocks. Applying its formula anyway leaves the structure unsupported and may produce an unjustified estimate. Use the trapezoidal rule over the full interval, or use a valid combination that includes a three-eighths block.

Finally, a quadrature estimate is not automatically a statement about its accuracy. The composite trapezoidal and Simpson error bounds require additional information about derivatives of the underlying function over the interval. A table alone generally does not provide those bounds. Also, if the entries are experimental measurements, measurement uncertainty is distinct from quadrature error; the estimate uses the supplied values but does not remove their uncertainty.

Takeaway: First verify the measurement locations and count the panels. Then choose a rule whose spacing and panel-count conditions are met, apply its weights carefully, and report the estimate with the product units of the measured function and the integration variable.

Check Your Understanding

For each question, identify the relevant spacing or panel-count condition before deciding how to calculate.

  1. A table has nine equally spaced measurements. How many panels does it contain, and may Simpson’s one-third rule cover the full interval?
  2. What are the composite trapezoidal weights for the first, an interior, and the last measurement?
  3. A table has six measurements with equal spacing. Which of the composite trapezoidal rule and Simpson’s one-third rule can be used over all its panels?
  4. Why is it not valid to use the equal-spacing Simpson formula after replacing unequal panel widths with their average?
  5. If a flow rate is measured in liters per minute and integrated over time in minutes, what are the units of the resulting estimate?

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