← 2020 Paper 2
UPSC 2020 Maths Optional Paper 2 Q7b — Step-by-Step Solution 20 marks · Section B
Gaussian quadrature · Numerical Analysis · asked 3× in 13 yrs · Read the full method →
Question
Find a quadrature formula ∫ 0 1 f ( x ) d x x ( 1 − x ) = α 1 f ( 0 ) + α 2 f ( 1 2 ) + α 3 f ( 1 ) \int_0^1 f(x)\frac{dx}{\sqrt{x(1-x)}}=\alpha_1 f(0)+\alpha_2 f\!\left(\frac12\right)+\alpha_3 f(1) ∫ 0 1 f ( x ) x ( 1 − x ) d x = α 1 f ( 0 ) + α 2 f ( 2 1 ) + α 3 f ( 1 ) which is exact for polynomials of highest possible degree. Then use the formula to evaluate ∫ 0 1 d x x − x 3 \int_0^1\frac{dx}{\sqrt{x-x^3}} ∫ 0 1 x − x 3 d x (correct up to three decimal places).
Technique
Moment matching for fixed (non-Gauss) nodes; weights from a 3 × 3 3\times3 3 × 3 linear system using Beta-integral moments of 1 / x ( 1 − x ) 1/\sqrt{x(1-x)} 1/ x ( 1 − x ) ; then peel off 1 / 1 + x 1/\sqrt{1+x} 1/ 1 + x as f f f and apply the rule.
Solution
Step 1 — Moments of the weight w ( x ) = 1 / x ( 1 − x ) w(x)=1/\sqrt{x(1-x)} w ( x ) = 1/ x ( 1 − x )
Using ∫ 0 1 x n d x x ( 1 − x ) \int_0^1\frac{x^n\,dx}{\sqrt{x(1-x)}} ∫ 0 1 x ( 1 − x ) x n d x (Beta integrals):
μ 0 = ∫ 0 1 d x x ( 1 − x ) = π , μ 1 = ∫ 0 1 x d x x ( 1 − x ) = π 2 , \mu_0=\int_0^1\frac{dx}{\sqrt{x(1-x)}}=\pi,\quad
\mu_1=\int_0^1\frac{x\,dx}{\sqrt{x(1-x)}}=\frac{\pi}{2}, μ 0 = ∫ 0 1 x ( 1 − x ) d x = π , μ 1 = ∫ 0 1 x ( 1 − x ) x d x = 2 π ,
μ 2 = 3 π 8 , μ 3 = 5 π 16 . \mu_2=\frac{3\pi}{8},\quad \mu_3=\frac{5\pi}{16}. μ 2 = 8 3 π , μ 3 = 16 5 π .
Step 2 — Determine α 1 , α 2 , α 3 \alpha_1,\alpha_2,\alpha_3 α 1 , α 2 , α 3 (exact for 1 , x , x 2 1,x,x^2 1 , x , x 2 )
With three free weights at the fixed nodes 0 , 1 2 , 1 0,\tfrac12,1 0 , 2 1 , 1 , demand exactness for f = 1 , x , x 2 f=1,x,x^2 f = 1 , x , x 2 :
α 1 + α 2 + α 3 = μ 0 = π , 0 ⋅ α 1 + 1 2 α 2 + 1 ⋅ α 3 = μ 1 = π 2 , 0 ⋅ α 1 + 1 4 α 2 + 1 ⋅ α 3 = μ 2 = 3 π 8 . \begin{aligned}
\alpha_1+\alpha_2+\alpha_3&=\mu_0=\pi,\\
0\cdot\alpha_1+\tfrac12\alpha_2+1\cdot\alpha_3&=\mu_1=\tfrac{\pi}{2},\\
0\cdot\alpha_1+\tfrac14\alpha_2+1\cdot\alpha_3&=\mu_2=\tfrac{3\pi}{8}.
\end{aligned} α 1 + α 2 + α 3 0 ⋅ α 1 + 2 1 α 2 + 1 ⋅ α 3 0 ⋅ α 1 + 4 1 α 2 + 1 ⋅ α 3 = μ 0 = π , = μ 1 = 2 π , = μ 2 = 8 3 π .
Subtracting the third from the second: 1 4 α 2 = π 8 ⇒ α 2 = π 2 \tfrac14\alpha_2=\tfrac{\pi}{8}\Rightarrow\alpha_2=\tfrac{\pi}{2} 4 1 α 2 = 8 π ⇒ α 2 = 2 π . Then α 3 = 3 π 8 − 1 4 ⋅ π 2 = 3 π 8 − π 8 = π 4 \alpha_3=\tfrac{3\pi}{8}-\tfrac14\cdot\tfrac\pi2=\tfrac{3\pi}{8}-\tfrac{\pi}{8}=\tfrac{\pi}{4} α 3 = 8 3 π − 4 1 ⋅ 2 π = 8 3 π − 8 π = 4 π , and α 1 = π − π 2 − π 4 = π 4 \alpha_1=\pi-\tfrac\pi2-\tfrac\pi4=\tfrac{\pi}{4} α 1 = π − 2 π − 4 π = 4 π .
α 1 = π 4 , α 2 = π 2 , α 3 = π 4 . \boxed{\;\alpha_1=\frac{\pi}{4},\quad\alpha_2=\frac{\pi}{2},\quad\alpha_3=\frac{\pi}{4}.\;} α 1 = 4 π , α 2 = 2 π , α 3 = 4 π .
Step 3 — Highest degree of exactness
Test f = x 3 f=x^3 f = x 3 :
rule = π 4 ⋅ 0 + π 2 ⋅ 1 8 + π 4 ⋅ 1 = π 16 + π 4 = 5 π 16 = μ 3 . ✓ \text{rule}=\frac{\pi}{4}\cdot0+\frac{\pi}{2}\cdot\frac18+\frac{\pi}{4}\cdot1=\frac{\pi}{16}+\frac{\pi}{4}=\frac{5\pi}{16}=\mu_3.\ \checkmark rule = 4 π ⋅ 0 + 2 π ⋅ 8 1 + 4 π ⋅ 1 = 16 π + 4 π = 16 5 π = μ 3 . ✓
Test f = x 4 f=x^4 f = x 4 : μ 4 = ∫ 0 1 x 4 d x x ( 1 − x ) = 35 π 128 \mu_4=\int_0^1\frac{x^4dx}{\sqrt{x(1-x)}}=\frac{35\pi}{128} μ 4 = ∫ 0 1 x ( 1 − x ) x 4 d x = 128 35 π , while the rule gives π 2 ⋅ 1 16 + π 4 = π 32 + π 4 = 9 π 32 = 36 π 128 ≠ 35 π 128 \frac{\pi}{2}\cdot\frac1{16}+\frac\pi4=\frac{\pi}{32}+\frac{\pi}{4}=\frac{9\pi}{32}=\frac{36\pi}{128}\neq\frac{35\pi}{128} 2 π ⋅ 16 1 + 4 π = 32 π + 4 π = 32 9 π = 128 36 π = 128 35 π . Not exact.
The formula is exact for all polynomials of degree ≤ 3. \boxed{\text{The formula is exact for all polynomials of degree}\le 3.} The formula is exact for all polynomials of degree ≤ 3.
Step 4 — Evaluate ∫ 0 1 d x x − x 3 \displaystyle\int_0^1\frac{dx}{\sqrt{x-x^3}} ∫ 0 1 x − x 3 d x
Factor x − x 3 = x ( 1 − x 2 ) = x ( 1 − x ) ( 1 + x ) x-x^3=x(1-x^2)=x(1-x)(1+x) x − x 3 = x ( 1 − x 2 ) = x ( 1 − x ) ( 1 + x ) , so
∫ 0 1 d x x − x 3 = ∫ 0 1 1 1 + x ⋅ d x x ( 1 − x ) , \int_0^1\frac{dx}{\sqrt{x-x^3}}=\int_0^1\frac{1}{\sqrt{1+x}}\cdot\frac{dx}{\sqrt{x(1-x)}}, ∫ 0 1 x − x 3 d x = ∫ 0 1 1 + x 1 ⋅ x ( 1 − x ) d x ,
i.e. take f ( x ) = 1 1 + x f(x)=\dfrac{1}{\sqrt{1+x}} f ( x ) = 1 + x 1 . Node values:
f ( 0 ) = 1 , f ( 1 2 ) = 1 3 / 2 = 2 3 = 0.816497 , f ( 1 ) = 1 2 = 0.707107. f(0)=1,\quad f\!\left(\tfrac12\right)=\frac{1}{\sqrt{3/2}}=\sqrt{\tfrac23}=0.816497,\quad f(1)=\frac{1}{\sqrt2}=0.707107. f ( 0 ) = 1 , f ( 2 1 ) = 3/2 1 = 3 2 = 0.816497 , f ( 1 ) = 2 1 = 0.707107.
Apply the formula:
I ≈ π 4 ( 1 ) + π 2 ( 0.816497 ) + π 4 ( 0.707107 ) = π 4 ( 1 + 0.707107 ) + π 2 ( 0.816497 ) . I\approx\frac{\pi}{4}(1)+\frac{\pi}{2}(0.816497)+\frac{\pi}{4}(0.707107)
=\frac{\pi}{4}(1+0.707107)+\frac{\pi}{2}(0.816497). I ≈ 4 π ( 1 ) + 2 π ( 0.816497 ) + 4 π ( 0.707107 ) = 4 π ( 1 + 0.707107 ) + 2 π ( 0.816497 ) .
= π 4 ( 1.707107 ) + π 2 ( 0.816497 ) = 0.785398 ⋅ 1.707107 + 1.570796 ⋅ 0.816497. =\frac{\pi}{4}(1.707107)+\frac{\pi}{2}(0.816497)=0.785398\cdot1.707107+1.570796\cdot0.816497. = 4 π ( 1.707107 ) + 2 π ( 0.816497 ) = 0.785398 ⋅ 1.707107 + 1.570796 ⋅ 0.816497.
= 1.340755 + 1.282553 = 2.62331. =1.340755+1.282553=2.62331. = 1.340755 + 1.282553 = 2.62331.
Answer
∫ 0 1 d x x − x 3 ≈ 2.623 \boxed{\;\int_0^1\frac{dx}{\sqrt{x-x^3}}\approx 2.623\;} ∫ 0 1 x − x 3 d x ≈ 2.623