Module 4
Numerical methods
Interpolation & extrapolation: if 𝑥0 , 𝑥1 , 𝑥2 ,… 𝑥𝑛 are the values of x and 𝑦0 , 𝑦1 , 𝑦2 ,… 𝑦𝑛
be the corresponding values of y, the process of estimating the value of y for any given value
of x between 𝑥0 & 𝑥𝑛 is called interpolation.
The process of estimating the value of y for any given value of x which is outside the given
range is called extrapolation.
a) Equal intervals
Finite difference:
Let 𝑦 = 𝑓(𝑥) and 𝑥0 , 𝑥1 , 𝑥2 ,… 𝑥𝑛 be the equidistant values of x and 𝑦0 , 𝑦1 , 𝑦2 ,… 𝑦𝑛 be the
corresponding values of y
Here h is the interval of difference or step length
Forward & backward difference table:
𝑥 𝑦 ∆𝑦 𝑜𝑟 ∇y ∆2 𝑦 𝑜𝑟 ∇2 y ∆3 𝑦 𝑜𝑟 ∇3 y
𝑥0 𝑦0
𝑦1 − 𝑦0 = ∆𝑦0
= ∇𝑦1
𝑥1 𝑦1 ∆𝑦1 − ∆𝑦0 = ∆2 𝑦0
= ∇2 𝑦2
𝑦2 − 𝑦1 = ∆𝑦1 ∆2 𝑦1 − ∆2 𝑦0 = ∆3 𝑦0
= ∇𝑦2 = ∇3 𝑦3
𝑥2 𝑦2 ∆𝑦2 − ∆𝑦1 = ∆2 𝑦1
= ∇2 𝑦3
𝑦3 − 𝑦2 = ∆𝑦2
= ∇𝑦3
𝑥3 𝑦3
Newton’s forward interpolation formula:
𝑝(𝑝 − 1) 2 𝑝(𝑝 − 1)(𝑝 − 2) 3 𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3) 4
𝒚 = 𝒚𝟎 + 𝒑∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3! 4!
𝑥 − 𝑥0
𝑤ℎ𝑒𝑟𝑒 𝑝 =
ℎ
Newton’s backward interpolation formula:
𝑝(𝑝 + 1) 2 𝑝(𝑝 + 1)(𝑝 + 2) 3 𝑝(𝑝 + 1)(𝑝 + 2)(𝑝 + 3) 4
𝒚 = 𝒚𝒏 + 𝒑∇𝑦𝑛 + ∇ 𝑦𝑛 + ∇ 𝑦𝑛 + ∇ 𝑦𝑛 + ⋯
2! 3! 4!
𝑥 − 𝑥𝑛
𝑤ℎ𝑒𝑟𝑒 𝑝 =
ℎ
Problems:
1. If 𝒚𝟎 = 𝟐𝟐𝟓, 𝒚𝟏 = 𝟐𝟑𝟖, 𝒚𝟐 = 𝟑𝟐𝟎, 𝒚𝟑 = 𝟑𝟒𝟎 find 𝒚𝟎.𝟓
Solution:
x y ∆𝑦 ∆2 𝑦 ∆3 𝑦
0 225
13
1 238 69
82 -131
2 320 -62
20
3 340
𝑝(𝑝 − 1) 2 𝑝(𝑝 − 1)(𝑝 − 2) 3 𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3) 4
𝒚 = 𝒚𝟎 + 𝒑∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3! 4!
0.5 − 0
𝑤ℎ𝑒𝑟𝑒 𝑝 = = 0.5
1
𝑦0.5 = 214.6875
2. Given 𝒇(𝟒𝟎) = 𝟏𝟖𝟒, 𝒇(𝟓𝟎) = 𝟐𝟎𝟒, 𝒇(𝟔𝟎) = 𝟐𝟐𝟔, 𝒇(𝟕𝟎) = 𝟐𝟓𝟎, 𝒇(𝟖𝟎) =
𝟐𝟕𝟔, 𝒇(𝟗𝟎) = 𝟑𝟎𝟒, 𝒇𝒊𝒏𝒅 𝒇(𝟑𝟖)& 𝒇(𝟖𝟓) using suitable interpolation formula.
Solution:
x y ∆𝑦 𝑜𝑟 ∇y ∆2 𝑦 𝑜𝑟 ∇2 y ∆3 𝑦 𝑜𝑟 ∇3 y
40 184
20
50 204 2
22 0
60 226 2
24 0
70 250 2
26 0
80 276 2
28
90 304
𝑝(𝑝 − 1) 2 𝑝(𝑝 − 1)(𝑝 − 2) 3 𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3) 4
𝒚 = 𝒚𝟎 + 𝒑∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3! 4!
38 − 40
𝑤ℎ𝑒𝑟𝑒 𝑝 = = −00.2
10
𝑓(38) = 180.24
𝑝(𝑝 + 1) 2 𝑝(𝑝 + 1)(𝑝 + 2) 3 𝑝(𝑝 + 1)(𝑝 + 2)(𝑝 + 3) 4
𝒚 = 𝒚𝒏 + 𝒑∇𝑦𝑛 + ∇ 𝑦𝑛 + ∇ 𝑦𝑛 + ∇ 𝑦𝑛 + ⋯
2! 3! 4!
85 − 90
𝑤ℎ𝑒𝑟𝑒 𝑝 = = −0.5
10
𝑓(85) = 289.75
3. Find the polynomial satisfying 𝒇(−𝟒) = −𝟐𝟓, 𝒇(−𝟐) = 𝟏, 𝒇(𝟎) = 𝟑, 𝒇(𝟐) =
𝟐𝟗, 𝒇(𝟒) = 𝟏𝟐𝟕. Hence find f(5)
Solution:
x y ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦
-4 -25
26
-2 1 -24
2 48
0 3 24 0
26 48
2 29 72
98
4 127
𝑝(𝑝 − 1) 2 𝑝(𝑝 − 1)(𝑝 − 2) 3 𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3) 4
𝑦 = 𝑦0 + 𝑝∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3! 4!
𝑥+4
𝑤ℎ𝑒𝑟𝑒 𝑝 =
2
𝑦 = 𝑓(𝑥) = 𝑥 3 + 3𝑥 2 + 3𝑥 + 3
𝑓(5) = 218
4. From the following data estimate the number of students who obtained
i. Less than 45 marks
ii. Between 40 & 45 marks
Marks 30-40 40-50 50-60 60-70 70-80
No of students 31 42 51 35 31
Solution: Let y be the number of students scored less than x marks
x y ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦
40 31
42
50 73 9
51 -25
60 124 -16 37
35 12
70 159 -4
31
80 190
𝑝(𝑝 − 1) 2 𝑝(𝑝 − 1)(𝑝 − 2) 3 𝑝(𝑝 − 1)(𝑝 − 2)(𝑝 − 3) 4
𝒚 = 𝒚𝟎 + 𝒑∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3! 4!
45 − 40
𝑤ℎ𝑒𝑟𝑒 𝑝 = = 0.5
10
𝑓(45) = 47.86 ≈ 48
The number of students who obtained marks less than 45 marks is 48
The number of students who obtained marks between 40 & 45 marks is 17
Practice problems:
1. From the following data, estimate the values of f(22) & f(42)
x 20 25 30 35 40 45
f(x) 354 332 291 260 231 204
2. Find the interpolating polynomial for the following data & hence estimate f(4)
x 0 1 2 3
f(x) 1 2 1 10
3. Given 𝑠𝑖𝑛20° = 0.3420, 𝑠𝑖𝑛25° = 0.4226, 𝑠𝑖𝑛30° = 0.5, 𝑠𝑖𝑛35° = 0.5736,
𝑠𝑖𝑛40° = 0.6428, find 𝑠𝑖𝑛24° & 𝑠𝑖𝑛42° using appropriate interpolation formula
4. Find an interpolating polynomial 𝑢𝑥 satisfying 𝑢−4 = −3, 𝑢−2 = 5, 𝑢0 = 13, 𝑢2 =
69, 𝑢4 = 221, hence find 𝑢3 & 𝑢6
b) Unequal intervals:
Let 𝑦 = 𝑓(𝑥) and 𝑥0 , 𝑥1 , 𝑥2 ,… 𝑥𝑛 be the values of x which are not at equidistant and 𝑦0 ,
𝑦1 , 𝑦2 ,… 𝑦𝑛 be the corresponding values of y
Newton’s divided difference formula:
Divided difference table:
𝑥 𝑦 𝐹𝐷𝐷 𝑆𝐷𝐷 𝑇𝐷𝐷
𝑥0 𝑦0
𝑦1 − 𝑦0
𝑥1 − 𝑥0
= [𝑥0 , 𝑥1 ]
𝑥1 𝑦1 [𝑥1 , 𝑥2 ] − [𝑥0 , 𝑥1 ]
𝑥2 − 𝑥0
= [𝑥0 , 𝑥1 , 𝑥2 ]
𝑦2 − 𝑦1 [𝑥1 , 𝑥2 , 𝑥3 ] − [𝑥0 , 𝑥1 , 𝑥2 ]
𝑥2 − 𝑥1 𝑥3 − 𝑥0
= [𝑥1 , 𝑥2 ] = [𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ]
𝑥2 𝑦2 [𝑥2 , 𝑥3 ] − [𝑥1 , 𝑥2 ]
𝑥3 − 𝑥1
= [𝑥1 , 𝑥2 , 𝑥3 ]
𝑦3 − 𝑦2
𝑥3 − 𝑥2
= [𝑥2 , 𝑥3 ]
𝑥3 𝑦3
a. Newton’s divided difference formula:
𝑦 = 𝑦0 + (𝑥 − 𝑥0 ) [𝑥0 , 𝑥1 ] + (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) [𝑥0 , 𝑥1 , 𝑥2 ]
+ (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) [𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ] + ⋯
Problems:
1. Use Newton’s divided difference formula to find f(4), given that
x 0 2 3 6
f(x) -4 2 14 158
Solution:
x y FDD SDD TDD
0 -4
3
2 2 3
12 1
3 14 9
48
6 158
𝒚 = 𝒚𝟎 + (𝒙 − 𝒙𝟎 ) [𝒙𝟎 , 𝒙𝟏 ] + (𝒙 − 𝒙𝟎 ) (𝒙 − 𝒙𝟏 ) [𝒙𝟎 , 𝒙𝟏 , 𝒙𝟐 ]
+ (𝒙 − 𝒙𝟎 ) (𝒙 − 𝒙𝟏 )(𝒙 − 𝒙𝟐 ) [𝒙𝟎 , 𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 ] + ⋯
f(4)=40
2. Given 𝒖𝟐𝟎 = 𝟐𝟒. 𝟑𝟕, 𝒖𝟐𝟐 = 𝟒𝟗. 𝟐𝟖, 𝒖𝟐𝟗 = 𝟏𝟔𝟐. 𝟖𝟔, & 𝒖𝟑𝟐 = 𝟐𝟒𝟎 . 𝟓 find 𝒖𝟐𝟖
by Newton’s divided difference formula
Solution:
x u FDD SDD TDD
20 24.37
12.455
22 49.28 0.419
16.226 0.0455
29 162.86 0.965
25.88
32 240.5
𝒚 = 𝒚𝟎 + (𝒙 − 𝒙𝟎 ) [𝒙𝟎 , 𝒙𝟏 ] + (𝒙 − 𝒙𝟎 ) (𝒙 − 𝒙𝟏 ) [𝒙𝟎 , 𝒙𝟏 , 𝒙𝟐 ]
+ (𝒙 − 𝒙𝟎 ) (𝒙 − 𝒙𝟏 )(𝒙 − 𝒙𝟐 ) [𝒙𝟎 , 𝒙𝟏 , 𝒙𝟐 , 𝒙𝟑 ] + ⋯
𝑢28 = 141.938
3. Fit an interpolating polynomial for the following data
x 0 1 4 8 10
f(x) -5 -14 -125 -21 355
Solution:
x u FDD SDD TDD
0 -5
-9
1 -14 -7
-37 2
4 -125 9
26 2
8 -21 27
188
10 355
𝑦 = 𝑦0 + (𝑥 − 𝑥0 ) [𝑥0 , 𝑥1 ] + (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) [𝑥0 , 𝑥1 , 𝑥2 ]
+ (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) [𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 ] + ⋯
𝑓(𝑥) = 2𝑥 3 − 17𝑥 2 + 6𝑥 − 5
Practice problems:
1. Use Newton’s divided difference formula to find f(x) at x=0.5, given that
x 0 2 3 5 6
f(x) 0 6 21 105 186
2. Use Newton’s divided difference formula to find f(x) at x=8, given that
x 1 2 4 7 12
f(x) 576 168 -30 48 378
3. Use Newton’s divided difference formula to find f(x) , given that
x -1 0 3 6 7
f(x) 3 -6 39 822 1611
4. Use Newton’s divided difference formula to find f(x) , given that
x 0 1 2 5
f(x) 2 3 12 147
b. Lagrange’s interpolation formula:
(𝒙 − 𝒙𝟏 )(𝒙 − 𝒙𝟐 )(𝒙 − 𝒙𝟑 ) … (𝒙 − 𝒙𝒏 )
𝒚= 𝒚
(𝒙𝟎 − 𝒙𝟏 )(𝒙𝟎 − 𝒙𝟐 )(𝒙𝟎 − 𝒙𝟑 ) … (𝒙𝟎 − 𝒙𝒏 ) 𝟎
(𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟐 )(𝒙 − 𝒙𝟑 ) … (𝒙 − 𝒙𝒏 )
+ 𝒚
(𝒙𝟎 − 𝒙𝟎 )(𝒙𝟎 − 𝒙𝟐 )(𝒙𝟎 − 𝒙𝟑 ) … (𝒙𝟎 − 𝒙𝒏 ) 𝟏
(𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 )(𝒙 − 𝒙𝟑 ) … (𝒙 − 𝒙𝒏 )
+ 𝒚 +⋯
(𝒙𝟎 − 𝒙𝟎 )(𝒙𝟎 − 𝒙𝟏 )(𝒙𝟎 − 𝒙𝟑 ) … (𝒙𝟎 − 𝒙𝒏 ) 𝟐
Problems:
1. Using Lagrange’s interpolation formula, find y when x=10 from the following data
x 5 6 9 11
f(x) 12 13 14 16
Solution:
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )
𝑦= 𝑦0 + 𝑦
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) (𝑥0 − 𝑥0 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) 1
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )
+ 𝑦2 + 𝑦 = 14.6667
(𝑥0 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥3 ) (𝑥0 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) 3
2. Using Lagrange’s interpolation formula, find an interpolating polynomial that
approximates to the function described by the following table
x 0 1 3 4
f(x) -12 0 6 12
Solution:
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )
𝑦= 𝑦0 + 𝑦
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) (𝑥0 − 𝑥0 )(𝑥0 − 𝑥2 )(𝑥0 − 𝑥3 ) 1
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )
+ 𝑦2 + 𝑦
(𝑥0 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥3 ) (𝑥0 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) 3
= 𝑥 3 − 7𝑥 2 + 18𝑥 − 12
Practice problems:
1. Using Lagrange’s interpolation formula, find y when x=11 from the following data
x 2 5 8 14
f(x) 94.8 87.9 81.3 68.7
2. Using Lagrange’s interpolation formula, find y when x=18 from the following data
x 10 12 19 22
f(x) 24 48 162 200
3. Using Lagrange’s interpolation formula, find an interpolating polynomial that
approximates to the function described by the following table
x 1 2 4 5
f(x) 14 41 197 350
4. Using Lagrange’s interpolation formula, find an interpolating polynomial that
approximates to the function described by the following table
x 0 2 3 5
f(x) 2 10 17 37
Solution of algebraic and transcendental equations:
Algebraic equation: Equations involving algebraic quantities like 𝑥, 𝑥 2 , 𝑥 3 …are called as
algebraic equations.
Ex:𝑥 3 − 3𝑥 + 1 = 0
Transcendental equation: Equations involving quantities like 𝑒 𝑥 , 𝑙𝑜𝑔𝑥, 𝑠𝑖𝑛𝑥, 𝑡𝑎𝑛𝑥 …are
called as transcendental equations.
Ex: 𝑥𝑙𝑜𝑔𝑥 − 1.2 = 0
Intermediate value property: If there exist two values a & b such that f(x) has opposite sign,
say f(a)<0, f(b)>0, then there exist atleast one real root in(a, b).
Newton-Raphson’s method: It is an iterative process used to find a real root of an algebraic
or a transcendental equation.
Working rule:
• Identify the interval (a, b) using intermediate value property
𝑎+𝑏
• Start with 𝑥0 = as the initial approximation to the root
2
𝑓(𝑥 )
• Use the formula 𝑥𝑛+1 = 𝑥𝑛 − 𝑓′ (𝑥𝑛 )repeatedly till two consecutive values of x are
𝑛
approximately same
• That is the root of the equation
Problems:
Find a real root of the following using Newton Raphson method
i. 𝒙𝟑 + 𝒙𝟐 + 𝟑𝒙 + 𝟒 = 𝟎
Solution: 𝑓(𝑥) = 𝑥 3 + 𝑥 2 + 3𝑥 + 4
𝑓 ′ (𝑥) = 3𝑥 2 + 2𝑥 + 3
𝑓(−2) = −6
𝑓(−1) = 1
One real root lies in (-2, -1)
Let𝑥0 = −1.5
𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 −
𝑓 ′ (𝑥𝑛 )
𝑓(𝑥0 ) 𝑓(−1.5)
𝑥1 = 𝑥0 − ′
= −1.5 − ′ = −1.25
𝑓 (𝑥0 ) 𝑓 (−1.5)
𝑓(𝑥1 ) 𝑓(−1.25)
𝑥2 = 𝑥1 − = −1.25 − = −1.2229
𝑓 ′ (𝑥1 ) 𝑓 ′ (−1.25)
𝑓(𝑥2 ) 𝑓(−1.2229)
𝑥3 = 𝑥2 − = −1.2229 − = −1.2229
𝑓 ′ (𝑥2 ) 𝑓 ′ (−1.2229)
ii. 𝒙𝒍𝒐𝒈𝟏𝟎 𝒙 = 𝟏. 𝟐
𝑓(𝑥) = 𝑥𝑙𝑜𝑔10 𝑥 − 1.2
𝑓(𝑥) = 𝑥(0.4343𝑙𝑜𝑔𝑥) − 1.2
𝑓 ′ (𝑥) = (0.4343) + 𝑙𝑜𝑔𝑥
𝑓(2) = −0.6
𝑓(3) = 0.23
One real root lies in (2, 3)
Let𝑥0 = 2.5
𝑓(𝑥0 ) 𝑓(2.5)
𝑥1 = 𝑥0 − ′
= 2.5 − ′ = 2.7461
𝑓 (𝑥0 ) 𝑓 (2.5)
𝑓(𝑥1 ) 𝑓(2.7461)
𝑥2 = 𝑥1 − ′
= 2.7461 − ′ = 2.7406
𝑓 (𝑥1 ) 𝑓 (2.7461)
𝑓(𝑥2 ) 𝑓(2.7406)
𝑥3 = 𝑥2 − = 2.7406 − = 2.7406
𝑓 ′ (𝑥2 ) 𝑓 ′ (2.7406)
Practice problems:
Find a real root of the following using Newton Raphson method
i. 𝑥 4 + 2𝑥 2 − 16𝑥 + 5 = 0
ii. 𝑥 3 + 5𝑥 − 11 = 0 in (1, 2)
iii. 𝑥𝑠𝑖𝑛𝑥 + 𝑐𝑜𝑠𝑥 = 0 𝑛𝑒𝑎𝑟 𝑥 = 𝜋
iv. 𝑥𝑒 𝑥 − 2 = 0
v. 𝑥 + 𝑙𝑜𝑔10 𝑥 = 3.375
Numerical integration: This is a process of finding an approximate value of the definite
𝑏
integral 𝐼 = ∫𝑎 𝑦𝑑𝑥 without actually integrating the function using the values of y for
equidistant values of x
Let 𝑦 = 𝑓(𝑥) and 𝑥0 , 𝑥1 , 𝑥2 ,… 𝑥𝑛 be the equidistant values of x and 𝑦0 , 𝑦1 , 𝑦2 ,… 𝑦𝑛 be the
corresponding values of y
𝑏−𝑎
Here ℎ = is the interval of difference or step length
𝑛
Trapezoidal rule:
𝒉
𝑰= [(𝒚𝟎 + 𝒚𝒏 ) + 𝟐(𝒚𝟏 + 𝒚𝟐 + 𝒚𝟑 + ⋯ 𝒚𝒏−𝟐 )]
𝟐
Simpson’s 1/3rd rule:
𝒉
𝑰= [(𝒚𝟎 + 𝒚𝒏 ) + 𝟐(𝒚𝟐 + 𝒚𝟒 + 𝒚𝟔 + ⋯ 𝒚𝒏−𝟏 ) + 𝟒(𝒚𝟏 + 𝒚𝟑 + 𝒚𝟓 + ⋯ 𝒚𝒏−𝟏 )]
𝟑
Simpson’s 3/8th rule:
𝟑𝒉
𝑰= [(𝒚𝟎 + 𝒚𝒏 ) + 𝟐(𝒚𝟑 + 𝒚𝟔 + 𝒚𝟗 + ⋯ 𝒚𝒏−𝟑 ) + 𝟑(𝒚𝟏 + 𝒚𝟐 + 𝒚𝟒 + ⋯ 𝒚𝒏−𝟏 )]
𝟖
Note:
• To apply Simpson’s 1/3rd rule, n must be multiples of 2
• To apply Simpson’s 3/8th rule, n must be multiples of 3
Problems:
1. Evaluate the following using Trapezoidal rule
𝟏 𝒙
i. ∫𝟎 𝒅𝒙
𝟏+𝒙𝟐
1
Solution: ℎ = 6
x 0 1/6 2/6 3/6 4/6 5/6 6/6=1
y 0 6/37 3/10 2/5 6/13 30/61 1/2
ℎ
𝐼= [(𝑦 + 𝑦𝑛 ) + 2(𝑦1 + 𝑦2 + 𝑦3 + ⋯ 𝑦𝑛−2 )] = 0.3466
2 0
𝟓.𝟐
ii. ∫𝟒 𝒍𝒐𝒈𝒙 𝒅𝒙
x 4 4.2 4.4 4.6 4.8 5 5.2
y 1.3863 1.4351 1.4816 1.5261 1.5686 1.6094 1.6487
ℎ
𝐼= [(𝑦 + 𝑦𝑛 ) + 2(𝑦1 + 𝑦2 + 𝑦3 + ⋯ 𝑦𝑛−2 )] = 1.8279
2 0
2. Evaluate the following using Simpson’s 1/3rd rule
𝟏 𝟏
i. ∫𝟎 𝒅𝒙 taking 4 stripes hence deduce an approximate value of
𝟏+𝒙𝟐
x 0 1/4 1/2 3/4 1
y 1 16/17 4/5 16/25 1/2
ℎ
𝐼= [(𝑦 + 𝑦𝑛 ) + 2(𝑦2 + 𝑦4 + 𝑦6 + ⋯ 𝑦𝑛−1 ) + 4(𝑦1 + 𝑦3 + 𝑦5 + ⋯ 𝑦𝑛−1 )] = 0.7854
3 0
1 1 𝜋
Also ∫0 𝑑𝑥 = [𝑡𝑎𝑛−1 𝑥]10 = 4 𝜋 = 3.1416
1+𝑥 2
𝝅
ii. ∫𝟎𝟐 √𝒄𝒐𝒔𝜽 𝒅𝜽
/12 2/12 3/12 4/12 5/12 6/12
y 1 0.9828 0.9306 0.8409 0.7071 0.5087
ℎ
𝐼= [(𝑦 + 𝑦𝑛 ) + 2(𝑦2 + 𝑦4 + 𝑦6 + ⋯ 𝑦𝑛−1 ) + 4(𝑦1 + 𝑦3 + 𝑦5 + ⋯ 𝑦𝑛−1 )]
3 0
= 1.1873
3. Evaluate the following using Simpson’s 3/8th rule
𝟒 𝟏⁄
i. ∫𝟏 𝒆 𝒙 𝒅𝒙 taking n=3
x 1 2 3 4
y 2.7183 1.6487 1.3956 1.2840
3ℎ
𝐼= [(𝑦0 + 𝑦𝑛 ) + 2(𝑦3 + 𝑦6 + 𝑦9 + ⋯ 𝑦𝑛−3 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + ⋯ 𝑦𝑛−1 )]
8
= 4.9257
𝟏 𝟏
ii. ∫𝟎 𝒅𝒙 taking 7 ordinates & hence deduce the value of 𝒍𝒐𝒈𝟐
𝟏+𝒙
x 0 1/6 2/6 3/6 4/6 5/6 6/6=1
y 1 6/7 3/4 2/3 3/5 6/11 1/2
3ℎ
𝐼= [(𝑦0 + 𝑦𝑛 ) + 2(𝑦3 + 𝑦6 + 𝑦9 + ⋯ 𝑦𝑛−3 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + ⋯ 𝑦𝑛−1 )] = 0.6932
8
1 1
Also ∫0 𝑑𝑥 = [𝑙𝑜𝑔(1 + 𝑥)]10 = 𝑙𝑜𝑔2 𝑙𝑜𝑔2 = 0.6932
1+𝑥
Practice problems:
1. Evaluate the following using appropriate formulae
𝟔
i. ∫𝟎 𝟑𝒙𝟐 𝒅𝒙
𝟑 𝟏
ii. ∫𝟎 (𝟏+𝒙)𝟐
𝒅𝒙 by taking 3 intervals
𝟖 𝟏
iii. ∫𝟐 𝒅𝒙 with 9 ordinates
𝒍𝒐𝒈𝟏𝟎 𝒙
𝟏 𝟐
iv. ∫𝟎 𝒆−𝒙 𝒅𝒙 by taking h=0.1