Inline videos. See also:Category: Articles with embedded Videos..

Simpson's rule

From Biocrawler, the free encyclopedia.

In numerical analysis, Simpson's rule (named after Thomas Simpson) is a way to get an approximation of an integral:

\int_{a}^{b} f(x) dx
Contents

Basics

Simpson's rule works by approximating f(x) by the quadratic polynomial P(x) which takes the same values as f(x) at a, b, and the midpoint m=(a+b)/2. One can use Lagrange polynomial interpolation to find an expression for this polynomial,

P(x)=f(a)\frac{(x-m)(x-b)}{(a-m)(a-b)}+ f(m)\frac{(x-a)(x-b)}{(m-a)(m-b)}+ f(b)\frac{(x-a)(x-m)}{(b-a)(b-m)}.

Simpson's rule then follows by an easy (albeit tedious) calculation:

\int_{a}^{b} f(x) dx\approx \int_{a}^{b} P(x) dx =\frac{b-a}{6}\left[f(a) + 4f\left(\frac{a+b}{2}\right)+f(b)\right].
The function f(x) (in blue) is approximated by a quadratic function P(x) (in red).
The function f(x) (in blue) is approximated by a quadratic function P(x) (in red).

The error in approximating an integral by Simpson's rule is

-\frac{h^5}{90}f^{(4)}(\xi),

with h = (ba) / 2 and ξ some number between a and b.

Composite Simpson's rule

We see that Simpson's rule provides an adequate approximation if the interval of integration [a,b] is small, which does not happen most of the time. The obvious solution is to split the interval of integration in small subintervals, apply Simpson's rule on each subinterval, and add up the results. In this way one obtains the composite Simpson's rule

\int_a^b f(x) dx\approx  \frac{h}{3}\bigg[f(x_0)+2\sum_{j=1}^{n/2-1}f(x_{2j})+ 4\sum_{j=1}^{n/2}f(x_{2j-1})+f(x_n) \bigg],

where n is the number of subintervals in which one splits [a,b] with n an even number, h = (ba) / n is the length of each subinterval, and xi = a + ih for i = 0,1,...,n − 1,n, in particular, x0 = a and xn = b. Alternatively, the above can be written as:

\int_a^b f(x) dx\approx \frac{h}{3}\bigg[f(x_0)+4f(x_1)+2f(x_2)+4f(x_3)+...+4f(x_{n-1})+f(x_n)\bigg].

The maximum error associated with the composite Simpson's rule can be found using the following formula:

-\frac{h^4}{180}(b-a)f^{(4)}(\xi),

Where h is the "step length", given by h = (ba) / n.

See also: Newton-Cotes formulas.

References

  • Burden, Richard L. and Faires, J. Douglas (2000). Numerical Analysis, (7th Ed). Brooks/Cole. ISBN 0534382169.

External link

Wikipedia (http://en.wikipedia.org/wiki/Main_Page) Simpson's_rule (http://en.wikipedia.org/wiki/Simpson's_rule) version history (http://en.wikipedia.org/w/index.php?title=Simpson's_rule&action=history) GNU Free Documentation Lizenz (http://en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License) CC-by-sa (http://creativecommons.org/licenses/by-sa/2.5/)

Personal tools
Google Search
Google
Web
biocrawler.com

 
In other languages