Mastering Numerical Integration: The Trapezoidal Rule
Numerical Integration • April 2026

Mastering Numerical Integration
The Trapezoidal Rule

A
Written By Archive Editorial
Reading Time 5 Min Read

Introduction to the Trapezoidal Rule

The Trapezoidal Rule is a technique for approximating the definite integral $\int_{a}^{b} f(x) dx$. Instead of finding the exact antiderivative, we approximate the area under the curve by dividing it into $n$ trapezoids of equal width.

The Formula

Given the interval $[a, b]$ divided into $n$ sub-intervals of width $h = \frac{b-a}{n}$, the Trapezoidal Rule is given by:

$$\int_{a}^{b} f(x) dx \approx \frac{h}{2} [y_0 + 2(y_1 + y_2 + ... + y_{n-1}) + y_n]$$

where $y_i = f(x_i)$ and $x_i = a + ih$.

Solving the Problem

We need to evaluate $\int_{0}^{2} \frac{dx}{1 + x^4}$ with $n=4$.

1. Identify parameters

  • $a = 0, b = 2, n = 4$
  • $h = \frac{b-a}{n} = \frac{2-0}{4} = 0.5$

2. Tabulate values

We evaluate $f(x) = \frac{1}{1+x^4}$ at $x_i = 0, 0.5, 1, 1.5, 2$:

$i$$x_i$$y_i = f(x_i)$
00$1 / (1+0^4) = 1.000$
10.5$1 / (1+0.5^4) = 1 / 1.0625 \approx 0.9412$
21.0$1 / (1+1^4) = 1 / 2 = 0.500$
31.5$1 / (1+1.5^4) = 1 / 6.0625 \approx 0.1649$
42.0$1 / (1+2^4) = 1 / 17 \approx 0.0588$

3. Apply the rule

$$\text{Integral} \approx \frac{0.5}{2} [1.000 + 2(0.9412 + 0.500 + 0.1649) + 0.0588]$$ $$\text{Integral} \approx 0.25 [1.000 + 2(1.6061) + 0.0588]$$ $$\text{Integral} \approx 0.25 [1.000 + 3.2122 + 0.0588] = 0.25 [4.2710] = 1.06775$$

Rounding to 3 decimal places, we get 1.068.

Platform & Study Tools