Trapezoidal rule is a technique used to approximate the value of a definite integral ($\int_{a}^{b}$ f(x)dx). Supposing f(x) is continuous on [a, b] divide [a, b] into n sub intervals of equal length $\bigtriangleup$x = $\frac{b - a}{n}$.  Using n + 1 points we get $x_{0}$ = a, $x_{1}$ = a + $\bigtriangleup$x, $x_{2}$ = a + 2$\bigtriangleup$x, ......, $x_{n}$ = a + n$\bigtriangleup$x = b.

f(x) at these points is $y_{0}$ = f($x_{0}$), $y_{1}$ = f($x_{1}$),.......,$y_{n}$ = f($x_{n}$). As straight lines are formed between the points (x$_{i-1}$, y$_{i-1}$) and (x$_{i}$, y$_{i}$) for 1 $\leq$ i $\leq$ n approximate the integral using n trapezoids.

Adding the area of a rectangle and a triangle the area of trapezoid is

Trapezoidal Rule Examples

Solved Examples

Question 1: Use the trapezoidal rule with n = 5 estimate  $\int_{1}^{5}\sqrt{1+x^{2}}$ dx
Solution:

For n = 5 we have $\bigtriangleup$x = $\frac{5-1}{5}$ = 0.8

Computing the values for $y_{0}$, $y_{1}$,......,$y_{5}$

 x y = $\sqrt{1+x^{2}}$ 1 1.41 1.8 2.06 2.6 2.78 3.4 3.54 4.2 4.32 5 5.10
$\int_{1}^{5}\sqrt{1+x^{2}}$ dx  = $\frac{0.8}{2}$ (1.41 + 2(2.06) + 2(2.18) + 2(3.54) + 2(4.32) + (5.10))
= 12.284

Question 2: Use the trapezoidal rule with n = 4 estimate $\int_{1}^{6}x^{4}$ dx.
Solution:

Given a = 1, b = 6 and n = 4  so h = $\frac{b-a}{n}$ = $\frac{6-1}{4}$ = 1.25

$x_{0}$ = 1, $x_{1}$ = 2.25, $x_{2}$ = 3.5, $x_{3}$ = 4.75, $x_{4}$ = 6
The given table gives values of x, in the left column, and $y=x^{4}$, in the right column.

 1 1 2.25 25.628 3.5 150.06 4.75 509.06 6 1296

Using the trapezoidal rule,
$\int_{1}^{6}x^{4}$ dx  = $\frac{1.25}{2}$ (1 + 2(25.628) + 2(150.06) + 2(509.06) + 1296)) = $0.625\times 2660.496$ = 1662.81.