How to do trapezoid rule approximation of integral of sec xdx from -1 to 1 and n= 4? Also what is the error bound? Thanks.
Should be everything you need here:
Trapezoidal rule - Wikipedia, the free encyclopedia
So what you do is decide how many trapezoids to divide your integral into (the more trapezoids, the more accurate your answer will be, but then the more work you have to do). At each of these points on the interval, calculate sec x. Then just feed those numbers into the "composite trapezoidal rule" equation.
$\displaystyle \int_{-1}^1 \sec{x} \, dx \approx \frac{1-(-1)}{2\cdot4} \left[\sec(-1) + 2\sec\left(-\frac{1}{2}\right) + 2\sec(0) + 2\sec\left(\frac{1}{2}\right) + \sec(1) \right]$
error bound ...
$\displaystyle |e| \le \frac{M(b-a)^3}{12n^2}$
where ...
$\displaystyle f''(c) \le M \, ; \, c \in [a,b]$