← 2025 Paper 2

UPSC 2025 Maths Optional Paper 2 Q8b — Step-by-Step Solution

15 marks · Section B

Trapezoidal rule (composite; error) · Numerical Analysis · asked 3× in 14 yrs · Read the full method →

Question

Find the constant pp and error term for the quadrature formula ∫x0x1f(x) dx=h2(f0+f1)+ph2(f0′−f1′)\displaystyle\int_{x_0}^{x_1} f(x)\,dx = \dfrac{h}{2}(f_0 + f_1) + ph^2(f_0' - f_1') where x0+h=x1x_0 + h = x_1, f0=f(x0)f_0 = f(x_0), f1=f(x1)f_1 = f(x_1) and prime (′') represents derivative with respect to xx. Hence deduce the composite rule for integrating ∫abf(x) dx\displaystyle\int_a^b f(x)\,dx, a=x0<x1<⋯<xN=ba = x_0 < x_1 < \cdots < x_N = b.

Technique

Use the method of undetermined coefficients: expand both sides in powers of hh about x0x_0 and choose pp to maximise the order of accuracy; the first non-vanishing residual gives the error term. This is the corrected trapezoidal (Euler–Maclaurin) rule.

Solution

Taylor expansion of both sides

Expand ff about x0x_0. Write f(k)≡f(k)(x0)f^{(k)} \equiv f^{(k)}(x_0). With x1=x0+hx_1 = x_0 + h:

∫x0x0+hf dx=fh+f′h22+f′′h36+f′′′h424+f(4)h5120+⋯\int_{x_0}^{x_0+h} f\,dx = f h + \frac{f' h^2}{2} + \frac{f'' h^3}{6} + \frac{f''' h^4}{24} + \frac{f^{(4)} h^5}{120} + \cdots

Right-hand side pieces:

f0=f,f1=f+f′h+f′′2h2+f′′′6h3+f(4)24h4+⋯ ,f_0 = f,\qquad f_1 = f + f'h + \tfrac{f''}{2}h^2 + \tfrac{f'''}{6}h^3 + \tfrac{f^{(4)}}{24}h^4 + \cdots, f0′=f′,f1′=f′+f′′h+f′′′2h2+f(4)6h3+⋯f_0' = f',\qquad f_1' = f' + f''h + \tfrac{f'''}{2}h^2 + \tfrac{f^{(4)}}{6}h^3 + \cdots

Then

h2(f0+f1)=fh+f′2h2+f′′4h3+f′′′12h4+f(4)48h5+⋯ ,\frac{h}{2}(f_0 + f_1) = fh + \frac{f'}{2}h^2 + \frac{f''}{4}h^3 + \frac{f'''}{12}h^4 + \frac{f^{(4)}}{48}h^5 + \cdots, ph2(f0′−f1′)=ph2(−f′′h−f′′′2h2−f(4)6h3−⋯)=−pf′′h3−p2f′′′h4−p6f(4)h5−⋯ph^2(f_0' - f_1') = ph^2\Big(-f''h - \tfrac{f'''}{2}h^2 - \tfrac{f^{(4)}}{6}h^3 - \cdots\Big) = -pf''h^3 - \tfrac{p}{2}f'''h^4 - \tfrac{p}{6}f^{(4)}h^5 - \cdots

Subtract to get the error

E=∫x0x1f dx−RHS.E = \int_{x_0}^{x_1}f\,dx - \text{RHS}.

Term-by-term (the hh and h2h^2 terms cancel exactly):

E=(16−14+p)f′′h3+(124−112+p2)f′′′h4+(1120−148+p6)f(4)h5+⋯E = \Big(\tfrac{1}{6} - \tfrac14 + p\Big)f''h^3 + \Big(\tfrac{1}{24} - \tfrac{1}{12} + \tfrac{p}{2}\Big)f'''h^4 + \Big(\tfrac{1}{120} - \tfrac{1}{48} + \tfrac{p}{6}\Big)f^{(4)}h^5 + \cdots

Choose pp to kill the h3h^3 term:

16−14+p=0  ⟹  p=14−16=112.\frac16 - \frac14 + p = 0 \implies p = \frac14 - \frac16 = \frac{1}{12}. p=112.\boxed{p = \frac{1}{12}.}

With p=112p = \tfrac{1}{12}, the h4h^4 coefficient becomes 124−112+124=0\tfrac{1}{24} - \tfrac{1}{12} + \tfrac{1}{24} = 0 — it also vanishes. The first surviving term is the h5h^5 term:

1120−148+172=6−15+10720=1720.\frac{1}{120} - \frac{1}{48} + \frac{1}{72} = \frac{6 - 15 + 10}{720} = \frac{1}{720}.

So the leading error is

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

via the mean-value form of the remainder.

Single-interval formula

∫x0x1f dx=h2(f0+f1)+h212(f0′−f1′)+h5720f(4)(ξ).\int_{x_0}^{x_1} f\,dx = \frac{h}{2}(f_0 + f_1) + \frac{h^2}{12}(f_0' - f_1') + \frac{h^5}{720}f^{(4)}(\xi).

Composite rule on [a,b][a,b]

Partition [a,b][a,b] into NN equal subintervals of width h=(b−a)/Nh = (b-a)/N, nodes xi=a+ihx_i = a + ih. Sum the single-interval rule:

∫abf dx=∑i=0N−1[h2(fi+fi+1)+h212(fi′−fi+1′)]+∑i=0N−1h5720f(4)(ξi).\int_a^b f\,dx = \sum_{i=0}^{N-1}\left[\frac{h}{2}(f_i + f_{i+1}) + \frac{h^2}{12}(f_i' - f_{i+1}')\right] + \sum_{i=0}^{N-1}\frac{h^5}{720}f^{(4)}(\xi_i).

The trapezoidal sum telescopes, and the derivative correction telescopes (fi′−fi+1′f_i' - f_{i+1}' sums to f0′−fN′f_0' - f_N'):

∫abf dx=h[12f0+f1+f2+⋯+fN−1+12fN]+h212(f′(a)−f′(b))+EN,\boxed{\int_a^b f\,dx = h\Big[\tfrac12 f_0 + f_1 + f_2 + \cdots + f_{N-1} + \tfrac12 f_N\Big] + \frac{h^2}{12}\big(f'(a) - f'(b)\big) + E_N,}

with total error

EN=∑i=0N−1h5720f(4)(ξi)=(b−a)h4720f(4)(η),η∈(a,b)E_N = \sum_{i=0}^{N-1}\frac{h^5}{720}f^{(4)}(\xi_i) = \frac{(b-a)h^4}{720}f^{(4)}(\eta),\quad \eta\in(a,b)

(using Nh=b−aNh = b-a and the intermediate-value theorem).

This is the corrected (end-corrected) trapezoidal rule — the leading Euler–Maclaurin term; it raises the trapezoidal accuracy from O(h2)O(h^2) to O(h4)O(h^4) globally.

Answer

p=112p = \dfrac{1}{12}. Single-panel error h5720f(4)(ξ)\dfrac{h^5}{720}f^{(4)}(\xi). Composite rule:

∫abf dx=h[12f0+∑i=1N−1fi+12fN]+h212(f′(a)−f′(b))+(b−a)h4720f(4)(η).\int_a^b f\,dx = h\Big[\tfrac12 f_0 + \textstyle\sum_{i=1}^{N-1} f_i + \tfrac12 f_N\Big] + \frac{h^2}{12}\big(f'(a)-f'(b)\big) + \frac{(b-a)h^4}{720}f^{(4)}(\eta).
We post more of this — worked solutions, CSAT trap breakdowns, guide chapters — a few times a week on Telegram. Free, no sign-in. Join

This solution is part of the Maths Coverage Map — 14 years, mapped. Get the take-away PDF free.