The composite trapezoidal rule splits [a,b] into n equal
subintervals of width h=(b-a)/n and sums trapezoids:
C = (h/2)(f0 + 2f1 + ... + 2f_{n-1} + fn).
Example: f(x)=x², [0,2], n=4, h=1/2 gives C=11/4;
true=8/3, error=1/12.
Example
Use a weighted point table to apply the composite trapezoid rule.
highlighted = computed this step
Step 1 — Set up
Set up four composite trapezoid subintervals.
f(x)=x2[0,2]n=4
Step 2 — Step size
Compute the step size.
h=21
Step 3 — Weighted point table
List nodes, function values, and trapezoid weights.
i01234x0211232f0411494w12221wf0212294
Step 4 — Weighted sum
Add the weighted function values.
Step 5 — Composite estimate
Multiply by h over 2 for the composite estimate.
T=41⋅11=411
composite-trapezoid
With n subintervals of width h=(b-a)/n and nodes x_i=a+i*h: ends = (h/2)(f(x0) + f(xn)) mid = h * (f(x1) + ... + f(x_{n-1})) C = ends + mid