Resources For Teachers For Tutors For Students & Parents Pricing
Year 12 Specialist (Unit 3 & 4) Applications of integral calculus

Simpson’s rule

20 practice questions 0 video lessons Theory + worked examples

Master Simpson's rule for Year 12 Specialist Mathematics in Queensland (QCAA). This is the numerical method that approximates a definite integral or an area by fitting parabolas through the ordinates of a curve — ideal when an antiderivative is hard to find or the data come from a table of measurements.

You will learn to find the strip width \(h=\dfrac{b-a}{n}\), tabulate the ordinates and apply the 1, 4, 2, 4, 1 coefficient pattern, then compare the estimate with the exact value — a key application of integral calculus in the course.

Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

Simpson's rule is a numerical method for approximating a definite integral or an area in Year 12 Specialist Mathematics (QCAA, Queensland). It fits parabolas through the ordinates of a curve and weights them by the pattern 1, 4, 2, 4, …, 2, 4, 1. This page shows how to find the strip width \(h\), tabulate the ordinates and apply the rule — from a function or from a table of values.

Simpson's rule estimates the value of a definite integral \(\int_a^b f(x)\,dx\) (or the area under a curve) when an antiderivative is hard to find, or when \(f\) is known only from a table of measured values. It works by fitting a parabola through each set of three neighbouring points, which follows the curve far more closely than straight-line strips.

The interval \([a,b]\) is divided into an even number \(n\) of equal-width strips. Each strip has width \(h=\dfrac{b-a}{n}\), and this produces \(n+1\) equally spaced ordinates \(f_0,f_1,\dots,f_n\), where \(f_i=f(a+ih)\). The number of strips \(n\) must be even so the ordinates pair up neatly for the parabolas.

Each pair of strips is replaced by a parabola through three ordinates. Adding the parabolic areas gives the weighted sum with the coefficient pattern \(1,4,2,4,\dots,2,4,1\): the two end ordinates take weight \(1\), the odd-indexed ordinates \(f_1,f_3,\dots\) take weight \(4\), and the even interior ordinates \(f_2,f_4,\dots\) take weight \(2\).

The estimate is usually very accurate; in fact Simpson's rule is exact for any polynomial of degree \(3\) or less. Increasing the number of strips \(n\) (so \(h\) shrinks) generally makes the approximation more accurate still.

Simpson's rule strips A curve y = f(x) over the interval from a to b is split into four equal-width strips of width h. Five equally spaced ordinates f0, f1, f2, f3, f4 rise from the x-axis to the curve; each pair of strips is fitted by a parabola. x f0 a f1 x1 f2 x2 f3 x3 f4 b y=f(x) h
Simpson's rule on \([a,b]\) with \(n=4\): five equally spaced ordinates \(f_0,\dots,f_4\), strip width \(h=\dfrac{b-a}{n}\), each pair of strips fitted by a parabola.
Simpson's rule coefficient pattern Five ordinates f0 to f4 with Simpson coefficients below them: the two ends f0 and f4 have weight 1, the odd ordinates f1 and f3 have weight 4, and the even interior ordinate f2 has weight 2, giving the pattern 1, 4, 2, 4, 1. f0 1 f1 4 f2 2 f3 4 f4 1 ends 1 • odd 4 • even interior 2
The coefficient pattern for \(n=4\): ends weight \(1\), odd ordinates weight \(4\), even interior weight \(2\) — giving \(1,4,2,4,1\).

For an even number of strips \(n\), with strip width \(h\) and ordinates \(f_i=f(a+ih)\):

\[ \int_a^b f(x)\,dx \approx \dfrac{h}{3}\Big[\,f_0 + 4\big(f_1+f_3+\cdots\big) + 2\big(f_2+f_4+\cdots\big) + f_n\,\Big] \]
abf(x)dxh3[f0+4(f1+)+2(f2+)+fn]

The strip width comes from the interval and the (even) number of strips:

\[ h = \dfrac{b-a}{n}, \qquad n \text{ even} \]
h=ban

The simplest case, two strips \((n=2)\), uses three ordinates and the weights \(1,4,1\):

\[ \int_a^b f(x)\,dx \approx \dfrac{h}{3}\big[\,f_0 + 4f_1 + f_2\,\big] \]
Count the ordinates, not the strips. \(n\) strips give \(n+1\) ordinates, and \(n\) must be even. The very first and last ordinates always take weight \(1\); everything between them alternates \(4,2,4,2,\dots,4\).

How to apply Simpson's rule

  1. Find the strip width: with an even number of strips \(n\), compute \(h=\dfrac{b-a}{n}\). (From a table, \(h\) is the equal spacing between the given values.)
  2. Tabulate the ordinates: list the \(n+1\) values \(f_0,f_1,\dots,f_n\) at \(x=a,\,a+h,\,\dots,\,b\).
  3. Apply the weights: multiply the ordinates by \(1,4,2,4,\dots,2,4,1\) and add — ends \(1\), odd ordinates \(4\), even interior \(2\).
  4. Scale by \(\dfrac{h}{3}\): multiply the weighted sum by \(\dfrac{h}{3}\) to get the estimate.
Example 1 — From a function, \(n=2\)
Use Simpson's rule with \(n=2\) strips to approximate \(\displaystyle\int_2^4 \dfrac{1}{x}\,dx\), to \(4\) decimal places.
Solution

Find the strip width, then tabulate the three ordinates of \(\dfrac{1}{x}\):

\(h\)\(=\)\(\dfrac{b-a}{n}=\dfrac{4-2}{2}=1\)
\(f_0\)\(=\)\(\dfrac{1}{2}=0.5\)
\(f_1\)\(=\)\(\dfrac{1}{3}\approx0.3333\)
\(f_2\)\(=\)\(\dfrac{1}{4}=0.25\)

Apply the weights \(1,4,1\) and scale by \(\dfrac{h}{3}\):

\(\int_2^4 \dfrac{1}{x}\,dx\)\(\approx\)\(\dfrac{h}{3}\big[f_0+4f_1+f_2\big]\)
\(\approx\)\(\dfrac{1}{3}\big[0.5+4(0.3333)+0.25\big]\)
\(\approx\)\(\dfrac{1}{3}(2.0833)\)
\(\approx\)\(0.6944\)

\(\displaystyle\int_2^4 \dfrac{1}{x}\,dx\approx0.6944\) (the exact value is \(\ln 2\approx0.6931\)).

Example 2 — From a table of values, \(n=4\)
A garden bed has a straight edge \(12\) m long. Its width is measured every \(3\) m: at \(x=0,3,6,9,12\) the widths are \(4,7,9,6,2\) metres. Estimate the area of the bed.
Solution

The spacing gives the strip width; there are \(5\) ordinates, so \(n=4\):

\(h\)\(=\)\(3\)
\(f_0,f_1,f_2,f_3,f_4\)\(=\)\(4,\,7,\,9,\,6,\,2\)

Apply the weights \(1,4,2,4,1\) and scale by \(\dfrac{h}{3}\):

\(A\)\(\approx\)\(\dfrac{h}{3}\big[f_0+4f_1+2f_2+4f_3+f_4\big]\)
\(\approx\)\(\dfrac{3}{3}\big[4+4(7)+2(9)+4(6)+2\big]\)
\(\approx\)\(1\big[4+28+18+24+2\big]\)
\(\approx\)\(76\)

The area of the garden bed is about \(76\) square metres.

Example 3 — From a function, \(n=4\), and compare
Use Simpson's rule with \(n=4\) strips to approximate \(\displaystyle\int_0^4 \sqrt{x}\,dx\), to \(4\) decimal places, and compare with the exact value \(\dfrac{16}{3}\).
Solution

Strip width \(h=\dfrac{4-0}{4}=1\); tabulate the five ordinates:

\(f_0\)\(=\)\(\sqrt{0}=0\)
\(f_1\)\(=\)\(\sqrt{1}=1\)
\(f_2\)\(=\)\(\sqrt{2}\approx1.4142\)
\(f_3\)\(=\)\(\sqrt{3}\approx1.7321\)
\(f_4\)\(=\)\(\sqrt{4}=2\)

Apply the weights \(1,4,2,4,1\) and scale by \(\dfrac{h}{3}\):

\(\int_0^4 \sqrt{x}\,dx\)\(\approx\)\(\dfrac{1}{3}\big[0+4(1)+2(1.4142)+4(1.7321)+2\big]\)
\(\approx\)\(\dfrac{1}{3}(15.7566)\)
\(\approx\)\(5.2522\)

Compare with the exact \(\dfrac{16}{3}\approx5.3333\):

\(5.2522\)\(<\)\(5.3333\)
\(\Rightarrow \text{Simpson}\)\(<\)\(\text{exact (an underestimate)}\)

\(\displaystyle\int_0^4 \sqrt{x}\,dx\approx5.2522\), a slight underestimate of \(\dfrac{16}{3}\approx5.3333\).

Example 4 — Exact for a cubic
Use Simpson's rule with \(n=2\) strips to evaluate \(\displaystyle\int_0^4 x^3\,dx\), and check it against the exact value.
Solution

Strip width \(h=\dfrac{4-0}{2}=2\); the three ordinates of \(x^3\):

\(f_0\)\(=\)\(0^3=0\)
\(f_1\)\(=\)\(2^3=8\)
\(f_2\)\(=\)\(4^3=64\)

Apply the weights \(1,4,1\) and scale by \(\dfrac{h}{3}\):

\(\int_0^4 x^3\,dx\)\(\approx\)\(\dfrac{2}{3}\big[0+4(8)+64\big]\)
\(\approx\)\(\dfrac{2}{3}(96)\)
\(\approx\)\(64\)

Check against the exact integral:

\(\int_0^4 x^3\,dx\)\(=\)\(\left[\dfrac{x^4}{4}\right]_0^4\)
\(=\)\(\dfrac{256}{4}=64\)

Both give \(64\): Simpson's rule is exact for cubics, even with just two strips.

Common pitfalls

Using an odd number of strips. Simpson's rule needs the strips to pair up for the parabolas, so \(n\) must be even. With an odd \(n\) (an even number of ordinates) the rule does not apply.
Getting the weights out of order. The pattern is \(1,4,2,4,\dots,2,4,1\): the ends are \(1\) and the interior starts and ends with \(4\). A common slip is \(1,2,4,2,1\) — that swaps the \(4\)s and \(2\)s.
Counting strips as ordinates. \(n\) strips give \(n+1\) ordinates. For \(n=4\) you need \(5\) values \(f_0,\dots,f_4\), not \(4\).
Forgetting the \(\tfrac{h}{3}\). The weighted sum must be multiplied by \(\dfrac{h}{3}\) — not \(h\), and not left unscaled.

Frequently asked questions

What is Simpson's rule used for?

It approximates a definite integral \(\int_a^b f(x)\,dx\) or the area under a curve, especially when the antiderivative is hard to find or the function is known only from a table of measured values.

Why must the number of strips be even?

Simpson's rule fits a parabola through each group of three ordinates, so the strips are used in pairs. An even number of strips \(n\) gives whole pairs; an odd \(n\) would leave one strip without a partner.

What is the coefficient pattern in Simpson's rule?

The ordinates are weighted \(1,4,2,4,\dots,2,4,1\): the two ends take \(1\), the odd-indexed ordinates \(f_1,f_3,\dots\) take \(4\), and the even interior ordinates \(f_2,f_4,\dots\) take \(2\).

How do you find the strip width \(h\)?

Use \(h=\dfrac{b-a}{n}\), where \(n\) is the (even) number of strips. From a table of equally spaced values, \(h\) is just the spacing between consecutive \(x\)-values.

How many ordinates do I need?

For \(n\) strips you need \(n+1\) equally spaced ordinates. For example \(n=4\) needs \(5\) ordinates \(f_0,f_1,f_2,f_3,f_4\).

Is Simpson's rule ever exact?

Yes. Because it fits parabolas, it is exact for any polynomial of degree \(3\) or less. For other functions it is an approximation that generally improves as the number of strips increases.