next up previous
Next: Gaussian Quadrature Up: NUMERICAL INTEGRATION Previous: Trapezoidal Rule:


Simpson's Rule:

uses second-order Lagrange polynomials. Schematically, the situation in the Trapezoidal rule is shown in Figure 45

Figure 45: The Simpson rule approximates the area under $f(x)$ by a box bounded above by a parabolic function.
\includegraphics[totalheight=3in]{simp.eps}

let $\displaystyle h=\frac{b-a}{2},\quad x_0=a,\quad x_1=a+h,\quad x_2=b$

\begin{eqnarray*}
&&\int^b_af(x)dx=\\
&&\int^{x_2}_{x_0}\left[\frac{(x-x_1)(x...
...int^{x_1}_{x_0}\frac{1}{6}(x-x_0)(x-x_2)(x-x_2)f^{(3)}(\xi(x))dx
\end{eqnarray*}



Exercise apply same technique: get O$(h^4)$ involving $f^{(3)}$

$\Box$

We can get a better approximation as follows:

\begin{displaymath}
f(x)=f(x_1)+f'(x_1)(x-x_0)+\frac{f''(x_1)}{2}+(x-x_1)^2+
\frac{f'''(x_1)}{6}(x-x_1)^3+\frac{f^{(iv)}(\xi(x))}{24}(x-x_1)^4
\end{displaymath}

and
(46) $\displaystyle \int^{x_2}_{x_0}f(x)dx$ $\textstyle =$ $\displaystyle f(x_1)(x_2-x_0)+$
      $\displaystyle \left[\frac{f'(x_1)}{2}
(x-x_1)^2+\right.$
      $\displaystyle \left.\frac{f''(x_1)}{6}(x-x_1)^3+\frac{f'''(x_1)}{24}(x-x_1)^4
\right\vert^{x_2}_{x_0}+$
      $\displaystyle \frac{1}{24}\int^{x_2}_{x_0}f^{(iv)}(\xi(x))(x-x_1)^4
dx$

$(x-x_1)^4$ is nonnegative so we can apply the Weighted Mean Value Theorem


\begin{displaymath}
\frac{1}{24}\int^{x_2}_{x_0}f^{(iv)}(\xi(x))(x-x_1)^4
dx=\...
...dx=
\frac{f^{(iv)}(\xi_1)}{120}(x-x_1)^5\Big\vert^{x_1}_{x_0}
\end{displaymath}

for some $
\xi_1\in(x_0, x_2).
$ Since $h= x_2-x_1=x_1-x_0$ We can rewrite (47) as

\begin{displaymath}
\int^{x_2}_{x_0}f(x)dx=\frac{h}{3}[f(x_0)+4f(x_1)+f(x_2)]
...
...[\frac{1}{3}f^{(iv)}(\xi_2)-\frac{1}{5}f^{(iv)}(\xi_1)\right].
\end{displaymath}

The resulting approximation of the integral is

\begin{displaymath}
\int_{x_0}^{x_2} f(x)\, dx=2hf(x_1)+\frac{h^3}{3}f''(x_1)+\frac{h^5}{60}f^{(iv)}(\xi_1)
\end{displaymath}

We can approximate the second derivative term using the three point central difference formula

\begin{displaymath}
f''(x_1)=\frac{f(x_2)-2f(x_1)+f(x_0)}{h^2}+\frac{h^2}{12}f^{(iv)}(\xi_2)
\end{displaymath}

to get

\begin{displaymath}
\int_{x_0}^{x_2} f(x)\, dx=\frac{h}{3}[f(x_0)+4f(x_1)+f(x_2)]
-\frac{h^5}{36}f^{(iv)}(\xi_2)
+\frac{h^5}{60}f^{(iv)}(\xi_1)
\end{displaymath}

One more application of the mean value theorem yields

\framebox[\textwidth][s]{
$\displaystyle
\mbox {Simpson's rule }
\int^{x_2}_{x_0}f(x)dx=\frac{h}{3}[f(x_0)+4f(x_1)+f(x_2)]
-\frac{h^5}{90}f^{(iv)}(\xi)
$}

Simpson's rule is exact for polynomials of degrees 3 or less. This is one degree higher than we would have expected based on the Lagrange polynomials. It is a consequence of the symmetry of the grid points which leads to cancellation what otherwise would have been the leading error term.

Remark: Both Trapezoidal and Simpson Rules are examples of ``Newton-Cotes Formulas'', since they use equidistant grid points. There are higher order ones, but in general these are not recommended: you are either better off using approximations by piecewise polynomials of low degree, (see9.4), or using unequally spaced points. For example, we could use Gaussian Quadrature (see 9.3), which we cover briefly next. As a matter of fact, Newton-Cotes formulas of degree larger than 8 can lead to unusual results, since the weights or coefficients are negative, beyond this point.


next up previous
Next: Gaussian Quadrature Up: NUMERICAL INTEGRATION Previous: Trapezoidal Rule:
Juan Restrepo 2003-04-12