Professional Documents
Culture Documents
Numerical Analysis: Lecture - 23
Numerical Analysis: Lecture - 23
Numerical Analysis: Lecture - 23
Lecture -23
Muhammad Rafiq
Assistant Professor
University of Central Punjab
Lahore Pakistan
𝟏
Simpson’s Rule
𝟑
𝑛 𝑢(𝑢−1) 2 𝑢(𝑢−1)(𝑢−2) 3
= h∫0 [𝑓0 + 𝑢∆𝑓0 + ∆ 𝑓0 + ∆ 𝑓0 + ⋯ ] 𝑑𝑢... (a)
2! 3!
ℎ ℎ ℎ
I= {𝑓 + 4𝑓1 + 𝑓2 }+ {𝑓2 + 4𝑓3 + 𝑓4 }+ {𝑓4 + 4𝑓5 + 𝑓6 }+
3 0 3 3
ℎ
{𝑓 + 4𝑓𝑛−1 + 𝑓𝑛 }
3 𝑛−2
𝑏 ℎ
∫𝑎 𝑓(𝑥) 𝑑𝑥 = [𝑓0 + 4𝑓1 + 2𝑓2 + 4𝑓3 + 2𝑓4 + 4𝑓5 + 2𝑓6 + ⋯ +
3
2𝑓𝑛−2 + 4𝑓𝑛−1 + 𝑓𝑛 ]
𝑏 ℎ
∫𝑎 𝑓(𝑥) 𝑑𝑥 = [𝑓0 + 4(𝑓1 + 𝑓3 + 𝑓5 + ⋯ 𝑓𝑛−1 ) + 2(𝑓2 + 𝑓4 +
3
𝑓6 + ⋯ + 𝑓𝑛−2 ) + 𝑓𝑛 ]
The above formula is called Simpsons 1/3Rule.
Example No: 1
1 1
Evaluate the integral ∫0 1+𝑥 2 𝑑𝑥 Using
𝑏−𝑎 1−0
a=0 b=1 , h= = =0.25
𝑛 4
x 0 0.25 0.50 0.75 1.0
1 1 ℎ
∫0 1+𝑥 2 𝑑𝑥 = [𝑓 + 2(𝑓1 + 𝑓2 + 𝑓3 ) + 𝑓4 ]
2 0
1 1 0.25
∫0 1+𝑥 2 𝑑𝑥 = [1 + 2(0.94118 + 0.8 + 0.64) + 0.5]
2
1 1
∫0 1+𝑥 2 𝑑𝑥 = 0.782795
1
(ii) Simpson’s Rule ( n=4 )
3
1
Using Simpson’s Rule :
3
1 ℎ
∫0 𝑓(𝑥) 𝑑𝑥 = [𝑓 + 4(𝑓1 + 𝑓3 ) + 2𝑓2 + 𝑓4 ]
3 0
1 0.25
∫0 𝑓(𝑥) 𝑑𝑥 = [1 + 4(0.94118 + 0.64) + 2(0.8) + 0.5]
3
1
∫0 𝑓(𝑥) 𝑑𝑥 = 0.785393
Exact Value:-
1 1
∫0 1+𝑥 2 𝑑𝑥 = | tan−1 𝑥|10
Note:-
1
The answer obtained by Simpson’s ( ) Rule is closer to
3
exact value than the answer calculated by Trapezoidal Rule.
Therefore Simpson’s 1/3 Rule is superior than Trapezoidal Rule.
𝑬𝒙𝒆𝒓𝒄𝒊𝒔𝒆
Evaluate the following integrals using Simpson’s 1/3 Rule .
𝜋
𝑄#1. ∫ 𝑆𝑖𝑛 𝑥 𝑑𝑥 𝑓𝑜𝑟 𝑛 = 6
0
𝜋
𝑄#2. ∫ 𝐶𝑜𝑠 𝑥 𝑑𝑥 𝑓𝑜𝑟 𝑛 = 6
0
7
1
𝑄#3. ∫ 𝑑𝑥 𝑓𝑜𝑟 𝑛 = 6
2 ln 𝑥
1
𝑥2
𝑄#4. ∫ 𝑒 𝑑𝑥 𝑓𝑜𝑟 𝑛 = 6
0
𝑄#5.
10
Evaluate the integral ∫0 𝑦 𝑑𝑥 using 5 points simpson’s
1
( ) rule from the following data.
3