Lesson 6 of 8 · 18 min

Simpson's rule

Approximate an area or a definite integral by fitting parabolas through pairs of strips, from a formula or a table of measurements, and judge how accurate the estimate is.

What you will be able to do

  • Explain why Simpson's rule fits parabolas and why it needs an even number of strips.
  • Apply Simpson's rule to a function or a table of values, with and without technology.
  • Compare Simpson's rule with the trapezoidal rule and with an exact value.

Some integrals cannot be done exactly. ∫01ex2 dx\int_0^1 e^{x^2}\,dx has no antiderivative made of the functions you know. And sometimes there is no formula at all, only measurements: the depth of a river every 2 metres, or the width of a block of land every 10 metres.

In Methods the trapezoidal rule joined the points with straight lines. Simpson's rule joins them, three at a time, with parabolas. Curves follow curves far better than lines do.

Simpson's rule with n=4n = 4 on y=2+sin⁡(1.5x)y = 2 + \sin(1.5x). One parabola passes through the points at x=0,1,2x = 0, 1, 2 and another through x=2,3,4x = 2, 3, 4. They hug the curve.

Key idea

Simpson's rule

Divide [a,b][a, b] into an even number nn of strips of width w=b−anw = \frac{b - a}{n}, with ordinates x0=a,x1,…,xn=bx_0 = a, x_1, \ldots, x_n = b. Then

∫abf(x) dx≈w3[f(x0)+4[f(x1)+f(x3)+…]+2[f(x2)+f(x4)+…]+f(xn)]\int_a^b f(x)\,dx \approx \frac{w}{3}\Big[f(x_0) + 4\big[f(x_1) + f(x_3) + \ldots\big] + 2\big[f(x_2) + f(x_4) + \ldots\big] + f(x_n)\Big]

The ends get weight 11, odd-numbered ordinates get 44, and even-numbered interior ordinates get 22. This is in the formula book.

Where the 1, 4, 1 comes from

Put the middle of a pair of strips at x=0x = 0, so the ordinates are at −w-w, 00 and ww with heights y0,y1,y2y_0, y_1, y_2. The parabola y=Ax2+Bx+Cy = Ax^2 + Bx + C through them has

∫−ww(Ax2+Bx+C) dx=2Aw33+2Cw=w3(2Aw2+6C)\int_{-w}^{w} (Ax^2 + Bx + C)\,dx = \frac{2Aw^3}{3} + 2Cw = \frac{w}{3}\left(2Aw^2 + 6C\right)

and y0+4y1+y2=(Aw2−Bw+C)+4C+(Aw2+Bw+C)=2Aw2+6Cy_0 + 4y_1 + y_2 = (Aw^2 - Bw + C) + 4C + (Aw^2 + Bw + C) = 2Aw^2 + 6C. So the area under each parabola is exactly w3(y0+4y1+y2)\frac{w}{3}(y_0 + 4y_1 + y_2). Adding the pairs, each shared ordinate is counted twice, which is where the 22s come from.

A bonus: Simpson's rule is exact for every cubic, not just quadratics, because the x3x^3 term integrates to zero over a symmetric pair of strips.

Setting out Simpson's rule

  1. Find ww and check that nn is even

    w=b−anw = \frac{b - a}{n}. There are n+1n + 1 ordinates, x0x_0 to xnx_n.

  2. Make a table

    List xix_i, f(xi)f(x_i) and the multiplier 1,4,2,4,…,2,4,11, 4, 2, 4, \ldots, 2, 4, 1.

  3. Add the weighted values

    Multiply each f(xi)f(x_i) by its multiplier and add.

  4. Multiply by w3\frac{w}{3}

    Round only at the end, as the question asks.

Worked example

Simpson's rule for ∫131x dx\int_1^3 \frac{1}{x}\,dx

  • Simple familiar
  • Technology free

Use Simpson's rule with n=4n = 4 to estimate ∫131x dx\int_1^3 \frac{1}{x}\,dx. Compare your estimate with the exact value, ln⁡(3)≈1.0986\ln(3) \approx 1.0986.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. w=b−anw = \frac{b - a}{n} with nn even.

  2. Tabulate xix_i, f(xi)f(x_i) and the multipliers 1,4,2,…,4,11, 4, 2, \ldots, 4, 1.

  3. Multiply the weighted sum by w3\frac{w}{3}.

Watch out for

  • Using w2\frac{w}{2} from the trapezoidal rule.

  • Putting the 4s on x2x_2 instead of x1x_1 and x3x_3.

A function ff takes the values below. Use Simpson's rule with n=4n = 4 to estimate ∫02f(x) dx\int_0^2 f(x)\,dx, correct to two decimal places.

xx000.50.5111.51.522
f(x)f(x)111.21.21.61.62.42.444

Round to 2 decimal places.

Interactive

Trapezoids against the true value

With n=4n = 4 the trapezoidal rule gives 1.49071.4907, an error of about 0.0280.028. Simpson's rule with the same five ordinates gives 1.46371.4637, an error of about 0.0010.001. How large must nn be before the trapezoids do as well?

Use Simpson's rule with n=2n = 2 to estimate ∫02x3 dx\int_0^2 x^3\,dx. Compare your answer with the exact value.

Worked example

A river's flow from depth soundings

  • Complex unfamiliar

A hydrologist measures the depth of a creek every 2 metres across its 12-metre width.

Distance from bank (m)002244668810101212
Depth (m)001.21.22.12.12.62.62.42.41.51.500

a) Use Simpson's rule to estimate the area of the cross-section.

b) The water flows through the cross-section at an average speed of 0.8 m s−10.8\ \text{m s}^{-1}. Estimate the flow rate in cubic metres per second.

c) Comment on the reasonableness of your estimate.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Check that readings are equally spaced and nn is even.

  2. Apply Simpson's rule to the table.

  3. Use the estimate in the context, with units.

  4. Compare with another method or a simple shape.

Watch out for

  • Counting seven readings as n=7n = 7: there are n+1n + 1 ordinates.

  • Forgetting the zero depths at the banks: they are f(x0)f(x_0) and f(xn)f(x_n).

Common mistake

Odd n, wrong weights, w over 2

Three slips cost most marks here. nn must be even, so five ordinates means n=4n = 4, not n=5n = 5. The 4s go on the odd subscripts x1,x3,…x_1, x_3, \ldots, which sit next to the ends. And the factor in front is w3\frac{w}{3}; w2\frac{w}{2} belongs to the trapezoidal rule.

Without technology

The values are given in a table, or the function is easy to evaluate at the ordinates. Set out the table and keep fractions or exact values until the last line.

With technology

Store the function and evaluate it at each ordinate, or enter the ordinates and multipliers as lists and multiply. Use the numerical integration tool to check the estimate and to find its error.

Exam tip

Judging accuracy

If you are asked to evaluate an estimate, compare it with the exact value or a technology value, and give the error or percentage error. Simpson's rule is usually far more accurate than the trapezoidal rule with the same ordinates, and doubling nn cuts its error by a factor of about 1616.

Summary

  • Simpson's rule fits a parabola through each pair of strips, so nn must be even.

  • Weights 1,4,2,4,…,2,4,11, 4, 2, 4, \ldots, 2, 4, 1, then multiply by w3\frac{w}{3} with w=b−anw = \frac{b - a}{n}.

  • It works on a formula or on a table of equally spaced measurements.

  • It is exact for polynomials up to degree three.

  • Set out a table, round only at the end, and compare with an exact or technology value when asked.

Finished the lesson?

Try the 2 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 6 of 80% read

Save your progress with a free account