Skip to main content
Examonaut

Topic 6 · Lesson 3 of 4

Simpson's rule

The rule

Divide [a,b][a, b] into an even number nn of strips of width h=b−anh = \frac{b - a}{n}, with ordinates y0,y1,…,yny_0, y_1, \dots, y_n. Simpson's rule fits a parabola through each consecutive set of three points, and adding the areas under the parabolas gives

∫aby dx≈h3[(y0+yn)+4(y1+y3+⋯+yn−1)+2(y2+y4+⋯+yn−2)]\int_a^b y \, dx \approx \frac{h}{3}\left[(y_0 + y_n) + 4(y_1 + y_3 + \dots + y_{n-1}) + 2(y_2 + y_4 + \dots + y_{n-2})\right]

"Ends, plus four times the odds, plus two times the evens, all times h3\frac{h}{3}." Because it uses pairs of strips, the number of strips must be even (an odd number of ordinates).

Worked example

Simpson's rule

Estimate ∫01ex2 dx\int_0^1 e^{x^2} \, dx with 4 strips.

Show solution
  1. h=0.25h = 0.25. The ordinates are e0=1e^0 = 1, e0.0625=1.06449e^{0.0625} = 1.06449, e0.25=1.28403e^{0.25} = 1.28403, e0.5625=1.75505e^{0.5625} = 1.75505, e1=2.71828e^1 = 2.71828.
  2. Ends: 1+2.71828=3.718281 + 2.71828 = 3.71828. Odds: 4(1.06449+1.75505)=11.278164(1.06449 + 1.75505) = 11.27816. Evens: 2(1.28403)=2.568062(1.28403) = 2.56806.
  3. 0.253×17.5645=1.46371\frac{0.25}{3} \times 17.5645 = 1.46371.

The true value is 1.462651.46265, so four strips already give three significant figures. (The trapezium rule with the same ordinates gives 1.49071.4907.)

Using data

Simpson's rule works on a table of measurements, as long as the readings are equally spaced and the number of intervals is even. A table of speeds at equal time intervals gives the distance travelled, and a table of cross-sectional areas gives a volume. In context, the estimate assumes the quantity varies smoothly between readings.

Why it is so accurate

Simpson's rule is exact for any cubic. On a pair of strips from −h-h to hh, odd powers integrate to zero, and for a+cx2a + cx^2:

∫−hh(a+cx2) dx=2ah+23ch3=h3[(a+ch2)+4a+(a+ch2)]\int_{-h}^{h} (a + cx^2) \, dx = 2ah + \frac{2}{3}ch^3 = \frac{h}{3}\left[(a + ch^2) + 4a + (a + ch^2)\right]

so the rule gives exactly the right answer. For other smooth functions the error falls very quickly as the strips get narrower: halving hh divides it by about 16.

Simpson's rule in other calculations

Any definite integral can be estimated this way: a volume of revolution π∫y2 dx\pi\int y^2 \, dx (apply the rule to y2y^2, then multiply by π\pi), an area under a parametric curve ∫ydxdt dt\int y\frac{dx}{dt} \, dt, or a mean value. Write down the integral first, then tabulate its integrand.

Practise this topic

Both are part of Premium.