 Simpson's rule

In numerical analysis, Simpson's rule is a method for numerical integration, the numerical approximation of definite integrals. Specifically, it is the following approximation:
Simpson's rule also corresponds to the 3point NewtonCotes quadrature rule.
The method is credited to the mathematician Thomas Simpson (1710–1761) of Leicestershire, England. Kepler used similar formulas over 100 years prior and in German the method is sometimes called Keplersche Fassregel for this reason.
Simpson's rule is a staple of scientific data analysis and engineering. It is widely used, for example, by Naval architects to calculate the capacity of a ship or lifeboat.^{[1]}
Contents
Derivation
Simpson's rule can be derived in various ways.
Quadratic interpolation
One derivation replaces the integrand f(x) by the quadratic polynomial P(x) which takes the same values as f(x) at the end points a and b and the midpoint m = (a + b) / 2. One can use Lagrange polynomial interpolation to find an expression for this polynomial,
An easy (albeit tedious) calculation shows that
 ^{[2]}
This calculation can be carried out more easily if one first observes that (by scaling) there is no loss of generality in assuming that a = − 1 and b = 1.
Averaging the midpoint and the trapezoidal rules
Another derivation constructs Simpson's rule from two simpler approximations: the midpoint rule
and the trapezoidal rule
The errors in these approximations are
respectively. It follows that the leading error term vanishes if we take the weighted average
This weighted average is exactly Simpson's rule.
Using another approximation (for example, the trapezoidal rule with twice as many points), it is possible to take a suitable weighted average and eliminate another error term. This is Romberg's method.
Undetermined coefficients
The third derivation starts from the ansatz
The coefficients α, β and γ can be fixed by requiring that this approximation be exact for all quadratic polynomials. This yields Simpson's rule.
Error
The error in approximating an integral by Simpson's rule is
where ξ is some number between a and b.^{[3]}
The error is asymptotically proportional to (b − a)^{5}. However, the above derivations suggest an error proportional to (b − a)^{4}. Simpson's rule gains an extra order because the points at which the integrand is evaluated are distributed symmetrically in the interval [a, b].
Simpson's rule provides exact results for any polynomial of degree three or less, since the error term involves the fourth derivative of f.
Composite Simpson's rule
If the interval of integration [a,b] is in some sense "small", then Simpson's rule will provide an adequate approximation to the exact integral. By small, what we really mean is that the function being integrated is relatively smooth over the interval [a,b]. For such a function, a smooth quadratic interpolant like the one used in Simpson's rule will give good results.
However, it is often the case that the function we are trying to integrate is not smooth over the interval. Typically, this means that either the function is highly oscillatory, or it lacks derivatives at certain points. In these cases, Simpson's rule may give very poor results. One common way of handling this problem is by breaking up the interval [a,b] into a number of small subintervals. Simpson's rule is then applied to each subinterval, with the results being summed to produce an approximation for the integral over the entire interval. This sort of approach is termed the composite Simpson's rule.
Suppose that the interval [a,b] is split up in n subintervals, with n an even number. Then, the composite Simpson's rule is given by
where x_{j} = a + jh for j = 0,1,...,n − 1,n with h = (b − a) / n; in particular, x_{0} = a and x_{n} = b. The above formula can also be written as
The error committed by the composite Simpson's rule is bounded (in absolute value) by
where h is the "step length", given by h = (b − a) / n.^{[4]}
This formulation splits the interval [a,b] in subintervals of equal length. In practice, it is often advantageous to use subintervals of different lengths, and concentrate the efforts on the places where the integrand is less wellbehaved. This leads to the adaptive Simpson's method.
Alternative extended Simpson's rule
This is another formulation of a composite Simpson's rule: instead of applying Simpson's rule to disjoint segments of the integral to be approximated, Simpson's rule is applied to overlapping segments, yielding:^{[5]}
Simpson's 3/8 rule
Simpson's 3/8 rule is another method for numerical integration proposed by Thomas Simpson. It is based upon a cubic interpolation rather than a quadratic interpolation. Simpson's 3/8 rule is as follows:
The error of this method is:
where ξ is some number between a and b. Thus, the 3/8 rule is about twice as accurate as the standard method, but it uses one more function value. A composite 3/8 rule also exists, similarly as above.^{[6]}
Simpson's 3/8 rule is used by Naval architects to calculate a merchant cargo ship's lifeboat capacity.
Sample implementation
An implementation of the composite Simpson's rule in pylab:
def simpson(f, a, b, n): """f=function, a=initial value, b=end value, n=number of double intervals of size 2h""" n *= 2 h = (b  a) / n; S = f(a) for i in range(1, n, 2): x = a + h * i S += 4 * f(x) for i in range(2, n1, 2): x = a + h * i S += 2 * f(x) S += f(b) F = h * S / 3 return F
See also
Notes
 ^ McCall Pate (1918). The naval artificer's manual: (The naval artificer's handbook revised) text, questions and general information for deck. United States. Bureau of Reconstruction and Repair. p. 198. http://books.google.com/books?id=bQc9AAAAYAAJ&pg=PA198.
 ^ Atkinson, p. 256; Süli and Mayers, §7.2
 ^ Atkinson, equation (5.1.15); Süli and Mayers, Theorem 7.2
 ^ Atkinson, pp. 257+258; Süli and Mayers, §7.5
 ^ Press (1989), p. 122
 ^ Matthews (2004)
References
 Atkinson, Kendall E. (1989). An Introduction to Numerical Analysis (2nd ed.). John Wiley & Sons. ISBN 0471500232.
 Burden, Richard L. and Faires, J. Douglas (2000). Numerical Analysis (7th ed.). Brooks/Cole. ISBN 0534382169.
 Matthews, John H. (2004). "Simpson's 3/8 Rule for Numerical Integration". Numerical Analysis  Numerical Methods Project. California State University, Fullerton. http://math.fullerton.edu/mathews/n2003/Simpson38RuleMod.html. Retrieved 11 November 2008.
 Press, William H., Brian P. Flannery, William T. Vetterling, and Saul A. Teukolsky (1989). Numerical Recipes in Pascal: The Art of Scientific Computing. Cambridge University Press. ISBN 0521375169. http://books.google.com/?id=bh5w6EMPUC&pg=PA122&dq=extendedsimpson%27srule.
 Süli, Endre and Mayers, David (2003). An Introduction to Numerical Analysis. Cambridge University Press. ISBN 0521810264 (hardback), ISBN 0521007941 (paperback).
 Kaw, Autar; Kalu, Egwu (2008). "Numerical Methods with Applications". [1]..
 Weisstein, Eric W. (2010). "NewtonCotes Formulas". MathWorldA Wolfram Web Resource.. MathWorld. http://mathworld.wolfram.com/NewtonCotesFormulas.html. Retrieved 2 August 2010.
External links
 Weisstein, Eric W., "Simpson's Rule" from MathWorld.
 Simpson's Rule for Numerical Integration
 Application of Simpson's Rule  Earthwork Excavation (Note: The formula described in this page is correct but there are errors in the calculation which should give a result of 569m3 and not 623m3 as stated)
 Simpson's 1/3rd rule of integration  Notes, PPT, Mathcad, Matlab, Mathematica, Maple at Numerical Methods for STEM undergraduate
 A detailed description of a computer implementation is described by Dorai Sitaram in Teach Yourself Scheme in Fixnum Days, Appendix C
 C Language Program to Implement Simpson's Rule
This article incorporates material from Code for Simpson's rule on PlanetMath, which is licensed under the Creative Commons Attribution/ShareAlike License.
Categories: Integral calculus
 Numerical integration (quadrature)
 Mathematical analysis
 Numerical analysis
Wikimedia Foundation. 2010.
Look at other dictionaries:
Simpson's rule — noun Etymology: Thomas Simpson died 1761 English mathematician Date: circa 1875 a method for approximating the area under a curve over a given interval that involves partitioning the interval by an odd number n + 1 of equally spaced ordinates and … New Collegiate Dictionary
Simpson's rule — Math. a method for approximating the value of a definite integral by approximating, with parabolic arcs, the area under the curve defined by the integrand. [1895 1900; named after Thomas Simpson (1710 61), English mathematician] * * * … Universalium
simpson's rule — noun Usage: usually capitalized S Etymology: after Thomas Simpson died 1761 English mathematician : a method used especially by naval architects for computing the approximate area bounded by a curve by adding the areas of a series of figures… … Useful english dictionary
Simpson — may refer to:* Simpson (name)In places:*In Australia: **Simpson Desert*In Canada: **Simpson, Saskatchewan*In the United Kingdom **Simpson, Buckinghamshire* In the United States **Simpson, Illinois **Simpson, Indiana **Simpson, Kansas **Simpson,… … Wikipedia
Simpson , Thomas — (1710–1761) British mathematician The son of a weaver from Market Bosworth in Leicestershire, Simpson was largely self educated. His mathematical interests were aroused when a peddler gave him a copy of the popular textbook, Cocker s Arithmetic.… … Scientists
Simpson's paradox — (or the Yule Simpson effect) is a statistical paradox wherein the successes of groups seem reversed when the groups are combined. This result is often encountered in social and medical science statistics [cite journal title = Simpson s Paradox in … Wikipedia
Simpson'sintheStrand — is one of London s most renowned traditional English restaurants, and banqueting suites. Situated in one of the capital s famous streets, The Strand, it is part of the Savoy Buildings, which include possibly the world s most famous hostelry, the… … Wikipedia
Adaptive Simpson's method — Adaptive Simpson s method, also called adaptive Simpson s rule, is a method of numerical integration proposed by William M. McKeeman in 1962.William M. McKeeman: Algorithm 145: Adaptive numerical integration by Simpson s rule. Commun. ACM 5(12):… … Wikipedia
Trapezoidal rule — This article is about the quadrature rule for approximating integrals. For the Explicit trapezoidal rule for solving initial value problems, see Heun s method. The function f(x) (in blue) is approximated by a linear function (in red). In… … Wikipedia
Thomas Simpson — (August 20, 1710 ndash; May 14, 1761) was a British mathematician, inventor and eponym of Simpson s rule to approximate definite integrals. However, this rule was also found 200 years earlier from Johannes Kepler, in the so called Keplersche… … Wikipedia