Simpson's Rule

Goal of this chapter

Understand the derivation of Simpson's rule (quadratic-polynomial approximation), the $O(h^4)$ error estimate, and the composite Simpson rule.

Contents

2. Simpson's 3/8 Rule

This rule is based on cubic Lagrange interpolation using four points.

Simpson's 3/8 rule

$$\displaystyle\int_a^b f(x)\,dx \approx \dfrac{3h}{8}\bigl[f(x_0) + 3f(x_1) + 3f(x_2) + f(x_3)\bigr], \qquad h = \dfrac{b-a}{3}$$

The weight ratio is $1:3:3:1$, and it is exact for cubic polynomials. It is convenient when the number of subintervals is a multiple of 3.

3. Composite Simpson Rule

Divide $[a,b]$ into $n$ (even) equal parts and apply the 1/3 rule over each adjacent pair of subintervals. With $h = (b-a)/n$,

Composite Simpson rule

$$S_n = \dfrac{h}{3}\bigl[f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + \cdots + 4f(x_{n-1}) + f(x_n)\bigr]$$

The weights follow the pattern $1, 4, 2, 4, 2, \ldots, 4, 2, 4, 1$.

4. Error Estimate

Theorem (error of the composite Simpson rule)

If $f \in C^4[a,b]$, then

$$\displaystyle\int_a^b f(x)\,dx - S_n = -\dfrac{(b-a)h^4}{180}\,f^{(4)}(\xi), \qquad \xi \in (a,b)$$

that is, the error is $O(h^4)$.

This is two orders more accurate than the trapezoidal rule's $O(h^2)$. Halving the step size $h$ reduces the error by roughly $1/16$.

5. Accuracy Comparison with the Trapezoidal Rule

10⁻¹⁰ 10⁻⁸ 10⁻⁶ 10⁻⁴ 10⁻¹¹ 64 128 256 512 1024 n (subdivisions, log spacing) |error| Trapezoid O(h²) Simpson O(h⁴)
Figure 2. Convergence of the error for $\displaystyle\int_{-4}^{4} \operatorname{sinc} x\,dx$ with the trapezoidal and Simpson rules (log-log). The measured errors (the difference of $T_n$ and $S_n$ from the true value $\approx 0.9499$) at $n=64,128,256,512,1024$ are plotted. The trapezoidal rule has slope about $2$ ($O(h^2)$) and Simpson rule slope about $4$ ($O(h^4)$); once the mesh resolves the peak Simpson is orders of magnitude smaller at the same $n$ and decreases more steeply. The integrand is the same $\operatorname{sinc} x$ as in Figure 1.
RuleInterpolation degreeDegree of accuracyError order
Trapezoidal11$O(h^2)$
Simpson 1/323 (+ bonus)$O(h^4)$
Simpson 3/833$O(h^4)$

6. FAQ

Q1. What is Simpson's rule?

It is a method of numerical integration that approximates a definite integral by the area under the parabola through three points. The 1/3 rule is $\dfrac{h}{3}[f(a)+4f(m)+f(b)]$ and returns the exact value for polynomials of degree up to 3.

Q2. How accurate is Simpson's rule?

The error of the composite Simpson rule is $O(h^4)$, two orders more accurate than the trapezoidal rule's $O(h^2)$.

Q3. What is the difference between the 1/3 and 3/8 rules?

The 1/3 rule uses quadratic interpolation (3 points) and the 3/8 rule cubic interpolation (4 points). Both are $O(h^5)$ on a single panel, but the 3/8 rule is convenient when the number of subintervals is a multiple of 3.

7. References

  • Wikipedia, "Simpson's rule"
  • R. L. Burden & J. D. Faires, Numerical Analysis, 10th ed., Cengage, 2016.
  • P. J. Davis & P. Rabinowitz, Methods of Numerical Integration, 2nd ed., Academic Press, 1984.