G 9 Math 3209 SecA
G 9 Math 3209 SecA
Submitted To:
Prof. Dr. Munnujahan Ara
Professor
Mathematics Discipline
Khulna University
Submitted By:
Md. Nahid Anam – 201208
Shovon Mondal – 201237
Ruqaiya Binta Mahtab – 201250
Samiha Tabassum – 201259
Tahmid Mahmud Shahriar (Retake) – 171256
3rd Year, 2nd Term
Mathematics Discipline
Khulna University
CONTENTS
Page -1
Numerical Analysis (Group-9)
Operator 𝛁: Let 𝑦 = 𝑓(𝑥) be any function of 𝑥. ∇𝑓(𝑎) means the backward difference of the
function 𝑓(𝑥) at 𝑥 = 𝑎.
∇𝑓(𝑎) = 𝑓(𝑎) − 𝑓(𝑎 − ℎ)
Where, h is the increment.
MATHEMATICAL PROBLEMS
Page -2
Numerical Analysis (Group-9)
Question-4: Define kth order difference of a function f(x) also Prove that,
𝒌
𝒌
∆ 𝒇(𝒙) = ∑(−𝟏)𝒊 ( ) 𝒇[𝒙 + (𝒌 − 𝒊)𝒉]
𝒌
𝒊
𝒊=𝟎
Solution:
From definition of shifting operator, we have,
𝐸𝑓(𝑥) = 𝑓(𝑥 + ℎ)
Where h is the increment.
Now,
Δ𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥)
Δ𝑓(𝑥) = 𝐸𝑓(𝑥) − 𝑓(𝑥)
Δ𝑓(𝑥) = (𝐸 − 1)𝑓(𝑥)
Again,
Δ2 𝑓(𝑥) = Δ{Δ𝑓(𝑥)}
= Δ{𝑓(𝑥 + ℎ) − 𝑓(𝑥)}
= Δ𝑓(𝑥 + ℎ) − Δ𝑓(𝑥)
= 𝑓(𝑥 + ℎ + ℎ) − 𝑓(𝑥 + ℎ) − {𝑓(𝑥 + ℎ) − 𝑓(𝑥)}
= 𝑓(𝑥 + 2ℎ) − 2𝑓(𝑥 + ℎ) + 𝑓(𝑥)
= 𝐸 2 𝑓(𝑥) − 2𝐸𝑓(𝑥) + 𝑓(𝑥)
= (𝐸 2 − 2𝐸 + 1)𝑓(𝑥)
= (𝐸 − 1)2 𝑓(𝑥)
Page -3
Numerical Analysis (Group-9)
Question-5: If h is very small Prove that, ∆𝒏+𝟏 𝒇(𝒙𝟎 ) = 𝒉𝒏+𝟏 𝒇𝒏+𝟏 (𝒙𝟎 )
Solution:
Let, 𝑦 = 𝑓(𝑥) and h is a very small increment.
Therefore, 𝑓(𝑥0 ) = 𝑦0 , 𝑓(𝑥0 + ℎ) = 𝑦1
and 𝑦1 − 𝑦0 = ∆𝑦0 = ∆𝑓(𝑥0 )
Now,
𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 )
𝑓 ′ (𝑥0 ) = lim
ℎ→0 ℎ
∆𝑓(𝑥0 )
⇒ lim = 𝑓 ′ (𝑥0 )
ℎ→0 ℎ
⇒ lim ∆𝑓(𝑥0 ) = ℎ𝑓 ′ (𝑥0 )
ℎ→0
⇒ ∆𝑓(𝑥0 ) = ℎ𝑓 ′ (𝑥0 )
Again,
𝑓 ′ (𝑥0 + ℎ) − 𝑓 ′ (𝑥0 )
𝑓 ′′ (𝑥0 ) = lim
ℎ→0 ℎ
∆𝑓(𝑥0 + ℎ) ∆𝑓(𝑥0 )
−
⇒ lim ℎ ℎ = 𝑓 ′′ (𝑥 )
0
ℎ→0 ℎ
∆𝑓(𝑥0 + ℎ) − ∆𝑓(𝑥0 )
⇒ lim = 𝑓 ′′ (𝑥0 )
ℎ→0 ℎ2
∆2 𝑓(𝑥0 )
⇒ lim = 𝑓 ′′ (𝑥0 )
ℎ→0 ℎ2
∴ ∆2 𝑓(𝑥0 ) = ℎ2 𝑓 ′′ (𝑥0 )
….. ….. ….. …..
….. ….. ….. …..
∆𝑛 𝑓(𝑥0 ) = ℎ𝑛 𝑓 𝑛 (𝑥0 )
∴ ∆𝑛+1 𝑓(𝑥0 ) = ℎ𝑛+1 𝑓 𝑛+1 (𝑥0 )
Page -4
Numerical Analysis (Group-9)
Question-7: Show that, 𝒏𝒕𝒉 difference of polynomial of degree 𝒏 is a constant and (𝒏 + 𝟏)𝒕𝒉
difference is zero.
Solution:
let a polynomial of 𝑛𝑡ℎ degree,
𝑓(𝑥) = 𝑎 + 𝑏𝑥 + 𝑐𝑥 2 + ⋯ + 𝑘𝑥 𝑛 𝑊ℎ𝑒𝑟𝑒 𝑘 ≠ 0
We know, Δ𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥)
∴ Δ𝑓(𝑥) = [𝑎 + 𝑏(𝑥 + ℎ) + 𝑐(𝑥 + ℎ)2 + ⋯ + 𝑘(𝑥 + ℎ)𝑛 ] − [𝑎 + 𝑏𝑥 + 𝑐𝑥 2 + ⋯ + 𝑘𝑥 𝑛 ]
= 𝑏ℎ + 𝑐[(𝑥 + ℎ)2 − 𝑥 2 ] + ⋯ + 𝑘[(𝑥 + ℎ)𝑛 − 𝑥 𝑛 ]
= 𝑏ℎ + 𝑐[𝑥 2 + 2𝑥ℎ + ℎ2 − 𝑥 2 ] + ⋯ + 𝑘[(𝑥 𝑛 + 𝑛𝐶 1 𝑥 𝑛−1 ℎ + 𝑛𝐶 2 𝑥 𝑛−2 ℎ2 + ⋯ ) − 𝑥 𝑛 ]
= 𝑏ℎ + 𝑐(2𝑥ℎ + ℎ2 ) + ⋯ + 𝑘(𝑛𝐶 1 𝑥 𝑛−1 ℎ + 𝑛𝐶 2 𝑥 𝑛−2 ℎ2 + ⋯ )
= (𝑏ℎ + 𝑐ℎ2 ) + 2𝑐ℎ𝑥 + ⋯ + 𝑘ℎ2 𝑛𝐶 2 𝑥 𝑛−2 + 𝑘ℎ𝑛𝐶 1 𝑥 𝑛−1
= 𝑎1 + 𝑏1 𝑥 + ⋯ + 𝑘ℎ𝑛𝑥 𝑛−1
Now,
Δ2 𝑓(𝑥) = Δ{Δ𝑓(𝑥)}
= Δ𝑓(𝑥 + ℎ) − Δ𝑓(𝑥)
= [𝑎1 + 𝑏1 (𝑥 + ℎ) + ⋯ + 𝑘ℎ𝑛(𝑥 + ℎ)𝑛−1 ] − [𝑎1 + 𝑏1 𝑥 + ⋯ + 𝑘ℎ𝑛𝑥 𝑛−1 ]
= 𝑏1 (𝑥 + ℎ − 𝑥) + ⋯ + 𝑘ℎ𝑛{(𝑥 + ℎ)𝑛−1 − 𝑥 𝑛−1 }
= 𝑏1 ℎ + ⋯ + 𝑘ℎ𝑛{𝑥 𝑛−1 + (𝑛 − 1)𝐶 1 𝑥 𝑛−2 ℎ + (𝑛 − 1)𝐶 2 𝑥 𝑛−3 ℎ2 + ⋯ − 𝑥 𝑛−1 }
= 𝑏1 ℎ + ⋯ + 𝑘ℎ𝑛{(𝑛 − 1)𝐶 1 𝑥 𝑛−2 ℎ + (𝑛 − 1)𝐶 2 𝑥 𝑛−3 ℎ2 + ⋯ }
= 𝑎2 + 𝑏2 𝑥 + ⋯ + 𝑘ℎ2 𝑛(𝑛 − 1)𝑥 𝑛−2
Similarly,
Δ3 𝑓(𝑥) = 𝑎3 + 𝑏3 𝑥 + ⋯ + 𝑘ℎ3 𝑛(𝑛 − 1)(𝑛 − 2)𝑥 𝑛−3
….. ….. ….. …..
….. ….. ….. …..
Δ𝑛 𝑓(𝑥) = 𝑘ℎ𝑛 𝑛(𝑛 − 1)(𝑛 − 2) … {𝑛 − (𝑛 − 1)}𝑥 𝑛−𝑛
= 𝑘ℎ𝑛 𝑛(𝑛 − 1)(𝑛 − 2) … 1
= 𝑘ℎ𝑛 𝑛!
Which is a constant.
So, (𝑛 + 1)𝑡ℎ difference –
Δ𝑛+1 𝑓(𝑥) = Δ{Δ𝑛 𝑓(𝑥)}
= Δ𝑛 𝑓(𝑥 + ℎ) − Δ𝑛 𝑓(𝑥)
= 𝑘ℎ𝑛 𝑛! − 𝑘ℎ𝑛 𝑛!
=0
Page -5
Numerical Analysis (Group-9)
= 𝑛ℎ Δ𝑥 𝑛−1
= 𝑛ℎ{(𝑛 − 1)ℎ𝑥 𝑛−2 } [∵ Δ𝑥 𝑛 = 𝑛ℎ𝑥 𝑛−1 ]
= 𝑛(𝑛 − 1)ℎ2 𝑥 𝑛−2
….. ….. ….. …..
….. ….. ….. …..
Δ𝑛 𝑥 𝑛 = 𝑛(𝑛 − 1) … 2.1ℎ𝑛 𝑥 𝑛−𝑛
= 𝑛! ℎ𝑛
and,
Δ𝑛+1 𝑥 𝑛 = Δ{Δ𝑛 𝑥 𝑛 }
= Δ𝑛 (𝑥 + ℎ)𝑛 − Δ𝑛 𝑥 𝑛
= 𝑛! ℎ𝑛 − 𝑛! ℎ𝑛
=0
Difference Table
Forward difference:
Let 𝑦 = 𝑓(𝑥) be any function of 𝑥. h is the equal interval of 𝑥.
𝑥0 , 𝑥1 = (𝑥0 + ℎ), 𝑥2 = (𝑥0 + 2ℎ) … are the values of 𝑥
𝑦0 = 𝑓(𝑥0 ), 𝑦1 = 𝑓(𝑥0 + ℎ), 𝑦2 = 𝑓(𝑥0 + 2ℎ) … are the corresponding values of y.
Δ𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥)
Δ𝑦𝑛 = 𝑦𝑛+1 − 𝑦𝑛
Δ2 𝑦𝑛 = Δ𝑦𝑛+1 − Δ𝑦𝑛
….. ….. ….. …..
….. ….. ….. …..
1. Horizontal forward difference table:
𝒙 𝒚 = 𝒇(𝒙) 𝚫𝒚 𝚫𝟐 𝒚 𝚫𝟑 𝒚 𝚫𝟒 𝒚
𝑥0 𝑦0 Δ𝑦0 Δ2 𝑦0 Δ3 𝑦0 Δ4 𝑦0
𝑥1 𝑦1 Δ𝑦1 Δ2 𝑦1 Δ3 𝑦1
𝑥2 𝑦2 Δ𝑦2 Δ2 𝑦2
𝑥3 𝑦3 Δ𝑦3
𝑥4 𝑦4
Example:
𝒙 𝒚 = 𝒇(𝒙) 𝚫𝒚 𝚫𝟐 𝒚 𝚫𝟑 𝒚 𝚫𝟒 𝒚
0 12 3 2 0 3
1 15 5 2 3
2 20 7 5
3 27 12
4 39
Page -6
Numerical Analysis (Group-9)
Backward difference:
Let 𝑦 = 𝑓(𝑥) be any function of 𝑥. h is the equal interval of 𝑥.
𝑥0 , 𝑥1 = (𝑥0 + ℎ), 𝑥2 = (𝑥0 + 2ℎ) … are the values of 𝑥
𝑦0 = 𝑓(𝑥0 ), 𝑦1 = 𝑓(𝑥0 + ℎ), 𝑦2 = 𝑓(𝑥0 + 2ℎ) … are the corresponding values of y.
∇𝑓(𝑥) = 𝑓(𝑥) − 𝑓(𝑥 − ℎ)
∇𝑦𝑛 = 𝑦𝑛 − 𝑦𝑛−1
∇2 𝑦𝑛 = ∇𝑦𝑛 − ∇𝑦𝑛−1
….. ….. ….. …..
….. ….. ….. …..
1. Horizontal backward difference table:
𝒙 𝒚 = 𝒇(𝒙) 𝛁𝒚 𝛁𝟐𝒚 𝛁𝟑𝒚 𝛁𝟒𝒚
𝑥0 𝑦0
𝑥1 𝑦1 ∇𝑦1
𝑥2 𝑦2 ∇𝑦2 ∇2 𝑦2
𝑥3 𝑦3 ∇𝑦3 ∇2 𝑦3 ∇3 𝑦3
𝑥4 𝑦4 ∇𝑦4 ∇2 𝑦4 ∇3 𝑦4 ∇4 𝑦4
Example:
𝒙 𝒚 = 𝒇(𝒙) 𝛁𝒚 𝛁𝟐𝒚 𝛁𝟑𝒚 𝛁𝟒𝒚
0 12
1 15 3
2 20 5 2
3 27 7 2 0
4 39 12 5 3 3
Divided difference:
Let 𝑦 = 𝑓(𝑥) be any function of 𝑥. 𝑥0 , 𝑥1 , 𝑥2 … are the values of x with unequal interval and
𝑦0 , 𝑦1 , 𝑦2 … are the corresponding values of y.
1𝑠𝑡 Divided difference 𝛿𝑦 –
(𝑦1 − 𝑦0 ) (𝑦0 − 𝑦1 )
𝛿(𝑥1 , 𝑥0 ) = = = 𝛿(𝑥0 , 𝑥1 )
(𝑥1 − 𝑥0 ) (𝑥0 − 𝑥1 )
(𝑦2 − 𝑦1 )
𝛿(𝑥2 , 𝑥1 ) =
(𝑥2 − 𝑥1 )
…… …… …….
…… …… …….
2𝑛𝑑 Divided difference 𝛿 2 𝑦 –
𝛿(𝑥2 , 𝑥1 ) − 𝛿(𝑥1 , 𝑥0 )
𝛿(𝑥2 , 𝑥1 , 𝑥0 ) =
𝑥2 − 𝑥0
𝛿(𝑥3 , 𝑥2 ) − 𝛿(𝑥2 , 𝑥1 )
𝛿(𝑥3 , 𝑥2 , 𝑥1 ) =
𝑥3 − 𝑥1
…… …… …….
…… …… …….
Example:
𝒙 𝒚 = 𝒇(𝒙) 𝛅𝒚 𝛅𝟐 𝒚 𝛅𝟑 𝒚
3 168
120 − 168
= −12
7−3
−24 + 12
7 120 = −2
9−3
72 − 120 5+2
= −24 =1
9−7 10 − 3
−9 + 24
9 72 =5
10 − 7
63 − 72
= −9
10 − 9
10 63
Page -8
Numerical Analysis (Group-9)
Figure: Interpolation
[Note: If 𝑥𝑖 lies outside of (𝑥0 , 𝑥𝑛 ) then the procedure of finding the value of 𝑦(𝑥𝑖 ) is called
extrapolation.]
Let 𝑦 = 𝑓(𝑥) be a function which takes the values 𝑦0 , 𝑦1 , 𝑦2 , 𝑦3 , … … , 𝑦𝑛 for the equidistant values
𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 , … … , 𝑥𝑛 respectively of the independent variable x. Also, Let, ∅(𝒙) be a polynomial
in x of degree n.
∅(𝑥) = 𝑎0 + 𝑎1 (𝑥 − 𝑥0 ) + 𝑎2 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + 𝑎3 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) + ⋯ +
𝑎𝑛 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )+. … + (𝑥 − 𝑥𝑛−1 )…………………… (1)
Where, 𝑎0 , 𝑎1 , 𝑎2, … 𝑎𝑛 are the coefficients.
Consider,(𝑥1 − 𝑥0 ) = ℎ, (𝑥2 − 𝑥0 ) = 2ℎ , (𝑥3 − 𝑥0 ) = 3ℎ … … … (𝑥𝑛 − 𝑥0 ) = 𝑛ℎ
putting (𝒙 = 𝒙𝟎 ) in (1) then ∅(𝒙𝟎 ) = 𝒚𝟎
∅(𝑥0 ) = 𝑎0
⇒ 𝑦0 = 𝑎
putting (𝒙 = 𝒙𝟏 ) and ∅(𝒙𝟏 ) = 𝒚𝟏 in (1),
∅(𝑥1 ) = 𝑎0 + 𝑎1 (𝑥1 − 𝑥0 )
⇒ 𝑦1 = 𝑦0 + 𝑎1 . ℎ
𝑦1 − 𝑦0
⇒ 𝑎1 =
ℎ
∆𝑦0 ∆𝑦0
⇒ 𝑎1 = =
ℎ 1! ℎ
Page -9
Numerical Analysis (Group-9)
Page -10
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
Question-1: Find 𝒇(𝟏𝟓) from the following table using Newton's Forward interpolation
formula.
𝒙: 10 20 30 40
𝒚: 9 39 74 116
Solution:
Newton forward difference table –
x y Δy Δ2 y Δ3 y
10 9 30 5 2
20 39 35 7
30 74 42
40 116
Page -11
Numerical Analysis (Group-9)
Question-2: Find a polynomial 𝒇(𝒙) from the following table using Newton's Forward
interpolation formula. Then find 𝒇(𝟏𝟓) using this polynomial.
𝒙: 10 20 30 40
𝒚: 9 39 74 116
Solution:
Newton forward difference table –
x y Δy Δ2 y Δ3 y
10 9 30 5 2
20 39 35 7
30 74 42
40 116
𝑥3 𝑥2 157𝑥
∴ 𝑓(𝑥) = + + − 18
3000 200 60
153 152 157
𝑓(15) = + + × 15 − 18
3000 200 60
47
=
2
= 23.5
Page -12
Numerical Analysis (Group-9)
Let 𝑦 = 𝑓(𝑥) be a function which takes the values 𝑦0 , 𝑦1 , 𝑦2 , 𝑦3 , … … , 𝑦𝑛 for the equidistant
values 𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 , … … , 𝑥𝑛 respectively of the independent variable x. Also, Let ∅(𝑥) be a
polynomial in x of degree n,
∅(𝑥) = 𝑎0 + 𝑎1 (𝑥 − 𝑥𝑛 ) + 𝑎2 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 ) + 𝑎3 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 )(𝑥 − 𝑥𝑛−2 ) +
⋯ + 𝑎𝑛 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 )(𝑥 − 𝑥𝑛−2 ) + ⋯ + (𝑥 − 𝑥1 ………………… (1)
Where, 𝑎0 , 𝑎1 , 𝑎2, … 𝑎𝑛 are the coefficients.
Consider,(𝑥𝑛 − 𝑥𝑛−1 ) = ℎ, (𝑥𝑛 − 𝑥𝑛−2 ) = 2ℎ , (𝑥𝑛 − 𝑥𝑛−3 ) = 3ℎ … … … & so on
Page -13
Numerical Analysis (Group-9)
𝑥 − 𝑥𝑛
Let, =𝑢
ℎ
⇒ 𝑥 = 𝑥𝑛 + ℎ𝑢
𝑥 − 𝑥𝑛−1 𝑥 − (𝑥𝑛 − ℎ) 𝑥 − 𝑥𝑛 ℎ
∴ = = + =𝑢+1
ℎ ℎ ℎ ℎ
And,
𝑥 − 𝑥𝑛−2 𝑥 − (𝑥𝑛 − 2ℎ) 𝑥 − 𝑥𝑛 2ℎ
= = + =𝑢+2
ℎ ℎ ℎ ℎ
……………………………………………….
……………………………………………….
𝑥 − 𝑥1 𝑥 − (𝑥𝑛 − (𝑛 − 1)ℎ) 𝑥 − 𝑥𝑛
= = + (𝑛 − 1) = 𝑢 + (𝑛 − 1)
ℎ ℎ ℎ
Substituting these values in (2), We get,
𝑢(𝑢 + 1) 2 𝑢(𝑢 + 1)(𝑢 + 2) 3
∅(𝑥) = 𝑦𝑛 + 𝑢∇𝑦𝑛 + ∇ 𝑦𝑛 + ∇ 𝑦𝑛 + ⋯
2! 3!
𝑢(𝑢 + 1)(𝑢 + 2) … . (𝑢 + 𝑛 − 1) 𝑛
+ ∇ 𝑦𝑛
𝑛!
This is known as Newton-Gregory’s formula for backward interpolation with equal intervals.
MATHEMATICAL PROBLEMS
Page -14
Numerical Analysis (Group-9)
(−0.6)(−0.6 + 1)
= 0.8660 + (−0.6) × 0.0468 + (−0.0064)
2
(−0.6)(−0.6 + 1)(−0.6 + 2)
+ × (−0.0057)
6
= 0.83872 (approximately)
Question-2: Compute 𝒇(𝟑. 𝟐) from the following table, using Newton's Backward difference
formula.
𝒙 0 1 2 3
𝒚 1 2 11 34
Solution:
Newton's backward difference table:
𝑥 𝑦 𝛻𝑦 𝛻2𝑦 𝛻3𝑦
0 1
1 2 1
2 11 9 8
3 34 23 14 6
The value of 𝑦 at 𝑥 = 3.2,
ℎ = 𝑥1 − 𝑥0 = 1 − 0 = 1
𝑥 − 𝑥𝑛 3.2 − 3
𝑢= = = 0.2
ℎ 1
Newton's backward difference interpolation formula is –
𝑢(𝑢 + 1) 2 𝑢(𝑢 + 1)(𝑢 + 2) 3
𝑦 = 𝑦𝑛 + 𝑢𝛻𝑦𝑛 + 𝛻 𝑦𝑛 + 𝛻 𝑦𝑛
2! 3!
0.2(0.2 + 1) 0.2(0.2 + 1)(0.2 + 2)
⇒ 𝑦 = 34 + 0.2 × 23 + × 14 + ×6
2 6
⇒ 𝑦 = 34 + 4.6 + 1.68 + 0.528
⇒ 𝑦 = 40.808
Page -15
Numerical Analysis (Group-9)
Let 𝑦 = 𝑓(𝑥) is a function of 𝑥. 𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 are the values of 𝑥 with unequal interval and
𝑦0 , 𝑦1 , 𝑦2 , … , 𝑦𝑛 are the corresponding values of 𝑦.
From the definition of divided difference, we have
𝑦 − 𝑦0
𝛿(𝑥, 𝑥0 ) =
𝑥 − 𝑥0
⇒ 𝑦 = 𝑦0 + (𝑥 − 𝑥0 )𝛿(𝑥, 𝑥0 ) → (𝒊)
2nd divided difference,
𝛿(𝑥, 𝑥0 ) − 𝛿(𝑥0 , 𝑥1 )
𝛿(𝑥, 𝑥0 , 𝑥1 ) =
𝑥 − 𝑥1
⇒ 𝛿(𝑥, 𝑥0 ) = 𝛿(𝑥0 , 𝑥1 ) + (𝑥 − 𝑥1 )𝛿(𝑥, 𝑥0 , 𝑥1 ) → (𝒊𝒊)
Similarly,
𝛿(𝑥, 𝑥0 , 𝑥1 ) = 𝛿(𝑥0 , 𝑥1 , 𝑥2 ) + (𝑥 − 𝑥2 )𝛿(𝑥, 𝑥0 , 𝑥1 , 𝑥2 ) → (𝒊𝒊𝒊)
………………………………………
………………………………………
𝛿(𝑥, 𝑥0 , . . . 𝑥𝑛−1 ) = 𝛿(𝑥0 , 𝑥1 , . . . 𝑥𝑛 ) + (𝑥 − 𝑥𝑛 )𝛿(𝑥, 𝑥0 , 𝑥1 , . . , 𝑥𝑛 ) → (𝒊𝒗)
Multiplying the equation (𝒊𝒊) by (𝑥 − 𝑥0 ) equation (𝒊𝒊𝒊)by (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) and so on and finally
the equation (𝒊𝒗) by (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ). . . (𝑥 − 𝑥𝑛−1 ) and adding to the equation(𝒊) we get,
𝑦 = 𝑦0 + (𝑥 − 𝑥0 )𝛿(𝑥0 , 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝛿(𝑥0 , 𝑥1 , 𝑥2 ) + ⋯ + {(𝑥 − 𝑥0 )(𝑥 − 𝑥1 ). . . (𝑥
− 𝑥𝑛−1 )}𝛿(𝑥0 , 𝑥1 , 𝑥2 , . . . , 𝑥𝑛 )
Which is the required formula for unequal intervals
We can write it as –
𝒚 = 𝒚𝟎 + (𝒙 − 𝒙𝟎 )𝜹𝒚𝟎 + (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 )𝜹𝟐 𝒚𝟎 + ⋯
+ {(𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 ). . . (𝒙 − 𝒙𝒏−𝟏 )}𝜹𝒏 𝒚𝟎
Page -16
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
Question-1: Find the value of 𝒇(𝟑𝟎𝟏) from the following table by using interpolation
formula.
x 300 304 305 307
y 2.4771 2.4829 2.4843 2.4871
Solution:
Divided difference table:
𝒙 𝒚 𝜹𝒚 𝜹𝟐 𝒚 𝜹𝟑 𝒚
300 2.4771
2.4829 − 2.4771
304 − 300
= 0.00145
0.0014 − 0.00145
304 2.4829 305 − 300
= −0.00001
0.0014 − 0.0014
305 2.4843 307 − 304
=0
2.4871 − 2.4843
307 − 305
= 0.0014
307 2.4871
Page -17
Numerical Analysis (Group-9)
-1 3
−6 − 3
= −9
0 − (−1)
15 − (−9)
0 -6 =6
3 − (−1)
39 − (−6) 41 − 6
= 15 =5
3−0 6 − (−1)
261 − 15 13 − 5
3 39 = 41 =1
6−0 7 − (−1)
822 − 39 132 − 41
= 261 = 13
6−3 7−0
789 − 261
6 822 = 132
7−3
1611 − 822
= 789
7−6
7 1611
Page -18
Numerical Analysis (Group-9)
Let 𝑦 = 𝑓(𝑥) is a polynomial of degree 𝑛. where 𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 are the values of 𝑥 with equal or
unequal interval and 𝑦0 , 𝑦1 , 𝑦2 , … , 𝑦𝑛 are the corresponding values of 𝑦.
Since (𝑛 + 1)𝑡ℎ difference of 𝑓(𝑥) = 0
Page -19
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
Page -20
Numerical Analysis (Group-9)
2 5
= (𝑥 − 2)(𝑥 − 7) − (𝑥 − 1)(𝑥 − 8)
3 6
1
= [4(𝑥 2 − 9𝑥 + 14) − 5(𝑥 2 − 9𝑥 + 8)]
6
1
= [−𝑥 2 + 9𝑥 + 16]
6
Now,
1
𝑓(6) = [−62 + 9 × 6 + 16] = 5.66
6
For maximum or minimum,
𝑓 ′ (𝑥 ) = 0
⇒ −2𝑥 + 9 = 0
⇒ 𝑥 = 4.5
Taking 2𝑛𝑑 derivative,
𝑓 ′′ (𝑥) = −2
∴ 𝑓 ′′ (4,5) = −2
which is less than zero.
So, 𝑓(𝑥) is maximum at 𝑥 = 4.5
Page -21
Numerical Analysis (Group-9)
Figure: Interpolation
Difference Table
Let 𝑦 = 𝑓(𝑥) be any function of 𝑥. h is the equal interval of 𝑥.
Central value = 𝑥0 and 𝑥−1 = (𝑥0 − ℎ), 𝑥−2 = (𝑥0 − 2ℎ), 𝑥1 = (𝑥0 + ℎ), 𝑥2 = (𝑥0 + 2ℎ) … are
the values of 𝑥. 𝑦0 = 𝑓(𝑥0 ), 𝑦−1 = 𝑓(𝑥0 − ℎ), 𝑦−2 = 𝑓(𝑥0 − 2ℎ), 𝑦1 = 𝑓(𝑥0 + ℎ), 𝑦2 =
𝑓(𝑥0 + 2ℎ) … are the corresponding values of y, then differences : 𝚫𝒚𝒏 = 𝒚𝒏+𝟏 − 𝒚𝒏
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
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
Page -22
Numerical Analysis (Group-9)
Page -23
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
Page -24
Numerical Analysis (Group-9)
Question-2: By using Gauss Forward formula, evaluate 𝒔𝒊𝒏(𝟓𝟕°) from the following table.
𝒙 𝒔𝒊𝒏𝟒𝟓𝟎 𝒔𝒊𝒏𝟓𝟎𝟎 𝒔𝒊𝒏𝟓𝟓𝟎 𝒔𝒊𝒏𝟔𝟎𝟎 𝒔𝒊𝒏𝟔𝟓𝟎
𝒇(𝒙) 0.7071 0.7660 0.8192 0.8660 0.9063
Solution:
Difference table –
𝒙 𝒚 = 𝒇(𝒙) 𝜟𝒇(𝒙) 𝜟𝟐 𝒇(𝒙) 𝜟𝟑 𝒇(𝒙) 𝜟𝟒 𝒇(𝒙)
45 0.7071
0.0589
50 0.7660 -0.0057
0.0532 -0.0007
55 0.8192 -0.0064 0.0006
0.0468 -0.0001
60 0.8660 -0.0065
0.0403
65 0.9063
Here,
ℎ = 50 − 45 = 5 and 𝑥 = 57
Taking 𝑥0 = 55,
𝑥 − 𝑥0 57 − 55
𝑢= = = 0.4
ℎ 5
By Gauss’s Forward Formula
𝑢(𝑢 − 1) 2 𝑢(𝑢2 − 1) 3 𝑢(𝑢2 − 1)(𝑢 − 2) 4
𝑦 = 𝑦0 + 𝑢∆𝑦0 + ∆ 𝑦−1 + ∆ 𝑦−1 + ∆ 𝑦−2
2! 3! 4!
(−0.0064) (−0.0001)
= 0.8192 + (0.4)(0.0468) + (0.4)(0.4 − 1) + (0.4)(0. 42 − 1)
2! 3!
(0.0006)
+ (0.4)(0. 42 − 1)(0.4 − 2)
4!
= (0.8192) + (0.01872) + (0.000768) + (0.0000056) + (0.00001344)
= 0.83870704
Hence the value for 𝑠𝑖𝑛(570 ) is 0.83870704
Page -25
Numerical Analysis (Group-9)
Page -26
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
Question-1: By using Gauss’s backward formula find the population for the year 1936, from
the following table:
Year 1901 1911 1921 1931 1941 1951
Population 12 15 20 27 39 52
(Population In thousands)
Solution:
Take 1931 as the origin and interval = 10,
1936 − 1931
then the population is to be estimated for 1936. So, u = = .5
10
The difference table is given below:
𝒙 𝒚𝒖 ∆𝐲𝐮 ∆𝟐 𝒚𝒖 ∆ 𝟑 𝒚𝒖 ∆ 𝟒 𝒚𝒖 ∆ 𝟓 𝒚𝒖
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
Page -27
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
Question-1: Use Stirling’s formula to find y35 , given y20 =512, y30 =439, y40 =346, y50 =243.
Solution:
For finding 𝑦35 , x0 =30 and h=10
35 − 30
Then u= =.5
10
The difference table is given below:
Page -28
Numerical Analysis (Group-9)
𝒙 𝒚𝒖 ∆𝐲𝐮 ∆ 𝟐 𝒚𝒖 ∆ 𝟑 𝒚𝒖
20 512
-73
30 439 -20
-93 10
40 346 -10
-103
50 243
Stirling’s formula is
y0 + y−1 u 2 2
yu = y0 +u + y−1
2 2!
−93 − 73 (.5)2
yu = 439+ (.5) + (−20)
2 2
yu =439-41.5-2.5=395
Hence the estimated value of y35 is 395.
Question-2: Use Stirling’s formula to find y28 , Given y20 =49225, y25 =48316, y30 =47326, y35
=45926
Solution:
For finding 𝑦28 , x0 =30 and h=5
28 − 30
then, u= = −0.4 .
5
The difference table is given below:
𝒙 𝒚𝒖 ∆𝐲𝐮 ∆ 𝟐 𝒚𝒖 ∆ 𝟑 𝒚𝒖 ∆ 𝟒 𝒚𝒖
20 49225
-909
25 48316 -171
-1080 -59
30 47236 -230 -21
-1310 -80
35 45926 -310
-1620
40 44306
Page -29
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
Question-1: Apply Bessel’s formula to find y25 given y20 =2854, y24 =3162, y28 =3544, y32
=3992,
Solution:
For finding 𝑦25 , x0 =24 and h=4
25 − 24
then, u= = 0.25
4
The difference table is given below:
Page -30
Numerical Analysis (Group-9)
𝒙 𝒚𝒖 ∆𝐲𝐮 ∆ 𝟐 𝒚𝒖 ∆ 𝟑 𝒚𝒖
20 2854
308
24 3162 74
382 -8
28 3544 66
448
32 3992
Bessel’s formula is
1
(u − )u (u − 1)
1 1 u(u − 1) ( y−1 + y0 )
2 2
2
yu = ( y0 + y1 ) + (u − )y0 + + 3 y−1
2 2 2! 2 6
Question-2: Apply Bessel’s formula to find y25 given y20 =24, y24 =32, y28 =35, y32 =40
Solution:
For finding 𝑦25 , x0 =24 and h=4
25 − 24
then, u= = 0.25
4
The difference table is given below:
𝒙 𝒚𝒖 ∆𝐲𝐮 ∆ 𝟐 𝒚𝒖 ∆ 𝟑 𝒚𝒖
20 24
8
24 32 -5
3 7
28 35 2
5
32 40
Bessel’s formula is
1
(u − )u (u − 1)
1 1 u(u − 1) ( 2 y−1 + 2 y0 ) 2
yu = ( y0 + y1 ) + (u − )y0 + + 3 y−1
2 2 2! 2 6
1 1 1 1 1 (−5 + 2) 1 1 1 1 7
yu = (35 + 32) + ( − ) 3 + ( − 1) + ( − ) ( − 1)
2 4 2 4 4 4 4 2 4 4 6
=32.945313
Page -31
Numerical Analysis (Group-9)
NUMERICAL INTEGRATION
For evaluating the definite integral of a function that has no explicit antiderivative or whose
antiderivative is not easy to obtain we use numerical integration. The process of computing the
value of a definite integral from a set of numerical values of the integrand is called numerical
integration.
y
f(x)
a b x
𝑛2 𝑛3 𝑛2 𝛥2 𝑦0 𝑛4 3 2
𝛥3 𝑦0
⇒ 𝐼 = ℎ [𝑛𝑦0 + 𝛥𝑦0 + ( − ) +( −𝑛 +𝑛 ) +. . . ] → (𝒊)
2 3 2 2! 4 3!
Page -32
Numerical Analysis (Group-9)
Putting 𝒏 = 𝟏 in the above equation and neglecting second and higher order differences we
get,
𝑥1
1
∫ 𝑦𝑑𝑥 = ℎ [𝑦0 + Δ𝑦0 ]
𝑥0 2
𝑦1 − 𝑦0
= ℎ [𝑦0 + ]
2
𝑦0 + 𝑦1
= ℎ[ ]
2
Similarly,
𝑥2
𝑦1 + 𝑦2
∫ 𝑦𝑑𝑥 = ℎ [ ]
𝑥1 2
.…… …… ……
…… …… ……
𝑥𝑛
𝑦𝑛−1 + 𝑦𝑛
∫ 𝑦𝑑𝑥 = ℎ [ ]
𝑥𝑛−1 2
Adding these integrals we get,
𝑥0 +𝑛ℎ
1
∫ 𝑦𝑑𝑥 = ℎ [ (𝑦0 + 𝑦𝑛 ) + (𝑦1 + 𝑦2 +. . . . . . . . . . . . . . +𝑦𝑛−1 )]
𝑥0 2
MATHEMATICAL PROBLEMS
𝟓.𝟐
Question-1: Calculate the value of the integral ∫𝟒 𝒍𝒐𝒈𝒙 𝒅𝒙 by Trapezoidal rule. After
finding the actual value of the integral, compute the error.
Solution:
Given, a = 4, b = 5.2
b − a 5.2 − 4
Let n = 6, So, h = = = 0.2
n 6
we divide the whole range of integration into six equal parts. The values of 𝑙𝑜𝑔𝑥 for each point of
sub-division are given below:
𝒙 𝒚 = 𝒍𝒐𝒈𝒆 𝒙
x0 =4.0 y0 =1.3862944
x0 +h=4.2 y1 =1.4350845
x0 +2h=4.4 y2 =1.4816045
x0 +3h=4.6 y3 =1.5260563
x0 +4h=4.8 y4 =1.5686159
x0 +5h=5.0 y5 =1.6094379
x0 +6h=5.2 y6 =1.6486586
By the trapezoidal rule, we have
5.2
h
log xdx
4
e = [ y0 + y6 + 2{ y1 + y2 + y3 + y4 + y5 }]
2
Page -33
Numerical Analysis (Group-9)
2
= [3 034953 + 2 7 6207991]
2
=.1 (18.276551) =1.8276551
5.2
Actual value of log xdx = [ x(log x −1)]
4
e
5.2
4
𝟏.𝟒
Question-2: Find ∫𝟎.𝟐 (𝐬𝐢𝐧 𝒙 − 𝐥𝐨𝐠 𝒆 𝒙 + 𝒆𝒙 )𝒅𝒙 by Trapezoidal rule. After finding the actual
value of the integral, compute the error.
Solution:
Given, a = 0.2, b = 1.4
b − a 1.4 − 0.2
Let n = 12, So, h = = = 0.1
n 12
Values of (sin x − loge x + e x ) for each point of sub-division are given below:
𝒙 𝒔𝒊𝒏 𝒙 𝒍𝒐𝒈𝒆 𝒙 𝒆𝒙 𝒚 = 𝐬𝐢𝐧 𝒙 − 𝐥𝐨𝐠 𝒆 𝒙 + 𝒆𝒙
x0 =.2 .19867 -1.60943 1.22140 3.02950
x0 +h=.3 .29552 -1.20397 1.34986 2.84935
x0 +2h=.4 .38942 -.91629 1.49182 2.79753
x0 +3h=.5 .47943 -.69315 1.64872 2.82130
x0 +4h=.6 .56464 -.51083 2.82212 2.89759
x0 +5h=.7 .64422 -.35667 2.01375 3.01464
x0 +6h=.8 .71736 -.22314 2.22554 3.16604
x0 +7h=.9 .78333 -.10536 2.45960 3.34829
x0 +8h=1.0 .84147 .00000 2.71828 3.55975
x0 +9h=1.1 .89121 .09531 3.00417 3.80007
x0 +10h=1.2 .93204 .18232 3.32012 4.06984
x0 +11h=1.3 .96356 .26236 3.66930 4.37050
x0 +12h=1.4 .98545 .33647 4.05520 4.70418
By the trapezoidal rule, we have
14
h
(sin x − log
02
e x + e x )dx = [ y0 + y12 + 2{ y1 + y2 + y3 + ...... + y11}]
2
0.1
= [7.73368 + 2(36.69481)]
2
=4.05617
14
Actual value of (sin x − log
02
e x + e x )dx = [− cos x − x(loge x − 1) + e x ]1.4
0.2
Page -34
Numerical Analysis (Group-9)
Page -35
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
𝟓.𝟐
Question-1: Calculate the value of the integral ∫𝟒 𝒍𝒐𝒈𝒙 𝒅𝒙 by Simpson’s ‘1/3’ rule. After
finding the actual value of the integral, compute the error.
Solution:
Given, a = 4, b = 5.2
b − a 5.2 − 4
Let n = 6, So, h = = = 0.2
n 6
we divide the whole range of integration into six equal parts. The values of 𝑙𝑜𝑔𝑥 for each point of
sub-division are given below:
𝒙 𝒚 = 𝒍𝒐𝒈𝒆 𝒙
x0 =4.0 y0 =1.3862944
x0 +h=4.2 y1 =1.4350845
x0 +2h=4.4 y2 =1.4816045
x0 +3h=4.6 y3 =1.5260563
x0 +4h=4.8 y4 =1.5686159
x0 +5h=5.0 y5 =1.6094379
x0 +6h=5.2 y6 =1.6486586
1
By the Simpson’s ‘ ’ rule , we have
3
5.2
h
4 log e xdx = 3 [ y0 + y6 + 4( y1 + y3 + y5 ) + 2( y2 + y4 )]
2
= [3 034953 + 18 282315 + 6 1004408]
3
2
= (27.417709) =1.8278472
3
5.2
Actual value of log xdx = [ x(log x −1)]
4
e
5.2
4
𝟏.𝟒
Question-2: Find ∫𝟎.𝟐 (𝐬𝐢𝐧 𝒙 − 𝐥𝐨𝐠 𝒆 𝒙 + 𝒆𝒙 )𝒅𝒙 by Simpson’s ‘1/3’ rule. After finding the
actual value of the integral, compute the error.
Solution:
Given, a = 0.2, b = 1.4
b − a 1.4 − 0.2
Let n = 12, So, h = = = 0.1
n 12
Page -36
Numerical Analysis (Group-9)
Values of (sin x − loge x + e x ) for each point of sub-division are given below:
𝒙 𝒔𝒊𝒏 𝒙 𝒍𝒐𝒈𝒆 𝒙 𝒆𝒙 𝒚 = 𝐬𝐢𝐧 𝒙 − 𝐥𝐨𝐠 𝒆 𝒙 + 𝒆𝒙
x0 =.2 .19867 -1.60943 1.22140 3.02950
x0 +h=.3 .29552 -1.20397 1.34986 2.84935
x0 +2h=.4 .38942 -.91629 1.49182 2.79753
x0 +3h=.5 .47943 -.69315 1.64872 2.82130
x0 +4h=.6 .56464 -.51083 2.82212 2.89759
x0 +5h=.7 .64422 -.35667 2.01375 3.01464
x0 +6h=.8 .71736 -.22314 2.22554 3.16604
x0 +7h=.9 .78333 -.10536 2.45960 3.34829
x0 +8h=1.0 .84147 .00000 2.71828 3.55975
x0 +9h=1.1 .89121 .09531 3.00417 3.80007
x0 +10h=1.2 .93204 .18232 3.32012 4.06984
x0 +11h=1.3 .96356 .26236 3.66930 4.37050
x0 +12h=1.4 .98545 .33647 4.05520 4.70418
1
By the Simpson’s ‘ ’ rule, we have
3
14
h
(sin x − log
2
e x + e x )dx = [ y0 + y12 + 4( y1 + y3 + ... + y11 ) + 2( y2 + y4 + ... + y10 )]
3
.1
= [7.73368 + 4(20.20415) + 2(16.49075)]
3
=4.05160
14
Actual value of (sin x − log
2
e x + e x )dx = [− cos x − x(loge x − 1) + e x ]1.4
.2
𝟑
Question-3: Evaluate ∫−𝟑 𝒙𝟒 𝒅𝒙 by Trapezoidal rule and Simpson’s ‘1/3’ rule, then compare
it with the exact value.
Solution:
Let’s divide the range of integration (-3, 3) into six equal parts.
Here,
𝑎 = −3, 𝑏 = 3 𝑎𝑛𝑑 𝑛 = 6
𝑏−𝑎
ℎ=
𝑛
3 − (−3)
=
6
=1
The values of the function for each point of sub-division are given below:
Page -37
Numerical Analysis (Group-9)
𝒙 𝒚 = 𝒙𝟒
x0 =-3 (−3) 4 = 81
x0 +h=-2 (−2)4 = 16
x0 +2h=-1 (−1) 4 = 1
x0 +3h=0 04 = 0
x0 +4h=1 14 = 1
x0 +5h=2 24 = 16
x0 +6h=3 34 = 81
−3
1
= [162 + 2 34] = 115
2
−3
1
= [162 + 4 32 + 2 2]
3
=98
Exact value,
3
3
x5 1
−3 x dx = 5 = 5 [(3) − (−3) ] =97.2
4 5 5
−3
In this case we observe that the Trapezoidal rule does not give an accurate result. In general,
Simpson’s rule gives a better result than the Trapezoidal rule.
Page -38
Numerical Analysis (Group-9)
Page -39
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
Question-1: Find the area between 𝒙 = [𝟏. 𝟒, 𝟐. 𝟐] and 𝒇(𝒙) from the following data by using
𝟑
Simpson’s 𝟖 rule.
𝒙 𝒇(𝒙)
1.4 4.0552
1.6 4.9530
1.8 6.0436
2.0 7.3891
2.2 9.0250
Solution:
Given data table for 𝑥 and 𝑦:
𝑥 1.4 1.6 1.8 2 2.2
𝑦 4.0552 4.9530 6.0436 7.3891 9.0250
9.025
7.3891
6.0436
4.953
4.0552
3
Using Simpson’s 8 rule
2.2 3ℎ
∫1.4 𝑦 𝑑𝑥 = [(𝑦0 + 𝑦4 ) + 3(𝑦1 + 𝑦2 ) + 2(𝑦3 )]
8
3×0.2
= [(4.0552+9.0250)+ 3×(4.9530 + 6.0436) + 2×(7.3891)]
8
= 4.5636
So, area is = 4.5636
𝟓.𝟐
Question-2: Compute the integral ∫𝟒 𝒍𝒐𝒈 𝒙 𝒅𝒙 by Simpson’s ‘3/8’rule and also find its
error.
Solution:
Let’s divide the range of integration 4,5.2 into 6 equal parts.
Here,
𝑎 = 4, 𝑏 = 5.2 and 𝑛 = 6
5.2 − 4
So, h = = 0.2
6
Page -40
Numerical Analysis (Group-9)
The values of log x for each point of subdivision are given below:
𝒙 𝒚 = 𝒍𝒐𝒈𝒆 𝒙
x0 =4.0 y0 =1.3862944
x0 +h=4.2 y1 =1.4350845
x0 +2h=4.4 y2 =1.4816045
x0 +3h=4.6 y3 =1.5260563
x0 +4h=4.8 y4 =1.5686159
x0 +5h=5.0 y5 =1.6094379
x0 +6h=5.2 y6 =1.6486586
3h
y0 + y6 + 3( y1 + y2 + y4 + y5 ) + 2 y3
5.2
log xdx =
4 8
=
3(0.2)
3.034953 + 18.284228 + 3.0521126
3
0.6
= 24.371294
3
= 1.827847
log xdx = x(log x − 1)4
5.2
5.2
Actual value of
4
= 1.8278475
Difference between actual and numerical value = | 1.8278475 − 1.8278472 | = 0.0000003
Page -41
Numerical Analysis (Group-9)
The value for Romberg’s Method of integration can be arranged in a lower triangular matrix:
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)
𝑹𝒌,𝟏 is always determined by the trapezoid method with a partition size of 𝟐𝒌−𝟏
ℎ1 (𝑏 − 𝑎)
𝑅1,1 = [𝑓(𝑎) + 𝑓(𝑏)] = [𝑓(𝑎) + 𝑓(𝑏)]
2 2
ℎ2
𝑅2,1 = [𝑓(𝑎) + 𝑓(𝑏) + 2𝑓(𝑎 + ℎ2 )]
2
(𝑏 − 𝑎) (𝑏 − 𝑎) 1
= [𝑓(𝑎) + 𝑓(𝑏) + 2𝑓 (𝑎 + )] = [𝑅1,1 + ℎ1 𝑓(𝑎 + ℎ2 )]
4 2 2
1
𝑅3,1 = {𝑅2,1 + ℎ2 [𝑓(𝑎 + ℎ3 ) + 𝑓(𝑎 + 3ℎ3 )]}
2
……… ………. ………. ……….
……… ………. ………. ……….
2𝑘−2
1
𝑅𝑘,1 = [𝑅𝑘−1,1 + ℎ𝑘−1 ∑ 𝑓(𝑎 + (2𝑖 − 1)ℎ𝑘 )]
2
𝑖=1
𝑹𝒌,𝒋 can be determined by the following formula –
4𝑗−1 𝑅(𝑘, 𝑗 − 1) − 𝑅(𝑘 − 1, 𝑗 − 1)
𝑅𝑘,𝑗 = ; 𝑊ℎ𝑒𝑟𝑒 𝑘, 𝑗 = 2,3,4, …
4𝑗−1 − 1
Page -42
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
𝝅
Question-1: Use Romberg Integration to evaluate ∫𝟎 𝒇(𝒙) 𝒅𝒙 where 𝒇(𝒙) = 𝐬𝐢𝐧 𝒙. Let 𝒏 = 𝟑
Solution:
Here,
𝑎 = 0, 𝑏 = 𝜋
(𝑏−𝑎)
we know, ℎ𝑘 = 2𝑘−1
𝜋−0
If 𝑛 = 1 then ℎ1 = =𝜋
1
ℎ1
𝑅1,1 = [𝑓(𝑎) + 𝑓(𝑏)]
2
𝜋
= [sin 0 + sin 𝜋] = 0
2
𝜋−0 𝜋
If 𝑛 = 2 then ℎ2 = =
2 2
ℎ2
𝑅2,1 = [𝑓(𝑎) + 𝑓(𝑏) + 2𝑓(𝑎 + ℎ2 )]
2
𝜋 𝜋
= [sin 0 + sin 𝜋 + 2 sin ( )] = 1.5708
4 2
𝜋−0 𝜋
If 𝑛 = 3 then ℎ3 = =
4 4
ℎ3
𝑅3,1 = [𝑓(𝑎) + 𝑓(𝑏) + 2{𝑓(𝑎 + ℎ3 ) + 𝑓(𝑎 + 2ℎ3 ) + 𝑓(𝑎 + 3ℎ3 )}
2
𝜋 𝜋 𝜋 3𝜋
= [sin 0 + 2 sin ( ) + 2 sin ( ) + 2 sin ( ) + sin 𝜋] = 1.8961
8 4 2 4
Now, we can determine 𝑅𝑘,𝑗 by formula,
4𝑗−1 𝑅(𝑘, 𝑗 − 1) − 𝑅(𝑘 − 1, 𝑗 − 1)
𝑅𝑘,𝑗 =
4𝑗−1 − 1
4𝑅2,1 − 𝑅1,1
𝑅2,2 = = 2.0944
3
4𝑅3,1 − 𝑅2,1
𝑅3,2 = = 2.0046
3
16𝑅3,2 − 𝑅2,2
𝑅3,3 = = 1.9986
15
𝜋
So, ∫0 𝑠𝑖𝑛𝑥 𝑑𝑥 ≈ 𝑅3,3 = 1.9986
𝟏
Question-2: Use Romberg Integration to evaluate 𝑹𝟑,𝟑 for ∫𝟎 𝒙𝟐 𝒆−𝒙 𝒅𝒙
Solution:
Here,
𝑎 = 0, 𝑏 = 1
𝑓(𝑥) = 𝑥 2 𝑒 −𝑥
(𝑏−𝑎)
we know, ℎ𝑘 = 2𝑘−1
Page -43
Numerical Analysis (Group-9)
1−0
If 𝑘 = 1 then ℎ1 = =1
1
1−0
𝑘 = 2 then ℎ2 = = 0.5
2
1−0
𝑘 = 3 then ℎ3 = = 0.25
4
ℎ1
𝑅1,1 = [𝑓(𝑎) + 𝑓(𝑏)]
2
1
= [𝑓(0) + 𝑓(1)]
2
= 0.1839
ℎ2
𝑅2,1 = [𝑓(𝑎) + 𝑓(𝑏) + 2𝑓(𝑎 + ℎ2 )]
2
0.5
= [𝑓(0) + 𝑓(1) + 2𝑓(0.5)]
2
= 0.1678
ℎ3
𝑅3,1 = [𝑓(𝑎) + 𝑓(𝑏) + 2{𝑓(𝑎 + ℎ3 ) + 𝑓(𝑎 + 2ℎ3 ) + 𝑓(𝑎 + 3ℎ3 )}]
2
0.25
= [𝑓(0) + 𝑓(1) + 2{𝑓(0.25) + 𝑓(0.5) + 𝑓(0.75)}]
2
= 0.1625
Now, we can determine 𝑅𝑘,𝑗 by formula,
4𝑗−1 𝑅(𝑘, 𝑗 − 1) − 𝑅(𝑘 − 1, 𝑗 − 1)
𝑅𝑘,𝑗 =
4𝑗−1 − 1
4𝑅2,1 − 𝑅1,1
𝑅2,2 = = 0.1624
3
4𝑅3,1 − 𝑅2,1
𝑅3,2 = = 0.1607
3
16𝑅3,2 − 𝑅2,2
𝑅3,3 = = 0.1606
15
1
So ∫0 𝑥 2 𝑒 −𝑥 𝑑𝑥 ≈ 𝑅3,3 = 0.1606
Page -44
Numerical Analysis (Group-9)
SOLUTION OF EQUATIONS
Suppose, 𝑓(𝑥) = 0 is a equation which may be algebraic or transcendental or combination of both.
Finding roots of 𝑓(𝑥) = 0 means find the values of 𝑥 for which 𝑓(𝑥) = 0. So, 𝑥 = 𝑎 is a root of
the equation 𝑓(𝑥) = 0 if and only if 𝑓(𝑎) = 0. But if 𝑥 = 𝑎 is a numerical solution of 𝑓(𝑥) = 0
after some iteration then 𝑓(𝑎) may be equal to zero or approximately zero.
Bisection Method:
If 𝑓(𝑥) is continuous in the interval (𝑎, 𝑏) such that 𝑓(𝑎) and 𝑓(𝑏) are of opposite signs, then
𝑓(𝑎). 𝑓(𝑏) < 0
𝑓(𝑏)
𝑎 𝑥2
𝑥1 𝑏
𝑓(𝑎)
Let 𝑓(𝑎) = −𝑣𝑒 and 𝑓(𝑏) = +𝑣𝑒. So, 𝑓(𝑥) crosses the 𝑥 axis between 𝑎 and 𝑏 then the first
approximation to the root is,
1
𝑥1 = (𝑎 + 𝑏)
2
Now, three cases can happen-
1. 𝑓(𝑥1 ) = 0, then 𝑥1 is the root of 𝑓(𝑥) = 0
2. 𝑓(𝑥1 ) < 0, then root lies between 𝑥1 and 𝑏
3. 𝑓(𝑥1 ) > 0, then root lies between 𝑎 and 𝑥1
Page -45
Numerical Analysis (Group-9)
1
𝑥3 = (𝑥 + 𝑥1 )
2 2
…. ….. ….. …. ….. …..
…. ….. ….. …. ….. …..
This process continues till 𝑓(𝑥𝑛 ) = 0 or approximately 0 then, 𝑥𝑛 is the root.
MATHEMATICAL PROBLEMS
Question-1: Find the root of the following polynomial function using the Bisection method:
𝒙𝟑 − 𝟒𝒙 − 𝟗.
Solution:
Let, 𝑓(𝑥) = 𝑥 3 − 4𝑥 − 9
𝑓(2) = 8 − 8 − 9 = −9
𝑓(3) = 27 − 12 − 9 = 6
So, the root lies in [2,3]
First iteration:
2+3
𝑥1 = = 2.5
2
Now, 𝑓(𝑥1 ) = 2.53 − 4(2.5) − 9 = −3.375
Then, 𝑓(𝑥1 ). 𝑓(3) < 0
So, the root lies in [2.5, 3]
Second iteration:
2.5 + 3
𝑥2 = = 2.75
2
Now, 𝑓(𝑥2 ) = (2.75)3 − 4(2.75) − 9 = 0.7969
Then, 𝑓(2.5). 𝑓(𝑥2 ) < 0
So, the root lies in [2.5, 2.75]
Hence we can make the following iteration table:
Iterations 𝒂 𝒃 𝒙𝒏 𝒇(𝒂) 𝒇(𝒃) 𝒇(𝒙𝒏 )
1 2 3 2.5 −9 6 −3.375
2 2.5 3 2.75 −3.375 6 0.7969
3 2.5 2.75 2.625 −3.375 0.7969 −1.4121
4 2.625 2.75 2.6875 −1.4121 0.7969 −0.3391
5 2.6875 2.75 2.71875 −0.3391 0.7969 0.2209
6 2.6875 2.71875 2.703125 −0.3391 0.2209 −0.0615
7 2.703125 2.71875 2.7109 0.2209 −0.0615 0.0787
8 2.703125 2.7109 2.707 −0.0615 0.0787 0.00849
Page -46
Numerical Analysis (Group-9)
So, after 6th iteration the root of the equation is 2.2359 (approximately).
Page -47
Numerical Analysis (Group-9)
𝑦 = 𝑓(𝑥)
𝑥𝑛+1 𝑥𝑛
Working Process:
1. Choose two close number 𝑎 and 𝑏 such that 𝑓(𝑎) and 𝑓(𝑏) are opposite signs. then the root
𝑥𝑛 lies between 𝑎 and 𝑏
2. Between 𝑓(𝑎) and 𝑓(𝑏) which is nearer to zero, choose that as initial approximation.
Suppose, 𝑓(𝑏) near to zero then 𝑥0 = 𝑏
3. Apply Newton Raphson formula to find better approximation 𝑥𝑛 . For which 𝑓(𝑥𝑛 ) near to
zero.
Page -48
Numerical Analysis (Group-9)
MATHEMATICAL PROBLEMS
Question-1: Find the root of 𝒙𝟑 − 𝟐𝒙 − 𝟓 = 𝟎. Correct to three decimal places, using Newton
– Raphson method.
Solution:
Let, 𝑓(𝑥) = 𝑥 3 − 2𝑥 − 5
𝑓(2) = 23 − 2 × 2 − 5 = −1
𝑓(2.5) = 2.53 − 2 × 2.5 − 5 = 5.625
Since, 𝑓(2) and 𝑓(2.5) are of opposite sign, the roots lies between 2 and 2.5
let approximate root 𝑥0 = 2
Now,
𝑓 ′ (𝑥) = 3𝑥 2 − 2
Using Newton Raphson method:
𝑓(𝑥0 )
𝑥1 = 𝑥0 −
𝑓 ′ (𝑥0 )
𝑓(2)
=2−
𝑓 ′ (2)
−1
=2−
10
= 2.1
Iteration table:
𝒇(𝒙𝒏 )
Iterations 𝒙𝒏 𝒇(𝒙𝒏 ) 𝒇′(𝒙𝒏 ) 𝒙𝒏+𝟏 = 𝒙𝒏 −
𝒇′(𝒙𝒏 )
1 2 −1 10 2.1
2 2.1 0.061 11.23 2.0945
3 2.0945 −0.00057 11.161 2.0945
So, after 3 iterations Solution is 2.0945
Page -49
Numerical Analysis (Group-9)
Iteration table:
𝒇(𝒙𝒏 )
Iterations 𝒙𝒏 𝒇(𝒙𝒏 ) 𝒇′(𝒙𝒏 ) 𝒙𝒏+𝟏 = 𝒙𝒏 −
𝒇′(𝒙𝒏 )
1 1 −3 -3 0
2 0 1 -5 0.2
3 0.2 0.04 -4.6 0.2087
4 0.2087 0.000055 -4.5826 0.2087
Page -50