Mathwords logoMathwords

Trapezoid Rule — Definition, Formula & Examples

Trapezoid Rule

A method for approximating a definite integral Definite integral notation: the integral from a to b of f(x)dx using linear approximations of f. The trapezoids are drawn as shown below. The bases are vertical lines.

To use the trapezoid rule follow these two steps:

Two-step trapezoid rule: partition [a,b] into n equal subintervals (width Δx=(b-a)/n); integral ≈...
Graph of y=f(x) with shaded trapezoids from x₀=a to x₃=b, width Δx each. Formula: ∫f(x)dx=(Δx/2)[f(x₀)+2f(x₁)+2f(x₂)+f(x₃)]

 

 

See also

Simpson's rule, partition, definite integral

Key Formula

abf(x)dxΔx2[f(x0)+2f(x1)+2f(x2)++2f(xn1)+f(xn)]\int_a^b f(x)\,dx \approx \frac{\Delta x}{2}\Big[f(x_0) + 2f(x_1) + 2f(x_2) + \cdots + 2f(x_{n-1}) + f(x_n)\Big]
Where:
  • a,ba, b = The lower and upper limits of integration
  • nn = The number of equal subintervals the interval [a, b] is divided into
  • Δx\Delta x = The width of each subinterval, equal to (b − a)/n
  • x0,x1,,xnx_0, x_1, \ldots, x_n = The partition points, where x_k = a + k·Δx
  • f(xk)f(x_k) = The value of the function evaluated at each partition point

Worked Example

Problem: Use the Trapezoid Rule with n = 4 subintervals to approximate the integral of x² from 0 to 4.
Step 1: Find the width of each subinterval Δx.
Δx=ban=404=1\Delta x = \frac{b - a}{n} = \frac{4 - 0}{4} = 1
Step 2: Identify the partition points x₀ through x₄.
x0=0,  x1=1,  x2=2,  x3=3,  x4=4x_0 = 0,\; x_1 = 1,\; x_2 = 2,\; x_3 = 3,\; x_4 = 4
Step 3: Evaluate f(x) = x² at each partition point.
f(0)=0,  f(1)=1,  f(2)=4,  f(3)=9,  f(4)=16f(0) = 0,\; f(1) = 1,\; f(2) = 4,\; f(3) = 9,\; f(4) = 16
Step 4: Apply the Trapezoid Rule formula. The first and last values get a coefficient of 1, and all middle values get a coefficient of 2.
12[0+2(1)+2(4)+2(9)+16]=12[0+2+8+18+16]=442=22\frac{1}{2}\Big[0 + 2(1) + 2(4) + 2(9) + 16\Big] = \frac{1}{2}\Big[0 + 2 + 8 + 18 + 16\Big] = \frac{44}{2} = 22
Step 5: Compare with the exact value. The exact integral of x² from 0 to 4 is 64/3 ≈ 21.333. The approximation of 22 has an error of about 0.667.
04x2dx=x3304=64321.333\int_0^4 x^2\,dx = \frac{x^3}{3}\Big|_0^4 = \frac{64}{3} \approx 21.333
Answer: The Trapezoid Rule approximation is 22, compared to the exact value of 64/3 ≈ 21.333.

Another Example

This example uses a non-polynomial function (1/x) and shows that the Trapezoid Rule overestimates the integral when the function is concave up. It also uses n = 3, an odd number of subintervals, unlike the first example.

Problem: Use the Trapezoid Rule with n = 3 subintervals to approximate the integral of 1/x from 1 to 4.
Step 1: Find Δx.
Δx=413=1\Delta x = \frac{4 - 1}{3} = 1
Step 2: Identify the partition points.
x0=1,  x1=2,  x2=3,  x3=4x_0 = 1,\; x_1 = 2,\; x_2 = 3,\; x_3 = 4
Step 3: Evaluate f(x) = 1/x at each partition point.
f(1)=1,  f(2)=0.5,  f(3)=13,  f(4)=0.25f(1) = 1,\; f(2) = 0.5,\; f(3) = \tfrac{1}{3},\; f(4) = 0.25
Step 4: Apply the Trapezoid Rule formula.
12[1+2(0.5)+2(13)+0.25]=12[1+1+23+0.25]=123512=35241.4583\frac{1}{2}\Big[1 + 2(0.5) + 2\left(\tfrac{1}{3}\right) + 0.25\Big] = \frac{1}{2}\Big[1 + 1 + \tfrac{2}{3} + 0.25\Big] = \frac{1}{2}\cdot\frac{35}{12} = \frac{35}{24} \approx 1.4583
Step 5: The exact value is ln(4) ≈ 1.3863. The approximation overestimates because 1/x is concave up on this interval.
141xdx=ln41.3863\int_1^4 \frac{1}{x}\,dx = \ln 4 \approx 1.3863
Answer: The Trapezoid Rule approximation is 35/24 ≈ 1.4583, compared to the exact value ln(4) ≈ 1.3863.

Frequently Asked Questions

What is the difference between the Trapezoid Rule and Simpson's Rule?
The Trapezoid Rule approximates the curve between consecutive points with straight lines (linear approximation), while Simpson's Rule uses parabolas (quadratic approximation) through groups of three points. Simpson's Rule is generally more accurate for the same number of subintervals. However, Simpson's Rule requires an even number of subintervals, while the Trapezoid Rule works with any positive integer n.
Does the Trapezoid Rule overestimate or underestimate an integral?
It depends on the concavity of the function. When the function is concave up on the interval, the Trapezoid Rule overestimates the integral because the straight-line segments lie above the curve. When the function is concave down, it underestimates. If the concavity changes, the errors may partially cancel.
How do you increase the accuracy of the Trapezoid Rule?
Increase the number of subintervals n. As n grows, Δx shrinks and the linear segments more closely follow the actual curve. The error of the Trapezoid Rule decreases proportionally to 1/n², meaning doubling the number of subintervals reduces the error by roughly a factor of 4.

Trapezoid Rule vs. Simpson's Rule

Trapezoid RuleSimpson's Rule
Approximation shapeTrapezoids (linear segments between points)Parabolic arcs through groups of 3 points
Formula(Δx/2)[f₀ + 2f₁ + 2f₂ + … + 2fₙ₋₁ + fₙ](Δx/3)[f₀ + 4f₁ + 2f₂ + 4f₃ + … + 4fₙ₋₁ + fₙ]
Error orderProportional to 1/n² (order 2)Proportional to 1/n⁴ (order 4)
Subinterval requirementAny positive integer nn must be even
Exact for polynomials up to degree1 (linear functions)3 (cubic functions)

Why It Matters

The Trapezoid Rule appears frequently in AP Calculus (AB and BC) courses, where you are asked to approximate definite integrals from tables of values or when antiderivatives are difficult to find. In science and engineering, it is one of the most commonly used methods for numerically integrating real-world data collected at discrete points, such as velocity readings or experimental measurements. Understanding this rule also builds a foundation for more advanced numerical integration techniques like Simpson's Rule and Gaussian quadrature.

Common Mistakes

Mistake: Forgetting to multiply the interior function values by 2.
Correction: In the Trapezoid Rule formula, every function value except the first (f(x₀)) and last (f(x_n)) is multiplied by 2. This is because each interior point is shared by two adjacent trapezoids. A helpful mnemonic: the coefficients follow the pattern 1, 2, 2, 2, …, 2, 1.
Mistake: Forgetting the Δx/2 factor at the front of the formula.
Correction: The area of each trapezoid includes a factor of (1/2) × base × (sum of parallel sides). The base here is Δx, so the overall factor is Δx/2. Omitting this will give an answer that is off by a factor of 2/Δx.

Related Terms