Simpson's rule is a Newton-Cotes formula for approximating the integral of a function 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 be tabulated at points , , and equally spaced by distance , and denote . Then Simpson's rule states that
(1)
| |||
(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.
For example, consider (black curve) on the interval , so that , , and . Then Simpson's rule (which corresponds to the area under the blue curve obtained from the third-order interpolating polynomial) gives
(3)
| |||
(4)
| |||
(5)
|
whereas the trapezoidal rule (area under the red curve) gives and the actual answer is 1.
In exact form,
(6)
| |||
(7)
|
where the remainder term can be written as
(8)
|
with being some value of in the interval .
An extended version of the rule can be written for tabulated at , , ..., as
(9)
|
where the remainder term is
(10)
|
for some .