a)With f(x)= e^-x^2 , compute approximations using midpoint, trapezoidal and simpson's rule for
∫ [0 to 2] f(x) dx
with n=2 (5 decimal places)
Well for midpoint, divide each subinterval into width $\displaystyle \frac{b-a}{n}$. And the height is of course the midpoint values. Thus we can use these rectangles to approximate the area. So...
$\displaystyle A \approx (\frac{2-0}{2}) \left(f(.5)+f(1.5) \right)$
I found that from midpoint rule gives 0.88420, trapezoidal rule gives 0.87704, and simpson's rule gives 0.82994. The next question asks me to
Compute the error esimates for midpoint, trapezoidal, simpson's. Carefully examine the extreme values of f ''(x). You may use that |f ''''(x)| < 12 for 0<x<2. (the < signs all mean less than or equal to).
How would you do this?
It is shown in numerical analysis that given a function,
$\displaystyle f$ continous on $\displaystyle [a,b]$ with a countinous $\displaystyle f''$ then, let $\displaystyle T_n$ be the result of using the trapezoidal rule $\displaystyle n$ subdivisons. Then, the error term
If $\displaystyle E_n=\left| \int_a^b f(x)dx -T_n \right|$
satisfies,
$\displaystyle E_n\leq \frac{(b-a)^3}{12n^2}\cdot \max_{a\leq x\leq b}\{f''(x)\}$ (which exists by EVT)