4.8.10 · Maths › Numerical Methods
Diye gaye n + 1 data points ( x 0 , y 0 ) , … , ( x n , y n ) jisme distinct x i hain, unse guzarne wala degree ≤ n ka exactly ek polynomial hota hai.
WHY unique? Degree ≤ n ke polynomial mein n + 1 free coefficients hote hain. n + 1 points se guzarne ki demand n + 1 linear equations deti hai → ek square system jiska matrix (Vandermonde matrix) invertible hota hai jab x i distinct hon.
Lagrange aur Newton bas do alag recipes hain isi same polynomial ko likhne ki. Same curve, alag algebra.
Definition Interpolation problem
Polynomial P ( x ) dhundo jisme deg P ≤ n ho aur P ( x i ) = y i for i = 0 , … , n , jahan x i distinct hain (koi repeated nodes nahi).
WHY distinct nodes matter: agar x i = x j lekin y i = y j to aap ek function se ek point par do values maang rahe ho — ye impossible hai. Distinctness Vandermonde determinant ko
∏ i < j ( x j − x i ) = 0 ,
banata hai, isliye system ka unique solution hota hai.
Main ek aisa polynomial chahta hun jo node x i par 1 ho aur baaki sabhi nodes par 0 ho . Ise L i ( x ) bolte hain — ek "switch" jo sirf x i par on hota hai. Tab
P ( x ) = ∑ i = 0 n y i L i ( x )
automatically P ( x k ) = y k deta hai, kyunki x k par L k = 1 ke alawa baaki sabhi switches off hote hain.
HOW to build L i ( x ) . Mujhe j = i wale sabhi x j par zeros chahiye. To ye factors daalo:
numerator = ∏ j = i ( x − x j ) .
Ye baaki sabhi nodes par zero hai. Ise x i par = 1 banane ke liye, iska wahan ka value divide karo:
Worked example Do points (unse guzarne wali line)
Points ( 1 , 2 ) , ( 3 , 8 ) .
L 0 = 1 − 3 x − 3 = − 2 x − 3 , L 1 = 3 − 1 x − 1 = 2 x − 1 .
P ( x ) = 2 ⋅ − 2 x − 3 + 8 ⋅ 2 x − 1 = − ( x − 3 ) + 4 ( x − 1 ) = 3 x − 1 .
Ye step kyun? Har L dusre node par zero hone ke liye force kiya gaya hai, isliye y i se multiply karke jodhne par kisi bhi node ki value disturb nahi hoti.
Check: P ( 1 ) = 2 ✔, P ( 3 ) = 8 ✔.
Intuition Doosra form kyun?
Lagrange elegant hai lekin rigid hai: ek naya data point add karo aur tumhe har L i recompute karni padti hai. Newton's form P ko aise likhta hai ki ek point add karna bas ek term append karna ho — growing data ke liye perfect.
Definition Divided differences (recursive)
f [ x i ] = y i , f [ x i , … , x i + k ] = x i + k − x i f [ x i + 1 , … , x i + k ] − f [ x i , … , x i + k − 1 ]
Ye "slope of slopes" hai: first-order f [ x i , x i + 1 ] = x i + 1 − x i y i + 1 − y i ordinary secant slope hai.
Worked example Teen points, Newton's tarika
( 1 , 2 ) , ( 3 , 8 ) , ( 4 , 5 ) . Table banao:
x
f [ ⋅ ]
1st
2nd
1
2
3 − 1 8 − 2 = 3
3
8
4 − 1 − 3 − 3 = − 2
4 − 3 5 − 8 = − 3
4
5
Top diagonal coefficients: 2 , 3 , − 2 .
P ( x ) = 2 + 3 ( x − 1 ) − 2 ( x − 1 ) ( x − 3 ) .
Ye step kyun? Main bas har column ka top read karta hun — ye f [ x 0 ] , f [ x 0 , x 1 ] , f [ x 0 , x 1 , x 2 ] hain.
Check P ( 4 ) = 2 + 9 − 2 ( 3 ) ( 1 ) = 11 − 6 = 5 ✔.
Worked example Same data → same polynomial (Lagrange vs Newton)
Newton expand karo: P ( x ) = 2 + 3 x − 3 − 2 ( x 2 − 4 x + 3 ) = − 2 x 2 + 11 x − 7 .
Unhi 3 points par Lagrange computation bhi identical − 2 x 2 + 11 x − 7 deta hai.
Ye kyun matter karta hai (Forecast-then-Verify): Forecast — unhe agree karna hi padega (uniqueness theorem). Verify — karte hain. Forms sirf bookkeeping mein alag hain.
Common mistake "Lagrange aur Newton alag polynomials dete hain."
Kyun sahi lagta hai: formulas bilkul alag dikhte hain. Fix: uniqueness theorem — sirf ek degree-≤ n polynomial points fit karta hai, isliye dono zaroor same cheez mein expand honge.
Common mistake "Divided differences points ke order par depend karti hain."
Kyun sahi lagta hai: recursion ordered indices use karta hai. Fix: f [ x 0 , … , x k ] apne arguments mein symmetric hai — points reorder karne se jo terms likhte hain wo alag ho sakti hain lekin final P nahi, aur na hi highest-order coefficient (P ke leading coefficient ke barabar hota hai).
Common mistake "Zyada points = hamesha better fit."
Kyun sahi lagta hai: zyada data matlab zyada accuracy lagta hai. Fix: equally spaced nodes par high-degree polynomials wildly oscillate karte hain (Runge). Chebyshev nodes ya low-degree splines use karo.
Common mistake Lagrange numerator ko
x i − x j se divide karna bhool jana.
Kyun sahi lagta hai: numerator mein pehle se sahi zeros hain. Fix: denominator ke bina L i ( x i ) = 1 , isliye P ( x i ) = y i . Normalization essential hai.
Recall Feynman: 12 saal ke bache ko explain karo
Socho tumhare paas graph paper par kuch dots hain aur tum chahte ho ek smooth bendy line unme se sabse guzre. Polynomial interpolation us line ka rule hai.
Lagrange tarika: har dot ke liye ek special bump-curve banao jo apne dot par exactly 1 ho aur baaki sabhi par 0 ho . Bumps ko stack karo, har ek ko apne dot ki height se scale karke. Line har dot se force hokar guzaregi.
Newton tarika: pehle dot se shuru karo. Correction add karo taki doosra bhi hit ho. Ek aur correction add karo jo pehle do par zero ho taki teesre ko hit kare — aur aise aage. Har correction ek "fix" hai jo pehle ki fixes kabhi nahi todta. Dono tarike same line banate hain — bas do alag recipes hain.
Mnemonic Dono forms yaad karo
"L for Local switches, N for New terms."
Lagrange = har basis L ocal hai (ek node par 1, baaki par 0). Newton = har step ek N aya term N udge karta hai jo purane nodes ko respect karta hai.
Vandermonde matrix — interpolation ka unique solution kyun hota hai.
Runge phenomenon — high-degree equispaced interpolation kyun fail hoti hai.
Chebyshev nodes — node placement jo error product ko tame karta hai.
Cubic splines — piecewise low-degree alternative.
Numerical differentiation — P ( x ) differentiate karke derivatives.
Newton-Cotes quadrature — interpolant ko integrate karna.
Taylor series — divided differences ki limit jab nodes coalesce hote hain (f [ x 0 , … , x k ] → f ( k ) / k ! ).
n + 1 distinct nodes ke liye degree ≤ n ka unique interpolating polynomial kyun exist karta hai?Vandermonde system square hai aur nonzero determinant ∏ i < j ( x j − x i ) hai jab nodes distinct hon, isliye coefficients uniquely determined hote hain.
Lagrange basis polynomial L i ( x ) define karo. L i ( x ) = ∏ j = i x i − x j x − x j ; ye x i par 1 aur baaki sabhi nodes par 0 hota hai.
L i ki kaun si property P ( x ) = ∑ y i L i ( x ) ko interpolate banati hai?L i ( x k ) = δ ik , isliye har node par sirf ek term survive karta hai, jisse P ( x k ) = y k milta hai.
Divided difference ki recursive definition do. f [ x i , … , x i + k ] = x i + k − x i f [ x i + 1 , … , x i + k ] − f [ x i , … , x i + k − 1 ] , jisme f [ x i ] = y i .
Newton's forward interpolation polynomial likho. P ( x ) = ∑ k = 0 n f [ x 0 , … , x k ] ∏ j = 0 k − 1 ( x − x j ) .
Newton's form mein ek data point cheaply add kyun ho sakta hai lekin Lagrange mein nahi? Newton ke naye term mein ∏ ( x − x j ) factor hota hai jo purane nodes par zero hota hai, isliye bas ek term append karo; Lagrange mein har basis L i recompute karni padti hai.
Kya Lagrange aur Newton interpolants same polynomial hain? Haan — uniqueness se wo identical hain; sirf algebraic form alag hota hai.
Interpolation error formula batao. f ( x ) − P ( x ) = ( n + 1 )! f ( n + 1 ) ( ξ ) ∏ i = 0 n ( x − x i ) kisi ξ ke liye interval mein.
Interpolation error interval ends ke paas kyun badhti hai? ∏ ( x − x i ) factor wahan large ho jata hai (Runge phenomenon), jo error inflate karta hai.
Kya divided difference f [ x 0 , … , x k ] apne nodes mein symmetric hai? Haan — nodes reorder karne se iska value change nahi hota; ye interpolating polynomial ke leading coefficient ke barabar hota hai.
Unique polynomial deg <= n
Vandermonde matrix invertible
Basis L_i = 1 at x_i, 0 elsewhere
Add point rebuilds everything
Divided differences slope of slopes
Add point appends one term