Skip to main content

Simpson's rule for numerical integration in QCE Specialist Mathematics Unit 4

Syllabus dot point

“Use Simpson's rule to approximate the value of a definite integral or an area, applying the rule with an even number of subintervals and recognising when a numerical method is required”

QCESpecialist MathematicsUnit 4: Further calculus, and…8 min read

Quick answer

Simpson's rule approximates ∫abf(x) dx≈h3[f(x0)+4f(x1)+2f(x2)+⋯+4f(xn−1)+f(xn)]\int_a^b f(x)\, dx \approx \frac{h}{3}[f(x_0) + 4f(x_1) + 2f(x_2) + \cdots + 4f(x_{n-1}) + f(x_n)], where h=b−anh = \frac{b-a}{n} and nn must be even. The coefficient pattern is 1,4,2,4,…,4,11, 4, 2, 4, \dots, 4, 1: ends weight 11, odd interior points weight 44, even interior points weight 22. It fits parabolas, is exact for cubics, and is used when an exact antiderivative is unavailable or the integrand is given as data.

Jump to a section
  1. What this dot point is asking
  2. The answer
  3. Exam-style questions

What this dot point is asking

QCAA wants you to approximate a definite integral numerically when an exact antiderivative is unavailable or impractical, using Simpson's rule. The assessable skill is applying the rule correctly: setting up an even number of subintervals, computing the function values, and applying the alternating 44 and 22 weighting pattern accurately.

The answer

When a numerical method is needed

Some integrands have no elementary antiderivative, for example e−x2e^{-x^2}, and some are given only as tabulated data. In these cases you approximate the definite integral numerically. Simpson's rule fits parabolic arcs through groups of three points, giving a more accurate estimate than the trapezoidal rule for smooth functions.

The strip width

Divide [a,b][a, b] into nn equal subintervals, where nn must be even. The strip width is

h=b−an,h = \frac{b - a}{n},

and the sample points are x0=ax_0 = a, x1=a+hx_1 = a + h, up to xn=bx_n = b.

Simpson's rule

The approximation is

∫abf(x) dx≈h3[f(x0)+4f(x1)+2f(x2)+4f(x3)+⋯+4f(xn−1)+f(xn)].\int_a^b f(x)\, dx \approx \frac{h}{3}\Big[ f(x_0) + 4 f(x_1) + 2 f(x_2) + 4 f(x_3) + \cdots + 4 f(x_{n-1}) + f(x_n) \Big].

The end values f(x0)f(x_0) and f(xn)f(x_n) have weight 11. Interior values alternate: odd-indexed points get weight 44, even-indexed interior points get weight 22. The whole bracket is multiplied by h3\frac{h}{3}.

The weighting pattern

The pattern of coefficients is 1,4,2,4,2,…,4,11, 4, 2, 4, 2, \dots, 4, 1. The first and last are 11, every odd-position interior value is 44, every even-position interior value is 22, and the values at odd positions always outnumber those at even positions. This pattern is why nn must be even: the points group into pairs of strips, each capped by a parabola.

Why it is accurate

Because Simpson's rule fits parabolas rather than straight lines, it is exact for polynomials up to degree three and very accurate for smooth curves. Halving hh reduces the error sharply, so a modest number of strips usually suffices.

Reading off function values

Tabulate the points x0,x1,…,xnx_0, x_1, \dots, x_n and the corresponding f(xi)f(x_i) before applying the rule. Organising the values in a table with their weights prevents the most common arithmetic slips.

Working from tabulated data

In many applied questions the function is never given as a formula at all; instead you are handed a table of measured values, such as river depths or terrain heights at equal spacings. Simpson's rule applies directly: the spacing between readings is hh, the number of strips is one fewer than the number of readings, and you must check that this strip count is even before proceeding. If a data set has an odd number of strips, Simpson's rule cannot be applied to the whole set, and you either drop to a different method or combine Simpson's rule on most strips with a trapezoidal strip at the end.

Areas, volumes and symmetry

Because a definite integral can represent an area or, via π∫y2 dx\pi\int y^2\,dx, a volume of revolution, Simpson's rule estimates these too when no formula integration is possible. Symmetry is a useful shortcut: if a region is symmetric about an axis, apply the rule to one half and double, which halves the arithmetic. The dam-surface question above uses exactly this idea, integrating the upper half of an ellipse and doubling for the lower half.

Accuracy and error behaviour

Simpson's rule is exact for any polynomial of degree three or less, because a cubic is captured perfectly by the parabolic fitting over paired strips. For smoother functions the error decreases rapidly as the strip width shrinks; roughly, halving hh cuts the error by a factor of about sixteen. This is far better than the trapezoidal rule, whose error only falls by a factor of four under the same refinement, which is why Simpson's rule is the preferred numerical method when the data spacing permits an even strip count.

Strip count rule

The number of strips is one less than the number of function values, and it must be even for Simpson's rule. Seven readings give six strips; five readings give four strips.

Worked example

Use Simpson's rule with n=4n = 4 to approximate ∫01e−x2 dx\displaystyle\int_0^1 e^{-x^2}\, dx.

The integrand e−x2e^{-x^2} has no elementary antiderivative, so numerical integration is required. Four strips gives n=4n = 4 (even), and we apply the 1,4,2,4,11, 4, 2, 4, 1 weighting pattern.

Step 1: Find the strip width and the sample points

Divide the interval [0,1][0, 1] into n=4n = 4 equal strips:

h=1−04=0.25.h = \frac{1 - 0}{4} = 0.25.

The five sample points are x0=0x_0 = 0, x1=0.25x_1 = 0.25, x2=0.5x_2 = 0.5, x3=0.75x_3 = 0.75, x4=1x_4 = 1.

Step 2: Evaluate the function at each point

Compute f(x)=e−x2f(x) = e^{-x^2} at each sample point:

f(x0)=e0=1f(x_0) = e^0 = 1; f(x1)=e−0.0625≈0.939413\quad f(x_1) = e^{-0.0625} \approx 0.939413; f(x2)=e−0.25≈0.778801\quad f(x_2) = e^{-0.25} \approx 0.778801; f(x3)=e−0.5625≈0.569783\quad f(x_3) = e^{-0.5625} \approx 0.569783; f(x4)=e−1≈0.367879\quad f(x_4) = e^{-1} \approx 0.367879.

Step 3: Apply Simpson's rule with weights 1,4,2,4,11, 4, 2, 4, 1

The end values carry weight 11, the odd-indexed interior values carry weight 44, and the even-indexed interior value carries weight 22:

∫01e−x2 dx≈0.253[1+4(0.939413)+2(0.778801)+4(0.569783)+0.367879].\int_0^1 e^{-x^2}\, dx \approx \frac{0.25}{3}\Big[ 1 + 4(0.939413) + 2(0.778801) + 4(0.569783) + 0.367879 \Big].

Step 4: Compute the weighted sum

Apply the weights to each value and add:

4(0.939413)=3.7576524(0.939413) = 3.757652; 2(0.778801)=1.557602\quad 2(0.778801) = 1.557602; 4(0.569783)=2.279132\quad 4(0.569783) = 2.279132.

Sum: 1+3.757652+1.557602+2.279132+0.367879=8.9622651 + 3.757652 + 1.557602 + 2.279132 + 0.367879 = 8.962265.

Step 5: Multiply by h/3h/3

0.253×8.962265≈0.083333×8.962265≈0.74686.\frac{0.25}{3} \times 8.962265 \approx 0.083333 \times 8.962265 \approx 0.74686.

Step 6: Check against the accepted value

The accepted value is about 0.746820.74682, so the estimate is accurate to four decimal places with only four strips, illustrating why Simpson's rule is preferred over the trapezoidal rule.

Final answer: ∫01e−x2 dx≈0.74686\displaystyle\int_0^1 e^{-x^2}\, dx \approx 0.74686.

Common trap

The most penalised error is muddling the coefficient pattern, for example weighting an interior point 22 when it should be 44 or vice versa. Remember: ends are 11, odd-indexed interior points are 44, even-indexed interior points are 22. A second error is using an odd number of subintervals; Simpson's rule requires nn to be even so the strips pair up under parabolas. Always tabulate values with their weights before summing.

Exam-style questions

Questions in the style of QCAA exam questions on this dot point, each with a worked answer. They are written by ExamExplained unless tagged "Past paper"; the year shows the paper a question is modelled on.

Practice4 marks
Paper 2 (complex familiar). A river is 1212 m wide. Depths (m) at 22 m intervals across the width are 0.52,2.15,3.70,4.27,3.32,1.28,0.590.52, 2.15, 3.70, 4.27, 3.32, 1.28, 0.59. A biologist estimates the cross-sectional area as 1515 m2^2. Use Simpson's rule to evaluate the reasonableness of this estimate, justifying your decision.
Show worked answer →

Seven readings give 66 strips of width h=2h = 2 (even, so Simpson's rule applies). Weights 1,4,2,4,2,4,11, 4, 2, 4, 2, 4, 1:

Area =h3[f0+4(f1+f3+f5)+2(f2+f4)+f6]= \dfrac{h}{3}\big[f_0 + 4(f_1 + f_3 + f_5) + 2(f_2 + f_4) + f_6\big] =23[0.52+4(2.15+4.27+1.28)+2(3.70+3.32)+0.59]= \dfrac{2}{3}\big[0.52 + 4(2.15 + 4.27 + 1.28) + 2(3.70 + 3.32) + 0.59\big] =23(45.95)≈30.6= \dfrac{2}{3}(45.95) \approx 30.6 m2^2.

The estimate 30.630.6 m2^2 is about double the biologist's 1515 m2^2, so 1515 m2^2 is not reasonable; it substantially underestimates the area.

Markers reward the correct strip count, the weighting pattern, the evaluated area, and a justified decision.

Practice4 marks
Paper 2 (complex familiar). The edge of a dam is modelled by the ellipse (x−2)216+y29=1\dfrac{(x - 2)^2}{16} + \dfrac{y^2}{9} = 1 for 0≤x≤60 \leq x \leq 6, symmetric about the xx-axis. Use Simpson's rule with four strips to approximate the surface area.
Show worked answer →

Upper half: y=31−(x−2)216y = 3\sqrt{1 - \dfrac{(x - 2)^2}{16}} over 0≤x≤60 \leq x \leq 6; double for symmetry. Four strips gives h=64=1.5h = \dfrac{6}{4} = 1.5.

Values: y(0)≈2.598y(0) \approx 2.598, y(1.5)≈2.976y(1.5) \approx 2.976, y(3)≈2.905y(3) \approx 2.905, y(4.5)≈2.342y(4.5) \approx 2.342, y(6)=0y(6) = 0.

Upper area =1.53[2.598+4(2.976+2.342)+2(2.905)+0]=0.5(29.68)≈14.84= \dfrac{1.5}{3}\big[2.598 + 4(2.976 + 2.342) + 2(2.905) + 0\big] = 0.5(29.68) \approx 14.84 km2^2. Total =2×14.84≈29.68= 2 \times 14.84 \approx 29.68 km2^2.

Markers reward the half-curve setup, the strip width, the function values, and doubling for symmetry.

Practise this

Sources & how we know this

ExamExplained