# How do you find the area using the trapezoidal approximation method, given sinpi*x dx, on the interval [2, 5] with n=25?

Feb 26, 2017

Trapezium rule gives:

${\int}_{2}^{5} \setminus \sin \left(\pi x\right) \setminus \mathrm{dx} \approx 0.629062$

#### Explanation:

The values of $f \left(x\right) = \sin \left(\pi x\right)$ are tabulated as follows (using Excel) working to 5dp

Using the trapezoidal rule:

${\int}_{a}^{b} y \mathrm{dx} \approx \frac{h}{2} \left\{\left({y}_{0} + {y}_{n}\right) + 2 \left({y}_{1} + {y}_{2} + \ldots + {y}_{n - 1}\right)\right\}$

We have:

 int_2^5 \ sin(pix) \ dx ~~ 0.119999/2 { (0 - 0.000001) + 2(0.368124
$\text{ } + 0.684547 + 0.904827 + 0.998026 + 0.951056 + 0.770513$
$\text{ } + 0.481753 + 0.125333 - 0.24869 - 0.587786 - 0.844328$
$\text{ } - 0.982288 - 0.982288 - 0.844328 - 0.587786 - 0.24869$
$\text{ } + 0.125333 + 0.481753 + 0.770513 + 0.951056 + 0.998026$
 " "+ 0.904827 + 0.684547 + 0.368124) }

$\text{ } = 0.059999 \left\{- 0.000001 + 2 \left(5.242183\right)\right\}$
$\text{ } = 0.059999 \left\{- 0.000001 + 10.484367\right\}$
$\text{ } = 0.059999 \left\{+ 10.484367\right\}$
$\text{ } = 0.629062$

Let's compare this to the exact value:

${\int}_{2}^{5} \setminus \sin \left(\pi x\right) \setminus \mathrm{dx} = {\left[- \cos \frac{\pi x}{\pi}\right]}_{2}^{5}$
$\text{ } = \left(- \frac{1}{\pi}\right) {\left[\cos \left(\pi x\right)\right]}_{2}^{5}$
$\text{ } = \left(- \frac{1}{\pi}\right) \left(\cos \left(5 \pi\right) - \cos \left(2 \pi\right)\right)$
$\text{ } = \left(- \frac{1}{\pi}\right) \left(- 1 - 1\right)$
$\text{ } = \frac{2}{\pi}$
$\text{ } \approx 0.6366197724 \ldots$