Tutorials › AP Calculus › Composite Trapezoidal Estimates on Equal Subintervals

Numerical and BC Integration Methods · Tutorial 510 of 999

Composite Trapezoidal Estimates on Equal Subintervals

Use equally spaced function values to build a composite trapezoidal estimate, and understand why interior values count twice while endpoints count once.

Advanced 9 min read

What You'll Learn

  • Find the common width of equal subintervals from the interval and number of subintervals
  • Write the composite trapezoidal formula using endpoint and interior function values
  • Explain why each interior value receives twice the weight of an endpoint
  • Compute an estimate efficiently from a table or a specified function
  • Check a composite estimate by adding the individual trapezoid contributions
  • Track units when an integral represents accumulated change

Why Combine Several Trapezoids?

A definite integral can represent accumulated quantity, such as distance from a velocity function. Sometimes the function is known only at a finite collection of points, so evaluating an exact integral is not an option. The trapezoidal rule estimates the integral by joining consecutive sampled points with line segments and adding the areas of the resulting trapezoids.

Using several subintervals creates a composite trapezoidal estimate. When the subintervals have equal width, the estimate can be calculated efficiently with one formula. The formula gives the two endpoints half the weight of each interior value. Understanding where those weights come from helps prevent a common arithmetic error.

Equal Subintervals and Sampled Values

Suppose we want to estimate \(\int_a^b f(x)\,dx\) using \(n\) equal subintervals, where \(n\) is a positive integer. The width of each subinterval is

$$ h=\frac{b-a}{n}. $$

Starting at \(a\), the partition points are \(x_i=a+ih\), for \(i=0,1,\ldots,n\). In particular, \(x_0=a\) and \(x_n=b\). There are \(n\) subintervals but \(n+1\) sampled function values: \(f(x_0), f(x_1),\ldots,f(x_n)\).

Definition: The composite trapezoidal estimate on \(n\) equal subintervals is the sum of the trapezoidal estimates on each adjacent pair of partition points. Each local trapezoid uses the two sampled function values at the ends of its subinterval.

For one subinterval \([x_i,x_{i+1}]\), the trapezoid has parallel sides of lengths \(f(x_i)\) and \(f(x_{i+1})\), and width \(h\). When these values are nonnegative, its geometric area is the average of the parallel sides times the width:

$$ \frac{h}{2}\bigl(f(x_i)+f(x_{i+1})\bigr). $$

Adding these local contributions gives the composite estimate. The same formula is used to estimate the definite integral, with each sampled function value treated as a signed height when appropriate.

Deriving the Composite Formula

Write \(f_i=f(x_i)\) for shorter notation. The estimate is the sum of the local trapezoids:

$$ T_n=\frac{h}{2}(f_0+f_1)+\frac{h}{2}(f_1+f_2)+\cdots+\frac{h}{2}(f_{n-1}+f_n). $$

Factor out the common multiplier \(h/2\). The first endpoint value \(f_0\) occurs only in the first trapezoid, and the last endpoint value \(f_n\) occurs only in the final trapezoid. Every interior value \(f_i\), where \(1\leq i\leq n-1\), occurs in two neighboring trapezoids: once as a right-hand height and once as a left-hand height. Therefore each interior value appears twice in the sum.

$$ \begin{aligned} T_n &=\frac{h}{2}\bigl[f_0+2f_1+2f_2+\cdots+2f_{n-1}+f_n\bigr]\\ &=\frac{h}{2}\left[f(a)+2\sum_{i=1}^{n-1}f(x_i)+f(b)\right]. \end{aligned} $$
Theorem: For \(n\) equal subintervals of \([a,b]\), with \(h=(b-a)/n\), the composite trapezoidal estimate is $$ T_n=\frac{h}{2}\left[f(a)+2\sum_{i=1}^{n-1}f(x_i)+f(b)\right], \qquad x_i=a+ih. $$ The endpoint values appear once inside the brackets; every interior value appears twice. If \(n=1\), there are no interior values, so the sum is empty and the formula reduces to the single trapezoid estimate.

This derivation explains the weights: they are not a separate adjustment to memorize. They follow from counting how many local trapezoids use each sampled value.

A Reliable Calculation Process

Before using the formula, identify the number of subintervals and the sample points. A table with \(n+1\) values has \(n\) subintervals. Then calculate \(h\), keep the endpoints separate from the interior values, and apply the common factor \(h/2\).

1
Count the subintervals.
If there are \(n+1\) consecutive sampled points, there are \(n\) subintervals.
2
Find the common width.
Calculate \(h=(b-a)/n\) and confirm that successive \(x\)-values are separated by this amount.
3
Apply the weights.
Add the endpoint values once, add each interior value twice, and multiply the bracketed sum by \(h/2\).
4
Check by local contributions.
Calculate each trapezoid separately and confirm that their sum matches the formula.

Worked Examples

Worked Example: Estimate an Integral from a Table

Suppose equally spaced values of \(f\) are given below. Use the composite trapezoidal rule to estimate \(\int_0^3 f(x)\,dx\).

\(x\)0123
\(f(x)\)1243

There are four sampled points, so \(n=3\) subintervals. Their width is

$$ h=\frac{3-0}{3}=1. $$

The endpoint values are \(f(0)=1\) and \(f(3)=3\). The interior values are \(f(1)=2\) and \(f(2)=4\). Substitute them into the formula:

$$ \begin{aligned} T_3 &=\frac{1}{2}\left[1+2(2+4)+3\right]\\ &=\frac{1}{2}\left[1+12+3\right]\\ &=\frac{1}{2}(16)=8. \end{aligned} $$

Check by adding the local trapezoids. Their estimates are \(\frac{1}{2}(1+2)(1)=1.5\), \(\frac{1}{2}(2+4)(1)=3\), and \(\frac{1}{2}(4+3)(1)=3.5\). Their sum is \(1.5+3+3.5=8\), matching the composite formula. Thus the estimate is \(8\).

Worked Example: Use a Function to Generate the Values

Use four equal subintervals to estimate \(\int_0^2 (x^2+1)\,dx\) with the composite trapezoidal rule.

Here \(n=4\), so

$$ h=\frac{2-0}{4}=\frac{1}{2}. $$

The partition points are \(x_i=0+i/2\), giving \(0,\frac12,1,\frac32,2\). Evaluate \(f(x)=x^2+1\) at each point:

$$ f(0)=1,\quad f\left(\frac12\right)=\frac54,\quad f(1)=2,\quad f\left(\frac32\right)=\frac{13}{4},\quad f(2)=5. $$

The endpoints have values \(1\) and \(5\); the interior values are \(\frac54,2,\frac{13}{4}\). Therefore,

$$ \begin{aligned} T_4 &=\frac{1/2}{2}\left[1+2\left(\frac54+2+\frac{13}{4}\right)+5\right]\\ &=\frac14\left[1+2\left(\frac54+\frac84+\frac{13}{4}\right)+5\right]\\ &=\frac14\left[1+2\left(\frac{26}{4}\right)+5\right]\\ &=\frac14(1+13+5)=\frac{19}{4}=4.75. \end{aligned} $$

For a check, calculate the four local contributions using width \(\frac12\):

$$ \begin{aligned} &\frac14\left(1+\frac54\right)=\frac{9}{16},\qquad \frac14\left(\frac54+2\right)=\frac{13}{16},\\ &\frac14\left(2+\frac{13}{4}\right)=\frac{21}{16},\qquad \frac14\left(\frac{13}{4}+5\right)=\frac{33}{16}. \end{aligned} $$

Their sum is \((9+13+21+33)/16=76/16=19/4=4.75\), as required. The trapezoidal estimate is \(4.75\).

Worked Example: Estimate Accumulated Distance from Velocity Data

A vehicle’s velocity is recorded at equal time intervals. Estimate the distance traveled over the eight seconds shown, using the composite trapezoidal rule.

Time \(t\) (s)02468
Velocity \(v(t)\) (m/s)35476

There are five data points and hence \(n=4\) subintervals. The common width is \(h=(8-0)/4=2\) seconds. The trapezoidal estimate for accumulated distance is

$$ \begin{aligned} T_4 &=\frac{2}{2}\left[3+2(5+4+7)+6\right]\\ &=1\left[3+2(16)+6\right]\\ &=3+32+6=41. \end{aligned} $$

Velocity is measured in metres per second and the width in seconds, so the estimate has units \((\mathrm{m/s})(\mathrm{s})=\mathrm{m}\). Check using the individual trapezoids: their estimates are \(\frac{2}{2}(3+5)=8\) m, \(\frac{2}{2}(5+4)=9\) m, \(\frac{2}{2}(4+7)=11\) m, and \(\frac{2}{2}(7+6)=13\) m. The total is \(8+9+11+13=41\) m, which agrees with the weighted formula.

A Common Weighting Error

A frequent mistake is to double the endpoint values as well as the interior values. Return to the table in the first example. Incorrectly doubling all four values gives

$$ \frac{1}{2}\left[2(1)+2(2+4)+2(3)\right] =\frac{1}{2}(20)=10. $$

This is not the composite trapezoidal estimate. The first and last values each occur in only one local trapezoid, so they must appear once. Only the interior values occur in two neighboring trapezoids. The correct calculation is

$$ \frac{1}{2}\left[1+2(2+4)+3\right] =\frac{1}{2}(16)=8. $$

The local-trapezoid check confirms the correction: the three contributions add to \(8\), not \(10\). A second useful safeguard is to include the factor \(h/2\); the weighted sum by itself is not the estimate.

What the Estimate Represents

The method replaces the curve between adjacent sampled points with a straight segment. Each segment forms one trapezoid, and the estimate adds the contributions from all the subintervals. More sampled points give more trapezoids, but the formula still uses the same structure: endpoints once, interior points twice, then multiply by \(h/2\).

When an integral represents accumulated change, the trapezoidal rule turns sampled rates into an estimated total. In the velocity example, multiplying a velocity scale by a time width produces distance. In other settings, the units of the estimate come from multiplying the units of the function by the units of \(x\). Checking these units and comparing the formula with the sum of local trapezoids are practical ways to catch mistakes.

Check Your Understanding

For each question, identify the subinterval width before applying any weights.

  1. A table gives five equally spaced values on \([2,10]\). How many subintervals are there, and what is their common width?
  2. For \(n\) equal subintervals, which sampled values are counted once in the composite formula, and which are counted twice?
  3. Use the composite formula to estimate an integral when \(h=2\), the endpoint values are \(3\) and \(5\), and the interior values are \(4\) and \(6\).
  4. Explain why an interior value occurs twice when the local trapezoid contributions are added.
  5. A velocity estimate uses time in seconds and velocity in metres per second. What units should the resulting trapezoidal estimate have?

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

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