Numerical Integration With the Trapezoidal Rule
Approximate an integral using trapezoid areas. Apply the composite rule on equally spaced points.
6 min · Calculus · Intermediate
Learning goals
- Approximate an integral using trapezoid areas.
- Apply the composite rule on equally spaced points.
Understand the concept
The trapezoidal rule approximates the integral of a function by joining sampled points with straight segments. For one interval [a, b], the signed approximation is (b − a)(f(a) + f(b))/2.
For n equal subintervals of width h, the composite rule is h[f(x₀)/2 + f(x₁) + ... + f(xₙ₋₁) + f(xₙ)/2]. It is exact for linear functions; curved functions generally introduce approximation error.
Worked example 1
On [0, 2], f(x) = x² gives one trapezoid estimate 2(0 + 4)/2 = 4.
Worked example 2
With samples at 0, 1, 2 for the same function, h = 1 and the estimate is 0/2 + 1 + 4/2 = 3.
Check your understanding
UNVRST English edition · Educational support · Editorial policy