← 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 13 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, Eh4fE\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: 0h1dx=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: 0hxdx=h22\displaystyle\int_0^h x\,dx=\frac{h^2}{2}, RHS =h(a0+bh3+ch)=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: 0hx2dx=h33\displaystyle\int_0^h x^2\,dx=\frac{h^3}{3}, RHS =h(bh29+ch2)=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: b3b9=1213\dfrac b3-\dfrac b9=\dfrac12-\dfrac13, i.e. 2b9=16b=34.\dfrac{2b}{9}=\dfrac16\Rightarrow b=\dfrac34. Then c=12b3=1214=14.c=\dfrac12-\dfrac b3=\dfrac12-\dfrac14=\dfrac14. And a=1bc=13414=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 0hfdxh[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:

0hx3dx=h44,RHS=h[34(h3)3+14h3]=h4[3427+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 (14518\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=0hfdxh[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 ff'''. Using the monomial x3x^3 (f=6f'''=6):

E[x3]=h445h418=9h410h436=h436.E[x^3]=\frac{h^4}{4}-\frac{5h^4}{18}=\frac{9h^4-10h^4}{36}=-\frac{h^4}{36}.

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

Answer

  E=h4216f(ξ),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 — 13 years, mapped. Get the take-away PDF free.