← 2018 Paper 2

UPSC 2018 Maths Optional Paper 2 Q7b — Step-by-Step Solution

15 marks · Section B

Gaussian quadrature · Numerical Analysis · asked 3× in 14 yrs · Read the full method →

Question

Find the values of the constants a,b,ca,b,c such that the quadrature formula

∫0hf(x) dx=h[af(0)+bf ⁣(h3)+cf(h)]\int_0^h f(x)\,dx=h\left[a f(0)+b f\!\left(\frac{h}{3}\right)+c f(h)\right]

is exact for polynomials of as high degree as possible, and hence find the order of the truncation error.

Technique

Method of undetermined coefficients — exactness on 1,x,x21,x,x^2; check x3x^3 for the first failure; error constant from the leading non-exact monomial, E∝h4f′′′E\propto h^4f'''.

Solution

Setup. Three free parameters a,b,ca,b,c ⇒ impose exactness on f=1,x,x2f=1,x,x^2 (three conditions). The method of undetermined coefficients: require equality for each monomial.

Step 1 — Exactness conditions

For f(x)=1f(x)=1: ∫0h1 dx=h\displaystyle\int_0^h 1\,dx=h, RHS =h(a+b+c)=h(a+b+c):

a+b+c=1.a+b+c=1.

For f(x)=xf(x)=x: ∫0hx dx=h22\displaystyle\int_0^h x\,dx=\frac{h^2}{2}, RHS =h(a⋅0+b⋅h3+c⋅h)=h2(b3+c)=h\big(a\cdot0+b\cdot\tfrac h3+c\cdot h\big)=h^2\big(\tfrac b3+c\big):

b3+c=12.\frac b3+c=\frac12.

For f(x)=x2f(x)=x^2: ∫0hx2 dx=h33\displaystyle\int_0^h x^2\,dx=\frac{h^3}{3}, RHS =h(b⋅h29+c⋅h2)=h3(b9+c)=h\big(b\cdot\tfrac{h^2}{9}+c\cdot h^2\big)=h^3\big(\tfrac b9+c\big):

b9+c=13.\frac b9+c=\frac13.

Step 2 — Solve the linear system

Subtract the third from the second: b3−b9=12−13\dfrac b3-\dfrac b9=\dfrac12-\dfrac13, i.e. 2b9=16⇒b=34.\dfrac{2b}{9}=\dfrac16\Rightarrow b=\dfrac34. Then c=12−b3=12−14=14.c=\dfrac12-\dfrac b3=\dfrac12-\dfrac14=\dfrac14. And a=1−b−c=1−34−14=0.a=1-b-c=1-\dfrac34-\dfrac14=0.

  a=0,b=34,c=14.  \boxed{\;a=0,\quad b=\frac34,\quad c=\frac14.\;}

So the rule is ∫0hf dx≈h[34f(h3)+14f(h)].\displaystyle\int_0^h f\,dx\approx h\Big[\tfrac34 f\big(\tfrac h3\big)+\tfrac14 f(h)\Big].

Step 3 — Highest degree of exactness

Test f(x)=x3f(x)=x^3:

∫0hx3 dx=h44,RHS=h[34(h3)3+14h3]=h4[34⋅27+14]=h4[136+14]=5h418.\int_0^h x^3\,dx=\frac{h^4}{4},\qquad \text{RHS}=h\Big[\tfrac34\big(\tfrac h3\big)^3+\tfrac14 h^3\Big]=h^4\Big[\tfrac{3}{4\cdot27}+\tfrac14\Big]=h^4\Big[\tfrac{1}{36}+\tfrac14\Big]=\frac{5h^4}{18}.

These differ (14≠518\tfrac14\ne\tfrac{5}{18}), so the rule is exact for polynomials of degree ≤2\le 2 but not degree 3.

Step 4 — Truncation error

The error E=∫0hf dx−h[34f(h3)+14f(h)]E=\displaystyle\int_0^h f\,dx-h\big[\tfrac34 f(\tfrac h3)+\tfrac14 f(h)\big] vanishes for degree ≤2\le2, so the leading term is proportional to f′′′f'''. Using the monomial x3x^3 (f′′′=6f'''=6):

E[x3]=h44−5h418=9h4−10h436=−h436.E[x^3]=\frac{h^4}{4}-\frac{5h^4}{18}=\frac{9h^4-10h^4}{36}=-\frac{h^4}{36}.

Writing E=C h4f′′′(ξ)E=C\,h^4 f'''(\xi) with f′′′=6f'''=6: C⋅6=−136⇒C=−1216C\cdot6=-\tfrac1{36}\Rightarrow C=-\tfrac1{216}. Hence

Answer

  E=−h4216 f′′′(ξ),0<ξ<h,i.e. the truncation error is of order O(h4).  \boxed{\;E=-\frac{h^4}{216}\,f'''(\xi),\qquad 0<\xi<h,\quad\text{i.e. the truncation error is of order }O(h^4).\;}
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.