The Trapezoidal Rule
Learn how to approximate definite integrals using the trapezoidal rule, understand when to apply numerical integration, and consider error in your approximations.
What Is the Trapezoidal Rule?
The trapezoidal rule is a method of numerical integration used to approximate the value of a definite integral when an exact antiderivative is difficult or impossible to find. Instead of finding the area under a curve exactly, we approximate it by dividing the region into trapezoids.
For a function f(x) on the interval [a, b] divided into n equal sub-intervals of width h = (b - a) / n, the trapezoidal rule gives:
The Formula
h/2 [f(x0) + 2f(x1) + 2f(x2) + ... + 2f(xn-1) + f(xn)]
Where x0 = a, xn = b, and each xi = a + ih. Notice the first and last function values have coefficient 1, while all interior values have coefficient 2.
Visual: Approximating Area with Trapezoids
Each trapezoid connects two consecutive function values with a straight line. The total area of all trapezoids approximates the integral.
Applying the Rule Step by Step
To apply the trapezoidal rule, follow these steps:
- Identify the interval [a, b] and the number of sub-intervals n.
- Calculate the width h = (b - a) / n.
- List all x-values: x0, x1, ..., xn where xi = a + ih.
- Evaluate the function at each x-value: f(x0), f(x1), ..., f(xn).
- Apply the formula: multiply by h/2 and use coefficients 1, 2, 2, ..., 2, 1.
Tip: You may also be given a table of values rather than a function. The trapezoidal rule works the same way -- just read the function values directly from the table.
Error Considerations
The trapezoidal rule provides an approximation, not an exact answer. The accuracy depends on:
- Number of sub-intervals (n): More sub-intervals generally means a better approximation.
- Curvature of the function: Functions that are nearly linear over each sub-interval give very accurate results.
- Concavity: The rule overestimates when the curve is concave up, and underestimates when the curve is concave down.
Overestimate vs Underestimate
Concave Up (f'' > 0)
Trapezoidal rule OVERESTIMATES
Concave Down (f'' < 0)
Trapezoidal rule UNDERESTIMATES
Key Vocabulary
Numerical Integration
A collection of methods for approximating the value of a definite integral, used when exact integration is difficult.
Sub-interval
One of the n equal parts into which the interval [a, b] is divided; each has width h.
Trapezoid
A quadrilateral with one pair of parallel sides. In this context, the parallel sides are vertical lines at xi and xi+1.
Concavity
Describes whether a curve bends upward (concave up) or downward (concave down), which affects the accuracy of the approximation.
Worked Examples
Use the trapezoidal rule with 4 sub-intervals to approximate the integral of f(x) = x^2 from x = 0 to x = 2.
Step 1: h = (2 - 0) / 4 = 0.5
Step 2: x-values: 0, 0.5, 1, 1.5, 2
Step 3: f-values: f(0) = 0, f(0.5) = 0.25, f(1) = 1, f(1.5) = 2.25, f(2) = 4
Step 4: Apply the formula: (0.5/2)[0 + 2(0.25) + 2(1) + 2(2.25) + 4]
= 0.25[0 + 0.5 + 2 + 4.5 + 4]
Answer: 0.25 x 11 = 2.75 (The exact answer is 8/3 = 2.667, so the approximation is an overestimate since x^2 is concave up.)
A table of values is given. Use the trapezoidal rule to estimate the integral.
| x | 1 | 2 | 3 | 4 | 5 |
| f(x) | 3 | 5 | 4 | 6 | 2 |
Step 1: h = (5 - 1) / 4 = 1
Step 2: Apply the formula: (1/2)[3 + 2(5) + 2(4) + 2(6) + 2]
= 0.5[3 + 10 + 8 + 12 + 2]
Answer: 0.5 x 35 = 17.5 square units
Will the trapezoidal rule overestimate or underestimate the integral of f(x) = ln(x) from x = 1 to x = 3?
Step 1: Find f''(x). f(x) = ln(x), so f'(x) = 1/x, and f''(x) = -1/x^2.
Step 2: Since f''(x) = -1/x^2 < 0 for all x in [1, 3], the function is concave down.
Answer: The trapezoidal rule will underestimate the integral because the curve is concave down on [1, 3].
Knowledge Check
Select the correct answer for each question. Click "Check Answer" to see if you are right.
Question 1
Using the trapezoidal rule with n = 2 sub-intervals, approximate the integral of f(x) = x from x = 0 to x = 4. What is the result?
Question 2
In the trapezoidal rule formula, which function values receive a coefficient of 2?
Question 3
If f''(x) > 0 on the entire interval, the trapezoidal rule will produce:
Question 4
Using the trapezoidal rule with n = 3 on [0, 6], what is the width h of each sub-interval?
Question 5
The trapezoidal rule gives the exact value of a definite integral when the function is:
Key Concepts Summary
- ● The trapezoidal rule approximates a definite integral by summing the areas of trapezoids under the curve.
- ● Formula: (h/2)[f(x0) + 2f(x1) + ... + 2f(xn-1) + f(xn)] where h = (b - a)/n.
- ● Increasing the number of sub-intervals improves accuracy.
- ● Concave up curves lead to overestimates; concave down curves lead to underestimates.
- ● The rule is exact for linear functions.