Trapezoidal Rule calculator calculates the given function using trapezoidal rule. The trapezoidal rule is one of the method used to calculate the problems based on definite integral. Here we are approximating the given definite integral by finding the integrand and evaluating it at two desired points [a, b].

Trapezoidal Rule Formulas

If f(x) is continuous on the definite interval [a,b]. Divide definite interval [a,b] into equal length of n intervals then width is given by

Trapezoidal Rule formula is given by
Trapezoidal Rule Formula
Where yo, y1, y2 ...... yn are the values we get from the function.
You can solve the problems using trapezoidal rule by the following steps:
  1. Read the problem and note down the given interval [a, b] and Calculate the width using the formula : h = $\frac{b-a}{n}$
  2. Find the values of y1,y2,....yn by substituting the values in the function
  3. Using trapezoidal rule formula. Substituting these values we get the answer.

Solved Examples

Question 1: Find the approximate area of the curve $\int^{0}_{3}$ y = $\frac{1}{1 + x^{2}}$ using trapezoidal.
Solution:
The given curve is y = $\frac{1}{1 + x^{2}}$ for the interval [1, 3]

Step 1 : Here a = 1, b = 3 and n = 3

The width is given by
                                             h = $\frac{b - a}{n}$

                                                = $\frac{3 - 1}{3}$ 

                                                = 0.667.

Step 2 : For xo = 1, y0 = $\frac{1}{1 + 1^{2}}$ = 0.5

                    x1 = 2, y1 = $\frac{1}{1 + 2^{2}}$ = 0.2

                    x2 = 3, y2 = $\frac{1}{1 + 3^{2}}$ = 0.1

Step 3 : Using trapezoidal rule we have

$\int^{1}_{3}$ $\frac{1}{1 + x^{2}}$ dx = $\frac{h}{2}$[(yo + y2) + 2 (y1)]

                                                    = $\frac{0.667}{2}$ [(0.5 + 0.1) + 2 (0.2) ]

                                                    = 0.3335.


Question 2: Evaluate using trapezoidal rule for the function $\int^{-3}_{-1}$ x dx
Solution:
The given curve is f(x) = x dx for the interval [-3, -1]

Step 1 : Here a = -3, b = -1 and n = 3

The width is given by
                                             h = $\frac{b - a}{n}$

                                                = $\frac{-3 + 1}{3}$ 

                                                = - 0.667.

Step 2 : For x0 = - 3, yo = -3
                     x1 = - 2, y1 = -2                    
                     x2 = -1, y2 = -1          

Step 3 : Using trapezoidal rule we have

$\int^{a}_{b}$ f(x) dx = $\frac{h}{2}$ [(yo + yn) + 2 (y1 + y2 + ....... + yn-1)]

$\int^{1}_{3}$ $\frac{1}{1 + x^{2}}$ dx = $\frac{h}{2}$[(yo + y2) + 2 (y1)]

                                                    = $\frac{- 0.667}{2}$ [(-3 -1) + 2 (-2) ]

                                                    = - 2.668.