Group 02
Group 02
Analysis Section: A
Group No: 2
Course No: Math-3209
Submitted To: Course Title: Numerical Analysis
Prof. Dr. Munnujahan Ara
Professor
Mathematics Discipline
Khulna University
Submitted By:
Student Name Student ID
The Operator 𝑬:
Here, 𝐸𝑓(𝑥) does not imply the multiplication of 𝐸 and 𝑓 (𝑥) but it implies that 𝐸 is
operated on 𝑓(𝑥). The operator 𝑬 is known as the shift operator.
The Operator 𝚫:
The Operator 𝛁:
We know,
f ( x0 h) f ( x0 )
lim f '( x0 )
h 0 h
f ( x0 )
lim f '( x0 )
h 0 h
Hence, f ( x0 ) hf '( x0 )
Also,
f '( x0 h) f '( x0 )
lim f ''( x0 )
h 0 h
f ( x0 h) f ( x0 )
lim h h f ''( x )
0
h 0 h
f ( x0 h) f ( x0 )
lim f ''( x0 )
h 0 h2
2 f ( x0 )
lim f ''( x0 )
h 0 h2
So, 2 f ( x0 ) h 2 f ''( x0 )
… … … … … … … … … … … … … … … ….
… … … … … … … … … … … … … … … ….
Similarly, n 1 f ( x0 ) h n 1 f n 1 ( x0 )
[Proved]
Solution:
Proof: From shifting operator we know that,
𝐸 = 1 + ∆ 𝑎𝑛𝑑 𝐸𝑓(𝑥) = 𝑓(𝑥 + ℎ)
Or, ∆ = 𝐸 − 1
So we get,
∆𝑓(𝑥) = (𝐸 − 1)𝑓(𝑥)
⇒ ∆𝑓(𝑥) = 𝐸𝑓(𝑥) − 𝑓 (𝑥)
Page |5
= 𝐸 𝑘 𝑓(𝑥) − 𝑘𝐶1 𝐸 𝑘−1 𝑓(𝑥) + 𝑘𝐶2 𝐸 𝑘−2 𝑓(𝑥) − 𝑘𝐶3 𝐸 𝑘−3 𝑓(𝑥) … … + (−1)𝑘 𝑓(𝑥)
= 𝑓(𝑥 + 𝑘ℎ) − 𝑘𝐶1 𝑓{𝑥 + (𝑘 − 1)ℎ} + 𝑘𝐶2 𝑓{𝑥 + (𝑘 − 2)ℎ} … … + (−1)𝑘 𝑓(𝑥)
𝑖=0
[Proved]
Question 05: Show that the 1st difference polynomial of degree n is a polynomial of degree
(𝑛 − 1).
Solution:
Let us consider a polynomial of degree ‘n’,
𝑦 = 𝑓 (𝑥) = 𝑎𝑥 𝑛 + 𝑏𝑥 𝑛−1 + ⋯ … + 𝑘𝑥 + 𝑙 … … … . (1)
Page |6
Again let,
∆𝑥 = ℎ i.e., 𝑥0 + ℎ = 𝑥0 + ∆𝑥0 = 𝑥1
Now,
𝑦 + ∆𝑦 = 𝑓(𝑥 + ∆𝑥) = 𝑎(𝑥 + ℎ)𝑛 + 𝑏(𝑥 + ℎ)𝑛−1 + ⋯ … + 𝑘(𝑥 + ℎ) + 𝑙 … … … . (2)
Subtracting (1) from (2) we get,
∆𝑦 = 𝑦 + ∆𝑦 − 𝑦
= 𝑎[(𝑥 + ℎ)𝑛 − 𝑥 𝑛 ] + 𝑏[(𝑥 + ℎ)𝑛−1 − 𝑥 𝑛−1 ] + ⋯ … + 𝑘(𝑥 + ℎ − 𝑥) + 𝑙 − 𝑙
= 𝑎[𝑥 𝑛 + nC1 𝑥 𝑛−1 ℎ + ⋯ … . −𝑥 𝑛 ] + 𝑏[𝑥 𝑛−1 +n-1C1 𝑥 𝑛−2 ℎ + ⋯ … − 𝑥 𝑛−1 ] + ⋯ + 𝑘ℎ
= 𝑎 nC1 ℎ 𝑥 𝑛−1 + 𝑏 n-1C1 ℎ 𝑥 𝑛−2 + ⋯ … + 𝑘ℎ
Let, 𝑎 nC1 ℎ = 𝑎′ , 𝑏 n-1C1 ℎ = 𝑏′ , …….
∴ ∆𝑦 = 𝑎′ 𝑥 𝑛−1 + 𝑏′ 𝑥 𝑛−2 + ⋯ … + 𝑘ℎ
Hence, the 1𝑠𝑡 difference of a polynomial of degree n is a polynomial of degree (𝑛 − 1).
[Showed]
Let 𝑦 = 𝑓(𝑥) is a function of x, x being given at an equal interval. Let the values of x be 𝑎,
𝑎 + ℎ, 𝑎 + 2ℎ and so on and the corresponding values of y be f(a), f(a + h), f(a + 2h)
and so on. Then the forward and backward differences can be calculated from the forward
difference table and backward difference table respectively.
Similarly, we can calculate third and higher order differences from the table. Here we have
taken forward differences therefore this table is known as forward difference table.
𝑓(𝑎 + ℎ) − 𝑓(𝑎) =
𝛻𝑓(𝑎 + ℎ)
𝑎+ℎ 𝑓 (𝑎 + ℎ ) 𝛻𝑓(𝑎 + 2ℎ) −
𝛻𝑓(𝑎 + ℎ) = 𝛻 2 𝑓(𝑎 +
2ℎ)
𝑓(𝑎 + 2ℎ) − 𝑓(𝑎 + ℎ) =
𝛻𝑓(𝑎 + 2ℎ)
𝑎 + 2ℎ 𝑓(𝑎 + 2ℎ) 𝛻𝑓(𝑎 + 3ℎ) −
𝛻𝑓(𝑎 + 2ℎ) =
𝛻 2 𝑓(𝑎 + 3ℎ)
𝑓(𝑎 + 3ℎ) − 𝑓(𝑎 + 2ℎ) =
𝛻𝑓(𝑎 + 3ℎ)
Page |8
Similarly, we can calculate third and higher order differences from the table. Here we have
taken backward differences therefore this table is known as backward difference table.
X: 𝑥0 𝑥1 𝑥2 , … , xn
Y: 𝑦0 𝑦1 𝑦2 , … , 𝑦𝑛
Let these values of x are in equidistance, such that 𝑥𝑖 𝑥0 𝑖ℎ (𝑖 0,1, ). Assuming 𝑦(𝑥) to be a
polynomial of the nth degree in 𝑥 such that 𝑦(x0) =y0, y(x1) =y1, . .. , y(xn)= yn . Then we can
write,
𝑦(𝑥) =𝑎 0 + 𝑎1 (𝑥 − 𝑥0 ) + 𝑎2 (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) + 𝑎3 (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) (𝑥 − 𝑥2 ) + ⋯ +
𝑎𝑛 (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛−1 ) … … … … … … … … . . (1)
Putting 𝑥 = 𝑥0 , 𝑥1 , … , 𝑥𝑛 successively in (1), we get that
𝑦0 = 𝑎0 , 𝑦1 = 𝑎0 + 𝑎1 (𝑥1 − 𝑥0 ), 𝑦2 = 𝑎0 + 𝑎1 (𝑥2 − 𝑥0 ) + 𝑎2 (𝑥2 − 𝑥0 ) (𝑥2 − 𝑥1 )….. and
so on.
From these, we find that 𝑎0 = 𝑦, ∆𝑦0 = 𝑦1 − 𝑦0 = 𝑎1 (𝑥1 − 𝑥0 ) = 𝑎1 ℎ
𝑎1 = ∆𝑦0
Also, ∆𝑦1 = 𝑦2 − 𝑦1 = 𝑎1 (𝑥2 − 𝑥1 ) + 𝑎2 (𝑥2 − 𝑥0 ) (𝑥2 − 𝑥1 )
= 𝑎1 ℎ + 𝑎2 ℎ. ℎ = ∆𝑦0 + 2ℎ2 𝑎2
𝑎2 = (∆𝑦1 − ∆𝑦0 ) = ∆2 𝑦0
Similarly, 𝑎3 = ∆3 𝑦0 and so on.
Substituting these values in (1), we obtain
Page |9
𝑌(𝑥) = 𝑦0 + ∆𝑦0 (𝑥 − 𝑥0 ) + ∆2 𝑦0 (𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) +
∆3 𝑦0 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) + … … … … . … (2)
Now if it is required to evaluate y for 𝑥 𝑥0 𝑢ℎ, then
This is called the Newton’s forward interpolation formula or Newton-Gregory formula for
forward difference as formula (3) contains 𝑦0 and the forward differences of 𝑦0 .
x f ( x) f ( x ) 2 f ( x) 3 f ( x)
0 1
2
1 3 2
4 0
2 7 2
6
3 13
𝑢(𝑢−1) 𝑢(𝑢−1)(𝑢−2)
𝑓(𝑎 + 𝑛ℎ − 𝑢ℎ) = 𝑓(𝑎 + 𝑛ℎ) 𝑢∆𝑓(𝑎 + 𝑛ℎ) + ∆2 𝑓 (𝑎 + 𝑛ℎ) + ∆3 𝑓(𝑎 +
2! 3!
𝑢(𝑢−1)(𝑢−2)(𝑢−3)
𝑛ℎ) + ∆4 𝑓 (𝑎 + 𝑛ℎ)
4!
= 1 + 2𝑥 + 𝑥 2 − 𝑥
= 𝑥2 + 𝑥 + 1
This is the required polynomial.
Question 2:
The following table is given:
x 0 1 2 3 4
f(x) 3 6 11 18 27
0 3
3
1 6 2
5 0
2 11 2
7 0
3 18 2
9
4 27
P a g e | 11
Solution:
1925−1891
Here, 𝑢 = = 3.4
10
1891 46
20
1901 66 -5
15 2
1911 81 -3 -3
12 -1
1921 93 -4
8
1931 101
P a g e | 12
= 96.8368 𝑎𝑝𝑝𝑟𝑜𝑥.
X: 𝑥0 𝑥1 𝑥2 … … …. 𝑥𝑛−1 𝑥𝑛
(𝑥0 + ℎ) (𝑥1 + ℎ) 𝑥𝑛−2 + ℎ 𝑥𝑛−1 + ℎ
Y: 𝑦0 𝑦1 𝑦2 ………… 𝑦𝑛−1 𝑦𝑛
… … … … ..
… … … … ….
𝛻𝑛 𝑦𝑛
𝑎𝑛 =
𝑛!ℎ 𝑛
𝑜𝑟, 𝑥 = 𝑥𝑛 + 𝑢ℎ
𝑥−𝑥𝑛−1 𝑥𝑛 +ℎ𝑢−𝑥𝑛−1 ℎ𝑢+(𝑥𝑛 −𝑥𝑛−1 )
Again, = = =𝑢+1
ℎ ℎ ℎ
Estimate 𝒇(𝟕. 𝟓)
Solution:
The value to be interpolated lies at the end of the given observations i.e. near 8. So in this
case Newton’s backward formula will be more suitable.
𝑥−(𝑎+𝑛ℎ) 7.5−8
Here, 𝑢 = = = −0.5
ℎ 1
x f ( x) f ( x ) 2 f ( x) 3 f ( x)
1 1
7
2 8 12
19 6
3 27 18
37 6
4 64 24
61 6
5 125 30
91 6
6 216 36
127 6
7 343 42
169
8 512
Question 2:
Compute sin (57°) by Newton’s Backward Interpolation Formula.
x 45° 50° 55° 60°
sin(x) 0.7071 0.7660 0.8192 0.8660
Solution:
Given,
x 45° 50° 55° 60°
sin(x) 0.7071 0.7660 0.8192 0.8660
45 .7071
.0589
50 .7660 -.0057
.0532 -.0007
55 .8192 -.0064
.0468
60 .8660
52−45
Here,𝑢 = = 1.4
5
= 0.7786512 𝑎𝑝𝑝𝑟𝑜𝑥.
Question 3:
Using Newton’s formula for interpolation, estimate the population for the year 1905:
Year Population
1891 98, 752
1901 132,285
1911 168,076
1921 195,690
1931 246,050
Solution:
The difference table:
x f ( x) f ( x ) 2 f ( x) 3 f ( x) 4 f ( x)
1891 98752
33533
1901 132285 2258
35791 -10435
1911 168076 -8177 41358
27614 30923
1921 195690 22746
50360
1931 246050
Here,
1905 − 1891
𝑢= = 1.4
10
P a g e | 17
x= a b c d e …
Or f ( x) f ( x0 ) ( x x0 ) f ( x, x0 ) … (1)
f ( x, x0 ) f ( x0 , x1 )
Also f ( x, x0 , x1 )
x x1
Or f ( x, x0 ) f ( x0 , x1 ) ( x x1 ) f ( x, x0 , x1 ) … (2)
Similarly f ( x, x0 , x1 ) f ( x0 , x1 , x2 ) ( x x2 ) f ( x, x0 , x1 , x2 ) … (3)
… … … … … … …
P a g e | 18
… … … … … … …
f ( x) f ( x0 ) ( x x0 ) f ( x0 , x1 ) ( x x0 )( x x1 ) f ( x0 , x1 , x2 ) ...
( x x0 )( x x1 )...( x xn1 ) f ( x0 , x1 ,..., xn ) Rn ,
Rn ( x x0 )( x x1 )...( x xn ) f ( x, x0 , x1 ,..., xn ).
f ( x) f ( x0 ) ( x x0 ) f ( x0 , x1 ) ( x x0 )( x x1 ) f ( x0 , x1 , x2 ) ...
…(5)
( x x0 )( x x1 )...( x xn1 ) f ( x0 , x1 ,..., xn )
Question 1:
Find the polynomial from the given values using Newton’s divided difference formula:
X 3 2 1 -1
F(x) 3 12 15 -21
Solution:
3 3
(12 − 3)
= −9
(2 − 3)
2 12 (−3 + 9)
(1 − 3)
= −3
(15 − 12) (−7 + 3)
1 15 = −3 =1
(1 − 2) (−1 − 3)
(18 + 3)
(−21 − 15) (−1 − 2)
15 -21 = 18
= −7
(−1 − 1)
Question 2:
Find the polynomial using Newton’s divided difference formula from the following table
x 0 2 3 4 7 9
F(x) 4 26 58 112 466 922
Solution:
0 4
(26 − 4)
= 11
(2 − 0)
2 26 (32 − 11)
(3 − 0)
(58 − 26) =7 (11 − 7)
= 32 (4 − 0)
(2 − 3)
=1 0
3 58 (54 − 32)
(4 − 2)
(112 − 58) = 11 (16 − 11)
= 54 (7 − 2)
(4 − 3)
4 112 =1
(1 − 1)
(118 − 54) (9 − 3)
(7 − 3) =0
(466 − 112) = 16
= 118 (22 − 16)
(7 − 4)
7 466 (9 − 4)
=1
− 7)∆5 𝑓(0)
x 2 4 5 6 8 10
f(x) 10 96 196 350 868 1746
Solution:
The difference table:
𝒙 𝒇(𝒙) ∆𝒇(𝒙) ∆𝟐 𝒇(𝒙) ∆𝟑 𝒇(𝒙) ∆𝟑 𝒇(𝒙)
2 10 (96 − 10)
= 43
(4 − 2)
(100 − 43)
4 96 = 19
(5 − 2)
(26 − 4) (27 − 19)
= 100 =2
(5 − 4) (6 − 2)
5 196 (154 − 100) 0
(6 − 4)
350 − 196 = 27 (35 − 27)
=2
(6 − 5) (8 − 4)
6 350
= 154
(259 − 154) 0
(8 − 5) (45 − 35)
(868 − 350) =2
= 35 (10 − 5)
8 868 (8 − 6)
= 259
(439 − 259)
(10 − 6)
(1746 − 868) = 45
(10 − 8)
10 1746 = 439
Question 4:
Find the polynomial from following data by using newton general interpolation formula for
divided difference and find f(8),f(15).
𝑥 4 5 7 10 11 13
𝑓(𝑥) 48 100 294 900 1210 2028
Solution:
𝐓𝐡𝐞 𝐝𝐢𝐟𝐟𝐞𝐫𝐞𝐧𝐜𝐞 𝐭𝐚𝐛𝐥𝐞:
𝒙 𝒇(𝒙) ∆𝒇(𝒙) ∆ 𝟐 𝒇(𝒙) ∆ 𝟑 𝒇(𝒙) ∆ 𝟒 𝒇(𝒙)
4 48
(100 − 48)
= 52
(5 − 4)
5 100 (97 − 52)
= 15
(7 − 4)
(294 − 100) (21 − 15)
=1
(10 − 5) (10 − 4)
7 294 = 97 (202 − 47)
= 21 0
(10 − 5)
𝑓(𝑥) = 𝑓(0) + (𝑥 − 0)∆𝑓(0) + (𝑥 − 0)(𝑥 − 2)∆2 𝑓(0) + (𝑥 − 0)(𝑥 − 2)(𝑥 − 3)∆3 𝑓(0)
+ (𝑥 − 0)(𝑥 − 2)(𝑥 − 3)(𝑥 − 4)∆4 𝑓(0) + (𝑥 − 0)(𝑥 − 2)(𝑥 − 3)(𝑥 − 4)(𝑥
− 7)∆5 𝑓(0)
𝑓(𝑥) = 48 + (𝑥 − 4)52 + (𝑥 − 5)(𝑥 − 4)15 + (𝑥 − 4)(𝑥 − 5)(𝑥 − 1)1
𝑓(𝑥) = 𝑥 3 − 𝑥 2
𝑝𝑢𝑡 𝑥 = 8, 𝑥 = 15
𝑓(8) = 448, 𝑓(15) = 3150
Question 5:
Find the polynomial from following data by using newton general interpolation formula for
divided difference
𝑥 0 1 2 5
𝑓(𝑥) 2 3 12 147
Solution:
The difference table
𝒙 𝒇(𝒙) ∆𝒇(𝒙) ∆ 𝟐 𝒇(𝒙) ∆ 𝟑 𝒇(𝒙)
0 2
(3 − 2)
(1 − 0)
1 3 =1 (9 − 1 )
=4
(2 − 0 )
(12 − 3) (9 − 4)
=1
(2 − 1) (5 − 0)
2 12 =9 (45 − 9)
=9
(5 − 1 )
(147 − 12)
5 147
(5 − 2)
= 45
𝑦
⟹
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … … … (𝑥 − 𝑥𝑛 )
𝑦0
− −
(𝑥 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … … … (𝑥0 − 𝑥𝑛 )
P a g e | 25
𝑦1
− ⋯……
(𝑥 − 𝑥1 )(𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … … … (𝑥1 − 𝑥𝑛 )
𝑦𝑛
− =0
(𝑥 − 𝑥𝑛 )(𝑥𝑛 − 𝑥0 )(𝑥𝑛 − 𝑥1 ) … … (𝑥𝑛 − 𝑥𝑛−1 )
𝑦
⟹
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … … … (𝑥 − 𝑥𝑛 )
𝑦0
= +
(𝑥 − 𝑥0 )(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … … … (𝑥0 − 𝑥𝑛 )
𝑦1
+ ⋯……
(𝑥 − 𝑥1 )(𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … … … (𝑥1 − 𝑥𝑛 )
𝑦𝑛
+
(𝑥 − 𝑥𝑛 )(𝑥𝑛 − 𝑥0 )(𝑥𝑛 − 𝑥1 ) … … (𝑥𝑛 − 𝑥𝑛−1 )
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … … … (𝑥 − 𝑥𝑛 )
𝑦 + ⋯……
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥2 ) … … … (𝑥2 − 𝑥𝑛 ) 2
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) … (𝑥 − 𝑥𝑛−1 )
+ 𝑦 … … (2)
(𝑥𝑛 − 𝑥0 )(𝑥𝑛 − 𝑥1 ) … … (𝑥𝑛 − 𝑥𝑛−1 ) 𝑛
This is the Lagrange’s formula of interpolation for unequal interval.
Now, by interchanging x and y in (2) we have:
(𝑦 − 𝑦1 )(𝑦 − 𝑦2 ) … (𝑦 − 𝑦) (𝑦 − 𝑦0 )(𝑦 − 𝑦2 ) … (𝑦 − 𝑦𝑛 )
𝑥= 𝑥0 + 𝑥 + ⋯…
(𝑦0 − 𝑦1 )(𝑦0 − 𝑦2 ) … (𝑦0 − 𝑦𝑛 ) (𝑦1 − 𝑦0 )(𝑦1 − 𝑦2 ) … (𝑦1 − 𝑦𝑛 ) 1
(𝑦 − 𝑦0 )(𝑦 − 𝑦1 ). . . (𝑦 − 𝑦𝑛−1 )
+ 𝑥 … … … (3)
(𝑦𝑛 − 𝑦0 )(𝑦𝑛 − 𝑦1 ). . . (𝑦𝑛 − 𝑦𝑛−1 ) 𝑛
Question 1:
The values of y and x are given as below:
P a g e | 26
x 5 6 9 11
y 12 13 14 16
Question 2:
The following values of the function 𝑓(𝑥) for values of x are given:
𝑓(1) = 4, 𝑓(2) = 5, 𝑓(7) = 5, 𝑓(8) = 4.
Find the value of 𝒇(𝟔).
Solution:
We know that, the Lagrange’s formula is:
(𝑥−𝑥1 )(𝑥−𝑥2 )…(𝑥−𝑥𝑛 ) (𝑥−𝑥0 )(𝑥−𝑥2 )…(𝑥−𝑥𝑛 )
𝑦 = (𝑥 𝑦0 + (𝑥 𝑦1 + ⋯ … +
0 −𝑥1 )(𝑥0 −𝑥2 )…(𝑥0 −𝑥𝑛 ) 1 −𝑥0 )(𝑥1 −𝑥2 )…(𝑥1 −𝑥𝑛 )
(𝑥−𝑥0 )(𝑥−𝑥1 )...(𝑥−𝑥𝑛−1 )
𝑦
(𝑥𝑛 −𝑥0 )(𝑥𝑛 −𝑥1 )...(𝑥𝑛 −𝑥𝑛−1 ) 𝑛
4 5 5
⇒𝑦=− (6 − 2)(6 − 7)(6 − 8) + (6 − 1)(6 − 7)(6 − 8) − (6 − 1)(6 − 2)(6 −
42 30 30
4
8) + (6 − 1)(6 − 2)(6 − 7)
42
4 5 5 4
⇒𝑦=− ×8+ × 10 − × (−40) + × (−20)
42 30 30 42
16 5 20 40
⇒𝑦=− + + −
21 3 3 21
17
∴𝑦= ≈ 5.66
3
Solution:
Here, 𝑥0 = 0, 𝑥1 = 1, 𝑥2 = 2, 𝑥3 = 5
By Lagrange’s formula, we have,
(𝑥−𝑥1 )(𝑥−𝑥2 )(𝑥−𝑥3 ) (𝑥−𝑥0 )(𝑥−𝑥2 )(𝑥−𝑥3 )
𝑓(𝑥) = (𝑥 𝑓(𝑥0 ) + (𝑥 𝑓(𝑥1 ) +
0 −𝑥1 )(𝑥0 −𝑥2 )(𝑥0 −𝑥3 ) 1 −𝑥0 )(𝑥1 −𝑥2 )(𝑥1 −𝑥3 )
(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥3 )
(𝑥2 −𝑥0 )(𝑥2 −𝑥1 )(𝑥2 −𝑥3 )
𝑓(𝑥2 ) +
(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥2 )
(𝑥3 −𝑥0 )(𝑥3 −𝑥1 )(𝑥3 −𝑥2 )
𝑓(𝑥3 ) … … … … … … (1)
∴ 𝑓(𝑥) = 𝑥 3 + 𝑥 2 − 𝑥 + 2
P a g e | 28
Question 4:
Using interpolation estimate the output of a factory in 1986 from the following data:
Year 1974 1978 1982 1990
Output in 1000
25 60 80 170
tones
Solution:
Here, 𝑥 = 1986, 𝑥0 = 1974, 𝑥1 = 1978, 𝑥2 = 1982, 𝑥3 = 1990 and 𝑦0 = 25, 𝑦1 =
60, 𝑦2 = 80, 𝑦3 = 170 .
By Lagrange’s interpolation formula, we have,
(𝑥−𝑥1 )(𝑥−𝑥2 )(𝑥−𝑥3 ) (𝑥−𝑥0 )(𝑥−𝑥2 )(𝑥−𝑥3 ) (𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥3 )
𝑦 = (𝑥 𝑦0 + (𝑥 𝑦1 + (𝑥 𝑦2 +
0 −𝑥1 )(𝑥0 −𝑥2 )(𝑥0 −𝑥3 ) 1 −𝑥0 )(𝑥1 −𝑥2 )(𝑥1 −𝑥3 ) 2 −𝑥0 )(𝑥2 −𝑥1 )(𝑥2 −𝑥3 )
(𝑥−𝑥0 )(𝑥−𝑥1 )(𝑥−𝑥2 )
𝑦
(𝑥3 −𝑥0 )(𝑥3 −𝑥1 )(𝑥3 −𝑥2 ) 3
… … … … … … (1)
Newton’s difference formulas are fundamental and applicable to almost all cases of
interpolation, but in general they do not converge as rapidly as central difference formula.
The central difference formulas are used for interpolating of the function near the middle of
tabulated set.
P a g e | 29
Figure: Interpolation
Difference Table:
Forward Difference:
𝒙 𝒚 𝚫𝒚 𝚫 𝟐𝒚 𝚫 𝟑𝒚 𝚫 𝟒𝒚
𝑥 −2 𝑦 −2
Δ𝑦 −2
𝑥 −1 𝑦 −1 Δ2𝑦 −2
Δ𝑦 −1 Δ3𝑦 −2
𝑥0 𝑦0 Δ2𝑦 −1 Δ4𝑦 −2
Δ𝑦 0 Δ3𝑦 −1
𝑥1 𝑦1 Δ2𝑦 0
Δ𝑦 1
𝑥2 𝑦2
P a g e | 30
Backward Difference:
𝒙 𝒚 𝚫𝒚 𝚫 𝟐𝒚 𝚫 𝟑𝒚 𝚫 𝟒𝒚
𝑥 −2 𝑦 −2
Δ𝑦 −2
𝑥 −1 𝑦 −1 Δ2𝑦 −2
Δ𝑦 −1 Δ3𝑦 −2
𝑥0 𝑦0 Δ2𝑦 −1 Δ4𝑦 −2
Δ𝑦 0 Δ3𝑦 −1
𝑥1 𝑦1 Δ2𝑦 0
Δ𝑦 1
𝑥2 𝑦2
𝑥−𝑥0
Now put 𝑢 = 𝑖 𝑒. 𝑥 − 𝑥0 = ℎ𝑢 . Then we have
ℎ
∆4 𝑦−1
𝑓(𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ) = ,
4! ℎ4
∆5 𝑦−1
𝑓(𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ, 𝑥0 + 3ℎ) = , 𝑒𝑡𝑐.
5! ℎ5
Substituting these values in (2), we get
∆ 𝑦0 ∆2 𝑦−1 ∆3 𝑦−1
𝑦 = 𝑦0 + ℎ𝑢 + ℎ2 𝑢(𝑢 − 1) + ℎ 3 (
𝑢 𝑢 − 1 )(𝑢 + 1 )
ℎ 2ℎ2 3! ℎ3
4
∆4 𝑦−1
+ℎ 𝑢 (𝑢 − 1)(𝑢 + 1)(𝑢 − 1)
4! ℎ4
5
∆5 𝑦−1
+ℎ 𝑢 (𝑢 − 1)(𝑢 + 1)(𝑢 − 2)(𝑢 + 2) …
5! ℎ5
∆2 𝑦−1 ∆3 𝑦−1
Or, 𝑦 = 𝑦0 + 𝑢 ∆ 𝑦0 + 𝑢(𝑢 − 1) + 𝑢(𝑢 2 − 1)
2! 3!
2
∆2 𝑦−2 2 2 2
∆5 𝑦−2
+𝑢(𝑢 − 1)(𝑢 − 2) + 𝑢(𝑢 − 1)(𝑢 − 2 ) +. . . … (3)
4! 5!
This result is known as Gauss’s forward formula for equal intervals.
Examples:
Question 1:
Use Gauss forward formula to find y30 , given that
𝑦21 = 18.4708; 𝑦25 = 17.8144; 𝑦29 = 17.1070; 𝑦33 = 16.3432; 𝑦37 = 15.5154
P a g e | 32
Solution:
Taking 𝑥0 = 29, ℎ = 4
𝑥 − 𝑥0 30 − 29
𝑢= = = 0.25
ℎ 4
The difference table is given below:
𝑥 𝑦𝑢 ∆𝑦𝑢 ∆2 𝑦𝑢 ∆3 𝑦𝑢 ∆4 𝑦𝑢
21 18.4708
-0.6564
25 17.8144 -0.0510
-0.7074 -0.0054
29 17.1070 -0.0564 -0.0022
-0.7638 -0.0076
33 16.3432 -0.0640
-0.8278
37 15.5154
Question 2:
Use Gauss Forward formula to find the value of y when x=3.75, given the following table:
Solution:
Let us take 3.5 as the origin and .5 as the unit.
P a g e | 33
x x0 3.75 3.5
We know u .5
h. .5
The difference table is given below:
x yu yu 2 yu 3 yu 4 yu 5 yu
2.5 24.145
-2.102
3.0 22.043 .284
-1.818 -.047
3.5 20.225 .237 .009
-1.581 -.038 -.003
4.0 18.644 .199 .006
-1.382 -.032
4.5 17.262 .167
-1.215
5.0 16.047
Question 3:
Use Gauss forward formula to find e x when x =1.748 from the following table:
X 1.72 1.73 1.74 1.75 1.76 1.77
F(x) 0.1790 0.1773 0.1755 0.1738 0.1720 0.1703
Solution:
Here the origin be taken at 1.74. Also here, h=0.01
P a g e | 34
1.748 1.74
u 0.8
0.01
The difference table is given below:
x 104 y 104 y 104 2 y 10 4 3 y 104 4 y
1.72 1790
-17
1.73 1773 -1
-18 2
1.74 1755 1 -4
-17 -2
1.75 1738 -1 4
-18 2
1.76 1720 1
-17
1.77 1703
Let,
𝑥 − 𝑥0
𝑢=
ℎ
∴ 𝑥 − 𝑥0 = ℎ𝑢
𝑦 = 𝑦0 + ℎ𝑢𝛿(𝑥0 , 𝑥0 − ℎ) + ℎ𝑢(ℎ𝑢 + ℎ)𝛿 (𝑥0 , 𝑥0 − ℎ, 𝑥0 + ℎ) + ℎ𝑢(ℎ𝑢 + ℎ)(ℎ𝑢
− ℎ)𝛿 (𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ) + ℎ𝑢(ℎ𝑢 + ℎ)(ℎ𝑢 − ℎ)(ℎ𝑢
+ 2ℎ)𝛿 (𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ) … … … … … . (2)
From the symmetric property of divided difference, we have:
𝑦0 − 𝑦−1 ∆𝑦−1 ∆𝑦−1
𝛿 (𝑥0 , 𝑥0 − ℎ) = 𝛿 (𝑥0 − ℎ, 𝑥0 ) = = =
𝑥0 − 𝑥−1 𝑥0 − 𝑥0 + ℎ 1! ℎ
Again: 𝛿 (𝑥0 , 𝑥0 + ℎ, 𝑥0 − ℎ) = 𝛿(𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ)
Since 𝑥0 − ℎ = 𝑥−1 , 𝑥0 + ℎ = 𝑥1
1 𝑦1 − 𝑦0 𝑦0 − 𝑦−1
𝛿 (𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ) = [ − ]
2ℎ 𝑥1 − 𝑥0 𝑥0 − 𝑥−1
1 ∆𝑦0 ∆𝑦−1
= [ − ]
2ℎ ℎ ℎ
1
= [∆𝑦0 − ∆𝑦−1 ]
2ℎ2
∆2 𝑦−1
=
2ℎ2
∆2 𝑦−1
=
2! ℎ2
∆3 𝑦−2
𝛿 (𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ) =
3! ℎ3
∆4 𝑦−2
𝛿 (𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ) =
4! ℎ4
And so on.
∆𝒚−𝟏 ∆𝟐 𝒚−𝟏 𝟐
∆𝟑 𝒚−𝟐
∴ 𝒚 = 𝒇(𝒙) = 𝒚𝟎 + 𝒖 (
+𝒖 𝒖+𝟏 ) + 𝒖(𝒖 − 𝟏)
𝟏! 𝟐! 𝟑!
𝟒
∆ 𝒚 −𝟐
+ 𝒖(𝒖𝟐 − 𝟏)(𝒖 + 𝟐) +⋯
𝟒!
This is known as the Gauss Backward interpolation formula for equal intervals.
P a g e | 36
Question 1:
Use Gauss’s backward formula to find y for 𝒙 = 𝟖 from the following:
𝒙 𝟎 𝟓 𝟏𝟎 𝟏𝟓 𝟐𝟎 𝟐𝟓
𝒚 = 𝒇(𝒙) 𝟕 𝟏𝟏 𝟏𝟒 𝟏𝟖 𝟐𝟒 𝟑𝟐
Solution:
The central difference table for the given problem is:
𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 ∆5 𝑦
0 7
4
5 11 −1
3 2
10 14 1 −1
4 1 0
15 18 2 −1
6 0
20 24 2
8
25 32
(8−10)
Here, 𝑢 = = −0.4
5
𝑦8 = 12.826 𝑎𝑝𝑝𝑟𝑜𝑥.
Question 2:
Interpolate using Gauss’s backward formula the population for the year 1936, given in the
following table:
𝑌𝑒𝑎𝑟 1901 1911 1921 1931 1941 1951
𝑃𝑜𝑝𝑢𝑙𝑎𝑡𝑖𝑜𝑛 12 15 20 27 39 52
Solution:
Taking 1931 as the origin and 10 years as the unit, then the population is to be estimated for
1936−1931
𝑢= = .5
10
𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 ∆5 𝑦
1901 12
3
1911 15 2
5 0
1921 20 2 3
7 3 −10
1931 27 5 −7
12 −4
1941 39 1
13
1951 52
Solution:
The central difference table for the given problem is:
𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦
0 14
10
4 24 −2
8 −3
8 32 −5 10
3 7
12 35 2
5
16 40
(9−8)
Here, 𝑢 = = 0.25
4
Question 4:
𝒙 𝒇(𝒙)
𝟏𝟗𝟒𝟎 𝟏𝟕
𝟏𝟗𝟓𝟎 𝟐𝟎
𝟏𝟗𝟔𝟎 𝟐𝟕
𝟏𝟗𝟕𝟎 𝟑𝟐
𝟏𝟗𝟖𝟎 𝟑𝟔
𝟏𝟗𝟗𝟎 𝟑𝟖
Solution:
Taking 1970 as the origin and 10 years as the unit, then the population is to be estimated for
𝑢=
1976 − 1970
= .6
10
The difference table is given below:
𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 ∆5 𝑦
1940 17
3
1950 20 4
7 −6
1960 27 −2 7
5 1 −9
1970 32 −1 −2
4 −1
1980 36 −2
2
1990 38
𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦 …
∆𝑦−1 ∆3 𝑦−2 …
𝑦0 ∆2 𝑦−1 ∆4 𝑦−2 …
∆𝑦0 ∆3 𝑦−1 …
Here,
0.644 − 0.64
𝑢= = 0.4
0.01
By Stirling’s Formula:
(∆𝑦−1 + ∆𝑦0 ) 𝑢 2 2 𝑢(𝑢 2 − 1) (∆3 𝑦−2 + ∆3 𝑦−1 )
𝑦 = 𝑦0 + 𝑢 + ∆ 𝑦−1 + +⋯
2 2 3! 2
∴ 𝑒 0.644 = 1.904082253
Question 2:
P a g e | 42
Question 3:
Use Stirling’s formula to find 𝒚𝟑𝟓 , given
𝒚𝟐𝟎 = 𝟓𝟏𝟐, 𝒚𝟑𝟎 = 𝟒𝟑𝟗, 𝒚𝟒𝟎 = 𝟑𝟒𝟔, 𝒚𝟓𝟎 = 𝟐𝟒𝟑
Where 𝑦𝑥 represents the number of persons at age x years in a life table.
Solution:
Taking 𝑥 = 30 as the origin and ℎ = 10 as the unit, the value of 𝑦 required will be for
35 − 30
𝑢= = 0.5
10
The difference table is given below:
P a g e | 43
𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦
20 512
−73
30 439 −20
−93 10
40 346 −10
−103
50 243
𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦
2 5
44
4 49 88
132 48
6 181 136 0
268 48
8 449 184
452
10 901
Here,
7−6
𝑢= = 0.5
2
By Stirling’s Formula:
(∆𝑦−1 + ∆𝑦0 ) 𝑢 2 2 𝑢(𝑢 2 − 1) (∆3 𝑦−2 + ∆3 𝑦−1 )
𝑦 = 𝑦0 + 𝑢 + ∆ 𝑦−1 + +⋯
2 2 3! 2
𝑦7 = 295 𝑎𝑝𝑝𝑟𝑜𝑥.
Question 6:
Use Stirling’s formula to find y for 𝒙 = 𝟗 from the following:
𝒙 𝟎 𝟒 𝟖 𝟏𝟐 𝟏𝟔
𝒚 = 𝒇(𝒙) 𝟏𝟒 𝟐𝟒 𝟑𝟐 𝟑𝟓 𝟒𝟎
P a g e | 45
Solution:
The Central difference table for the given problem is:
𝑥 𝑦 ∆𝑦 ∆2 𝑦 ∆3 𝑦 ∆4 𝑦
0 14
10
4 24 −2
8 −3
8 32 −5 10
3 7
12 35 2
5
16 40
Here,
9−8
𝑢= = 0.25
4
By Stirling’s Formula:
(∆𝑦−1 + ∆𝑦0 ) 𝑢 2 2 𝑢(𝑢 2 − 1) (∆3 𝑦−2 + ∆3 𝑦−1 )
𝑦 = 𝑦0 + 𝑢 + ∆ 𝑦−1 + +⋯
2 2 3! 2
𝑦9 = 33.116 𝑎𝑝𝑝𝑟𝑜𝑥.
Bessel's Interpolation:
We know that Gauss's forward interpolation formula for equal interval:
∆y0 ∆ 2 y_ 1 ∆3 y_1
y = y0 + u + u(u − 1) + u(u − 1)(u + 1) +
1! 2! 3!
∆4 y
u(u2 − 1)(u + 2) +…………. (1)
4!
𝑥−𝑥0
Where 𝑢 =
ℎ
We Know ∆𝑦0 = 𝑦1 − 𝑦0
𝑦0 = 𝑦1 − ∆𝑦0 … … … … … … . . (2)
And 𝑦−1 = 𝑦0 − ∆𝑦−1
∆2 𝑦_1 = ∆3 ∆𝑦−1 … … … . (3)
P a g e | 46
Solution:
Difference Table:
P a g e | 47
x Y = 𝑒𝑥 ∆y ∆2 y ∆3 y ∆4 y
0.61 1.840431
0.018497
0.62 1.858928 0.000185
0.000004
0.63 1.877610 0.018682 -0.000004
0.000189
0.00 = ∆3 𝑦−2 0.000002 = ∆4 𝑦−2
By Bessel’s formula
1
𝑦0 + 𝑦1 1 𝑢(𝑢 − 1) ∆2 𝑦−1 + ∆2 𝑦0 𝑢(𝑢 − 2)(𝑢 − 1) 3
𝑦(𝑢) = + (𝑢 − ) ∆𝑦0 + + ∆ 𝑦−1
2 2 2! 2 3!
𝑢(𝑢 2 − 1)(𝑢 − 2) (∆4 𝑦−2 + ∆4 𝑦−1
+
4! 2
1
𝑦(0.644) = (1.896481 + 1.915541) + (0.4 − 0.5)0.01906
2
0.4(0.4 − 1) 0.000189 + 0.000189 0.4(0.4 − 0.5)(0.4 − 1)
+ + (0.00002)
2! 2 3!
0.4(0.42 − 1)(0.4 − 2) (0.000002 + 0.000004)
+
4! 2
= 1.904082336
By calculating, 𝑒 0.644 = 1.904081995
Error = 1.904081995-1.904082336 = 0.00000034
P a g e | 48
Numerical Integration
The process of computing the value of a definite integral from a set of numerical values of
the integrand is called Numerical Integral. When applied to the integration of a function of
a single variable, the process is known as Quadrature.
Three types of numerical integration:
1. Trapezoidal Rule
2. Simpson’s one third rule
3. Simpson’s three eight rule
1. Trapezoidal Rule
x0 +h
∫ ydx = h[1/2(𝑦0 − 𝑦𝑛 ) + (𝑦1 + 𝑦2 + ⋯ … … . . +𝑦𝑛−1 )
x0
Here 𝑓 (𝑥) = 𝑦
𝑓(𝑥0 ) = 𝑦0
For h interval
𝑓(𝑥1 ) = 𝑓 (𝑥0 + ℎ) = 𝑦1
𝑓(𝑥2 ) = 𝑓(𝑥0 + 2ℎ) = 𝑦2
𝑓(𝑥0 + 𝑛ℎ) = 𝑦𝑛
Example:
12 𝑑𝑥
1. Evaluate ∫5 trapezoid rule also find the error with comparing the actual integral value
𝑥
Solution:
Divided the range with comparing of integration (5, 12) equal parts each of width ℎ =
12−5
=1
7
1
Where 𝑓(𝑥) = =𝑦
𝑥
P a g e | 49
x y = 1/x
𝑥0 = 5 1
𝑦0 = = 𝑜. 2
5
𝑥1 = 𝑥0 + ℎ = 6 1
𝑦1 = = 0.16667
6
𝑥2 = 𝑥0 + 2ℎ = 7 1
𝑦2 = = 0.14286
7
𝑥3 = 𝑥0 + 3ℎ = 8 1
𝑦3 = = 0.125
8
𝑥4 = 𝑥0 + 4ℎ = 9 1
𝑦4 = = 0.11111
9
𝑥5 = 𝑥0 + 5ℎ = 10 1
𝑦5 = = 0.1
10
𝑥6 = 𝑥0 + 6ℎ = 11 1
𝑦6 = = 0.09091
11
𝑥7 = 𝑥0 + 7ℎ = 12 1
𝑦7 = = 0.83333
12
12 𝑑𝑥 1
∫5 = [ (0.2 + 0.083333) + (0.16667 + 0.14286 + 0.125 + 0.11111 + 0.09091)
𝑥 2
= (0.141665 + 0.73655)
= 0.878215
12 𝑑𝑥
Actual value ∫5 = [𝑙𝑛𝑥]12
5
𝑥
= [𝑙𝑛12 − 𝑙𝑛5]
= 0.8754687
Error = -0.0027463
x Y=1/x
𝑥0 = 5 1
𝑦0 = = 𝑜. 2
5
𝑥1 = 𝑥0 + ℎ = 5.5 1
𝑦1 = = 0.181818
5.5
𝑥2 = 𝑥0 + 2ℎ = 6 1
𝑦2 = = 0.166667
6
𝑥3 = 𝑥0 + 3ℎ = 6.5 1
𝑦3 = = 0.153846
6.5
𝑥4 = 𝑥0 + 4ℎ = 7 1
𝑦4 = = 0.142857
7
𝑥5 = 𝑥0 + 5ℎ = 7.5 1
𝑦5 = = 0.133333
7.5
𝑥6 = 𝑥0 + 6ℎ = 8 1
𝑦6 = = 0.125
8
𝑥7 = 𝑥0 + 7ℎ = 8.5 1
𝑦7 = = 0.117647
8.5
𝑥8 = 𝑥0 + 8ℎ = 9 1
𝑦8 = = 0.11111
9
𝑥9 = 𝑥0 + 9ℎ = 9.5 1
𝑦9 = = 0.105263
9.5
𝑥10 = 𝑥0 + 10ℎ = 10 1
𝑦10 = = 0.1
10
𝑥11 = 𝑥0 + 11ℎ = 10.5 1
𝑦11 = = 0.095238
10.5
𝑥12 = 𝑥0 + 12ℎ = 11 1
𝑦12 = = 0.090909
11
𝑥713 = 𝑥0 + 13ℎ = 11.5 1
𝑦13 = = 0.086956
11.5
𝑥14 = 𝑥0 + 14ℎ = 12 1
𝑦14 = = 0.083333
12
12 𝑑𝑥
∫5 = ℎ[1/2(𝑦0 + 𝑦𝑛 ) + (𝑦1 + 𝑦2 +𝑦3 + ⋯ … … . +𝑦𝑛−1 )
𝑥
1
= 0.5[ (0.2 + 0.083333) + 1.610645]
2
= 0.876155
12 𝑑𝑥
Actual value = ∫5 = [𝑙𝑛𝑥]12
5
𝑥
= [𝑙𝑛12 − 𝑙𝑛5]
= 0.875468
P a g e | 51
𝑛2 𝑛3 𝑛2 ∆2 𝑦0 𝑛4 ∆3 𝑦0
= ℎ [𝑛𝑦0 + ∆𝑦0 + ( − ) +( − 𝑛3 + 𝑛2 )
2 3 2 2! 4 3!
𝑛5 3𝑛4 11𝑛3 2
∆4 𝑦0
+( − + − 3𝑛 ) + ⋯ 𝑢𝑝𝑡𝑜 (𝑛 + 1) 𝑡𝑒𝑟𝑚𝑠]
5 2 3 4!
And neglecting the third and higher order differences, we obtain
𝑥 +2ℎ 22 23 22 ∆2 𝑦0
∫𝑥 0 𝑦𝑑𝑥 = ℎ [2𝑦0 +
2
∆𝑦0 + (
3
−
2
)
2!
]
0
2 1
=h [2y0 + 2(𝑦1 − 𝑦0 ) + ( . ) (𝑦2 − 2𝑦1 + 𝑦0 )]
3 2
Clearly (3) determines the area of two strips, bounded by the ordinates at
𝑥0 , 𝑥0 + ℎ 𝑎𝑛𝑑 𝑥0 + 2ℎ , at a time. Now by using (3), if n is a multiple of 2 i.e.
n is an even positive integer, we obtain,
𝑥 +4ℎ ℎ
∫𝑥 0+2ℎ 𝑦𝑑𝑥 = 3 [𝑦2 + 4𝑦3 + 𝑦4 ]
0
𝑥 +6ℎ ℎ
∫𝑥 0+4ℎ 𝑦𝑑𝑥 = 3 [𝑦4 + 4𝑦5 + 𝑦9 ]
0
………………………………………
𝑥 +𝑛ℎ ℎ
∫𝑥 0+(𝑛−2)ℎ 𝑦𝑑𝑥 = 3 [𝑦(𝑛−2) + 4𝑦(𝑛−1) + 𝑦𝑛 ]
0
𝑏
𝑥0 +𝑛ℎ
𝐼 = ∫ 𝑦𝑑𝑥 = ∫ 𝑦𝑑𝑥
𝑥0
𝑎
𝑥 +2ℎ 𝑥 +4ℎ 𝑥 +6ℎ 𝑥 +𝑛ℎ
= ∫𝑥 0 𝑦𝑑𝑥 +∫𝑥 0 𝑦𝑑𝑥 + ∫𝑥 0 𝑦𝑑𝑥 + ⋯ + ∫𝑥 0 𝑦𝑑𝑥
0 0+2ℎ 0+4ℎ 0+(𝑛−2)ℎ
ℎ ℎ
= [𝑦0 + 4𝑦1 + 𝑦0 ] + [𝑦2 + 4𝑦3 + 𝑦4 ] + ⋯ + [𝑦(𝑛−2) + 4𝑦(𝑛−1) + 𝑦𝑛 ]
3 3
ℎ
= [(𝑦0 + 𝑦𝑛 ) + 4(𝑦1 + 𝑦3 + … + 𝑦𝑛−1 ) + 2(𝑦2 +𝑦4 + ⋯ + 𝑦𝑛−2 )]
3
ℎ
= [(sum of extreme ordinates) + 4(sum of odd ordinates) + 2(sum of even
3
ordinates)].
This is known as Simpson’s one third rule.
In this method we find the area of two strips at a time. Also in this method, in two
consecutive intervals we replace y by a second-degree polynomial as its differences of order
higher than 2 will vanish.
𝑥 1
𝑦=
𝑥
𝑥0 = 6 1
𝑦0 = = 0.1666666
6
𝑥1 = 𝑥0 + ℎ = 7 1
𝑦1 = = 0.1428771
7
𝑥2 = 𝑥0 + 2ℎ = 8 1
𝑦2 = = 0.125
8
P a g e | 53
𝑥3 = 𝑥0 + 3ℎ = 9 1
𝑦3 = = 0.11111
9
𝑥4 = 𝑥0 + 4ℎ = 10 1
𝑦4 = = 0.1
10
𝑥5 = 𝑥0 + 5ℎ = 11 1
𝑦5 = = 0.090909
11
𝑥6 = 𝑥0 + 6ℎ = 12 1
𝑦6 = = 0.083333
12
1
By Simpson’s ‘ ’ rule we get,
3
12
𝑑𝑥 ℎ
∫ = [(𝑦0 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦5 ) + 2(𝑦2 + 𝑦4 )]
6 𝑥 3
1
= [0.249999 + 1.3795044 + 0.45]
3
= 0.693169
12 𝑑𝑥
Now the exact value is: ∫6 = 𝑙𝑛12 − 𝑙𝑛6 = 0.6931471806
𝑥
Question 2:
1 𝑑𝑥 1
Find ∫0 by using Simpson’s rule. Hence obtain the approximate value of 𝜋 in each
1+𝑥 2 3
case.
Solution:
1−0 1
Divide the range of integration (0,1) into 6 equal parts each of width = . The values of
6 6
𝑓(𝑥) at each point of sub-division are given below:
1
𝑥 𝑦=
1+𝑥 2
𝑥0 = 0 1
𝑦0 = = 1.0000000
1
1 1 36
𝑥1 = 𝑥0 + ℎ = 0 + = 𝑦1 = = 0.9729729
6 6 37
2 36
𝑥2 = 𝑥0 + 2ℎ = 𝑦2 = = 0.9000000
6 40
P a g e | 54
3 36
𝑥3 = 𝑥0 + 3ℎ = 𝑦3 = = 0.8000000
6 45
4 36
𝑥4 = 𝑥0 + 4ℎ = 𝑦4 = = 0.6923076
6 52
5 36
𝑥5 = 𝑥0 + 5ℎ = 𝑦5 = = 0.5901639
6 61
𝑥6 = 𝑥0 + 6ℎ = 1 1
𝑦6 = = 0.5000000
2
1
By Simpson’s ‘ ’ rule, we get,
3
1 𝑑𝑥 ℎ
∫0 = [(𝑦0 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦6 ) + 2(𝑦2 + 𝑦4 )]
1+𝑥 2 3
1
= [1.5000000 + 4(2.3631369) + 2(1.5923077)]
18
1
= (14.137163) = 0.7853979 … … … … … … (1)
18
1 𝑑𝑥 𝜋
But ∫0 = [tan−1 𝑥]01 = tan−1 1 − tan−1 0 = … … … … … … (2)
1+𝑥 2 4
Question 3:
6 1
Evaluate ∫0 𝑒 𝑥 𝑑𝑥 by using Simpson’s rule. Also find the error with comparing the actual
3
integral value.
Solution:
6−0
Divided the range of integration (0,6) into 6 equal parts each of width = 1. The values
6
of 𝑓(𝑥) = 𝑒 𝑥 = 𝑦 at each point of sub-division are given below:
𝑥 𝑦 = 𝑒𝑥
𝑥0 = 0 𝑦0 = 𝑒 0 = 1.0000
𝑥1 = 𝑥0 + ℎ = 1 𝑦1 = 𝑒 1 = 2.7183
P a g e | 55
𝑥2 = 𝑥0 + 2ℎ = 2 𝑦2 = 𝑒 2 = 7.3891
𝑥3 = 𝑥0 + 3ℎ = 3 𝑦3 = 𝑒 3 = 20.0855
𝑥4 = 𝑥0 + 4ℎ = 4 𝑦4 = 𝑒 4 = 54.5982
𝑥5 = 𝑥0 + 5ℎ = 5 𝑦5 = 𝑒 5 = 148.4132
𝑥6 = 𝑥0 + 6ℎ = 6 𝑦6 = 𝑒 6 = 403.4288
1
By Simpson’s ‘ ’ rule, we get,
3
6
ℎ
∫ 𝑒 𝑥 𝑑𝑥 = [(𝑦 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦5 ) + 2(𝑦2 + 𝑦4 )]
0 3 0
1
= [1213.2704] = 404.4235
3
6
Now the exact value is: ∫0 𝑒 𝑥 𝑑𝑥 = 𝑒 6 − 1 = 403.4288 − 1 = 402.4288
𝑥0 = 0.2 𝑦0 = 3.0295
𝑥1 = 𝑥0 + ℎ = 0.4 𝑦1 = 2.7975
𝑥2 = 𝑥0 + 2ℎ = 0.6 𝑦2 = 2.8976
P a g e | 56
𝑥3 = 𝑥0 + 3ℎ = 0.8 𝑦3 = 3.1660
𝑥4 = 𝑥0 + 4ℎ = 1.0 𝑦4 = 3.5598
𝑥5 = 𝑥0 + 5ℎ = 1.2 𝑦5 = 4.0698
𝑥6 = 𝑥0 + 6ℎ = 1.4 𝑦6 = 4.7042
1
By Simpson’s ‘ ’ rule, we get,
3
1.4
ℎ
∫ (𝑠𝑖𝑛𝑥 − 𝑙𝑛𝑥 + 𝑒 𝑥 )𝑑𝑥 = [(𝑦 + 𝑦6 ) + 4(𝑦1 + 𝑦3 + 𝑦5 ) + 2(𝑦2 + 𝑦4 )]
0.2 3 0
= 4.0521
1.4
Now the exact value is: ∫0.2 (𝑠𝑖𝑛𝑥 − 𝑙𝑛𝑥 + 𝑒 𝑥 )𝑑𝑥 = 4.0509
𝑛2 𝑛3 𝑛2 ∆2 𝑦0 𝑛4 ∆3 𝑦0
= ℎ [𝑛𝑦0 + ∆𝑦0 + ( − ) +( − 𝑛3 + 𝑛2 )
2 3 2 2! 4 3!
𝑛5 3𝑛4 11𝑛3 ∆4 𝑦0
+( − + − 3𝑛2 ) + ⋯ 𝑢𝑝𝑡𝑜 (𝑛 + 1) 𝑡𝑒𝑟𝑚𝑠]
5 2 3 4!
9 9
= ℎ [3𝑦0 + (𝑦1 − 𝑦0 ) + (𝑦2 − 2𝑦1 + 𝑦0 )
2 4
9
+ (𝑦3 − 3𝑦2 + 3𝑦1 − 𝑦0 )]
8
3ℎ
= [𝑦0 − 3𝑦1 + 3𝑦2 + 𝑦3 ] ……………………… (4)
8
Clearly (3) determines the area of three strips at a time, which bounded by the ordinates
𝑥0 , 𝑥0 + ℎ , 𝑥0 + 2ℎ and 𝑥0 + 3ℎ . Now by using (4), if n is a multiple of three, we obtain
P a g e | 57
𝑥0 +6ℎ 3ℎ
∫𝑥 𝑦𝑑𝑥 = [𝑦3 + 3𝑦4 + 3𝑦5 + 𝑦6 ]
0 +3ℎ 8
………………………………………………………
𝑥 +𝑛ℎ 3ℎ
∫𝑥 0+(𝑛−3)ℎ 𝑦𝑑𝑥 = 8
[𝑦𝑛−3 + 3𝑦𝑛−2 + 3𝑦𝑛−1 + 𝑦𝑛 ]
0
3ℎ 3ℎ
= [𝑦0 − 3𝑦1 + 3𝑦2 + 𝑦3 ] + [𝑦3 + 3𝑦4 + 3𝑦5 + 𝑦6 ]
8 8
3ℎ
+⋯+ [𝑦𝑛−3 + 3𝑦𝑛−2 + 3𝑦𝑛−1 + 𝑦𝑛 ]
8
3ℎ
= [(𝑦0 + 𝑦𝑛 ) + 3((𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 + 𝑦7 + ⋯ + 𝑦𝑛−1 )
8
+2(𝑦2 + 𝑦6 + ⋯ + 𝑦𝑛−3 )]
This is known as Simpson’s three- eight rule.
Question 1:
12 𝑑𝑥 3
Evaluate ∫6 by using Simpson’s rule. Also find the error with comparing the actual
𝑥 8
integral value.
Solution:
12−6
Divided the range of integration (6,12) into 3 equal parts each of width = 2. The values
3
1
of 𝑓(𝑥) = = 𝑦 at each point of sub-division are given below:
𝑥
𝑥 1
𝑦=
𝑥
𝑥0 = 6 1
𝑦0 = = 0.1666666
6
𝑥1 = 𝑥0 + ℎ = 8 1
𝑦1 = = 0.125
8
P a g e | 58
𝑥2 = 𝑥0 + 2ℎ = 10 1
𝑦2 = = 0.1
10
𝑥3 = 𝑥0 + 3ℎ = 12 1
𝑦3 = = 0.083333
12
3
By Simpson’s ‘ ’ rule, we get,
8
12 𝑑𝑥 3ℎ
∫6 = [(𝑦0 + 𝑦6 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 ) + 2𝑦3 ]
𝑥 8
3.2 1 1 1 1
= [ + 3( + )+ ]
8 6 8 10 12
= 0.69375
12 𝑑𝑥
Now the exact value is: ∫6 = 𝑙𝑛12 − 𝑙𝑛6 = 0.693147
𝑥
Question 2:
1 𝑑𝑥 3
Evaluate ∫0 by using Simpson’s rule. Also find the error with comparing the actual
1+𝑥 2 8
integral value.
Solution:
1−0 1 1
Divide the range of integration (0, 1) into 3 equal parts each of width= = . Hence h= .
3 3 3
The values of the function for each point of sub-division are given below:
1
𝑥 𝑦=
1+𝑥 2
𝑥0 = 0 𝑦0 = 1
1 9
𝑥1 = 𝑥0 + ℎ = 𝑦1 = = 0.9
3 10
2 9
𝑥2 = 𝑥0 + 2ℎ = 𝑦2 = = 0.692307
3 13
𝑥3 = 𝑥0 + 3ℎ = 1 1
𝑦3 =
2
1
By Simpson’s ‘ ’ rule, we get,
3
P a g e | 59
6 𝑑𝑥 3ℎ
∫0 = [(𝑦0 + 𝑦6 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 ) + 2𝑦3 ]
1+𝑥 2 8
1
= [1 + 2.7 + 2.076923 + 0.5]
8
1
= × 6.276923 = 0.784615
8
6 𝑑𝑥 𝜋
Now the exact value is: ∫0 = arctan(1) − arctan(0) = = 0.785398
1+𝑥 2 4
Question 3:
6 3
Evaluate ∫0 𝑒 𝑥 𝑑𝑥 by using Simpson’s rule. Also find the error with comparing the actual
8
integral value.
Solution:
6−0
Divide the range of integration (0, 6) into 3 equal parts each of width= = 2. Hence h=2.
3
The values of the function for each point of sub-division are given below:
𝑥 𝑦 = 𝑒𝑥
𝑥0 = 0 𝑦0 = 1
𝑥1 = 𝑥0 + ℎ = 2 𝑦1 = 𝑒 2 = 7.389
𝑥2 = 𝑥0 + 2ℎ = 4 = 𝑦2 = 𝑒 4 = 54.598
𝑥3 = 𝑥0 + 3ℎ = 6 𝑦3 = 𝑒 6 = 403.429
3
By Simpson’s ‘ ’ rule, we get,
8
6 3ℎ
∫0 𝑒 𝑥 𝑑𝑥 = 8
[(𝑦0 + 𝑦6 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 ) + 2𝑦3 ]
6
= [1 + 3(𝑒 2 + 𝑒 4 ) + 2𝑒 6 ]
8
P a g e | 60
= 442.79
6
Now the exact value is: ∫0 𝑒 𝑥 𝑑𝑥 = 𝑒 6 − 1 = 402.43
Question 4:
1.4 3
Evaluate ∫0.2 (𝑠𝑖𝑛𝑥 − 𝑙𝑛𝑥 + 𝑒 𝑥 )𝑑𝑥 by using Simpson’s rule. Also find the error with
8
comparing the actual integral value.
Solution:
1.4−0.2
Divide the range of integration (0.2, 1.4) into 3 equal parts each of width= = 0.4.
3
Hence h=0.4. The values of the function for each point of sub-division are given below:
𝑥 𝑦 = 𝑠𝑖𝑛𝑥 − 𝑙𝑛𝑥 + 𝑒 𝑥
𝑥0 = 0.2 𝑦0 = 3.0295
𝑥1 = 𝑥0 + ℎ = 0.6 𝑦1 = 2.8976
𝑥2 = 𝑥0 + 2ℎ = 1.0 𝑦2 = 3.5598
𝑥3 = 𝑥0 + 3ℎ = 1.4 𝑦3 = 4.7042
3
By Simpson’s ‘ ’ rule, we get,
8
1.4 3ℎ
∫0.2 (𝑠𝑖𝑛𝑥 − 𝑙𝑛𝑥 + 𝑒 𝑥 )𝑑𝑥 = 8
[(𝑦0 + 𝑦6 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 ) + 2𝑦3 ]
= 4.0659
1.4
Now the exact value is: ∫0.2 (𝑠𝑖𝑛𝑥 − 𝑙𝑛𝑥 + 𝑒 𝑥 )𝑑𝑥 = 4.0509
Romberg Integration:
Romberg Integration is an extrapolation of two results of the trapezoid method applied to a
regular partition cut into subintervals of sizes that are consecutive powers of 2.
Define a sequence of values Ai where:
P a g e | 61
A1
4 A2 A1
B1 =
3
16 B2 B1
A2 C1 =
15
4 A3 A2
B2 =
3
16 B3 B2
A3 C2 =
15
4 A4 A3
B3 =
3
A4
. . .
. . .
. . .
The values for Romberg’s Method of integration con be arranged in a triangular matrix.
1 2 3 4 5 6
1 A1
2 A2 B1
3 A3 B2 C1
P a g e | 62
4 A4 B3 C2 D1
5 A5 B4 C3 D2 E1
6 A6 B5 C4 D3 E2 F1
The best possible estimate in each row is the right most entry: A1, B1 ,C1 ,D1 ,E1 ,F1.
Since we will run out of letters after 6 rows we express this with R(i,j).
1 2 3 4 5 6
1 R(1,1)
2 R(2,1) R(2,2)
3 R(3,1) R(3,2) R(3,3)
4 R(4,1) R(4,2) R(4,3) R(4,4)
5 R(5,1) R(5,2) R(5,3) R(5,4) R(5,5)
6 R(6,1) R(6,2) R(6,3) R(6,4) R(6,5) R(6,6)
The best possible estimate in each row is the right most entry: R(i,i) .
The R(i,j) can be obtained in the following way:
R(i,1) is always the trapezoid method applied with a partition size of 2i .
1 2 3 4 5 6
1 R(1,1)
2 R(2,1) R(2,2)
3 R(3,1) R(3,2) R(3,3)
4 R(4,1) R(4,2) R(4,3) R(4,4)
5 R(5,1) R(5,2) R(5,3) R(5,4) R(5,5)
6 R(6,1) R(6,2) R(6,3) R(6,4) R(6,5) R(6,6)
4𝑗−1 𝑅(𝑖,𝑗−1)−𝑅(𝑖−1,𝑗−1)
R(i,j) = ; i,j= 2,3,4….
4𝑗−1 −1
For the rest of them a triangular pattern exist as how one fill in the other entries.
P a g e | 63
4 R (2,1) R(1,1)
R (2, 2)
4 1 42 R (3, 2) R(2, 2)
R (3,3)
4 R (3,1) R(2,1) 42 1 43 R (4,3) R(3,3)
R (3, 2) R(4, 4)
4 1 42 R (4,1) R (3, 2) 43 1
R (4,3)
4 R (4,1) R(3,1) 42 1 43 R (5,3) R(4,3)
R (4, 2) R(5, 4) .......
4 1 42 R (5, 2) R(4, 2) 43 1
4 R(5,1) R(4,1) R (5,3)
42 1 43 R (6,3) R(5,3)
R (5, 2) R(6, 4) .......
4 1 42 R (6, 2) R (3, 2) 43 1
4 R (6,1) R(5,1) R (6,3)
R (6, 2) 42 1
4 1
Solution:
𝑏−𝑎 1 𝑏−𝑎 1
Here, 𝑎 = 0, 𝑏 = 1, ℎ1 = (𝑏 − 𝑎) = 1, ℎ2 = = , ℎ3 = = ,
2 2 22 4
𝑏−𝑎 1
ℎ4 = =
23 8
Now,
1
𝑅(1,1) = (𝑏 − 𝑎)(𝑓(𝑎) + 𝑓(𝑏))
2
3
𝑅(1,1) = = 0.75
4
1
𝑅(2,1) = [𝑅(1,1) + ℎ1 𝑓 (𝑎 + ℎ2 )]
2
𝑅(2,1) = 0.708331
1
𝑅(3,1) = [𝑅(2,1) + ℎ2 {𝑓(𝑎 + ℎ3 ) + 𝑓 (𝑎 + 3ℎ3 )}]
2
𝑅(3,1) = 0.697024
1
𝑅(4,1) = [𝑅(3,1) + ℎ3 {𝑓(𝑎 + ℎ4 ) + 𝑓 (𝑎 + 3ℎ4 ) + 𝑓(𝑎 + 5ℎ4 ) + 𝑓(𝑎 + 7ℎ4 )}]
2
P a g e | 64
𝑅(4,1) = 0.694122
4𝑅(2,1)−𝑅(1,1) 42 𝑅(3,2)−𝑅(2,2)
𝑅(2,2) = = 0.69444; 𝑅 (3,3) = = 0.693176
4−1 42 −1
4𝑅(3,1)−𝑅(2,1) 42 𝑅(4,2)−𝑅(3,2)
𝑅(3,2) = = 0.693255; 𝑅 (4,3) = = 0.693148
4−1 42 −1
4𝑅(4,1)−𝑅(3,1) 43 𝑅(4,3)−𝑅(3,3)
𝑅(4,2) = = 0.693155; 𝑅 (4,4) = = 0.693148
4−1 43 −1
𝑅(1,1) = 0.75
𝑅(2,1) = 0.708331 𝑅(2,2) = 0.69444
𝑅(3,1) = 0.697024 𝑅 (3,2) = 0.693255 𝑅 (3,3) = 0.693176
𝑅(4,1) = 0.694122 𝑅 (4,2) = 0.693155 𝑅 (4,3) = 0.693148 𝑅(4,4) = 0.693148
Question 2:
2 𝑑𝑥
Apply Romberg Extrapolation to get the best possible estimate for: ∫1 for n=4.
𝑥
Solution:
𝑏−𝑎 1 𝑏−𝑎 1
Here, 𝑎 = 1, 𝑏 = 2, ℎ1 = (𝑏 − 𝑎) = 1, ℎ2 = = , ℎ3 = = ,
2 2 22 4
𝑏−𝑎 1
ℎ4 = =
23 8
Now,
1
𝑅(1,1) = (𝑏 − 𝑎)(𝑓(𝑎) + 𝑓(𝑏))
2
3
𝑅(1,1) = = 0.75
4
P a g e | 65
1
𝑅(2,1) = [𝑅(1,1) + ℎ1 𝑓 (𝑎 + ℎ2 )]
2
𝑅(2,1) = 0.70833333
1
𝑅(3,1) = [𝑅(2,1) + ℎ2 {𝑓(𝑎 + ℎ3 ) + 𝑓 (𝑎 + 3ℎ3 )}]
2
𝑅(3,1) = 0.69702381
1
𝑅(4,1) = [𝑅(3,1) + ℎ3 {𝑓(𝑎 + ℎ4 ) + 𝑓 (𝑎 + 3ℎ4 ) + 𝑓(𝑎 + 5ℎ4 ) + 𝑓(𝑎 + 7ℎ4 )}]
2
𝑅(4,1) = 0.69412185
4𝑅(2,1)−𝑅(1,1) 42 𝑅(3,2)−𝑅(2,2)
𝑅(2,2) = = 0.69444444; 𝑅 (3,3) = = 0.69317461
4−1 42 −1
4𝑅(3,1)−𝑅(2,1) 42 𝑅(4,2)−𝑅(3,2)
𝑅(3,2) = = 0.69325397; 𝑅(4,3) = = 0.6931479
4−1 42 −1
4𝑅(4,1)−𝑅(3,1) 43 𝑅(4,3)−𝑅(3,3)
𝑅(4,2) = = 0.69315453; 𝑅(4,4) = = 0.69314748
4−1 43 −1
𝑅(1,1) = 0.75
𝑅(2,1) = 𝑅(2,2)
0.70833333 = 0.69444444
𝑅(3,1) = 𝑅(3,2) 𝑅(3,3)
0.69702381 = 0.69325397 = 0.69317461
𝑅(4,1) = 𝑅(4,2) 𝑅(4,3) 𝑅(4,4) =
0.69412185 = 0.69315453 = 0.6931479 0.69314748
Question 3:
𝜋
Use Romberg Extrapolation to get the best possible estimate for: ∫0 𝑓(𝑥)𝑑𝑥 where 𝑓(𝑥) =
sin 𝑥, for n = 4.
Solution:
𝑏−𝑎 𝜋 𝑏−𝑎 𝜋
Here, 𝑎 = 0, 𝑏 = 𝜋, ℎ1 = (𝑏 − 𝑎) = 𝜋, ℎ2 = = , ℎ3 = = ,
2 2 22 4
𝑏−𝑎 𝜋
ℎ4 = =
23 8
Now,
1
𝑅(1,1) = (𝑏 − 𝑎)(𝑓(𝑎) + 𝑓(𝑏))
2
1
𝑅(1,1) = × 𝜋 × (sin 0 + sin 𝜋) = 0
2
1
𝑅(2,1) = [𝑅(1,1) + ℎ1 𝑓 (𝑎 + ℎ2 )]
2
𝜋
𝑅(2,1) = = 1.5708
2
1
𝑅(3,1) = [𝑅(2,1) + ℎ2 {𝑓(𝑎 + ℎ3 ) + 𝑓 (𝑎 + 3ℎ3 )}]
2
𝑅(3,1) = 1.8961
1
𝑅(4,1) = [𝑅(3,1) + ℎ3 {𝑓(𝑎 + ℎ4 ) + 𝑓 (𝑎 + 3ℎ4 ) + 𝑓(𝑎 + 5ℎ4 ) + 𝑓(𝑎 + 7ℎ4 )}]
2
𝑅(4,1) = 1.9742
4𝑅(2,1)−𝑅(1,1) 42 𝑅(3,2)−𝑅(2,2)
𝑅(2,2) = = 2.0944; 𝑅 (3,3) = = 1.9986
4−1 42 −1
4𝑅(3,1)−𝑅(2,1) 42 𝑅(4,2)−𝑅(3,2)
𝑅(3,2) = = 2.0046; 𝑅(4,3) = = 2.0000
4−1 42 −1
4𝑅(4,1)−𝑅(3,1) 43 𝑅(4,3)−𝑅(3,3)
𝑅(4,2) = = 2.0003; 𝑅(4,4) = = 2.0000
4−1 43 −1
P a g e | 67
𝑅(1,1) = 0
𝑅(2,1) = 1.5708 𝑅(2,2) = 2.0944
𝑅(3,1) = 1.8961 𝑅(3,2) = 2.0046 𝑅(3,3) = 1.9986
𝑅(4,1) = 1.9742 𝑅(4,2) = 2.0003 𝑅(4,3) = 2.0000 𝑅(4,4) = 2.0000
𝜋
Here, the exact value is: ∫0 sin 𝑥 𝑑𝑥 = [−cos 𝑥]0𝜋 = 2
1
𝑥2 = (𝑎 + 𝑥1 )
2
Question-1: Find the root of the following polynomial function using the Bisection method:
𝑥 3 − 4𝑥 − 9.
Solution:
Let, (𝒙) = 𝒙𝟑 − 𝟒𝒙 − 𝟗
(𝟐) = 𝟖 − 𝟖 − 𝟗 = −𝟗
(𝟑) = 𝟐𝟕 − 𝟏𝟐 − 𝟗 = 𝟔
So, the root lies in [𝟐, 𝟑]
First iteration:
P a g e | 69
𝟐+𝟑
𝒙𝟏 = = 𝟐. 𝟓
𝟐
Now. (𝒙𝟏 ) = 𝟐. 𝟓𝟑 − 𝟒(𝟐. 𝟓) − 𝟗 = −𝟑. 𝟑𝟕𝟓
Then(𝒙𝟏 ). (𝟑) < 𝟎
So, the root lies in [2.5, 3]
Second iteration:
𝟐. 𝟓 + 𝟑
𝒙𝟐 = = 𝟐. 𝟕𝟓
𝟐
Now. (𝒙𝟐 ) = 𝟐. 𝟕𝟓𝟑 − 𝟒(𝟐. 𝟕𝟓) − 𝟗 = 𝟎. 𝟕𝟗𝟔𝟗
Then (𝒙𝟐 ). (𝟐. 𝟓) < 𝟎
So, the root lies in [2.5, 2.75]
Solution:
Here, (𝒙) = 𝒙𝟐 − 𝟓
(𝟐) = 𝟒 − 𝟓 = −𝟏
P a g e | 70
(𝟑) = 𝟗 − 𝟓 = 𝟒
So the root lies in [2,3]
First iteration
𝟐+𝟑
𝒙𝟏 =
𝟐
= 𝟐. 𝟓
Now, 𝑥1 ) = 2.52 − 5 = 1.25
Then, ((𝑥1 ) 2) < 0
So, the root lies [2,2.5]
1 2 3 2.5 −1 4 1.25
Now, if h is the sufficiently small, we may neglected the terms containing 2nd and higher
power of h and get simple relation,
𝑓 ′ (𝑥0 )
𝑓(𝑥0 ) + ℎ =0
1!
𝑓(𝑥0 )
⇒ ℎ=−
𝑓′ (𝑥0 )
Here, 𝑓 ′ (𝑥0 ) ≠ 0.
Putting the value of h in (1) we get that
𝑥 = 𝑥0 + ℎ
𝑓 (𝑥0 )
⇒ 𝑥 = 𝑥0 −
𝑓 ′ (𝑥0 )
Successive approximation are given by 𝑥0 , 𝑥1 , 𝑥2 , … … 𝑥𝑛+1
Similarly,
𝑓(𝑥0 )
⇒ 𝑥1 = 𝑥0 −
𝑓 ′ (𝑥0 )
𝑓(𝑥0 )
⇒ 𝑥2 = 𝑥1 −
𝑓 ′ (𝑥0 )
…………………………………
…………………………………
𝑓 (𝑥𝑛 )
⇒ 𝑥𝑛+1 = 𝑥𝑛 −
𝑓 ′ (𝑥𝑛 )
Which is known as the Newton-Raphson Method formula.
P a g e | 72
𝑦 = 𝑓(𝑥)
𝑦
𝑓(𝑥0 )
𝑓(𝑥1 )
𝑓(𝑥2 )
𝑥
𝑥2 𝑥1 𝑥0
Question 1:
Here, 𝑓(𝑥) = 𝑥 4 − 𝑥 − 10
∴ 𝑓 ′ (𝑥) = 4𝑥 3 − 1
By using Newton-Rapson method,
𝑓 (𝑥𝑛 ) 𝑥𝑛 4 − 𝑥𝑛 − 10 3𝑥𝑛 4 + 10
𝑥𝑛+1= 𝑥𝑛 – ′ = 𝑥𝑛 – =
𝑓 (𝑥𝑛 ) 4𝑥𝑛 3 − 1 4𝑥𝑛 3 − 1
The approximate value of the root is given to be 2. Taking, 𝑥0 = 2 , we get
P a g e | 73
3𝑥0 4 + 10 3.24 + 10
𝑥1 = = = 1.871
4𝑥0 3 − 1 4.23 − 1
3𝑥1 4 + 10 3. (1.871)4 + 10
𝑥2 = = = 1.856
4𝑥1 3 − 1 4. (1.871)2 − 1
3𝑥2 4 + 10 3. (1.856 )4 + 10
𝑥3 = = = 1.856
4𝑥2 3 − 1 4. (1.856 )3 − 1
Question 2:
By using Newton- Raphson method, find the root √12 to five place of decimal.
Solution:
Question 3:
By using Newton- Raphson method, Solve the equation 3𝑥 − cos 𝑥 − 1 =
0, which is nearer to x = 2.
Solution:
P a g e | 74
Question 4:
By using Newton- Raphson method, find the root 𝑥 3 − 3x − 5 =
0, which is nearer to 𝑥0 = 3.
Solution:
Here, 𝑓(𝑥) = 𝑥 3 − 3𝑥 − 5
∴ 𝑓 ′ (𝑥) = 3𝑥 2 − 3
By using Newton-Rapson method,
𝑓(𝑥𝑛 ) 𝑥𝑛 3 − 3𝑥𝑛 − 5 2𝑥𝑛 3 + 5
𝑥𝑛+1= 𝑥𝑛 – ′ = 𝑥𝑛 – =
𝑓 (𝑥𝑛 ) 3𝑥𝑛 2 − 3 3𝑥𝑛 2 − 3
The approximate value of the root is given to be 3. Taking, 𝑥0 = 3 , we get
2𝑥0 3 + 5 2.33 + 5
𝑥1 = = = 2.4583
3𝑥0 2 − 3 3.32 − 3
2𝑥1 3 + 5 2. (2.4583)3 + 5
𝑥2 = = = 2.2943
3𝑥1 2 − 3 3. (2.4583)2 − 3
2𝑥2 3 + 5 2. (2.2943)3 + 5
𝑥3 = = = 2.2791
3𝑥2 2 − 3 3. (2.2943)2 − 3
Question 5: Find the real root of the equation −4𝑥 + 𝑐𝑜𝑠𝑥 + 2 = 0 , by Newton-Rapshon
method up to four decimal places.
Solution:
𝑓 ′ (𝑥) = −4 − 𝑠𝑖𝑛𝑥
f(0)= -4(0)+cos0+2=3 ˃ 0
Now,
(0 + 1)
𝑥0 = = 0.5
2
First approximation:
𝑓(𝑥0 )
𝑥1 = 𝑥0 − = 0.7494
𝑓′(𝑥0 )
Second approximation:
𝑓(𝑥1 )
𝑥2 = 𝑥1 − = 0.7499
𝑓 ′ (𝑥1 )
Third approximation:
𝑓(𝑥2 )
𝑥3 = 𝑥2 − = 0.7499
𝑓′(𝑥2 )
Now 0.7499 is the root of the given equation correct to the three decimal places.
This is the method for finding the real root of an equation and closely resembles the bisection
method. In this method, we choose two points 𝑥1 and 𝑥2 such that 𝑓(𝑥1 ) and 𝑓(𝑥2 ) are of
opposite signs. Since the graph of 𝑦 = 𝑓(𝑥) crosses the 𝑥 axis between these two points, a
root must lie in between these two points.
P a g e | 76
𝑓(𝑥)
[𝑥1 , 𝑓(𝑥1 )]
𝑦 = 𝑓(𝑥)
𝑥2
𝑥
𝑥1
[𝑥2 , 𝑓(𝑥2 )]
Now the equation of the chord joining the two points [𝑥1 , 𝑓 (𝑥1 )] and [𝑥2 , 𝑓 (𝑥2 )] is
𝑦 − 𝑓(𝑥1 ) 𝑓(𝑥2 ) − 𝑓(𝑥1 )
= … … … … … … … … … (1)
𝑥 − 𝑥1 𝑥2 − 𝑥1
The method consist in replacing the part of the curve between the points [𝑥1 , 𝑓 (𝑥1 )] and
[𝑥2 , 𝑓 (𝑥2 )] by means of the chord joining these points and taking the point of intersection of
the chord with the axis as an approximation to the root.
The point of intersection in the present case giving by putting 𝑦 = 0 in (1).
Thus we obtain,
P a g e | 77
𝑓(𝑥1 )
x = 𝑥1 − (𝑥 − 𝑥1 )
𝑓(𝑥2 ) − 𝑓(𝑥1 ) 2
Hence the first approximation to the root 𝑓(𝑥) = 0 is giving by
𝑓 (𝑥1 )
𝑥3 = 𝑥1 − (𝑥 − 𝑥1 ) … … … … … … … (2)
𝑓(𝑥2 ) − 𝑓(𝑥1 ) 2
If now 𝑓(𝑥3 ) and 𝑓(𝑥1 ) are at opposite signs, then the roots lies between 𝑥1 and 𝑥3 and we
replace 𝑥2 by 𝑥3 in (2) and obtain the nextr approximation. Otherwise we replace 𝑥2 by 𝑥3
and generate the next approximation.
Question 1:
Find a real root of wallis’s(1685) equation 𝑓(𝑥) = 𝑥 3 − 2𝑥 − 5 = 0
Solution: We observe that,
𝑓(2) = −1 𝑎𝑛𝑑 𝑓(3) = 16
Hence a root lies between 2 and 3 .we have,
𝑓(𝑥1 )
𝑥 = 𝑥1 − (𝑥2 -𝑥1 ) …………………..(1)
𝑓(𝑥2 )−𝑓(𝑥1 )
−1
=2− (3 − 2) = 2.059
16+1
i.e 𝑥3 = 2.059
Now 𝑓(𝑥3 ) = −0.38 𝑎𝑛𝑑 ℎ𝑒𝑛𝑐𝑒 𝑡ℎ𝑒 𝑟𝑜𝑜𝑡 𝑙𝑖𝑒𝑠 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 2.059 𝑎𝑛𝑑 3.0
Using equation (1) again,
0.386
𝑥4 = 2.059 + (3 − 2.059)
16.386
Repeating the process ,we obtain successfully
𝑥5 = 2.0904, 𝑥6 = 2.0934 𝑒𝑡𝑐.
The correct value is 2.0943, so 𝑥6 is correct to two decimal places.