Visual walkthrough — Polynomial interpolation — Lagrange form, Newton's divided differences
4.8.10 · D2· Maths › Numerical Methods › Polynomial interpolation — Lagrange form, Newton's divided d
Neeche jo bhi hai, woh un teeno dots ke baare mein hai. Main unhe ek baar seedhe shabdon mein naam deta hoon, taaki koi bhi symbol bina bataye andar na ghus aaye.
Step 1 — Goal, drawn karo
KYA. Hum ek smooth curve chahte hain — ek polynomial — jo teeno dots ko exactly touch kare.
Ek polynomial sirf ki powers ko jodkar bani curve hoti hai, jaise . Iska degree sabse badi power hoti hai. Teen dots ko degree- (parabola-shaped) curve pin kar sakti hai, kyunki ek degree- polynomial mein teen knobs hote hain: , , .
dots ke liye degree kyun. Knobs ko demands se count karo:
Teen knobs, teen demands → curve ko lock karne ke liye bilkul enough. (Generally: dots ke liye degree chahiye.)
PICTURE. Teen dots aur woh (spoiler) curve jo hum banana chahte hain.
Step 2 — Lagrange idea: har dot ke liye ek "switch"
KYA. seedha solve karne ki jagah, hum har dot ke liye ek chhoti curve banate hain jo ek switch hai: apne dot par aur baaki sab dots par . Dot ke switch ko symbol dete hain.
Switch se kya fayda. Agar mere paas teen switches hain, to har ek ko uski dot ki height se scale karke add karne par milta hai
- — dot ki height (ek fixed number).
- — dot ka switch (sirf par on).
Node par, misal ke taur par, aur , to poora sum par collapse ho jaata hai. Curve us dot se force hoti hai bina koi algebra solve kiye.
PICTURE. Teen switch-curves, har ek apne node par tak spike karti hai, baaki jagah flat-zero.
Recall Switches ek doosre ko disturb kyun nahi karte
Kyunki har apne node ko chhodkar baaki sab nodes par zero hai, unhe add karne se koi pehle se set height disturb nahi hoti. Har term sirf apne dot par "bolta" hai.
Step 3 — Ek switch banana, factor by factor
KYA. Aao banate hain — dot 0 ka switch (node ).
Zeros se kyun shuru karein. Dot 0 ke liye switch ko doosre nodes aur par zero hona chahiye. Kisi curve ko kisi jagah zero force karne ka sabse saaf tarika hai ek aisa factor multiply karna jo wahan vanish ho jaaye:
- — ek factor jo exactly par hota hai (node 1).
- — ek factor jo exactly par hota hai (node 2).
Yeh sahi jagahon par vanish ho jaata hai. Lekin apne node par yeh deta hai, nahi. To switch ko par normalise karne ke liye hum us value se divide karte hain:
- Upar curve ko doosre nodes par maar deta hai.
- Neeche ek fixed number hai jo height ko par par reset karta hai.
PICTURE. Dekho kaise banta hai: raw product (sahi jagah zeros), phir vertical rescale taaki peak height par baithe.
Step 4 — Switches ko stack karke curve banana
KYA. Ab teeno switches add karo, har ek ko uski dot ki height se weight dekar:
Yeh har dot se kyun guzarti hai. Node par evaluate karo: sirf on hai (), baaki dono off hain (), to . Har node par same story.
PICTURE. Scaled switches (heights , , ) aur unka sum — red curve jo teeno dots se guzarti hai.
Is sum ko expand karne par milta hai (neeche verify karte hain). Yahi ek interpolating polynomial hai.
Step 5 — Newton ka idea: usi curve ko nudges se banana
KYA. Lagrange mein ek dot add karne par sab kuch rebuild karna padta hai. Newton curve ko ek correction ek baar badhata hai, aur har correction design ki gayi hai ki woh pehle se fix cheezein disturb na kare.
Yeh kyun kaam karta hai. Dot 0 se shuru karo. Ek term add karo taaki dot 1 bhi hit ho. Phir ek aisa term add karo jo dots 0 aur 1 par zero ho taaki woh dot 2 ko fix kar sake bina unhe todne ke:
- — dot 0 par vanish hota hai, to doosri term dot 0 ko chhod deti hai.
- — dots 0 aur 1 par vanish hota hai, to teesri term dono ko chhod deti hai.
Har naaya factor saare pehle wale dots ko "protect" karta hai.
PICTURE. Teen snapshots: height par flat start, phir dots 0–1 se guzarti tilted line, phir dot 2 ko pakad'ti bent curve — pehle wale dots kabhi nahi hilte.
Step 6 — Newton coefficients kahan se aate hain (slopes of slopes)
KYA. Numbers divided differences hain — literally slopes, phir slopes of slopes.
Slopes kyun. Dot 0 se dot 1 tak jaane ke liye, sahi steepness ordinary secant slope hai. Dot 2 ke liye sahi bend ke liye, hume chahiye ki woh slope khud kitna change hoti hai.
- — bas starting height ().
- — dots 0 aur 1 ke beech secant slope ().
- — "slopes ka slope" (), yaani steepness kitna bend karti hai.
To
PICTURE. Divided-difference triangle, arrows dikhate hue ki har number apne left ke dono numbers ka difference hai, outer nodes ke span se divide kiya hua. Final coefficient highlight kiya hua.
Recall Dot 2 check karo
. ✔
Step 7 — Do recipes, ek curve
KYA. Newton's form expand karo: jo Step 4 ke Lagrange result se bilkul same hai.
Yeh match kyun karna chahiye. Teeno dots se guzarne wali sirf ek degree- polynomial hoti hai (Step 1 ka knob-count, Vandermonde matrix se proven). Do sahi recipes do alag aisi curves nahi bana sakti — to woh ek hi hoti hain.
PICTURE. Dono constructions ek saath; curves ek doosre ke upar hain, ek red.
Step 8 — Degenerate aur edge cases jo tumhe dekhne chahiye
KYA. Teen scenarios jinse recipe ko survive karna hai:
- Collinear dots. Agar teen dots ek line par hain, to knob aur doosra divided difference dono hain, to ek line ban jaati hai — degree se neeche gir jaati hai. Kuch nahi tootता.
- Repeated node (). Denominator aata hai — division by zero. Yeh forbidden hai: distinct nodes zaroori hain. Ek spot par do heights koi function nahi hota.
- Interval ke ends. Nodes par perfect fit hone ke baad bhi curve unke beech mein bhatak sakti hai. Error mein factor hota hai, jo outer edges ke paas badhta hai — Runge phenomenon ka beej.
Yeh kyun dikhate hain. Recipe tabhi trustworthy hai jab tum jaano ki woh exactly kab succeed karti hai, collapse karti hai, ya illegal hai.
- — nodes par zero, beech/aage bade.
- — true function kitna curvy hai; agar wild hai, error wild hai.
PICTURE. Left: collinear dots se ek line. Middle: illegal repeated node (ek vertical clash). Right: error product ends par phool raha hai.
Ek-picture summary
Sab kuch ek canvas par: teen dots, teen Lagrange switches (faint), Newton ka nudging path (dashed), aur ek red interpolant jis par sab agree karte hain — saath mein edges par error product ka hint.
Recall Feynman retelling — poora walkthrough seedhe shabdon mein
Tumhare paas teen dots hain aur ek bendy line chahiye jo sab se guzre. Kyunki ek parabola mein teen dials hain () aur tumhare paas teen demands hain, exactly ek aisi curve hoti hai.
Lagrange ka tarika: har dot ke liye ek chhoti "switch" curve banao jo us dot par on ho (height 1) aur baaki par off (height 0). Switch ko kisi jagah off force karne ke liye ek aisa factor multiply karo jo wahan mar jaaye; use apne dot par on force karne ke liye us value se divide karo jo us waqt uski hai. Phir har switch ko uski dot ki height se scale karo aur add karo. Kyunki har switch baaki dots par silent hai, sum teeno se guzar jaata hai.
Newton ka tarika: pehle dot par flat shuru karo. Doosre ko pakadne ke liye tilt karo — unke beech ka plain slope use karke. Phir teesre ko pakadne ke liye bend karo — "slope of the slopes" use karke — aur us correction ko se multiply karo taaki woh pehle dono dots par zero ho aur unhe barbaad na kar sake. Tumhe jo numbers chahiye woh sirf differences divided by gaps hain, ek chhote triangle se padhe.
Dono recipes ek hi red curve banati hain — sirf ek hai — woh sirf alag tarike se bookkeeping karte hain. Aur dhyan raho: nodes alag hone chahiye (warna division by zero hoga), aur fit dots par perfect hone ke baad bhi edges par wobble kar sakti hai.
Connections
- Parent topic
- Vandermonde matrix — teen knobs uniquely fixed kyun hote hain.
- Runge phenomenon — edge-wobble real hota hua.
- Chebyshev nodes — node spacing jo error product ko tame karta hai.
- Cubic splines — ek badi curve ki jagah bahut saari chhoti curves.
- Numerical differentiation — slopes ke liye differentiate karo.
- Newton-Cotes quadrature — areas ke liye integrate karo.
- Taylor series — divided differences → derivatives jab nodes coalesce hote hain.