Mastering the Composite Trapezoidal Rule
Numerical Integration • April 2026

Mastering the Composite Trapezoidal Rule

A
Written By Archive Editorial
Reading Time 5 Min Read

Introduction to Numerical Integration

Numerical integration allows us to approximate the area under a curve when an analytical solution is difficult or impossible to find. The Composite Trapezoidal Rule divides the interval $[a, b]$ into $n$ smaller sub-intervals of width $h = \frac{b-a}{n}$, approximates each piece as a trapezoid, and sums them up.

The formula for the Composite Trapezoidal Rule is: $$\int_a^b f(x) dx \approx \frac{h}{2} \left[ f(x_0) + 2f(x_1) + 2f(x_2) + \dots + 2f(x_{n-1}) + f(x_n) \right]$$

Solving the Problem

Given function $f(x) = x^{-2}$ on interval $[1, 2]$.

Case 1: $h = 1/2$

$n = (2-1) / 0.5 = 2$ sub-intervals. Points: $x_0=1, x_1=1.5, x_2=2$. Values: $f(1)=1, f(1.5)=1/2.25 \approx 0.4444, f(2)=0.25$. Area $\approx \frac{0.5}{2} [1 + 2(0.4444) + 0.25] = 0.25 [2.1388] \approx 0.5347$.

Case 2: $h = 1/4$

$n = (2-1) / 0.25 = 4$ sub-intervals. Points: $x_0=1, x_1=1.25, x_2=1.5, x_3=1.75, x_4=2$. Values: $f(1)=1, f(1.25)=0.64, f(1.5)=0.4444, f(1.75)=0.3265, f(2)=0.25$. Area $\approx \frac{0.25}{2} [1 + 2(0.64 + 0.4444 + 0.3265) + 0.25] = 0.125 [1.25 + 2.8218] = 0.125 [4.0718] \approx 0.5090$.

Intuition

As $h$ decreases (making more trapezoids), the approximation becomes more accurate, converging toward the exact value of $\int_1^2 x^{-2} dx = [-x^{-1}]_1^2 = -0.5 - (-1) = 0.5$.

Platform & Study Tools