4.8.16 · HinglishNumerical Methods

Simpson's 1 - 3 rule, 3 - 8 rule (composite) — derivation

1,566 words7 min readRead in English

4.8.16 · Maths › Numerical Methods


1. Hum kaunsa problem solve kar rahe hain?

KYA cheez rules ko alag karti hai: har panel mein use hone wali polynomial ki degree aur ek panel kitne subintervals span karta hai.

Rule Polynomial Subintervals per panel Nodes needed
Trapezoid line (deg 1) 1 2
Simpson 1/3 parabola (deg 2) 2 3
Simpson 3/8 cubic (deg 3) 3 4

2. Simpson's 1/3 rule ko scratch se derive karna

KAISE — 3 points ke through ek parabola fit karo. Ek panel lo jiska midpoint hai, spacing hai. Coordinates shift karo taaki ho jaaye (allowed hai: integral translation-invariant hota hai). Fit karo

Teen nodes par match karo:

Recall Yeh equations kyun?

Ek parabola mein 3 unknowns hote hain ; teen points unhe uniquely pin down kar dete hain. Hume ke liye solve karne ki zaroorat nahi — dekho.

Pehli aur teesri add karo: .

Ab parabola ko panel ke upar integrate karo:

Odd term integrate hokar deta hai (symmetric limits — yeh step kyun? odd functions ke upar cancel ho jaate hain), bacha:

aur substitute karo:

=\frac{h}{3}(f_0+f_2)-\frac{2h}{3}f_1+2h f_1.$$ $$\boxed{\ \int_{x_0}^{x_2}f\,dx \approx \frac{h}{3}\big(f_0+4f_1+f_2\big)\ }$$ > [!formula] Simpson's 1/3 (single panel) > $$\int_{x_0}^{x_2} f\,dx \approx \frac{h}{3}(f_0+4f_1+f_2)$$ > **"1/3"** woh $h/3$ hai jo aage hai; weights $1,4,1$ hain. ### Composite 1/3 rule Strips ke har pair par apply karo, isliye $n$ **==even==** hona chahiye. Panels $[x_0,x_2],[x_2,x_4],\dots$ add karo: $$I\approx \frac{h}{3}\Big[f_0+4(f_1+f_3+\cdots)+2(f_2+f_4+\cdots)+f_n\Big].$$ > [!intuition] 4-2-4-2 pattern kyun? > Interior **odd-index** nodes ek panel ke midpoints hote hain → weight 4. **Even-index** interior nodes do adjacent panels ke beech shared *endpoints* hote hain → $1+1=2$. Bahar ke endpoints ek baar aate hain → weight 1. --- ## 3. Simpson's 3/8 rule derive karna **KAISE — 4 points ke through ek cubic fit karo.** Panel $[x_0,x_3]$, nodes $-\tfrac{3h}{2}$ par? Easier: nodes $0,h,2h,3h$ rakho aur Newton's forward formula use karo, lekin symmetric trick sabse clean hai. Nodes ko $-\frac{3h}{2},-\frac{h}{2},\frac{h}{2},\frac{3h}{2}$ rakho (spacing $h$, panel width $3h$). Cubic $p(x)=Ax^3+Bx^2+Cx+D$ fit karo. Symmetric limits ke upar integrate karne par odd powers $A,C$ cancel ho jaate hain: $$\int_{-3h/2}^{3h/2}p\,dx = 2\Big[B\frac{x^3}{3}+Dx\Big]_0^{3h/2}=2B\frac{(3h/2)^3}{3}+2D\frac{3h}{2}.$$ 4 node equations se $B,D$ ko $f_0,f_1,f_2,f_3$ ke terms mein solve karna (standard algebra) weights $1,3,3,1$ deta hai: $$\boxed{\ \int_{x_0}^{x_3} f\,dx\approx \frac{3h}{8}(f_0+3f_1+3f_2+f_3)\ }$$ > [!formula] Simpson's 3/8 (single panel) > $$\int_{x_0}^{x_3} f\,dx \approx \frac{3h}{8}(f_0+3f_1+3f_2+f_3)$$ > Coefficient $\frac{3h}{8}$ hai, weights $1,3,3,1$ hain. $n$ **==3==** se divisible hona chahiye. ### Composite 3/8 rule $$I\approx\frac{3h}{8}\Big[f_0+3(f_1+f_2+f_4+f_5+\cdots)+2(f_3+f_6+\cdots)+f_n\Big].$$ Pattern: nodes jo 3 ke multiples nahi hain → weight 3; shared joints (3 ke multiples, interior) → weight 2. > [!intuition] 3/8 kab use karein? > Jab $n$ cleanly 2 se divisible **nahi** ho, ya kisi leftover 3-strip chunk ko handle karna ho. Aksar: bulk 1/3 rule se karo, aakhri 3 strips 3/8 se khatam karo. ![[4.8.16-Simpson's-1-3-rule,-3-8-rule-(composite)-—-derivation.png]] --- ## 4. Error terms (KYU Simpson itna achha hai) > [!formula] Error > 1/3 composite: $E=-\dfrac{(b-a)h^4}{180}f^{(4)}(\xi)$ — cubics ke liye exact hai! > 3/8 composite: $E=-\dfrac{(b-a)h^4}{80}f^{(4)}(\xi)$. > > Dono $O(h^4)$ hain. **Surprise:** Simpson 1/3 ek parabola fit karta hai phir bhi *cubics* ko exactly integrate karta hai — odd-degree error term symmetry se cancel ho jaata hai (same reason jisse $B$ vanish hua tha). --- ## 5. Worked examples > [!example] Ex 1 — $\int_0^1 \frac{dx}{1+x}$ by 1/3 rule, $n=2$ > Exact $=\ln 2=0.693147$. $h=0.5$, nodes $0,0.5,1$; $f=1,\,0.6667,\,0.5$. > **$n=2$ kyun?** Sabse chhota even $n$ → ek parabola panel. > $I\approx\frac{0.5}{3}(1+4(0.6667)+0.5)=\frac{0.5}{3}(4.1667)=0.69444$. Error $\approx 0.0013$. > [!example] Ex 2 — same integral, 1/3 with $n=4$ > $h=0.25$, $f_0=1,f_1=0.8,f_2=0.6667,f_3=0.5714,f_4=0.5$. > $I=\frac{0.25}{3}[1+4(0.8+0.5714)+2(0.6667)+0.5]=\frac{0.25}{3}[8.3145]=0.69288$. > **Zyada accurate kyun?** $h$ half karne se error $\sim 2^4=16\times$ cut ho gayi — yahi $h^4$ law hai. > [!example] Ex 3 — $\int_0^3 x^3\,dx$ by 3/8 rule, $n=3$ > Exact $=81/4=20.25$. $h=1$, $f=0,1,8,27$. > $I=\frac{3(1)}{8}(0+3(1)+3(8)+27)=\frac{3}{8}(54)=20.25$. **Exact!** > **Exact kyun?** 3/8 cubics ke liye exact hai; $x^3$ ek cubic hai. --- ## 6. Common mistakes > [!mistake] 1/3 rule ke saath odd $n$ use karna > **Kyun sahi lagta hai:** "zyada strips = better, parity se kya farak padta hai." **Reality:** 1/3 rule strips ko *pairs* mein consume karta hai; ek odd $n$ ek orphan strip chhodta hai jiske liye koi defined parabola nahi hai. **Fix:** $n$ even karo, ya aakhri 3 strips 3/8 rule se khatam karo. > [!mistake] 4-2 alternation bhool jaana > Students *sabhi* interior nodes par weight 4 likh dete hain. **Kyun tempting lagta hai:** single-panel formula mein ek "4" hai. **Fix:** sirf **odd-index** (midpoints) ko 4 milta hai; even-index shared joints ko 2 milta hai. > [!mistake] Galat coefficient: $h/3$ vs $3h/8$ > Dono ko mix up karna. **Neeche mnemonic hai.** Aur: 3/8 mein aage $\frac{3h}{8}$ hai, $\frac{h}{8}$ *nahi*. --- > [!recall]- Feynman: ek 12-saal ke bachche ko samjhao > Socho ek uneven hill ke neeche ka area measure kar rahe ho. Lazy tarika fence posts ke beech straight lines kheeechna hai (trapezoid) — lekin straight lines curve miss kar deti hain. Simpson smarter hai: woh ek flexible ruler ko itna moda hai ki woh **teen** posts ko ek saath touch kare, ek smooth U-shape (parabola) banate hue jo hill ko hug kare. Inn curved-ruler areas ko add karo. Extra wiggly jagahon ke liye woh **chaar** posts aur ek S-shape ruler (cubic) use karta hai — woh hai 3/8 rule. Jitna fancy ruler = utni chhoti error. > [!mnemonic] Dono rules yaad rakhna > **"One-Third → 1-4-1, even pairs."** (3 numbers, sum 6, $/6\cdot 2h=h/3$... weights $1,4,1$.) > **"Three-Eighths → 1-3-3-1, threes."** Coefficient naam se match karta hai: $\frac{3h}{8}$. Digits count karo: 1/3 rule mein **3** weights hain, 3/8 rule mein **4** weights hain. --- ## 7. Flashcards #flashcards/maths Simpson's 1/3 rule har panel mein kaunsi polynomial fit karta hai? ::: Ek parabola (degree 2) jo 3 points se guzre. Single-panel Simpson 1/3 formula kya hai? ::: $\frac{h}{3}(f_0+4f_1+f_2)$. Single-panel Simpson 3/8 formula kya hai? ::: $\frac{3h}{8}(f_0+3f_1+3f_2+f_3)$. Composite 1/3 ke liye $n$ par constraint kya hai? ::: $n$ even hona chahiye (strips pairs mein li jaati hain). Composite 3/8 ke liye $n$ par constraint kya hai? ::: $n$ 3 se divisible hona chahiye. Composite 1/3 mein weight pattern kya hai? ::: $1,4,2,4,2,\dots,4,1$ (odd-index → 4, even interior → 2). Simpson 1/3 cubics ke liye exact kyun hai jabki woh sirf parabola fit karta hai? ::: Odd-degree error term symmetry se $[-h,h]$ ke upar cancel ho jaata hai. Dono Simpson rules ke liye error ka order kya hai? ::: $O(h^4)$; error $\propto f^{(4)}(\xi)$. 1/3 composite error term kya hai? ::: $-\frac{(b-a)h^4}{180}f^{(4)}(\xi)$. 3/8 composite error term kya hai? ::: $-\frac{(b-a)h^4}{80}f^{(4)}(\xi)$. Derivation mein $Bx$ term kyun vanish ho jaata hai? ::: Yeh odd hai; symmetric limits $[-h,h]$ ke upar iska integral zero hota hai. Jab n odd ho tab combined strategy kya hai? ::: Zyaadatar strips par 1/3 use karo, aakhri 3 strips 3/8 rule se khatam karo. --- ## 8. Connections - [[Trapezoidal Rule]] — degree-1 ancestor; Simpson degree-2/3 upgrade hai. - [[Newton-Cotes Formulas]] — Simpson rules $n=2,3$ closed Newton-Cotes members hain. - [[Lagrange Interpolation]] — fitted polynomial provide karta hai jiska integral weights deta hai. - [[Richardson Extrapolation]] — 1/3 results combine karne se error aadhi hoti hai → [[Romberg Integration]] tak le jaata hai. - [[Gaussian Quadrature]] — optimal-node alternative jo equal-spacing rules ko beat karta hai. - [[Taylor's Theorem]] — $h^4 f^{(4)}$ error term ka source. ## 🖼️ Concept Map ```mermaid flowchart TD P[Cannot integrate f exactly] -->|solution| Q[Numerical quadrature] Q -->|approximates I| W[Weighted sum of f values] Q -->|fit polynomial per panel| POLY[Replace curve with polynomial] POLY -->|degree 1 line| TR[Trapezoid rule] POLY -->|degree 2 parabola| S13[Simpson 1/3 rule] POLY -->|degree 3 cubic| S38[Simpson 3/8 rule] S13 -->|fit through 3 nodes| DER[Integrate over symmetric panel] DER -->|odd Bx term cancels| BOX[weights 1 4 1, h/3 out front] BOX -->|apply per pair of strips| COMP[Composite 1/3 rule] COMP -->|requires| EVEN[n must be even] COMP -->|shared endpoints| PAT[4-2-4-2 weight pattern] S38 -->|fit through 4 nodes| CUBIC[weights 1 3 3 1, 3h/8] ```