← 2016 Paper 2

UPSC 2016 Maths Optional Paper 2 Q7c — Step-by-Step Solution

15 marks · Section B

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

Question

For an integral 11f(x)dx\displaystyle\int_{-1}^1 f(x)\,dx, show that the two-point Gauss quadrature rule is given by 11f(x)dx=f ⁣(13)+f ⁣(13)\displaystyle\int_{-1}^1 f(x)\,dx=f\!\left(\frac{1}{\sqrt3}\right)+f\!\left(-\frac{1}{\sqrt3}\right). Using this rule, estimate 242xexdx\displaystyle\int_2^4 2xe^x\,dx.

Technique

Derive Gauss–Legendre 2-point rule by enforcing exactness on 1,x,x2,x31,x,x^2,x^3 (⇒ weights 1,11,1, nodes ±1/3\pm1/\sqrt3 = roots of P2P_2); rescale [2,4][1,1][2,4]\to[-1,1] via x=3+tx=3+t (Jacobian =1=1); evaluate at the two nodes.

Solution

Setup. A two-point rule 11fdxw1f(x1)+w2f(x2)\displaystyle\int_{-1}^1 f\,dx\approx w_1 f(x_1)+w_2 f(x_2) has four free parameters w1,w2,x1,x2w_1,w_2,x_1,x_2; choosing them to integrate 1,x,x2,x31,x,x^2,x^3 exactly gives a rule exact for all cubics (degree 2n1=32n-1=3).

Step 1 — Derive the nodes and weights

Impose exactness on the monomials over [1,1][-1,1]:

111dx=2=w1+w2,\int_{-1}^1 1\,dx=2=w_1+w_2, 11xdx=0=w1x1+w2x2,\int_{-1}^1 x\,dx=0=w_1x_1+w_2x_2, 11x2dx=23=w1x12+w2x22,\int_{-1}^1 x^2\,dx=\tfrac23=w_1x_1^2+w_2x_2^2, 11x3dx=0=w1x13+w2x23.\int_{-1}^1 x^3\,dx=0=w_1x_1^3+w_2x_2^3.

By symmetry take w1=w2=ww_1=w_2=w and x2=x1x_2=-x_1. Then equation 1 gives w=1w=1; equations 2 and 4 are satisfied automatically; equation 3 gives 2x12=232x_1^2=\tfrac23, so x12=13x_1^2=\tfrac13, i.e. x1=13, x2=13x_1=\dfrac{1}{\sqrt3},\ x_2=-\dfrac{1}{\sqrt3}. Hence

Answer

  11f(x)dx=f ⁣(13)+f ⁣(13).  \boxed{\;\int_{-1}^1 f(x)\,dx=f\!\Big(\tfrac{1}{\sqrt3}\Big)+f\!\Big(-\tfrac{1}{\sqrt3}\Big).\;}
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.