The math optional, made finite. Daily Practice

Trapezoidal rule (composite; error)

At a Glance

Why This Chapter Matters

The trapezoidal rule is tested in two modes: straightforward application (2014, 2024) and theoretical derivation of the correction constant and error term (2025). The application questions are among the fastest 10-mark problems in the paper — tabulate f(xi)f(x_i), apply the formula, done. The 2025 derivation question is harder (15 marks) but follows a single pattern: expand both sides in Taylor series about x0x_0, match powers of hh, and the surviving term gives the error. Both modes are mechanical once the template is known.

Minimum Theory

Composite trapezoidal rule. For abf(x)dx\int_a^b f(x)\,dx with nn equal subintervals of width h=(ba)/nh=(b-a)/n and nodes xi=a+ihx_i=a+ih:

abf(x)dxh2[f(x0)+2f(x1)+2f(x2)++2f(xn1)+f(xn)]\int_a^b f(x)\,dx \approx \frac{h}{2}\Big[f(x_0) + 2f(x_1) + 2f(x_2) + \cdots + 2f(x_{n-1}) + f(x_n)\Big]

Weights: 1 for the two endpoints; 2 for each interior node. The total number of function evaluations is n+1n+1.

Truncation error. The composite trapezoidal rule has global error O(h2)O(h^2): specifically ET=(ba)h212f(ξ)E_T = -\dfrac{(b-a)h^2}{12}f''(\xi) for some ξ(a,b)\xi\in(a,b). Halving hh reduces the error by a factor of 4.

Corrected trapezoidal rule (2025). Adding derivative correction terms h212(f(a)f(b))\tfrac{h^2}{12}(f'(a)-f'(b)) raises accuracy to O(h4)O(h^4). This is derived by choosing the constant pp in h2(f0+f1)+ph2(f0f1)\tfrac{h}{2}(f_0+f_1)+ph^2(f_0'-f_1') to kill the h3h^3 Taylor residual, giving p=112p=\tfrac{1}{12}.

Composite trapezoidal rule with trapezoids under a curve

Question Archetypes

ArchetypeRecognition
trapezoidal-rule”Integrate … using the trapezoidal rule with nn subintervals / width hh
quadrature-derivation”Find the constant pp and error term for the formula =h2(f0+f1)+ph2(f0f1)\int = \tfrac{h}{2}(f_0+f_1)+ph^2(f_0'-f_1')

trapezoidal-rule (2 question(s); 2014, 2024)

Recognition Cues

Solution Template

  1. Compute hh and list nodes. h=(ba)/nh=(b-a)/n; nodes x0,x1,,xnx_0,x_1,\ldots,x_n.
  2. Tabulate f(xi)f(x_i). Compute each value, keeping 6 decimal places.
  3. Apply the formula. Sum = f0+fn+2(f1+f2++fn1)f_0 + f_n + 2(f_1+f_2+\cdots+f_{n-1}); multiply by h/2h/2.
  4. State the result. Optionally compare with the exact value to show O(h2)O(h^2) accuracy.

Worked Example

2014 Paper 2, 2014-P2-Q5c (10 marks)

Use five subintervals to integrate 01dx1+x2\displaystyle\int_0^1\dfrac{dx}{1+x^2} using the trapezoidal rule.

h=(10)/5=0.2h=(1-0)/5=0.2. Nodes: 0,0.2,0.4,0.6,0.8,1.00,\,0.2,\,0.4,\,0.6,\,0.8,\,1.0.

iixix_if(xi)=1/(1+xi2)f(x_i)=1/(1+x_i^2)
00.01.000000
10.20.961538
20.40.862069
30.60.735294
40.80.609756
51.00.500000

T=0.22[1.000000+0.500000+2(0.961538+0.862069+0.735294+0.609756)]T = \frac{0.2}{2}\Big[1.000000 + 0.500000 + 2(0.961538+0.862069+0.735294+0.609756)\Big]

=0.1[1.500000+2×3.168657]=0.1×7.837314= 0.1\cdot[1.500000 + 2\times 3.168657] = 0.1\times 7.837314

01dx1+x20.7837\boxed{\int_0^1\frac{dx}{1+x^2}\approx 0.7837}

(Exact: π/40.7854\pi/4\approx0.7854; error 0.0017\approx0.0017, consistent with O(h2)=O(0.04)O(h^2)=O(0.04).)


2024 Paper 2, 2024-P2-Q7bii (7.5 marks)

Integrate f(x)=5x33x2+2x+1f(x)=5x^3-3x^2+2x+1 from x=2x=-2 to x=4x=4 using the trapezoidal rule with h=1h=1.

Nodes: 2,1,0,1,2,3,4-2,-1,0,1,2,3,4 (n=6n=6). Function values: 55,9,1,5,33,115,281-55,-9,1,5,33,115,281.

T=12[55+281+2(9+1+5+33+115)]=12[226+2(145)]=5162T = \frac{1}{2}\Big[-55+281 + 2(-9+1+5+33+115)\Big] = \frac{1}{2}[226 + 2(145)] = \frac{516}{2}

24f(x)dx258\boxed{\int_{-2}^4 f(x)\,dx \approx 258}

(Exact value 246; error 12, expected for a cubic with h=1h=1.)


quadrature-derivation (1 question(s); 2025)

Recognition Cues

Solution Template

  1. Expand both sides in powers of hh about x0x_0 using f1=f+fh+f2h2+f_1=f+f'h+\tfrac{f''}{2}h^2+\cdots and f0=ff_0'=f', f1=f+fh+f_1'=f'+f''h+\cdots.
  2. Compute the error E=E = LHS - RHS term by term.
  3. Set the h3h^3 coefficient to zero to find pp.
  4. Identify the leading surviving error term (the first non-vanishing power of hh).
  5. Compose over [a,b][a,b]: sum NN panels; derivative correction telescopes to f(a)f(b)f'(a)-f'(b).

Worked Example

2025 Paper 2, 2025-P2-Q8b (15 marks)

Find the constant pp and error term for x0x1fdx=h2(f0+f1)+ph2(f0f1)\int_{x_0}^{x_1}f\,dx = \tfrac{h}{2}(f_0+f_1)+ph^2(f_0'-f_1'). Deduce the composite rule on [a,b][a,b].

Taylor expansions about x0x_0 (writing f(k)=f(k)(x0)f^{(k)}=f^{(k)}(x_0)):

LHS=fh+fh22+fh36+fh424+f(4)h5120+\text{LHS} = fh + \frac{f'h^2}{2} + \frac{f''h^3}{6} + \frac{f'''h^4}{24} + \frac{f^{(4)}h^5}{120}+\cdots

h2(f0+f1)=fh+fh22+fh34+fh412+f(4)h548+\frac{h}{2}(f_0+f_1) = fh + \frac{f'h^2}{2} + \frac{f''h^3}{4} + \frac{f'''h^4}{12} + \frac{f^{(4)}h^5}{48}+\cdots

ph2(f0f1)=pfh3p2fh4p6f(4)h5ph^2(f_0'-f_1') = -pf''h^3 - \frac{p}{2}f'''h^4 - \frac{p}{6}f^{(4)}h^5 - \cdots

Error E=E= LHS - RHS:

E=(1614+p)fh3+(124112+p2)fh4+E = \left(\frac{1}{6}-\frac{1}{4}+p\right)f''h^3 + \left(\frac{1}{24}-\frac{1}{12}+\frac{p}{2}\right)f'''h^4 + \cdots

Set h3h^3 coefficient to zero: 1614+p=0\tfrac{1}{6}-\tfrac{1}{4}+p=0 \Rightarrow

p=112\boxed{p = \frac{1}{12}}

With p=112p=\tfrac{1}{12}, the h4h^4 coefficient also vanishes. The first surviving term is:

E=h5720f(4)(ξ),ξ(x0,x1)E = \frac{h^5}{720}f^{(4)}(\xi),\quad \xi\in(x_0,x_1)

Composite rule on [a,b][a,b] with NN panels (h=(ba)/Nh=(b-a)/N):

abfdx=h[f02+f1+f2++fN1+fN2]+h212(f(a)f(b))+(ba)h4720f(4)(η)\int_a^b f\,dx = h\left[\frac{f_0}{2}+f_1+f_2+\cdots+f_{N-1}+\frac{f_N}{2}\right] + \frac{h^2}{12}\big(f'(a)-f'(b)\big) + \frac{(b-a)h^4}{720}f^{(4)}(\eta)

Common Traps

Marks-Aware Writing

A 10-mark trapezoidal application answer must show: the step size hh computed, a table of f(xi)f(x_i) values, the formula with interior/endpoint weights identified, and the numerical result. A 15-mark derivation answer must show: the Taylor expansion of each side to at least h5h^5, the coefficient-matching step, the value of pp with clear algebra, the error term with its exponent identified, and the composite rule written out.

Practice Set

We've mapped all 13 years of this exam. Get new chapters, tools, and solutions as we release them — free.