Opening your learning space
Starting the app …
Opening your learning space
Starting the app …
The composite trapezoidal rule approximates a definite integral by joining adjacent function values with straight line segments.
Free to browse · flashcards or a multiple-choice quiz · import from Essential
Formula
Tn and the integral have units of function value times x; h has the units of x.
| Symbol | Meaning | Unit |
|---|---|---|
| Trapezoidal approximation to the integral | unit of f · unit of x | |
| Number of equal subintervals | unit of x | |
| Subinterval width (b−a)/n | unit of x | |
| Function value at grid point xi | dimensionless | |
| Integration limits | unit of f |
T_n=h\left(\frac{f(x_0)}{2}+\sum_{i=1}^{n-1}f(x_i)+\frac{f(x_n)}{2}\right), \quad h=\frac{b-a}{n}Original schematic by Quanta
Free with a Quanta account. Your download stays ready after registration.
For equally spaced nodes xi=a+ih, the endpoint values receive half weight because each belongs to one trapezoid, while interior values belong to two. For twice continuously differentiable f, the error satisfies |I−Tn|≤(b−a)3 max|f″|/(12n2). The method is exact for linear functions; curvature controls its error. Unequal spacing requires adding the individual trapezoid areas rather than using the equal-step formula.
A quadrature approximation for continuous f; the classic global O(h2) error order assumes sufficient smoothness and a uniform grid.
On each subinterval a line replaces the graph; its area is a trapezoid.
Choose the step size
n is a positive integer; for a fixed interval, doubling n halves the step size.
Approximate ∫01x2dx with two subintervals.
h=0.5; T2=0.5·(0/2+0.25+1/2)=0.375.
The exact value is 1/3; the convex function is overestimated.
Giving all sample values equal weight.
Endpoints have weight 1/2; interior points have weight 1.
Formula cluster
Quadrature approximates area and can be systematically refined with smaller h.
Approximate ∫02x2dx with n=2. Here h=1 and the values are 0, 1, 4, so T2=1(0/2+1+4/2)=3. The exact integral is 8/3≈2.667. Check: the estimate is high because x2 is convex on [0,2].
Approximate areas and accumulated quantities from measured or tabulated values, and provide a simple numerical-integration baseline.
Here is how to work through a typical Composite trapezoidal rule (Tn = h (f0/2 + Σ fᵢ + fn/2)) task step by step:
Task
Approximate ∫01x2dx with two subintervals.
Solution path
h=0.5; T2=0.5·(0/2+0.25+1/2)=0.375.
The exact value is 1/3; the convex function is overestimated.
Each subinterval forms a trapezoid from two adjacent heights. An interior grid value belongs to two trapezoids and receives the factor 1/2 twice, for total weight 1. The first left and final right values each occur in only one trapezoid and keep weight 1/2. This yields Tn=h(f0/2+f1+…+f(n−1)+fn/2). Equal weights would count the endpoint area incorrectly. With unevenly spaced measurements, calculate each trapezoid using its own interval width. With uniform step h, the familiar endpoint weights are one half. With unequal spacing, each subinterval needs its own width rather than one global h.
No. For a convex function, the secant between two sample points lies above the graph, so the trapezoid overestimates the integral on that interval. For a concave function, the secant lies below and the area is underestimated. If curvature changes, local errors may partly cancel. The total error sign therefore requires additional conditions. For twice continuously differentiable functions, an error bound depends in part on the maximum second derivative and the step size. For x2 on [0,1], the secant lies above the graph, so the error is positive. For −x2, its sign reverses on the same interval.
Refine the uniform grid by increasing n and reducing h=(b−a)/n. For sufficiently smooth functions, the composite trapezoidal rule’s global error typically scales as h2. Halving h therefore reduces the error by about a factor of four once the asymptotic regime is reached, at the cost of roughly twice as many function evaluations. Measurements may not be available at finer spacing; then use uncertainty estimates or a higher-order quadrature method. When possible, compare results at two step sizes rather than inferring accuracy from many displayed decimal places.
If f is twice continuously differentiable and the grid is uniform with step h, then |I−Tn|≤(b−a)h2 max|f″|/12. The bound shows how curvature matters: a linear function has f″=0 and is integrated exactly, while stronger curvature allows a larger error. For f(x)=x2 on [0,1] with n=2, h=0.5 and max|f″|=2. The bound is 1·0.25·2/12=1/24≈0.0417, equal here to the actual error 0.375−1/3. In applications, max|f″| is often known only roughly, so the bound remains conservative. Since max|f″| is an upper curvature bound, the actual error is often smaller.
For a sufficiently smooth function, the leading trapezoidal error on uniform grids is of order h2. Compute Tn with step h and T2n with h/2; then (4T2n−Tn)/3 cancels the leading error term. For the integral of x2 on [0,1], T1=0.5 and T2=0.375, so the combination (4·0.375−0.5)/3=1/3, the exact value. This improvement requires both grids to use the same endpoints and the asymptotic error regime to apply. With discontinuities or highly irregular measured data, the extrapolation is not reliable. It often improves the number of reliable decimal places.
Quanta exam set
Curated exam set for "Composite trapezoidal rule":
Question (front)
Which formula describes Composite trapezoidal rule?
Answer in your set
Question (front)
How do you rearrange Composite trapezoidal rule for Choose the step size?
Answer in your set
Question (front)
Which common mistake happens with Composite trapezoidal rule?
Answer in your set
+ 8 more cards: units, variables, derivation, example, exam task
The formula set contains 11 cards. After importing, review them and start practicing; your ratings determine later review intervals.
This list names subject references and further reading. A page or section number appears when it is part of the reference; these are not verbatim quotations.
Create a curated FSRS exam set for Tn = h (f0/2 + Σ fᵢ + fn/2): formula recall, variables, derivation, rearrangement, worked example, common mistakes and exam context.
Curated formula set · LaTeX · FSRS spaced repetition · import from Essential