Skip to content

Composite Trapezoidal Rule

The basic Trapezoidal Rule fits a single straight line over the entire interval [a,b][a, b]. When f(x)f(x) curves significantly, this single trapezoid can be a poor approximation. The Composite Trapezoidal Rule fixes this by dividing [a,b][a, b] into mm equal sub-intervals and applying the basic Trapezoidal Rule on each one. The total integral is then the sum of all the small trapezoids.


Partitioning the Interval

Divide [a,b][a, b] into mm equal sub-intervals of width:

h=b−amh = \frac{b - a}{m}

This defines m+1m + 1 equally spaced nodes:

x0=a,x1=a+h,x2=a+2h,…,xm=a+mh=bx_0 = a, \quad x_1 = a + h, \quad x_2 = a + 2h, \quad \ldots, \quad x_m = a + mh = b

Applying the Trapezoidal Rule to the jj-th sub-interval [xj−1,xj][x_{j-1}, x_j] gives:

h2[f(xj−1)+f(xj)]\frac{h}{2}\left[f(x_{j-1}) + f(x_j)\right]


Assembling the Sum

The composite approximation is the sum over all mm sub-intervals:

C1,m=h2[f(x0)+f(x1)]+h2[f(x1)+f(x2)]+⋯+h2[f(xm−1)+f(xm)]C_{1,m} = \frac{h}{2}\left[f(x_0) + f(x_1)\right] + \frac{h}{2}\left[f(x_1) + f(x_2)\right] + \cdots + \frac{h}{2}\left[f(x_{m-1}) + f(x_m)\right]

Every interior node x1,x2,…,xm−1x_1, x_2, \ldots, x_{m-1} appears once as the right endpoint of one sub-interval and once as the left endpoint of the next. Each therefore contributes twice. The two endpoints x0=ax_0 = a and xm=bx_m = b appear only once. Collecting terms:

C1,m=h2[f(x0)+2f(x1)+2f(x2)+⋯+2f(xm−1)+f(xm)]\boxed{C_{1,m} = \frac{h}{2}\left[f(x_0) + 2f(x_1) + 2f(x_2) + \cdots + 2f(x_{m-1}) + f(x_m)\right]}


Example: m=4m = 4 Sub-intervals

Writing out all four trapezoids explicitly shows exactly how the interior nodes combine:

C1,4=h2[f(x0)+f(x1)]+h2[f(x1)+f(x2)]+h2[f(x2)+f(x3)]+h2[f(x3)+f(x4)]C_{1,4} = \frac{h}{2}\left[f(x_0)+f(x_1)\right] + \frac{h}{2}\left[f(x_1)+f(x_2)\right] + \frac{h}{2}\left[f(x_2)+f(x_3)\right] + \frac{h}{2}\left[f(x_3)+f(x_4)\right]

=h2[f(x0)+2f(x1)+2f(x2)+2f(x3)+f(x4)]= \frac{h}{2}\left[f(x_0) + 2f(x_1) + 2f(x_2) + 2f(x_3) + f(x_4)\right]

The pattern is clear: coefficients of 1 at the two endpoints and 2 at every interior node.

f(x) subdivided into four equal sub-intervals each approximated by a trapezoid shaded in blue; nodes x_0 through x_m are labeled, with interior nodes annotated times 2 and endpoints annotated times 1.

Interior nodes each appear in two adjacent trapezoids, which is why each contributes a factor of 2 in the composite formula C1,mC_{1,m}.


Accuracy and the Role of mm