Tutorials › AP Statistics › Trapezoidal Estimates on Unequal Subintervals

Numerical and BC Integration Methods · Tutorial 511 of 999

Trapezoidal Estimates on Unequal Subintervals

Build a trapezoidal estimate on a nonuniform partition by pairing each neighboring function-value pair with the width of its own subinterval.

Advanced 11 min read

What You'll Learn

  • Identify the subinterval widths in a nonuniform partition
  • Apply the trapezoidal rule separately on each panel
  • Combine panel estimates into one approximation
  • Derive the formula by integrating a linear interpolant
  • Recognize why the equal-subinterval formula does not apply to uneven spacing
  • Check units and arithmetic in a trapezoidal estimate

Why Unequal Spacing Requires Care

A table of function values does not always use equally spaced \(x\)-values. For example, measurements might be recorded more frequently in one region than another. To estimate the area represented by a definite integral, the trapezoidal method connects neighboring data points with line segments and adds the areas of the resulting trapezoids.

When the spacing is uniform, every trapezoid has the same width. With unequal spacing, each panel has its own width, so each pair of neighboring function values must be multiplied by that panel’s width. Using one common width can produce an incorrect estimate even if all the function values are copied correctly.

The Nonuniform Trapezoidal Formula

Let the interval be partitioned at ordered points \(x_0<x_1<\cdots<x_n\). Write \(f_i=f(x_i)\), and let \(\Delta x_i=x_{i+1}-x_i\) be the width of the panel from \(x_i\) to \(x_{i+1}\). The panel has endpoint heights \(f_i\) and \(f_{i+1}\).

Definition: The trapezoidal estimate on the partition is the sum of the trapezoid areas on its individual panels: \[ T=\sum_{i=0}^{n-1}\frac{\Delta x_i}{2}(f_i+f_{i+1}) =\sum_{i=0}^{n-1}\frac{x_{i+1}-x_i}{2}\bigl(f(x_i)+f(x_{i+1})\bigr). \]

For an area interpretation, the graph should remain on or above the \(x\)-axis on the interval being considered. Each panel’s trapezoid area is its width multiplied by the average of its two endpoint heights. In applications, the integral is estimated by replacing the curve on each panel with the straight segment joining its endpoint values.

The formula uses the full list of partition points, not just the number of panels and the overall interval length. Before calculating, find every \(\Delta x_i\). In general, these widths are not interchangeable.

Worked Example: Three Panels with Different Widths

Worked Example: Three Panels with Different Widths

Use the table to estimate \(\int_0^3 f(x)\,dx\) by the trapezoidal method.

\(x\)\(f(x)\)
\(0\)\(1\)
\(0.5\)\(2\)
\(2\)\(1\)
\(3\)\(4\)

Step 1: Find the panel widths.

$$ \Delta x_0=0.5-0=0.5,\qquad \Delta x_1=2-0.5=1.5,\qquad \Delta x_2=3-2=1. $$

Step 2: Calculate each trapezoid. The first panel has endpoint heights \(1\) and \(2\), the second has heights \(2\) and \(1\), and the third has heights \(1\) and \(4\).

$$ T_0=\frac{0.5}{2}(1+2)=0.25(3)=0.75, $$ $$ T_1=\frac{1.5}{2}(2+1)=0.75(3)=2.25, $$ $$ T_2=\frac{1}{2}(1+4)=0.5(5)=2.5. $$

Step 3: Add the panel areas.

$$ T=T_0+T_1+T_2=0.75+2.25+2.5=5.5. $$

The estimated integral is \(5.5\) square units if the horizontal and vertical measurements are in the same length units. As an arithmetic check, the panel widths add to \(0.5+1.5+1=3\), the full interval length, and the three panel estimates add to \(5.5\).

Why the Formula Works

The trapezoidal rule replaces the function on one panel by the line segment joining its endpoint values. Integrating that line gives exactly the area of the panel’s trapezoid. Adding these individual approximations gives the composite estimate. The derivation also shows why each panel must use its own width.

Derivation: On the panel \([x_i,x_{i+1}]\), set \(\Delta x_i=x_{i+1}-x_i\). The line through \((x_i,f_i)\) and \((x_{i+1},f_{i+1})\) is \[ L_i(x)=f_i+\frac{f_{i+1}-f_i}{\Delta x_i}(x-x_i). \] Integrating this line across the panel gives \[ \begin{aligned} \int_{x_i}^{x_{i+1}}L_i(x)\,dx &=f_i\Delta x_i+ \frac{f_{i+1}-f_i}{\Delta x_i} \int_{x_i}^{x_{i+1}}(x-x_i)\,dx\\ &=f_i\Delta x_i+ \frac{f_{i+1}-f_i}{\Delta x_i}\cdot\frac{(\Delta x_i)^2}{2}\\ &=\frac{\Delta x_i}{2}(f_i+f_{i+1}). \end{aligned} \] Thus the trapezoid formula is the exact integral of the linear interpolant on that panel. Summing over all panels gives the stated estimate for the whole partition.

This derivation is a justification of the approximation method, not a claim that a curved function equals its interpolating line. If the function is linear on every panel, the estimate equals the definite integral exactly. Otherwise, it is an approximation based on the endpoint data.

Worked Example: Unequal Panels from a Data Table

Worked Example: Unequal Panels from a Data Table

A quantity \(r(t)\) is measured in units per minute, with \(t\) in minutes. Use the data below to estimate the accumulated quantity from \(t=1\) to \(t=3\).

\(t\) (minutes)\(r(t)\) (units per minute)
\(1\)\(1\)
\(1.4\)\(2.5\)
\(2.2\)\(1.5\)
\(3\)\(4\)

Step 1: Calculate each time width.

$$ \Delta t_0=1.4-1=0.4,\qquad \Delta t_1=2.2-1.4=0.8,\qquad \Delta t_2=3-2.2=0.8. $$

Step 2: Estimate the accumulation on each panel. Each estimate is the time width times the average of the two endpoint rates.

$$ T_0=\frac{0.4}{2}(1+2.5)=0.2(3.5)=0.7\text{ units}, $$ $$ T_1=\frac{0.8}{2}(2.5+1.5)=0.4(4)=1.6\text{ units}, $$ $$ T_2=\frac{0.8}{2}(1.5+4)=0.4(5.5)=2.2\text{ units}. $$

Step 3: Add the contributions.

$$ T=0.7+1.6+2.2=4.5\text{ units}. $$

The units check: \((\text{minutes})(\text{units per minute})=\text{units}\). The widths also check, since \(0.4+0.8+0.8=2\) minutes, matching the interval from \(1\) to \(3\). The estimated accumulated quantity is \(4.5\) units.

An Equivalent Weighted-Sum Form

The panel formula can also be regrouped by function value. Each endpoint value appears in one panel; an interior value appears in the two panels that meet there. This gives a useful way to check a calculation, provided that the widths attached to each value are retained.

$$ T= \frac{\Delta x_0}{2}f_0+ \sum_{i=1}^{n-1}\frac{\Delta x_{i-1}+\Delta x_i}{2}f_i+ \frac{\Delta x_{n-1}}{2}f_n. $$

For instance, in the first worked example, the coefficient of \(f_1\) is \((0.5+1.5)/2=1\): that function value borders panels of widths \(0.5\) and \(1.5\). It is not generally correct to give every interior value the same coefficient, because the widths around different interior points may differ.

Worked Example: Check the Estimate in Two Forms

Worked Example: Check the Estimate in Two Forms

Let \(f(x)=x^2\), and use the partition \(0,1,3\) to estimate \(\int_0^3 x^2\,dx\).

Step 1: Record the values and widths.

$$ f(0)=0,\qquad f(1)=1,\qquad f(3)=9, $$ $$ \Delta x_0=1-0=1,\qquad \Delta x_1=3-1=2. $$

Step 2: Apply the panel formula.

$$ T_0=\frac{1}{2}(0+1)=0.5, \qquad T_1=\frac{2}{2}(1+9)=10, $$ $$ T=0.5+10=10.5. $$

Step 3: Check using the weighted-sum form. The coefficient of the interior value \(f(1)\) is \((1+2)/2=1.5\).

$$ T=\frac{1}{2}(0)+\frac{1+2}{2}(1)+\frac{2}{2}(9) =0+1.5+9=10.5. $$

Both forms give the same estimate, \(10.5\). As an additional check, the exact integral is \(\left[\frac{x^3}{3}\right]_0^3=9\), so the numerical estimate is an approximation rather than an equality. This comparison checks the result for this example; it does not establish a general rule about the direction of trapezoidal error.

Common Pitfall: Reusing One Width

The familiar equal-subinterval formula uses one constant width \(h\). It is valid only when all the panels have that same width. On an unequal partition, replacing every \(\Delta x_i\) with a single \(h\) changes the calculation.

Common mistake: For \(x=0,1,3\) and function values \(2,4,6\), a mistaken use of \(h=1\) gives \[ \frac{h}{2}(f_0+2f_1+f_2) =\frac{1}{2}(2+2\cdot4+6) =\frac{1}{2}(16)=8. \] The correction is to use each panel width separately: \[ T_0=\frac{1}{2}(2+4)=3,\qquad T_1=\frac{2}{2}(4+6)=10,\qquad T=3+10=13. \] The second panel has width \(2\), not \(1\), so the single-width calculation does not represent the given partition.

A reliable habit is to write the partition points in increasing order, calculate the consecutive differences, and then write one trapezoid term per panel. Only after those steps should the terms be added. This makes it easier to spot a missing panel, a misplaced function value, or a width assigned to the wrong pair of endpoints.

When This Method Is Useful

The nonuniform trapezoidal rule is useful whenever function values are available at ordered sample points but the spacing varies. It is especially natural for data collected at irregular times or locations: each neighboring pair contributes an estimate over precisely the interval between those two measurements.

The method depends on the chosen partition and the available endpoint values. A panel with a large width contributes its own width factor, while a narrow panel contributes a smaller one. The formula does not require the widths to be equal, but it does require using the correct width for every adjacent pair. When the function is known by a formula, a definite integral may sometimes be evaluated exactly; when only sampled values are available, a numerical estimate such as this one provides an approximation.

Check Your Understanding

Use the panel formula, and show the width of every subinterval in your work.

  1. For partition points \(0,2,5\) with function values \(f(0)=1\), \(f(2)=3\), and \(f(5)=2\), calculate the trapezoidal estimate.
  2. For partition points \(1,1.5,2.5\) with values \(4,2,6\), what are the two panel estimates and their sum?
  3. State the condition under which the equal-subinterval formula can be used with a single width \(h\).
  4. Explain why an interior function value receives contributions from two neighboring panels in the weighted-sum form.
  5. If a rate is measured in liters per hour and the horizontal variable in hours, what are the units of the trapezoidal estimate?

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: 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