Learning Outcomes
- Use Simpson’s rule to approximate the value of a definite integral to a given accuracy
With the midpoint rule, we estimated areas of regions under curves by using rectangles. In a sense, we approximated the curve with piecewise constant functions. With the trapezoidal rule, we approximated the curve by using piecewise linear functions. What if we were, instead, to approximate a curve using piecewise quadratic functions? With Simpson’s rule, we do just this. We partition the interval into an even number of subintervals, each of equal width. Over the first pair of subintervals we approximate [latex]{\displaystyle\int }_{{x}_{0}}^{{x}_{2}}f\left(x\right)dx[/latex] with [latex]{\displaystyle\int }_{{x}_{0}}^{{x}_{2}}p\left(x\right)dx[/latex], where [latex]p\left(x\right)=A{x}^{2}+Bx+C[/latex] is the quadratic function passing through [latex]\left({x}_{0},f\left({x}_{0}\right)\right)[/latex], [latex]\left({x}_{1},f\left({x}_{1}\right)\right)[/latex], and [latex]\left({x}_{2},f\left({x}_{2}\right)\right)[/latex] (Figure 4). Over the next pair of subintervals we approximate [latex]{\displaystyle\int }_{{x}_{2}}^{{x}_{4}}f\left(x\right)dx[/latex] with the integral of another quadratic function passing through [latex]\left({x}_{2},f\left({x}_{2}\right)\right)[/latex], [latex]\left({x}_{3},f\left({x}_{3}\right)\right)[/latex], and [latex]\left({x}_{4},f\left({x}_{4}\right)\right)[/latex]. This process is continued with each successive pair of subintervals.
To understand the formula that we obtain for Simpson’s rule, we begin by deriving a formula for this approximation over the first two subintervals. As we go through the derivation, we need to keep in mind the following relationships:
[latex]{x}_{2}-{x}_{0}=2\Delta x[/latex], where [latex]\Delta x[/latex] is the length of a subinterval.
Thus,
If we approximate [latex]{\displaystyle\int }_{{x}_{2}}^{{x}_{4}}f\left(x\right)dx[/latex] using the same method, we see that we have
Combining these two approximations, we get
The pattern continues as we add pairs of subintervals to our approximation. The general rule may be stated as follows.
Simpson’s Rule
Assume that [latex]f\left(x\right)[/latex] is continuous over [latex]\left[a,b\right][/latex]. Let n be a positive even integer and [latex]\Delta x=\frac{b-a}{n}[/latex]. Let [latex]\left[a,b\right][/latex] be divided into [latex]n[/latex] subintervals, each of length [latex]\Delta x[/latex], with endpoints at [latex]P=\left\{{x}_{0},{x}_{1},{x}_{2},\ldots ,{x}_{n}\right\}[/latex]. Set
Then,
Just as the trapezoidal rule is the average of the left-hand and right-hand rules for estimating definite integrals, Simpson’s rule may be obtained from the midpoint and trapezoidal rules by using a weighted average. It can be shown that [latex]{S}_{2n}=\left(\frac{2}{3}\right){M}_{n}+\left(\frac{1}{3}\right){T}_{n}[/latex].
It is also possible to put a bound on the error when using Simpson’s rule to approximate a definite integral. The bound in the error is given by the following rule:
Rule: Error Bound for Simpson’s Rule
Let [latex]f\left(x\right)[/latex] be a continuous function over [latex]\left[a,b\right][/latex] having a fourth derivative, [latex]{f}^{\left(4\right)}\left(x\right)[/latex], over this interval. If [latex]M[/latex] is the maximum value of [latex]|{f}^{\left(4\right)}\left(x\right)|[/latex] over [latex]\left[a,b\right][/latex], then the upper bound for the error in using [latex]{S}_{n}[/latex] to estimate [latex]{\displaystyle\int }_{a}^{b}f\left(x\right)dx[/latex] is given by
Example: Applying Simpson’s Rule 1
Use [latex]{S}_{2}[/latex] to approximate [latex]{\displaystyle\int }_{0}^{1}{x}^{3}dx[/latex]. Estimate a bound for the error in [latex]{S}_{2}[/latex].
Example: Applying Simpson’s Rule 2
Use [latex]{S}_{6}[/latex] to estimate the length of the curve [latex]y=\frac{1}{2}{x}^{2}[/latex] over [latex]\left[1,4\right][/latex].
Watch the following video to see the worked solution to Example: Applying Simpson’s Rule 2
For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.
You can view the transcript for this segmented clip of “3.6.5” here (opens in new window).
try it
Use [latex]{S}_{2}[/latex] to estimate [latex]{\displaystyle\int }_{1}^{2}\frac{1}{x}dx[/latex].
Try It
Candela Citations
- 3.6.5. Authored by: Ryan Melton. License: CC BY: Attribution
- Calculus Volume 2. Authored by: Gilbert Strang, Edwin (Jed) Herman. Provided by: OpenStax. Located at: https://openstax.org/books/calculus-volume-2/pages/1-introduction. License: CC BY-NC-SA: Attribution-NonCommercial-ShareAlike. License Terms: Access for free at https://openstax.org/books/calculus-volume-2/pages/1-introduction