4.8.17 · Maths › Numerical Methods
Intuition Badi idea (KYUN)
Normal quadrature rules (trapezoid, Simpson) points fix kar dete hain (evenly spaced) aur sirf weights choose karte hain. Gauss ne kaha: kyun main apni aadhi freedom waste karun? Agar mujhe dono — n nodes x i aur n weights w i — choose karne ki permission ho, toh mere paas 2 n free numbers hain — toh main degree 2 n − 1 tak ke polynomials ko exactly integrate kar sakta hun, instead of sirf degree n − 1 ke.
Yahi poora game hai: apne 2 n degrees of freedom spend karo taaki maximum possible degree ka error khatam ho sake.
Definition Gauss–Legendre quadrature
Hum approximate karte hain
∫ − 1 1 f ( x ) d x ≈ ∑ i = 1 n w i f ( x i )
jahan nodes x i ==Legendre polynomial P n ( x ) ke roots== hain aur weights w i is tarah choose kiye jaate hain ki rule degree ≤ 2 n − 1 ke sabhi polynomials ke liye exact ho.
[ − 1 , 1 ] interval kyun? Kyunki magic hoti hai Legendre polynomials ke saath, jo [ − 1 , 1 ] par orthogonal hain. Koi bhi real integral ∫ a b ko ek linear change of variable se [ − 1 , 1 ] mein convert kiya jaata hai (niche dikhaya gaya hai).
Hum chahte hain
∫ − 1 1 f ( x ) d x ≈ w 1 f ( x 1 ) + w 2 f ( x 2 ) ,
degree ≤ 2 n − 1 = 3 ke liye exact. Chaar unknowns ( w 1 , w 2 , x 1 , x 2 ) , toh basis 1 , x , x 2 , x 3 par exactness impose karo:
f = 1 : f = x : f = x 2 : f = x 3 : w 1 + w 2 = ∫ − 1 1 1 d x = 2 w 1 x 1 + w 2 x 2 = ∫ − 1 1 x d x = 0 w 1 x 1 2 + w 2 x 2 2 = ∫ − 1 1 x 2 d x = 3 2 w 1 x 1 3 + w 2 x 2 3 = ∫ − 1 1 x 3 d x = 0
Ye equations kyun? Agar rule har monomial ko exactly integrate karta hai, toh linearity se yeh degree ≤ 3 ke har polynomial ko exactly integrate karega.
Symmetry se guess karo x 2 = − x 1 , w 1 = w 2 = w .
f = 1 se: 2 w = 2 ⇒ w = 1 . (Kyun? dono weights equal hain, sum 2 hai.)
f = x aur f = x 3 odd symmetry se auto-satisfy ho jaate hain. (Kyun? symmetric nodes par odd function cancel ho jaata hai.)
f = x 2 se: x 1 2 + x 2 2 = 2 x 1 2 = 3 2 ⇒ x 1 = 3 1 .
∫ − 1 1 f d x ≈ f ( − 3 1 ) + f ( 3 1 )
P n ke roots kyun?
Likho f = q ( x ) P n ( x ) + r ( x ) jahan deg q , deg r ≤ n − 1 (polynomial division). Tab ∫ − 1 1 f = ∫ q P n + ∫ r . Pehla integral 0 hai kyunki P n har lower-degree polynomial q ke saath orthogonal hai. q P n par quadrature sum bhi 0 hai agar hum nodes ko P n ke roots par rakhein (kyunki P n ( x i ) = 0 ). Toh dono sides sirf r ko "dekhti" hain, degree ≤ n − 1 — jise koi bhi interpolatory rule exactly handle karta hai. Isliye nodes = P n ke roots degree 2 n − 1 dilata hai.
Indeed P 2 ( x ) = 2 1 ( 3 x 2 − 1 ) ke roots ± 1/ 3 hain — hamare derivation se match karta hai.
Weights nodes par Lagrange basis ke integrals hain:
w i = ∫ − 1 1 ∏ j = i x i − x j x − x j d x ,
jo degree ≤ n − 1 ke liye exactness guarantee karta hai; orthogonality ise 2 n − 1 tak boost karta hai. Ek closed form:
w i = ( 1 − x i 2 ) [ P n ′ ( x i ) ] 2 2 .
Worked example 1. Exact case:
∫ − 1 1 ( 3 x 3 − x 2 + 2 ) d x 2-point rule se
Nodes ± 1/ 3 , weights 1 , 1 .
f ( 1/ 3 ) = 3 ( 3 3 1 ) − 3 1 + 2 = 3 1 + 3 5 .
f ( − 1/ 3 ) = − 3 1 + 3 5 .
Sum = 3 10 .
Exact kyun? Degree 3 ≤ 2 n − 1 = 3 . True value: ∫ − 1 1 ( 3 x 3 − x 2 + 2 ) = 0 − 3 2 + 4 = 3 10 . ✓
∫ 0 1 e x d x 2-point rule se
Map: x = 2 1 t + 2 1 , factor 2 b − a = 2 1 .
Nodes t = ± 1/ 3 ⇒ x = 0.21132 , 0.78868 (Kyun? t ko map mein plug karo.)
2 1 ( e 0.21132 + e 0.78868 ) = 2 1 ( 1.2353 + 2.2005 ) = 1.7179 .
Exact = e − 1 = 1.71828 . Error ≈ 4 × 1 0 − 5 sirf do evaluations se — 2 intervals wala Simpson kaafi zyada worse hai.
Worked example 3. Forecast-then-Verify
Forecast: kya 2-point rule ∫ − 1 1 x 4 d x ke liye exact hoga? Degree 4 > 3 , toh nahi .
Verify: rule deta hai ( 1/ 3 ) 4 + ( − 1/ 3 ) 4 = 2 ⋅ 9 1 = 9 2 ≈ 0.222 . True value = 5 2 = 0.4 . Exact nahi — degree limit confirm ho gayi. (Yeh kyun matter karta hai: yeh exactly batata hai kab zyada nodes add karne chahiye.)
Common mistake "Gauss nodes Simpson ki tarah evenly spaced hote hain."
Kyun aisa lagta hai: har rule jo pehle seekha (trapezoid, Simpson) equal spacing use karta hai, toh assume karte hain Gauss bhi karta hoga.
Fix: Gauss nodes P n ke roots hain — interior/ends ki taraf asymmetrically clustered , endpoints ± 1 kabhi include nahi karte. Non-uniform placement hi exactly woh cheez hai jo extra accuracy dilati hai.
2 b − a scale factor bhool jaana."
Kyun aisa lagta hai: [ − 1 , 1 ] par iska zaroorat kabhi nahi padi, toh drop karna aasaan lagta hai.
Fix: Jab bhi b − a = 2 , weight sum aur node remap dono ko scale karna padega. Quick sanity check: f = 1 integrate karo; rule ko b − a return karna chahiye, 2 nahi.
n -point rule degree n tak exact hai."
Kyun aisa lagta hai: n points → degree n polynomial fitting (interpolation intuition).
Fix: Yeh degree == 2 n − 1 == tak exact hai, kyunki tumne nodes bhi tune kiye hain. Yahi doubling Gauss ka poora payoff hai.
Recall Feynman: 12-saal ke bacche ko samjhao
Socho ek tedhi-medhi saanp ka area nikalna hai. Purane rulers kehte hain fixed, equally-spaced jagahon par measure karo. Gauss kehta hai: "Mujhe khud sabse smart jagahein chunne do aur decide karne do ki har jagah kitni count karti hai." Same number of measurements se woh kaafi zyada tedhe-medhe curves ke liye bilkul sahi ho sakta hai. Uske secret spots special points hain jinhe zeros of Legendre polynomials kehte hain — aisi jagahein jo is tarah arranged hain ki bachi hui error bilkul cancel ho jaaye.
Mnemonic Magic yaad rakho
"Points aur weights dono chuno → power D ouble ho jaati hai." n points → degree 2 n − 1 . Aur 2-point nodes: "one over root three" ± 3 1 , dono weights 1 .
n -point Gauss rule degree 2 n − 1 tak exact kyun ho sakta hai?Iske paas 2 n free parameters hain (n nodes + n weights), jo 2 n moment conditions ∫ x k for k = 0..2 n − 1 match karne ke liye kaafi hain.
Gauss–Legendre ke nodes kahan placed hote hain? [ − 1 , 1 ] par Legendre polynomial P n ( x ) ke roots par.
2-point Gauss–Legendre nodes aur weights kya hain? P n ke roots extra accuracy kyun dete hain?P n sabhi lower-degree polynomials ke saath orthogonal hai, isliye high-degree remainder q P n ka integral 0 ho jaata hai aur nodes par bhi vanish karta hai.
[ a , b ] ko [ − 1 , 1 ] par map karne wala change of variable kya hai?x = 2 b − a t + 2 a + b , extra factor 2 b − a ke saath.
Closed-form weight formula kya hai? w i = ( 1 − x i 2 ) [ P n ′ ( x i ) ] 2 2 .
Kya Gauss–Legendre endpoints ± 1 include karta hai? Nahi (yeh Gauss–Lobatto hai). Standard Gauss–Legendre nodes strictly interior hote hain.
[ a , b ] par correctly scale kiya hai ya nahi, sanity check kya hai?f = 1 integrate karo toh b − a aana chahiye.
Legendre polynomials — nodes ka source (orthogonality)
Orthogonal polynomials — Gauss-type rules ki general recipe
Newton-Cotes formulas — fixed-node cousins (trapezoid, Simpson)
Gauss-Lobatto quadrature — endpoints include karne wala variant
Polynomial interpolation — weights ke peeche Lagrange basis
Numerical integration error analysis — error ∝ f ( 2 n ) ( ξ )
2n free numbers nodes plus weights
Integrate polynomials up to degree 2n-1 exactly
Gauss-Legendre rule sum wi f xi
Pn orthogonal to lower degrees
Exactness on monomials 1 x x2 x3
2-point rule f at plus-minus 1 over root3
Linear change of variable