![](http://image.absoluteastronomy.com/images//topicimages/noimage.gif)
Simpson's rule
Encyclopedia
![](http://image.absoluteastronomy.com/images/encyclopediaimages/s/si/simpsons_method_illustration.png)
Numerical analysis
Numerical analysis is the study of algorithms that use numerical approximation for the problems of mathematical analysis ....
, Simpson's rule is a method for numerical integration
Numerical integration
In numerical analysis, numerical integration constitutes a broad family of algorithms for calculating the numerical value of a definite integral, and by extension, the term is also sometimes used to describe the numerical solution of differential equations. This article focuses on calculation of...
, the numerical approximation of definite integrals. Specifically, it is the following approximation:
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-1.gif)
Simpson's rule also corresponds to the 3-point Newton-Cotes quadrature rule
Newton-Cotes formulas
In numerical analysis, the Newton–Cotes formulae, also called the Newton–Cotes quadrature rules or simply Newton–Cotes rules, are a group of formulae for numerical integration based on evaluating the integrand at equally-spaced points...
.
The method is credited to the mathematician Thomas Simpson
Thomas Simpson
Thomas Simpson FRS was a British mathematician, inventor and eponym of Simpson's rule to approximate definite integrals...
(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
Naval architecture
Naval architecture is an engineering discipline dealing with the design, construction, maintenance and operation of marine vessels and structures. Naval architecture involves basic and applied research, design, development, design evaluation and calculations during all stages of the life of a...
to calculate the capacity of a ship or lifeboat
Lifeboat (shipboard)
A lifeboat is a small, rigid or inflatable watercraft carried for emergency evacuation in the event of a disaster aboard ship. In the military, a lifeboat may be referred to as a whaleboat, dinghy, or gig. The ship's tenders of cruise ships often double as lifeboats. Recreational sailors sometimes...
.
Quadratic interpolation
One derivation replaces the integrand![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-2.gif)
Quadratic polynomial
In mathematics, a quadratic polynomial or quadratic is a polynomial of degree two, also called second-order polynomial. That means the exponents of the polynomial's variables are no larger than 2...
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-3.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-4.gif)
Lagrange polynomial
In numerical analysis, Lagrange polynomials are used for polynomial interpolation. For a given set of distinct points x_j and numbers y_j, the Lagrange polynomial is the polynomial of the least degree that at each point x_j assumes the corresponding value y_j...
to find an expression for this polynomial,
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-5.gif)
An easy (albeit tedious) calculation shows that
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-6.gif)
This calculation can be carried out more easily if one first observes that (by scaling) there is no loss of generality
Without loss of generality
Without loss of generality is a frequently used expression in mathematics...
in assuming that
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-7.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-8.gif)
Averaging the midpoint and the trapezoidal rules
Another derivation constructs Simpson's rule from two simpler approximations: the midpoint rule![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-9.gif)
and the trapezoidal rule
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-10.gif)
The errors in these approximations are
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-11.gif)
respectively. It follows that the leading error term vanishes if we take the weighted average
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-12.gif)
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
Romberg's method
In numerical analysis, Romberg's method is used to estimate the definite integral \int_a^b f \, dx by applying Richardson extrapolation repeatedly on the trapezium rule or the rectangle rule . The estimates generate a triangular array...
.
Undetermined coefficients
The third derivation starts from the ansatzAnsatz
Ansatz is a German noun with several meanings in the English language.It is widely encountered in physics and mathematics literature.Since ansatz is a noun, in German texts the initial a of this word is always capitalised.-Definition:...
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-13.gif)
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![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-14.gif)
where
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-15.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-16.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-17.gif)
The error is asymptotically proportional to
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-18.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-19.gif)
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![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-20.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-21.gif)
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
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-22.gif)
Suppose that the interval
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-23.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-24.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-25.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-26.gif)
where
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-27.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-28.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-29.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-30.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-31.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-32.gif)
The error committed by the composite Simpson's rule is bounded (in absolute value) by
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-33.gif)
where
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-34.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-35.gif)
This formulation splits the interval
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-36.gif)
Adaptive Simpson's method
Adaptive Simpson's method, also called adaptive Simpson's rule, is a method of numerical integration proposed by G.F. Kuncir in 1962. It is probably the first recursive adaptive algorithm for numerical integration to appear in print, although more modern adaptive methods based on Gauss–Kronrod...
.
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:![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-37.gif)
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:![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-38.gif)
The error of this method is:
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-39.gif)
where
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-40.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-41.gif)
![](http://image.absoluteastronomy.com/images/formulas/7/6/1769399-42.gif)
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, n-1, 2):
x = a + h * i
S += 2 * f(x)
S += f(b)
F = h * S / 3
return F
External links
- 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