TOPICS
Search

Simpson's Rule


Simpson's rule is a Newton-Cotes formula for approximating the integral of a function f using quadratic polynomials (i.e., parabolic arcs instead of the straight line segments used in the trapezoidal rule). Simpson's rule can be derived by integrating a third-order Lagrange interpolating polynomial fit to the function at three equally spaced points. In particular, let the function f be tabulated at points x_0, x_1, and x_2 equally spaced by distance h, and denote f_n=f(x_n). Then Simpson's rule states that

int_(x_0)^(x_2)f(x)dx=int_(x_0)^(x_0+2h)f(x)dx
(1)
 approx 1/3h(f_0+4f_1+f_2).
(2)

Since it uses quadratic polynomials to approximate functions, Simpson's rule actually gives exact results when approximating integrals of polynomials up to cubic degree.

SimpsonsRule

For example, consider f(x)=sinx (black curve) on the interval [0,pi/2], so that f(x_0=0)=0, f(x_1=pi/4)=1/sqrt(2), and f(x_2=pi/2)=1. Then Simpson's rule (which corresponds to the area under the blue curve obtained from the third-order interpolating polynomial) gives

int_0^(pi/2)sinxdx approx 1/3(1/4pi)(0+4/sqrt(2)+1)
(3)
=1/(12)(1+2sqrt(2))pi
(4)
 approx 1.00228,
(5)

whereas the trapezoidal rule (area under the red curve) gives pi/4 approx 0.785398 and the actual answer is 1.

In exact form,

int_(x_0)^(x_2)f(x)dx=1/3h(f_0+4f_1+f_2)+1/6int_(x_0)^(x_1)(x_0-t)^2(x_1-t)f^((3))(t)dt+1/6int_(x_1)^(x_2)(x_2-t)^2(x_1-t)f^((3))(t)dt
(6)
=1/3h(f_0+4f_1+f_2)+R_n,
(7)

where the remainder term can be written as

 R_n=1/(90)h^5f^((4))(x^*),
(8)

with x^* being some value of x in the interval [x_0,x_2].

An extended version of the rule can be written for f(x) tabulated at x_0, x_1, ..., x_(2n) as

 int_(x_0)^(x_(2n))f(x)dx=1/3h[f_0+4(f_1+f_3+...+f_(2n-1)) 
 +2(f_2+f_4+...+f_(2n-2))+f_(2n)]-R_n,
(9)

where the remainder term is

 R_n=(nh^5)/(90)f^((4))(x^*)
(10)

for some x^* in [x_0,x_(2n)].


See also

Boole's Rule, Newton-Cotes Formulas, Simpson's 3/8 Rule, Trapezoidal Rule

Explore with Wolfram|Alpha

References

Abramowitz, M. and Stegun, I. A. (Eds.). Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, p. 886, 1972.Horwitz, A. "A Version of Simpson's Rule for Multiple Integrals." J. Comput. Appl. Math. 134, 1-11, 2001.Jeffreys, H. and Jeffreys, B. S. Methods of Mathematical Physics, 3rd ed. Cambridge, England: Cambridge University Press, p. 286, 1988.Trott, M. The Mathematica GuideBook for Programming. New York: Springer-Verlag, p. 105, 2004. http://www.mathematicaguidebooks.org/.Whittaker, E. T. and Robinson, G. "The Trapezoidal and Parabolic Rules." The Calculus of Observations: A Treatise on Numerical Mathematics, 4th ed. New York: Dover, pp. 156-158, 1967.

Cite this as:

Weisstein, Eric W. "Simpson's Rule." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/SimpsonsRule.html

Subject classifications