Simpson’s rule
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.
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.
For an even number of strips \(n\), with strip width \(h\) and ordinates \(f_i=f(a+ih)\):
The strip width comes from the interval and the (even) number of strips:
The simplest case, two strips \((n=2)\), uses three ordinates and the weights \(1,4,1\):
How to apply Simpson's rule
- 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.)
- Tabulate the ordinates: list the \(n+1\) values \(f_0,f_1,\dots,f_n\) at \(x=a,\,a+h,\,\dots,\,b\).
- 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\).
- Scale by \(\dfrac{h}{3}\): multiply the weighted sum by \(\dfrac{h}{3}\) to get the estimate.
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\)).
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.
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\).
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
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.