0% found this document useful (0 votes)
0 views51 pages

G 9 Math 3209 SecA

This document is an assignment on Numerical Analysis submitted by a group of students to their professor at Khulna University. It includes various topics such as Calculus of Finite Differences, Interpolation, Numerical Integration, and Solution of Equations, along with detailed explanations and mathematical problems. The assignment aims to provide approximate solutions to mathematical problems using numerical techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views51 pages

G 9 Math 3209 SecA

This document is an assignment on Numerical Analysis submitted by a group of students to their professor at Khulna University. It includes various topics such as Calculus of Finite Differences, Interpolation, Numerical Integration, and Solution of Equations, along with detailed explanations and mathematical problems. The assignment aims to provide approximate solutions to mathematical problems using numerical techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

An Assignment on Numerical Analysis (Section A)

Course Title: Numerical Analysis


Course No.: Math – 3209
Group – 9

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

Submission Date: 28-09-2023


Numerical Analysis (Group-9)

CONTENTS

Why we read Numerical Analysis …………………………………………………. 2


CALCULUS OF FINITE DIFFERENCES ……………………………………….. 2-8
The operators 𝐸, Δ 𝑎𝑛𝑑 ∇ …………………………………………………….. 2-6
Difference Table ……………………………………………………………... 6-8
INTERPOLATION WITH EQUAL INTERVAL ………………………………... 9-15
Interpolation ………………………………………………………………….. 9
Newton-Gregory formula for forward interpolation …………………………. 9-12
Newton-Gregory formula for backward interpolation ……………………….. 13-15
INTERPOLATION WITH UNEQUAL INTERVAL ……………………………. 16-21
Newton’s formula for Unequal Intervals/Divided difference ………………... 16-18
Lagrange’s interpolation formula ……………………………………………. 19-21
CENTRAL DIFFERENCE INTERPOLATION …………………………………. 22-31
Difference Table ……………………………………………………………... 22
Gauss’s forward interpolation formula ………………………………………. 23-25
Gauss’s Backward interpolation formula ……………………………………. 26-27
Stirling’s interpolation formula ……………………………………………… 28-29
Bessel’s interpolation formula ……………………………………………….. 30-31
NUMERICAL INTEGRATION …………………………………………………... 32-44
Trapezoidal rule for numerical integration …………………………………... 32-34
Simpson’s ‘1/3’ rule for numerical integration ……………………………… 35-38
Simpson’s ‘3/8’ rule for numerical integration ……………………………… 39-41
Romberg Integration rule …………………………………………………….. 42-44
SOLUTION OF EQUATIONS …………………………………………………….. 45-50
Bisection Method …………………………………………………………….. 45-47
Newton – Raphson Method ………………………………………………….. 48-50

Page -1
Numerical Analysis (Group-9)

Why we read Numerical Analysis:


Numerical mean approximates not exact. So, from numerical analysis we always get approximate
result not actual result. The goal of the field is to design and analysis of techniques to give
approximate but very near of actual solution to a problem.

CALCULUS OF FINITE DIFFERENCES


The operators 𝑬, 𝚫 𝒂𝒏𝒅 𝛁:
Operator E: Let 𝑓(𝑥) be any function of 𝑥. By operating E on 𝑓(𝑥) means an increment to the
value of 𝑥 in the function 𝑓(𝑥).
𝐸𝑓(𝑥) = 𝑓(𝑥 + ℎ)
Where, h is the increment.
[Note: 𝑬−𝟏 𝒇(𝒙) = 𝒇(𝒙 − 𝒉)]

Operator 𝚫: Let 𝑦 = 𝑓(𝑥) be any function of 𝑥. 𝑎, 𝑎 + ℎ, 𝑎 + 2ℎ … are the values of 𝑥 and


𝑓(𝑎), 𝑓(𝑎 + ℎ), 𝑓(𝑎 + 2ℎ) … are the corresponding values of y. Δ𝑓(𝑎) means the forward
difference of the function 𝑓(𝑥) at 𝑥 = 𝑎.
Δ𝑓(𝑎) = 𝑓(𝑎 + ℎ) − 𝑓(𝑎)

Operator 𝛁: Let 𝑦 = 𝑓(𝑥) be any function of 𝑥. ∇𝑓(𝑎) means the backward difference of the
function 𝑓(𝑥) at 𝑥 = 𝑎.
∇𝑓(𝑎) = 𝑓(𝑎) − 𝑓(𝑎 − ℎ)
Where, h is the increment.

MATHEMATICAL PROBLEMS

Question-1: Show that, 𝑬𝒌 𝒇(𝒙) = 𝒇(𝒙 + 𝒌𝒉)


Solution:
We know,
𝐸𝑓(𝑥) = 𝑓(𝑥 + ℎ)
𝐸 2 𝑓(𝑥) = 𝐸{𝐸𝑓(𝑥)}
= 𝐸{𝑓(𝑥 + ℎ)}
= 𝑓(𝑥 + ℎ + ℎ)
= 𝑓(𝑥 + 2ℎ)
Similarly,
𝐸 3 𝑓(𝑥) = 𝑓(𝑥 + 3ℎ)
….. ….. ….. …..
….. ….. ….. …..
𝐸 𝑘 𝑓(𝑥) = 𝑓(𝑥 + 𝑘ℎ)

Question-2: Show that, 𝑬 ≡ 𝟏 + 𝚫


Solution:
Δ𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥)
Δ𝑓(𝑥) = 𝐸𝑓(𝑥) − 𝑓(𝑥)
Δ𝑓(𝑥) = (𝐸 − 1)𝑓(𝑥)
∴ For any function 𝑓(𝑥),
Δ≡𝐸−1
𝐸 ≡ Δ+1

Page -2
Numerical Analysis (Group-9)

Question-3: Show that, 𝚫𝛁 ≡ 𝚫 − 𝛁


Solution:
We know,
Δ𝑓(𝑥) = 𝑓(𝑥 + ℎ) − 𝑓(𝑥) and ∇𝑓(𝑥) = 𝑓(𝑥) − 𝑓(𝑥 − ℎ)
Where, h is the increment.
Now,
Δ∇𝑓(𝑥) = Δ{∇𝑓(𝑥)}
= Δ{𝑓(𝑥) − 𝑓(𝑥 − ℎ)}
= Δ𝑓(𝑥) − Δ𝑓(𝑥 − ℎ)
= {𝑓(𝑥 + ℎ) − 𝑓(𝑥)} − {𝑓(𝑥) − 𝑓(𝑥 − ℎ)}
= Δ𝑓(𝑥) − ∇𝑓(𝑥)
∴ For any function 𝑓(𝑥),
Δ∇≡ Δ − ∇

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 𝑓(𝑥)

∴ Δ𝑘 𝑓(𝑥) = (𝐸 − 1)𝑘 𝑓(𝑥)


𝑘 𝑘 𝑘
= [𝐸 𝑘 − ( ) 𝐸 𝑘−1 + ( ) 𝐸 𝑘−2 − ( ) 𝐸 𝑘−3 + ⋯ + (−1)𝑘 ] 𝑓(𝑥)
1 2 3
𝑘 𝑘 𝑘
= 𝐸 𝑘 𝑓(𝑥) − ( ) 𝐸 𝑘−1 𝑓(𝑥) + ( ) 𝐸 𝑘−2 𝑓(𝑥) − ( ) 𝐸 𝑘−3 𝑓(𝑥) + ⋯ + (−1)𝑘 𝑓(𝑥)
1 2 3
𝑘 𝑘 𝑘
= 𝑓(𝑥 + 𝑘ℎ) − ( ) 𝑓[𝑥 + (𝑘 − 1)ℎ] + ( ) 𝑓[𝑥 + (𝑘 − 2)ℎ] − ( ) 𝑓[𝑥 + (𝑘 − 3)ℎ] + ⋯
1 2 3
+ (−1)𝑘 𝑓(𝑥)
𝑘
𝑘
= ∑(−1)𝑖 ( ) 𝑓[𝑥 + (𝑘 − 𝑖)ℎ]
𝑖
𝑖=0

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 )

Question-6: Show that, 𝟏𝒔𝒕 difference of polynomial of degree n is a polynomial of degree


(𝒏 − 𝟏)
Solution:
Let a polynomial of degree n, 𝑦 = 𝑓(𝑥) = 𝑎𝑥 𝑛 + 𝑏𝑥 𝑛−1 + ⋯ + 𝑘𝑥 + 𝑙 → (𝒊)
If Δ𝑥 = ℎ is the increment then 𝑥1 = 𝑥 + Δ𝑥
∴ 𝑦 + Δ𝑦 = 𝑓(𝑥 + Δ𝑥) = 𝑎(𝑥 + ℎ)𝑛 + 𝑏(𝑥 + ℎ)𝑛−1 + ⋯ + 𝑘(𝑥 + ℎ) + 𝑙 → (𝒊𝒊)

Subtracting (𝑖) from (𝑖𝑖) we get,


Δ𝑦 = 𝑎[(𝑥 + ℎ)𝑛 − 𝑥 𝑛 ] + 𝑏[(𝑥 + ℎ)𝑛−1 − 𝑥 𝑛−1 ] + ⋯ + 𝑘ℎ
= 𝑎[(𝑥 𝑛 + 𝑛𝐶 1 𝑥 𝑛−1 ℎ + ⋯ ) − 𝑥 𝑛 ] + 𝑏[(𝑥 𝑛−1 + (𝑛 − 1)𝐶 1 𝑥 𝑛−2 ℎ + ⋯ ) − 𝑥 𝑛−1 ] + ⋯ + 𝑘ℎ
= 𝑎[𝑛𝐶1 𝑥 𝑛−1 ℎ + ⋯ ] + 𝑏[(𝑛 − 1)𝐶 1 𝑥 𝑛−2 ℎ + ⋯ ] + ⋯ + 𝑘ℎ
= 𝑎′ 𝑥 𝑛−1 + 𝑏 ′ 𝑥 𝑛−1 + ⋯ + 𝑘ℎ
So, 1𝑠𝑡 difference of polynomial of degree n is a polynomial of degree (𝑛 − 1)

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

Question-8: Prove that 𝚫𝒏 𝒙𝒏 = 𝒏! 𝒉𝒏 and 𝚫𝒏+𝟏 𝒙𝒏 = 𝟎


Solution:
let consider, 𝑥 𝑛 = 𝑥(𝑥 − ℎ)(𝑥 − 2ℎ) … {𝑥 − (𝑛 − 1)ℎ} and interval is h.
Δ𝑥 𝑛 = (𝑥 + ℎ)𝑛 − 𝑥 𝑛
= [(𝑥 + ℎ)(𝑥)(𝑥 − ℎ) … {𝑥 + ℎ − (𝑛 − 1)ℎ}] − [𝑥(𝑥 − ℎ)(𝑥 − 2ℎ) … {𝑥 − (𝑛 − 1)ℎ}]
= [(𝑥 + ℎ)𝑥(𝑥 − ℎ) … {𝑥 − (𝑛 − 2)ℎ}] − [𝑥(𝑥 − ℎ)(𝑥 − 2ℎ) … {𝑥 − (𝑛 − 1)ℎ}]
= 𝑥(𝑥 − ℎ) … {𝑥 − (𝑛 − 2)ℎ}[𝑥 + ℎ − {𝑥 − (𝑛 − 1)ℎ}]
= 𝑥(𝑥 − ℎ) … {𝑥 − (𝑛 − 2)ℎ}(𝑥 + ℎ − 𝑥 + 𝑛ℎ − ℎ)
= 𝑥(𝑥 − ℎ) … {𝑥 − (𝑛 − 2)ℎ}𝑛ℎ
= 𝑛ℎ𝑥 𝑛−1
Now,
Δ2 𝑥 𝑛 = Δ{Δ𝑥 𝑛 }
= Δ{𝑛ℎ𝑥 𝑛−1 }

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)

2. Diagonal forward difference table:


𝒙 𝒚 = 𝒇(𝒙) 𝚫𝒚 𝚫𝟐 𝒚 𝚫𝟑 𝒚 𝚫𝟒 𝒚
𝑥0 𝑦0
Δ𝑦0
𝑥1 𝑦1 Δ2 𝑦0
Δ𝑦1 Δ3 𝑦0
𝑥2 𝑦2 Δ2 𝑦1 Δ4 𝑦0
Δ𝑦2 Δ3 𝑦1
𝑥3 𝑦3 Δ2 𝑦2
Δ𝑦3
𝑥4 𝑦4

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

2. Diagonal backward difference table:


𝒙 𝒚 = 𝒇(𝒙) 𝛁𝒚 𝛁𝟐𝒚 𝛁𝟑𝒚 𝛁𝟒𝒚
𝑥0 𝑦0
∇𝑦1
𝑥1 𝑦1 ∇2 𝑦2
∇𝑦2 ∇3 𝑦3
𝑥2 𝑦2 2
∇ 𝑦3 ∇4 𝑦4
∇𝑦3 ∇3 𝑦4
𝑥3 𝑦3 ∇2 𝑦4
∇𝑦4
𝑥4 𝑦4
Page -7
Numerical Analysis (Group-9)

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)

INTERPOLATION WITH EQUAL INTERVAL


Interpolation:
Suppose, we have some data points say 𝑥0 , 𝑥1 , 𝑥2 , … … … , 𝑥𝑛 and the corresponding values of 𝑦0 ,
𝑦1 , 𝑦2 , … … … , 𝑦𝑛 . Now, if we have to find any value of 𝑦(𝑥𝑖 ) where 𝑥𝑖 ∈ (𝑥0 , 𝑥𝑛 ), then the
procedure of finding the value of 𝑦(𝑥𝑖 ) is called interpolation.

Figure: Interpolation
[Note: If 𝑥𝑖 lies outside of (𝑥0 , 𝑥𝑛 ) then the procedure of finding the value of 𝑦(𝑥𝑖 ) is called
extrapolation.]

There are 2 types of interpolation for equal interval –


1. Newton-Gregory forward interpolation
2. Newton-Gregory backward interpolation

Newton-Gregory formula for forward interpolation:

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)

putting (𝒙 = 𝒙𝟐 ) and ∅(𝒙𝟐 ) = 𝒚𝟐 in (1),


∅(𝑥2 ) = 𝑎0 + 𝑎1 (𝑥2 − 𝑥0 ) + 𝑎2 (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )
𝑦1− 𝑦0
⇒ 𝑦2 = 𝑦0 + . 2ℎ + 𝑎2 . 2ℎ. ℎ

𝑦2 − 2𝑦1 + 𝑦0
⇒ 𝑎2 =
2.1. ℎ2
∆2 𝑦0
⇒ 𝑎2 =
2! ℎ2
putting (𝒙 = 𝒙𝟑 ) and ∅(𝒙𝟑 ) = 𝒚𝟑 in equation (1),
∅(𝑥3 ) = 𝑎0 + 𝑎1 (𝑥3 − 𝑥0 ) + 𝑎2 (𝑥3 − 𝑥0 )(𝑥3 − 𝑥1 ) + 𝑎3 (𝑥3 − 𝑥0 )(𝑥3 − 𝑥1 )(𝑥3 − 𝑥2 )
𝑦1− 𝑦0 𝑦2 − 2𝑦1 + 𝑦0
⇒ 𝑦3 = 𝑦0 + . 3ℎ + . 3ℎ. 2ℎ + 𝑎3 . 3ℎ. 2ℎ. ℎ
ℎ ℎ2
𝑦3 − 3𝑦2 + 3𝑦1 − 𝑦0
⇒ 𝑎3 =
3.2.1. ℎ3
∆3 𝑦0
⇒ 𝑎3 =
3! ℎ3
…… ……… …….. ………
…… ……… …….. ………
∆𝑛 𝑦0
𝑎𝑛 =
𝑛! ℎ𝑛
Substituting all these values in equation (1) We get,
∆𝑦0 ∆2 𝑦 ∆3 𝑦
∅(𝑥) = 𝑦0 + (𝑥 − 𝑥0 ) + 02 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 ) + 03 (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) + ⋯ +
ℎ 2! ℎ 3! ℎ
∆𝑛 𝑦0
(𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) … … (𝑥 − 𝑥𝑛−1 )……………………… (2)
𝑛! ℎ𝑛
𝑥 − 𝑥0
Let, =𝑢

⇒ 𝑥 = 𝑥0 + ℎ𝑢 We get,
𝑥 − 𝑥1 𝑥 − (𝑥0 + ℎ) 𝑥 − 𝑥0 ℎ
= = − =𝑢−1
ℎ ℎ ℎ ℎ
And,
𝑥 − 𝑥2 𝑥 − (𝑥0 + 2ℎ) 𝑥 − 𝑥0 2ℎ
= = − =𝑢−2
ℎ ℎ ℎ ℎ
……………………………………………….
……………………………………………….
𝑥 − 𝑥𝑛−1 𝑥 − (𝑥0 + (𝑛 − 1)ℎ) 𝑥 − 𝑥0
= = − (𝑛 − 1) = 𝑢 − (𝑛 − 1)
ℎ ℎ ℎ

Page -10
Numerical Analysis (Group-9)

Substituting these values in (2) We get,


𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3
∅(𝑥) = 𝑦0 + 𝑢∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦0 + ⋯
2! 3!
𝑢(𝑢 − 1)(𝑢 − 2) … . (𝑢 − 𝑛 + 1) 𝑛
+ ∆ 𝑦0
𝑛!
This is known as Newton-Gregory’s formula for forward interpolation with equal intervals.

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

The value of 𝑦 at 𝑥 = 15,


ℎ = 𝑥1 − 𝑥0 = 20 − 10 = 10
𝑥 − 𝑥0 15 − 10
𝑢= = = 0.5
ℎ 10

Newton's forward difference interpolation formula is –


𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3
𝑦(𝑥) = 𝑦0 + 𝑢𝛥𝑦0 + 𝛥 𝑦0 + 𝛥 𝑦0
2! 3!
0.5(0.5 − 1) 0.5(0.5 − 1)(0.5 − 2)
⇒ 𝑦 = 9 + 0.5 × 30 + ×5+ ×2
2 6
⇒ 𝑦 = 9 + 15 − 0.62 + 0.12
⇒ 𝑦 = 23.5

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

For finding 𝑓(𝑥),


ℎ = 𝑥1 − 𝑥0 = 20 − 10 = 10
𝑥 − 𝑥0 𝑥 − 10 𝑥
𝑢= = = −1
ℎ 10 10
Newton's forward difference interpolation formula is –
𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3
𝑦(𝑥) = 𝑦0 + 𝑢𝛥𝑦0 + 𝛥 𝑦0 + 𝛥 𝑦0
2! 3!
𝑥 𝑥 𝑥 𝑥 𝑥
𝑥 (10 − 1) (10 − 2) (10 − 1) (10 − 2) (10 − 3)
= 9 + ( − 1) × 30 + ×5+ ×2
10 2 6
𝑥 2 3𝑥 𝑥3 𝑥 2 11𝑥
= 9 + 3𝑥 − 30 + − +5+ − + −2
40 4 3000 50 30
𝑥3 𝑥2 157𝑥
= + + − 18
3000 200 60

𝑥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)

Newton-Gregory formula for backward interpolation:

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

Now, putting (𝒙 = 𝒙𝒏 ) in (1) and also putting ∅(𝒙𝒏 ) = 𝒚𝒏 ,


∅(𝑥𝑛 ) = 𝑎0 + 0
⇒ 𝑎0 = 𝑦𝑛
putting (𝒙 = 𝒙𝒏−𝟏 ) and ∅(𝒙𝒏−𝟏 ) = 𝒚𝒏−𝟏 in (1),
∅(𝑥𝑛−1 ) = 𝑎0 + 𝑎1 (𝑥𝑛−1 − 𝑥𝑛 )
⇒ 𝑦𝑛−1 = 𝑦𝑛 + 𝑎1 . (−ℎ )
𝑦𝑛 − 𝑦𝑛−1
⇒ 𝑎1 =

∇𝑦𝑛
⇒ 𝑎1 =
1! ℎ
putting (𝒙 = 𝒙𝒏−𝟐 ) and ∅(𝒙𝒏−𝟐 ) = 𝒚𝒏−𝟐 in (1),
∅(𝑥𝑛−2 ) = 𝑎0 + 𝑎1 (𝑥𝑛−2 − 𝑥𝑛 ) + 𝑎2 (𝑥𝑛−2 − 𝑥𝑛 )(𝑥𝑛−2 − 𝑥𝑛−1 )
𝑦𝑛− 𝑦𝑛−1
⇒ 𝑦𝑛−2 = 𝑦𝑛 + . (−2ℎ) + 𝑎2 . (−2ℎ). (−ℎ)

𝑦𝑛 − 2𝑦𝑛−1 + 𝑦𝑛−2
⇒ 𝑎2 =
2.1. ℎ2
2
∇ 𝑦𝑛
⇒ 𝑎2 =
2! ℎ2
putting (𝒙 = 𝒙𝒏−𝟑 ) and ∅(𝒙𝒏−𝟑 ) = 𝒚𝒏−𝟑 in equation (1),
∅(𝑥𝑛−3 ) = 𝑎0 + 𝑎1 (𝑥𝑛−3 − 𝑥𝑛 ) + 𝑎2 (𝑥𝑛−3 − 𝑥𝑛 )(𝑥𝑛−3 − 𝑥𝑛−1 )
+ 𝑎3 (𝑥𝑛−3 − 𝑥𝑛 )(𝑥𝑛−3 − 𝑥𝑛−1 )(𝑥𝑛−3 − 𝑥𝑛−2 )
𝑦𝑛− 𝑦𝑛−1 𝑦𝑛 − 2𝑦𝑛−1 + 𝑦𝑛−2
⇒ 𝑦𝑛−3 = 𝑦𝑛 + . (−3ℎ) + . (−3ℎ). (−2ℎ). (−ℎ)
ℎ 2ℎ2
+ 𝑎3 . (−3ℎ). (−2ℎ). (−ℎ)
𝑦𝑛 − 3𝑦𝑛−1 + 3𝑦𝑛−2 − 𝑦𝑛−3
⇒ 𝑎3 =
3.2.1. ℎ3
3
∇ 𝑦𝑛
⇒ 𝑎3 =
3! ℎ3
…… ……… …….. ………
…… ……… …….. ………
∇𝑛 𝑦𝑛
𝑎𝑛 =
𝑛! ℎ𝑛
Substituting all these values in equation (1) We get,
∇𝑦𝑛 ∇2 𝑦 ∇3 𝑦
∅(𝑥) = 𝑦𝑛 + (𝑥 − 𝑥𝑛 ) + 𝑛2 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 ) + 𝑛3 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 )(𝑥 −
ℎ 2! ℎ 3! ℎ
∇𝑛 𝑦𝑛
𝑥𝑛−2 ) + ⋯ + 𝑛! ℎ𝑛 (𝑥 − 𝑥𝑛 )(𝑥 − 𝑥𝑛−1 ) … . (𝑥 − 𝑥1 )…………………… (2)

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

Question-1: Compute 𝒔𝒊𝒏(𝟓𝟕°) by Newton’s Backward Interpolation Formula.


𝒙: 𝟒𝟓° 𝟓𝟎° 𝟓𝟓° 𝟔𝟎°
𝒔𝒊𝒏(𝒙): 0.7071 𝟎. 𝟕𝟔𝟔𝟎 𝟎. 𝟖𝟏𝟗𝟐 𝟎. 𝟖𝟔𝟔𝟎
Solution:
The difference Table for the problem given below:
𝒙 𝒚 = 𝒇(𝒙) 𝜵𝒇(𝒙) 𝜵𝟐 𝒇(𝒙) 𝜵𝟑 𝒇(𝒙)
45 0.7071
0.0589
50 0.7600 -0.0057
0.0532 -0.0007
55 0.8192 -0.0064
0.0468
60 0.8660
Here,
ℎ = 5, 𝑥 = 57, 𝑥𝑛 = 60
𝑥 − 𝑥𝑛 57 − 60
𝑆𝑜, 𝑢 = = = −0.6
ℎ 5
We know from the Newton’s Backward Interpolation formula,
𝑢(𝑢 + 1) 2 𝑢(𝑢 + 1)(𝑢 + 2) 3
𝑦 = 𝑦𝑛 + 𝑢∇𝑦𝑛 + ∇ 𝑦𝑛 + ∇ 𝑦𝑛
2! 3!

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)

INTERPOLATION WITH UNEQUAL INTERVAL


Newton’s formula for unequal intervals or Divided difference formula

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

2.4843 − 2.4829 0 − (−0.00001)


305 − 304 307 − 300
= 0.0014 = 0.00000143

0.0014 − 0.0014
305 2.4843 307 − 304
=0

2.4871 − 2.4843
307 − 305
= 0.0014

307 2.4871

Newton’s formula for unequal interval’s is –


𝑦 = 𝑦0 + (𝑥 − 𝑥0 )𝛿𝑦0 + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝛿 2 𝑦0 + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )𝛿 3 𝑦0
⇒ 𝑦 = 2.4771 + (301 − 300) × 0.00145 + (301 − 300)(301 − 304) × (−0.00001)
+ (301 − 300)(301 − 304)(301 − 305) × 0.00000143
⇒ 𝑦 = 2.4771 + 0.00145 + 0.00003 + 0.00001716
⇒ 𝑦 = 2.47859716

Page -17
Numerical Analysis (Group-9)

Question-2: Find the value of 𝒚 when 𝒙 = 𝟏


x -1 0 3 6 7
y 3 -6 39 822 1611
Solution:
Divided difference table:
𝒙 𝒚 𝜹𝒚 𝜹𝟐 𝒚 𝜹𝟑 𝒚 𝜹𝟒 𝒚

-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

Newton’s formula for unequal interval’s is –


𝑦 = 𝑦0 + (𝑥 − 𝑥0 )𝛿𝑦0 + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝛿 2 𝑦0 + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )𝛿 3 𝑦0
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )𝛿 3 𝑦0
⇒ 𝑦 = 3 + (1 + 1) × (−9) + (1 + 1)(1) × 6 + (1 + 1)(1)(1 − 3) × 5
+ (1 + 1)(1)(1 − 3)(1 − 6) × 1
⇒ 𝑦 = 3 − 18 + 12 − 20 + 20
⇒ 𝑦 = −3

Page -18
Numerical Analysis (Group-9)

Lagrange’s interpolation formula:

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

Let, 𝑓(𝑥) = 𝑎0 {(𝑥 − 𝑥1 ) (𝑥 − 𝑥2 ). . . (𝑥 − 𝑥𝑛 )} + 𝑎1 {(𝑥 − 𝑥0 ) (𝑥 − 𝑥2 ). . . (𝑥 − 𝑥𝑛 )} +


𝑎2 {(𝑥 − 𝑥0 ) (𝑥 − 𝑥3 ). . . (𝑥 − 𝑥𝑛 )} + ⋯ + 𝑎𝑛 {(𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ). . . (𝑥 − 𝑥𝑛−1 )} → (𝒊)
To find 𝑎0 , 𝑎1 , 𝑎2 , … , 𝑎𝑛 we put 𝑥 = 𝑥0 , 𝑥1 , 𝑥2 , … , 𝑥𝑛 respectively in (𝑖).

Putting 𝒙 = 𝒙𝟎 in (𝒊), we get


𝑓(𝑥0 ) = 𝑎0 (𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … … … . . (𝑥0 − 𝑥𝑛 )
𝑓(𝑥0 )
⇒ 𝑎0 =
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … … … . . (𝑥0 − 𝑥𝑛 )
Putting 𝒙 = 𝒙𝟏 in (𝒊), we get
𝑓(𝑥1 ) = 𝑎1 (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … … … . . (𝑥1 − 𝑥𝑛 )
𝑓(𝑥1 )
⇒ 𝑎1 =
(𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … … … . . (𝑥1 − 𝑥𝑛 )
Putting 𝒙 = 𝒙𝟐 in (𝒊), we get
𝑓(𝑥2 ) = 𝑎2 (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) … … … . . (𝑥2 − 𝑥𝑛 )
𝑓(𝑥2 )
⇒ 𝑎2 =
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) … … … . . (𝑥2 − 𝑥𝑛 )
……… ……… ……… ……… ………..
……… ……… ……… ……… ………..
Putting 𝒙 = 𝒙𝒏 in (𝒊), we will get
𝑓(𝑥𝑛 )
𝑎𝑛 =
(𝑥𝑛 − 𝑥0 )(𝑥𝑛 − 𝑥1 ) … … … . . (𝑥𝑛 − 𝑥𝑛−1 )

Substituting these values in (𝒊)we get,


(𝑥 − 𝑥1 ) (𝑥 − 𝑥2 )(𝑥 − 𝑥3 ) … … . (𝑥 − 𝑥𝑛 )
𝑦 = 𝑓(𝑥) = 𝑓(𝑥0 )
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) … … … . . (𝑥0 − 𝑥𝑛 )
(𝑥 − 𝑥0 ) (𝑥 − 𝑥2 ) … … . (𝑥 − 𝑥𝑛 )
+ 𝑓(𝑥1 )
(𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) … … … . . (𝑥1 − 𝑥𝑛 )
(𝑥 − 𝑥0 ) (𝑥 − 𝑥1 )(𝑥 − 𝑥3 ) … … . (𝑥 − 𝑥𝑛 )
+ 𝑓(𝑥2 ) + ⋯
(𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 )(𝑥2 − 𝑥3 ) … … … . . (𝑥2 − 𝑥𝑛 )
(𝑥 − 𝑥0 ) (𝑥 − 𝑥1 ) … … . (𝑥 − 𝑥𝑛−1 )
+ 𝑓(𝑥𝑛 )
(𝑥𝑛 − 𝑥0 )(𝑥𝑛 − 𝑥1 ) … … … . . (𝑥𝑛 − 𝑥𝑛−1 )

Page -19
Numerical Analysis (Group-9)

MATHEMATICAL PROBLEMS

Question-1: Find 𝒇(𝟐. 𝟕) using Lagrange's Interpolation formula.


𝒙: 2 2.5 3
𝒚: 0.69315 0.91629 1.09861
Solution:
Given that,
𝑥 2 2.5 3
𝑦 0.69315 0.91629 1.09861
Lagrange’s formula –
(𝑥 − 𝑥1 )(𝑥 − 𝑥2 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥2 ) (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )
𝑦= 𝑦0 + 𝑦1 + 𝑦
(𝑥0 − 𝑥1 )(𝑥0 − 𝑥2 ) (𝑥1 − 𝑥0 )(𝑥1 − 𝑥2 ) (𝑥2 − 𝑥0 )(𝑥2 − 𝑥1 ) 2
(2.7 − 2.5)(2.7 − 3) (2.7 − 2)(2.7 − 3)
⇒𝑦= × 0.69315 + × 0.91629
(2 − 2.5)(2 − 3) (2.5 − 2)(2.5 − 3)
(2.7 − 2)(2.7 − 2.5)
+ × 1.09861
(3 − 2)(3 − 2.5)
(0.2)(−0.3) (0.7)(−0.3) (0.7)(0.2)
⇒𝑦= × 0.69315 + × 0.91629 + × 1.09861
(−0.5)(−1) (0.5)(−0.5) (1)(0.5)
⇒ 𝑦 = (−0.12) × 0.69315 + 0.84 × 0.91629 + 0.28 × 1.09861
⇒ 𝑦 = 0.9941164
So, at point 2.7 is 𝑦 = 0.9941164

Question-2: Find 𝒇(𝒙) from the following values of 𝒙


𝒇(𝟏) = 𝟒, 𝒇(𝟐) = 𝟓, 𝒇(𝟕) = 𝟓, 𝒇(𝟖) = 𝟒
(𝒊) Find 𝒇(𝟔)
(𝒊𝒊) Find the value of 𝒙 for which 𝒇(𝒙) is maximum or minimum.
Solution:
𝑥 1 2 7 8
𝑓(𝑥) 4 5 5 4
Using lagrange’s formula –
(𝑥 − 2)(𝑥 − 7)(𝑥 − 8) (𝑥 − 1)(𝑥 − 7)(𝑥 − 8) (𝑥 − 1)(𝑥 − 2)(𝑥 − 8)
𝑦= 4+ 5+ 5
(1 − 2)(1 − 7)(1 − 8) (2 − 1)(2 − 7)(2 − 8) (7 − 1)(7 − 2)(7 − 8)
(𝑥 − 1)(𝑥 − 2)(𝑥 − 7)
+ 4
(8 − 1)(8 − 2)(8 − 7)
−4 5 5
= (𝑥 − 2)(𝑥 − 7)(𝑥 − 8) + (𝑥 − 1)(𝑥 − 7)(𝑥 − 8) − (𝑥 − 1)(𝑥 − 2)(𝑥 − 8)
42 30 30
4
+ (𝑥 − 1)(𝑥 − 2)(𝑥 − 7)
42
4 5
= (𝑥 − 2)(𝑥 − 7){(𝑥 − 1) − (𝑥 − 8)} + (𝑥 − 1)(𝑥 − 8){(𝑥 − 7) − (𝑥 − 2)}
42 30

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)

CENTRAL DIFFERENCE INTERPOLATION


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.

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)

Gauss’s forward interpolation formula:


We know, Newton’s general interpolation formula is
𝑦 = 𝑓(𝑥) = 𝑓(𝑥0 ) + (𝑥 − 𝑥0 )𝑓(𝑥0 , 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓(𝑥0 , 𝑥1 , 𝑥2 )
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 )
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) + ⋯
…………………… (1)
Putting 𝑥0 = 𝑥0 , 𝑥1 = 𝑥0 + ℎ, 𝑥2 = 𝑥0 − ℎ, 𝑥3 = 𝑥0 + 2ℎ, 𝑥4 = 𝑥0 − 2ℎ, 𝑥5 = 𝑥0 + 3ℎ,
𝑥6 = 𝑥0 − 3ℎ etc.
We get,
𝑓(𝑥) = 𝑓(𝑥0 ) + (𝑥 − 𝑥0 ) 𝑓(𝑥0 , 𝑥0 + ℎ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥0 − ℎ) 𝑓(𝑥0 , 𝑥0 + ℎ, 𝑥0 − ℎ)
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥0 − ℎ)(𝑥 − 𝑥0 + ℎ) 𝑓(𝑥0 , 𝑥0 + ℎ, 𝑥0 − ℎ, 𝑥0 + 2ℎ)
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥0 − ℎ)(𝑥 − 𝑥0 + ℎ)(𝑥 − 𝑥0 − 2ℎ) 𝑓(𝑥0 , 𝑥0 + ℎ, 𝑥0 − ℎ,
𝑥0 + 2ℎ, 𝑥0 − 2ℎ)
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥0 − ℎ)(𝑥 − 𝑥0 + ℎ)(𝑥 − 𝑥0 − 2ℎ)(𝑥 − 𝑥0 + 2ℎ) 𝑓(𝑥0 , 𝑥0
+ ℎ, 𝑥0 − ℎ, 𝑥0 + 2ℎ, 𝑥0 − 2ℎ, 𝑥0 + 3ℎ) + ⋯
𝑥 − 𝑥0
Now, Let 𝑢 = i. e 𝑥 − 𝑥0 = ℎ𝑢

Then, we have,
𝑓(𝑥) = 𝑓(𝑥0 ) + ℎ𝑢𝑓(𝑥0 , 𝑥0 + ℎ) + ℎ𝑢(ℎ𝑢 − ℎ)𝑓(𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ) + ℎ𝑢(ℎ𝑢 − ℎ)(ℎ𝑢 +
ℎ)𝑓(𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ) + ℎ𝑢(ℎ𝑢 − ℎ)(ℎ𝑢 + ℎ)(ℎ𝑢 − 2ℎ)𝑓(𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 +
ℎ, 𝑥0 + 2ℎ) + ℎ𝑢(ℎ𝑢 − ℎ)(ℎ𝑢 + ℎ)(ℎ𝑢 − 2ℎ)(ℎ𝑢 + 2ℎ)𝑓(𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 +
2ℎ)(𝑥0 + 3ℎ) + ⋯………………………… (2)
But we have, from the relation between simple and divided difference,
∆𝑦0
𝑓(𝑥0 , 𝑥0 + ℎ) = ,

∆2 𝑦−1
𝑓(𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ) = ,
2! ℎ2
∆3 𝑦−1
𝑓(𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ) = ,
3! ℎ3
∆4 𝑦−2
𝑓(𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ) = ,
4! ℎ4
∆5 𝑦−2
𝑓(𝑥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
∆ 𝑦−2
+ ℎ4 𝑢(𝑢 − 1)(𝑢 + 1)(𝑢 − 2)
4! ℎ4
5
∆5 𝑦−2
+ ℎ 𝑢(𝑢 − 1)(𝑢 + 1)(𝑢 − 2)(𝑢 + 2) + . . ..
5! ℎ5
𝒖(𝒖 − 𝟏) 𝟐 𝒖(𝒖𝟐 − 𝟏) 𝟑 𝒖(𝒖𝟐 − 𝟏)(𝒖 − 𝟐) 𝟒
⇒ 𝒚 = 𝒇(𝒙) = 𝒚𝟎 + 𝒖∆𝒚𝟎 + ∆ 𝒚−𝟏 + ∆ 𝒚−𝟏 + ∆ 𝒚−𝟐
𝟐! 𝟑! 𝟒!
𝒖(𝒖𝟐 − 𝟏)(𝒖 − 𝟐𝟐 ) 𝟓
+ ∆ 𝒚−𝟐 +. ..
𝟓!
This formula is known as Gauss’s forward interpolation formula for equal intervals.

Page -23
Numerical Analysis (Group-9)

MATHEMATICAL PROBLEMS

Question-1: Find 𝒇(𝟑𝟎) using Gauss Forward formula.


𝒙 21 25 29 33 37
𝒚 18.4708 17.8144 17.107 16.3432 15.5154
Solution:
Difference table:
𝒙 𝒚 𝜟𝒚 𝜟𝟐 𝒚 𝜟𝟑 𝒚 𝜟𝟒 𝒚
21 18.4708
-0.6564
25 17.8144 -0.051
-0.7074 -0.0054
29 17.107 -0.0564 -0.0022
-0.7638 -0.0076
33 16.3432 -0.064
-0.8278
37 15.5154
Here,
h=25-21=4 and 𝑥 = 30
Taking 𝑥0 = 29,
𝑦0 = 17.107, 𝛥𝑦0 = −0.7638, 𝛥2 𝑦−1 = −0.0564, 𝛥3 𝑦−1 = −0.0076, 𝛥4 𝑦−2 = −0.0022
𝑥 − 𝑥0
𝑢=

30 − 29
=
4
= 0.25
Gauss forward interpolation formula:
𝑢(𝑢 − 1) 2 𝑢(𝑢2 − 1) 3 𝑢(𝑢2 − 1)(𝑢 − 2) 4
𝑦 = 𝑦0 + 𝑢∆𝑦0 + ∆ 𝑦−1 + ∆ 𝑦−1 + ∆ 𝑦−2
2! 3! 4!
0.25(0.25 − 1)
= 17.107 + 0.25 × (−0.7638) + × (−0.0564)
2
0.25(0.252 − 1) 0.25(0.252 − 1)(0.25 − 2)
+ × (−0.0076) + × (−0.0022)
6 24
= 17.107 − 0.19095 + 0.0052875 + 0.000296875 − 0.0000375977
= 16.92159678

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)

Gauss’s Backward interpolation formula:


We know, Newton’s general interpolation formula is
𝑦 = 𝑓(𝑥) = 𝑓(𝑥0 ) + (𝑥 − 𝑥0 )𝑓(𝑥0 , 𝑥1 ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )𝑓(𝑥0 , 𝑥1 , 𝑥2 )
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 )
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥1 )(𝑥 − 𝑥2 )(𝑥 − 𝑥3 )𝑓(𝑥0 , 𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) + ⋯
…………………… (1)
Substituting 𝑥0 = 𝑥0 , 𝑥1 = 𝑥0 − ℎ, 𝑥2 = 𝑥0 + ℎ, 𝑥3 = 𝑥0 − 2ℎ, 𝑥4 = 𝑥0 + 2ℎ, 𝑥5 = 𝑥0 − 3ℎ,
𝑥6 = 𝑥0 + 3ℎ etc.
We get,
𝑓(𝑥) = 𝑓(𝑥0 ) + (𝑥 − 𝑥0 ) 𝑓(𝑥0 , 𝑥0 − ℎ) + (𝑥 − 𝑥0 )(𝑥 − 𝑥0 + ℎ) 𝑓(𝑥0 , 𝑥0 − ℎ, 𝑥0 + ℎ)
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥0 + ℎ)(𝑥 − 𝑥0 − ℎ) 𝑓(𝑥0 , 𝑥0 − ℎ, 𝑥0 + ℎ, 𝑥0 − 2ℎ)
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥0 + ℎ)(𝑥 − 𝑥0 − ℎ)(𝑥 − 𝑥0 + 2ℎ) 𝑓(𝑥0 , 𝑥0 − ℎ, 𝑥0 + ℎ,
𝑥0 − 2ℎ, 𝑥0 + 2ℎ)
+ (𝑥 − 𝑥0 )(𝑥 − 𝑥0 + ℎ)(𝑥 − 𝑥0 − ℎ)(𝑥 − 𝑥0 + 2ℎ)(𝑥 − 𝑥0 − 2ℎ) 𝑓(𝑥0 , 𝑥0
− ℎ, 𝑥0 + ℎ, 𝑥0 − 2ℎ, 𝑥0 + 2ℎ, 𝑥0 − 3ℎ) + ⋯
𝑥 − 𝑥0
Now, Let 𝑢 = i. e. 𝑥 − 𝑥0 = ℎ𝑢

Then, we have,
𝑓(𝑥) = 𝑓(𝑥0 ) + ℎ𝑢𝑓(𝑥0 − ℎ, 𝑥0 ) + ℎ𝑢(ℎ𝑢 + ℎ)𝑓(𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ) + ℎ𝑢(ℎ𝑢 + ℎ)(ℎ𝑢 −
ℎ)𝑓(𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ) + ℎ𝑢(ℎ𝑢 + ℎ)(ℎ𝑢 − ℎ)(ℎ𝑢 + 2ℎ)𝑓(𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 +
ℎ, 𝑥0 + 2ℎ) + ℎ𝑢(ℎ𝑢 + ℎ)(ℎ𝑢 − ℎ)(ℎ𝑢 + 2ℎ)(ℎ𝑢 − 2ℎ)𝑓(𝑥0 − 3ℎ, 𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 +
ℎ)(𝑥0 + 2ℎ) + ⋯………………………… (2)
But we have, from the relation between simple and divided difference,
∆𝑦−1
𝑓(𝑥0 , 𝑥0 − ℎ) = ,

∆2 𝑦−1
𝑓(𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ) = ,
2! ℎ2
∆3 𝑦−2
𝑓(𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ) = ,
3! ℎ3
∆4 𝑦−2
𝑓(𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ) = ,
4! ℎ4
∆5 𝑦−3
𝑓(𝑥0 − 3ℎ, 𝑥0 − 2ℎ, 𝑥0 − ℎ, 𝑥0 , 𝑥0 + ℎ, 𝑥0 + 2ℎ) = 𝑒𝑡𝑐.
5! ℎ5
Substituting these values in (2), We get,
∆𝑦−1 ∆2 𝑦−1 ∆3 𝑦−2
𝑦 = 𝑓(𝑥) = 𝑦0 + ℎ𝑢 + ℎ2 𝑢(𝑢 + 1) + ℎ 3
𝑢(𝑢 + 1)(𝑢 − 1)
ℎ 2! ℎ2 3! ℎ3
4
∆ 𝑦−2
+ ℎ4 𝑢(𝑢 + 1)(𝑢 − 1)(𝑢 + 2)
4! ℎ4
5
∆5 𝑦−3
+ ℎ 𝑢(𝑢 + 1)(𝑢 − 1)(𝑢 + 2)(𝑢 − 2) + . . ..
5! ℎ5
𝑢(𝑢 + 1) 2 𝑢(𝑢2 − 1) 3 𝑢(𝑢2 − 1)(𝑢 + 2) 4
⇒ 𝑦 = 𝑓(𝑥) = 𝑦0 + 𝑢∆𝑦−1 + ∆ 𝑦−1 + ∆ 𝑦−2 + ∆ 𝑦−2
2! 3! 4!
𝑢(𝑢2 − 1)(𝑢 − 22 ) 5
+ ∆ 𝑦−3 +. ..
5!
This formula is known as Gauss’s backward interpolation formula for equal intervals.

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

Now Gauss’s backward formula is


(u + 1)u 2 (u + 1)u(u − 1) 3 (u + 2)(u + 1)u(u − 1) 4
yu = y0 +u∆ y−1 + ∆ y−1 + ∆ y−2 + ∆ y−2 +
2 6 24
(u + 2)(u + 1)u(u − 1)(u − 2) 5
∆ y−3 +…
120
(.5 + 1)(.5) (.5 + 1)(.5)(.5 − 1) (.5 + 2)(.5 + 1)(.5)(.5 − 1)
 yu =27+ (.5) ×7+ ×5+ ×3+ ×(-7)+
2 6 24
(.5 + 2)(.5 + 1)(.5)(.5 − 1)(.5 − 2)
×(-10)
120
= 27 + 3.5 + 1.875 − 0.1875 + 0.2734 − 0.1172 = 32.3437 thousand.
So, the estimated population for 1936 is 32.3437 thousand.

Page -27
Numerical Analysis (Group-9)

Stirling’s interpolation formula:


We have gauss’s forward interpolation formula –
𝑢(𝑢 − 1) 2 𝑢(𝑢2 − 1) 3 𝑢(𝑢2 − 1)(𝑢 − 2) 4
y(x) = 𝑦0 + 𝑢∆𝑦0 + ∆ 𝑦−1 + ∆ 𝑦−1 + ∆ 𝑦−2 + ⋯
2! 3! 4!
→ (𝟏)
And gauss’s backward interpolation formula –
𝑢(𝑢 + 1) 2 𝑢(𝑢2 − 1) 3 𝑢(𝑢2 − 1)(𝑢 + 2) 4
y(x) = 𝑦0 + 𝑢∆𝑦−1 + ∆ 𝑦−1 + ∆ 𝑦−2 + ∆ 𝑦−2 + …
2! 3! 4!
→ (𝟐)
𝑥 − 𝑥0
𝑊ℎ𝑒𝑟𝑒, 𝑢 =

Adding (1) and (2) we get,
𝑢(𝑢 − 1) 𝑢(𝑢 + 1) 2 𝑢(𝑢2 − 1) 3
]
2y(x) = 2𝑦0 + 𝑢[∆𝑦0 + ∆𝑦−1 + [ + ] ∆ 𝑦−1 + [∆ 𝑦−1 + ∆3 𝑦−2 ]
2! 2! 3!
𝑢(𝑢2 − 1)(𝑢 − 2) 𝑢(𝑢2 − 1)(𝑢 + 2) 4
+[ + ] ∆ 𝑦−2 + ⋯
4! 4!
2𝑢2 2 𝑢(𝑢2 − 1) 3
⇒ 2𝑦(𝑥) = 2𝑦0 + 𝑢[∆𝑦0 + ∆𝑦−1 ] + ∆ 𝑦−1 + [∆ 𝑦−1 + ∆3 𝑦−2 ]
2! 3!
2𝑢2 (𝑢2 − 1) 4
+ ∆ 𝑦−2 + ⋯
4!
[∆𝑦0 + ∆𝑦−1 ] 𝑢2 2 𝑢(𝑢2 − 1) [∆3 𝑦−1 + ∆3 𝑦−2 ] 𝑢2 (𝑢2 − 1) 4
⇒ y(x) = 𝑦0 + 𝑢 + ∆ 𝑦−1 + + ∆ 𝑦−2
2 2! 3! 2 4!
+⋯
which is the Stirling’s interpolation formula.

Easy way to memorizing Stirling’s Formula:


This direction index reduces consecutively
Δ𝑦−1 Δ3 𝑦−2 Δ5 𝑦−3
𝑦0 Δ2 𝑦−1 Δ4 𝑦−2 Δ6 𝑦−3
Δ𝑦0 Δ3 𝑦−1 Δ5 𝑦−2
average of this type terms This direction index remains unchanged

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

(−1310 − 1080) (−0.4)2 (−0.4)(.16 − 1) (−59 − 80)


yu = 47326 + (-0.4) + (−230) + +
2 2 6 2
(0.16)(0.16 − 1)
(−21)
24
=47236+478-18.4-3.8920+.1176=47692 approx.
So, the estimated value of y28 is 47692 approximately.

Page -29
Numerical Analysis (Group-9)

Bessel’s interpolation formula:


We have gauss’s forward interpolation formula –
𝑢(𝑢 − 1) 2 𝑢(𝑢2 − 1) 3 𝑢(𝑢2 − 1)(𝑢 − 2) 4
y(x) = 𝑦0 + 𝑢∆𝑦0 + ∆ 𝑦−1 + ∆ 𝑦−1 + ∆ 𝑦−2 + ⋯
2! 3! 4!
→ (𝟏)
The third formula due to Gauss –
𝑢(𝑢 − 1) 2 𝑢(u − 1)(𝑢 − 2) 3
y(x) = 𝑦1 + (𝑢 − 1)∆𝑦0 + ∆ 𝑦0 + ∆ 𝑦−1
2! 3!
𝑢(𝑢2 − 1)(𝑢 − 2) 4
+ ∆ 𝑦−1 + ⋯ → (𝟐)
4!
𝑥 − 𝑥0
𝑊ℎ𝑒𝑟𝑒, 𝑢 =

Adding (1) and (2) we get,
𝑢(𝑢 − 1) 2
2y(x) = 𝑦0 + 𝑦1 + (2𝑢 − 1)∆y0 + [∆ 𝑦−1 + ∆2 𝑦0 ]
2!
𝑢(𝑢2 − 1) 𝑢(u − 1)(𝑢 − 2) 3 𝑢(𝑢2 − 1)(𝑢 − 2)
+[ + ] ∆ 𝑦−1 + [ ] [∆4 𝑦−2
3! 3! 4!
+ ∆4 𝑦−1 ] + ⋯
1
𝑦0 + 𝑦1 1 𝑢(𝑢 − 1) [∆2 𝑦−1 + ∆2 𝑦0 ] 𝑢 (𝑢 − 2) (𝑢 − 1) 3
⇒ y(x) = + (𝑢 − ) ∆y0 + + ∆ 𝑦−1
2 2 2! 2 3!
𝑢(𝑢2 − 1)(𝑢 − 2) [∆4 𝑦−2 + ∆4 𝑦−1 ]
+ +⋯
4! 2
which is Bessel’s interpolation formula

Easy way to memorizing Bessel’s Formula:


This direction index reduces consecutively
𝑦0 Δ2 𝑦−1 Δ4 𝑦−2 Δ6 𝑦−3
Δ𝑦0 Δ3 𝑦−1 Δ5 𝑦−2
𝑦1 Δ2 𝑦0 Δ4 𝑦−1 Δ6 𝑦−2
average of this type terms This direction index remains unchanged

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

1 1 1 1 1 (74 + 66) 1 1 1 1 (−8)


yu = (3162 + 3544) + ( − )  382 + ( −1) + ( − ) ( −1)
2 4 2 4 4 4 4 2 4 4 6
=3353-95.5-6.5625-0.0625=3250.875

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

Trapezoidal rule for numerical integration:


𝑏
Let, 𝐼 = ∫𝑎 𝑦𝑑𝑥 where 𝑦 = 𝑓(𝑥). Let 𝑓(𝑥) be given for certain equidistant values of 𝑥 say 𝑥0 ,
𝑥0 + ℎ, 𝑥0 + 2ℎ, … 𝑥0 + 𝑛ℎ and the range (𝑎, 𝑏) be divided into 𝑛 equal parts, each of width ℎ
so that 𝑏 − 𝑎 = 𝑛ℎ.
Let, 𝑥0 = 𝑎, 𝑥1 = 𝑥0 + ℎ = 𝑎 + ℎ, 𝑥2 = 𝑎 + 2ℎ, . . . , 𝑥𝑛 = 𝑎 + 𝑛ℎ = 𝑏. We have assumed that
the 𝑛 + 1 ordinates 𝑦0 , 𝑦1 , 𝑦2 , . . . . . , 𝑦𝑛 are at equal intervals.

By Newton’s forward interpolation formula we have,


𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3
𝑦 = 𝑦0 + 𝑢𝛥𝑦0 + 𝛥 𝑦0 + 𝛥 𝑦0 +⋅⋅⋅
2! 3!
Where,
𝑥 − 𝑥0
𝑢=

⇒ 𝑥 = 𝑥0 + 𝑢ℎ
⇒ 𝑑𝑥 = ℎ𝑑𝑢
When 𝑥 = 𝑥0 then 𝑢 = 0
and 𝑥 = 𝑥0 + 𝑛ℎ then 𝑢 = 𝑛
𝑛
𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3
∴ 𝐼 = ℎ ∫ [𝑦0 + 𝑢𝛥𝑦0 + 𝛥 𝑦0 + 𝛥 𝑦0 +. . . ] 𝑑𝑢
0 2! 3!
𝑛
𝑢2 𝛥2 𝑦0 𝑢3 𝑢2 𝛥3 𝑦0 𝑢4
⇒ 𝐼 = ℎ [𝑦0 𝑢 + 𝛥𝑦0 + ( − )+ ( − 𝑢3 + 𝑢2 ) +. . . ]
2 2! 3 2 3! 4 0

𝑛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

= [5.2(log 5.2-1)-4(log 4 -1)]


=1.8278475
Hence the errors is = |1.8276551 − 1.8278475| = 0.0001924

𝟏.𝟒
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
14
h
 (sin x − log
02
e x + e x )dx = [ y0 + y12 + 2{ y1 + y2 + y3 + ...... + y11}]
2
0.1
= [7.73368 + 2(36.69481)]
2
=4.05617
14
Actual value of  (sin x − log
02
e x + e x )dx = [− cos x − x(loge x − 1) + e x ]1.4
0.2

= [{− cos1.4 − (1.4)(loge 1.4 − 1) + e1.4 } − {− cos.2 − (.2)(loge .2 − 1) + e.2 }]


=4.05095
Hence the error is = |4.05617 − 4.05095| = 0.00522

Page -34
Numerical Analysis (Group-9)

Simpson’s ‘1/3’ rule for numerical integration:


𝑏
Let, 𝐼 = ∫𝑎 𝑦𝑑𝑥 where 𝑦 = 𝑓(𝑥). Let 𝑓(𝑥) be given for certain equidistant values of 𝑥 say 𝑥0 ,
𝑥0 + ℎ, 𝑥0 + 2ℎ, … 𝑥0 + 𝑛ℎ and the range (𝑎, 𝑏) be divided into 𝑛 equal parts, each of width ℎ
so that 𝑏 − 𝑎 = 𝑛ℎ.
Let, 𝑥0 = 𝑎, 𝑥1 = 𝑥0 + ℎ = 𝑎 + ℎ, 𝑥2 = 𝑎 + 2ℎ, . . . , 𝑥𝑛 = 𝑎 + 𝑛ℎ = 𝑏. We have assumed that
the 𝑛 + 1 ordinates 𝑦0 , 𝑦1 , 𝑦2 , . . . . . , 𝑦𝑛 are at equal intervals.

By Newton’s forward interpolation formula we have,


𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3
𝑦 = 𝑦0 + 𝑢𝛥𝑦0 + 𝛥 𝑦0 + 𝛥 𝑦0 +⋅⋅⋅
2! 3!
Where,
𝑥 − 𝑥0
𝑢=

⇒ 𝑥 = 𝑥0 + 𝑢ℎ
⇒ 𝑑𝑥 = ℎ𝑑𝑢
When 𝑥 = 𝑥0 then 𝑢 = 0
and 𝑥 = 𝑥0 + 𝑛ℎ then 𝑢 = 𝑛
𝑛
𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3
∴ 𝐼 = ℎ ∫ [𝑦0 + 𝑢𝛥𝑦0 + 𝛥 𝑦0 + 𝛥 𝑦0 +. . . ] 𝑑𝑢
0 2! 3!
𝑛
𝑢2 𝛥2 𝑦0 𝑢3 𝑢2 𝛥3 𝑦0 𝑢4
⇒ 𝐼 = ℎ [𝑦0 𝑢 + 𝛥𝑦0 + ( − )+ ( − 𝑢3 + 𝑢2 ) +. . . ]
2 2! 3 2 3! 4 0
𝑛2 𝑛3 𝑛2 𝛥2 𝑦0 𝑛4 𝛥3 𝑦0
⇒ 𝐼 = ℎ [𝑛𝑦0 + 𝛥𝑦0 + ( − ) + ( − 𝑛3 + 𝑛2 ) +. . . ] → (𝒊)
2 3 2 2! 4 3!
Putting 𝒏 = 𝟐 in the above equation and neglecting third and higher order differences we
get,
8
𝑥2 (3 − 2)
∫ 𝑦𝑑𝑥 = [2𝑦0 + 2𝛥𝑦0 + 𝛥2 𝑦0 ]
𝑥0 2
1
= ℎ [2𝑦0 + 2(𝑦1 − 𝑦0 ) + (𝑦2 − 2𝑦1 + 𝑦0 )]
3

= (𝑦0 + 4𝑦1 + 𝑦2 )
3
Similarly,
𝑥4

∫ 𝑦𝑑𝑥 = (𝑦2 + 4𝑦3 + 𝑦4 )
𝑥2 3
…. ….. …..
…. ….. …..
𝑥𝑛

∫ 𝑦𝑑𝑥 = (𝑦𝑛−2 + 4𝑦𝑛−1 + 𝑦𝑛 )
𝑥𝑛−2 3
Adding all the above integrals, we get
𝑥0 +𝑛ℎ

∫ 𝑦𝑑𝑥 = [(𝑦0 + 𝑦𝑛 ) + 4(𝑦1 + 𝑦3 + ⋯ + 𝑦𝑛−1 ) + 2(𝑦2 + 𝑦4 + ⋯ + 𝑦𝑛−2 ) ]
𝑥0 3

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

= [5.2(log 5.2-1)-4(log4 -1)]


=1.8278475
Hence the errors is = |1.8278475 − 1.8278472| = 0.0000003

𝟏.𝟒
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
14
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
14
Actual value of  (sin x − log
2
e x + e x )dx = [− cos x − x(loge x − 1) + e x ]1.4
.2

= [{− cos1.4 − (1.4)(loge 1.4 − 1) + e1.4 } − {− cos.2 − (.2)(loge .2 − 1) + e.2 }]


=4.05095
Hence the error is = |4.05160 − 4.05095| = 0.00011

𝟑
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

By Trapezoidal rule, we get


3
h
 x dx = 2 [ y0 + y6 + 2{ y1 + y2 + y3 + y4 + y5}]
4

−3

1
= [162 + 2  34] = 115
2

By Simpson’s ‘1/3’ rule, we get


3
h
 x dx = 3 [ y0 + y6 + 4( y1 + y3 + y5 ) + 2( y2 + y4 )]
4

−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)

Simpson’s ‘3/8’ rule for numerical integration:


𝑏
Let, 𝐼 = ∫𝑎 𝑦𝑑𝑥 where 𝑦 = 𝑓(𝑥). Let 𝑓(𝑥) be given for certain equidistant values of 𝑥 say 𝑥0 ,
𝑥0 + ℎ, 𝑥0 + 2ℎ, … 𝑥0 + 𝑛ℎ and the range (𝑎, 𝑏) be divided into 𝑛 equal parts, each of width ℎ
so that 𝑏 − 𝑎 = 𝑛ℎ.
Let, 𝑥0 = 𝑎, 𝑥1 = 𝑥0 + ℎ = 𝑎 + ℎ, 𝑥2 = 𝑎 + 2ℎ, . . . , 𝑥𝑛 = 𝑎 + 𝑛ℎ = 𝑏. We have assumed that
the 𝑛 + 1 ordinates 𝑦0 , 𝑦1 , 𝑦2 , . . . . . , 𝑦𝑛 are at equal intervals.

By Newton’s forward interpolation formula we have,


𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3
𝑦 = 𝑦0 + 𝑢𝛥𝑦0 + 𝛥 𝑦0 + 𝛥 𝑦0 +⋅⋅⋅
2! 3!
Where,
𝑥 − 𝑥0
𝑢=

⇒ 𝑥 = 𝑥0 + 𝑢ℎ
⇒ 𝑑𝑥 = ℎ𝑑𝑢
When 𝑥 = 𝑥0 then 𝑢 = 0
and 𝑥 = 𝑥0 + 𝑛ℎ then 𝑢 = 𝑛
𝑛
𝑢(𝑢 − 1) 2 𝑢(𝑢 − 1)(𝑢 − 2) 3
∴ 𝐼 = ℎ ∫ [𝑦0 + 𝑢𝛥𝑦0 + 𝛥 𝑦0 + 𝛥 𝑦0 +. . . ] 𝑑𝑢
0 2! 3!
𝑛
𝑢2 𝛥2 𝑦0 𝑢3 𝑢2 𝛥3 𝑦0 𝑢4
⇒ 𝐼 = ℎ [𝑦0 𝑢 + 𝛥𝑦0 + ( − )+ ( − 𝑢3 + 𝑢2 ) +. . . ]
2 2! 3 2 3! 4 0
𝑛2 𝑛3 𝑛2 𝛥2 𝑦0 𝑛4 𝛥3 𝑦0
⇒ 𝐼 = ℎ [𝑛𝑦0 + 𝛥𝑦0 + ( − ) + ( − 𝑛3 + 𝑛2 ) +. . . ] → (𝒊)
2 3 2 2! 4 3!
Putting 𝒏 = 𝟑 in the above equation and neglecting fourth and higher order differences we
get,
𝑥3
9 27 9 Δ2 𝑦0 81 Δ3 𝑦0
∫ 𝑦𝑑𝑥 = ℎ [3𝑦0 + Δ𝑦0 + ( − ) + ( − 27 + 9) ]
𝑥0 2 3 2 2! 4 3!
9 9 3
= ℎ [3𝑦0 + (𝑦1 − 𝑦0 ) + (𝑦2 − 2𝑦1 + 𝑦0 ) + (𝑦3 − 3𝑦2 + 3𝑦1 − 𝑦0 )]
2 4 8
3ℎ
= [𝑦 + 3𝑦1 + 3𝑦2 + 𝑦3 ]
8 0
Similarly,
𝑥6
3ℎ
∫ 𝑦𝑑𝑥 = (𝑦 + 3𝑦4 + 3𝑦5 + 𝑦6 )
𝑥3 8 3
….. ….. ….. …..
….. ….. ….. …..
𝑥𝑛
3ℎ
= ∫ 𝑦𝑑𝑥 = [𝑦 + 3𝑦𝑛−2 + 3𝑦𝑛−1 + 𝑦𝑛 ]
𝑥𝑛−3 8 𝑛−3
Adding all these integrals we have,
𝑥0 +𝑛ℎ
3ℎ
∫ 𝑦𝑑𝑥 = [(𝑦0 + 𝑦𝑛 ) + 3(𝑦1 + 𝑦2 + 𝑦4 + 𝑦5 + ⋯ … . . +𝑦𝑛−1 )
𝑥0 8
+ 2(𝑦3 + 𝑦6 + ⋯ . +𝑦𝑛−3 )]

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

By Simpson’s ‘3/8’ rule, we have


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)

Romberg Integration rule:


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. It is based on successive
application of the trapezoidal rule.
𝑏 (𝑏−𝑎)
To obtain approximations for ∫𝑎 𝑓(𝑥)𝑑𝑥. Let, interval ℎ𝑘 = 2𝑘−1

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)

(This is for 6 iterations)

𝑹𝒌,𝟏 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 𝑏

𝑓(𝑎)

Figure: Bisection Method

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

Suppose 𝒇(𝒙𝟏 ) > 𝟎, then 𝒂 < 𝒓𝒐𝒐𝒕 < 𝒙𝟏


So, second approximation to the root is,
1
𝑥2 = (𝑎 + 𝑥1 )
2
Again, three cases can happen-
4. 𝑓(𝑥2 ) = 0, then 𝑥2 is the root of 𝑓(𝑥) = 0
5. 𝑓(𝑥2 ) < 0, then root lies between 𝑥2 and 𝑥1
6. 𝑓(𝑥2 ) > 0, then root lies between 𝑎 and 𝑥2

Suppose 𝒇(𝒙𝟐 ) < 𝟎, then 𝒙𝟐 < 𝒓𝒐𝒐𝒕 < 𝒙𝟏


So, third approximation to the root is,

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

So, after 8th iteration the root of the function is 2.707

Page -46
Numerical Analysis (Group-9)

Question-2: Find the root of 𝒙𝟐 − 𝟓 = 𝟎 by using the Bisection method.


Solution:
Here, 𝑓(𝑥) = 𝑥 2 − 5
𝑓(2) = 4 − 5 = −1
𝑓(3) = 9 − 5 = 4
So the root lies in [2,3]
First iteration:
2+3
𝑥1 = = 2.5
2
Now, 𝑓(𝑥1 ) = 2.52 − 5 = 1.25
Then, 𝑓(2). 𝑓(𝑥1 ) < 0
So, the root lies in [2,2.5]
Hence, we can make the following iteration table:
Iterations(n) a b 𝒙𝒏 f(a) f(b) f(𝒙𝒏 )
1 2 3 2.5 −1 4 1.25
2 2 2.5 2.25 −1 1.25 0.0625
3 2 2.25 2.2125 −1 0.0625 −0.48437
4 2.2125 2.25 2.23125 −0.1048 0.0625 −0.02152
5 2.23125 2.25 2.2406 0.3476 0.0625 0.0204
6 2.23125 2.2406 2.2359 −0.02152 0.0202 −0.0007

So, after 6th iteration the root of the equation is 2.2359 (approximately).

Page -47
Numerical Analysis (Group-9)

Newton – Raphson Method:


Let, 𝑥0 be an approximate root of 𝑓(𝑥) = 0 and 𝑥1 = 𝑥0 + ℎ be the correct root so that
𝑓(𝑥0 + ℎ) = 0

𝑦 = 𝑓(𝑥)

𝑥𝑛+1 𝑥𝑛

Figure: Newton – Raphson Method

For finding h, we expand 𝑓(𝑥0 + ℎ) by Taylor’s Series



ℎ2 ′′
𝑓(𝑥0 + ℎ) = 𝑓(𝑥0 ) + ℎ𝑓 (𝑥0 ) + 𝑓 (𝑥0 ) + ⋯
2!
⇒ 0 = 𝑓(𝑥0 ) + ℎ𝑓 ′ (𝑥0 ) [Neglecting the second and higher order derivative]
𝑓(𝑥0 )
⇒ℎ=− ′ … … … … (𝑖)
𝑓 (𝑥0 )
But,
𝑥1 = 𝑥0 + ℎ
⇒ ℎ = 𝑥1 − 𝑥0
Putting the value of h in (𝑖) we get,
𝑓(𝑥0 )
𝑥1 − 𝑥0 = − ′
𝑓 (𝑥0 )
𝑓(𝑥0 )
⇒ 𝑥1 = 𝑥0 − ′
𝑓 (𝑥0 )
Similarly,
𝑓(𝑥1 )
𝑥2 = 𝑥1 − ′
𝑓 (𝑥1 )
…. ….. …..
…. ….. …..
𝑓(𝑥𝑛 )
𝑥𝑛+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

Question-2: For the initial value 𝒙𝟎 = 𝟏, approximate the root of 𝒇(𝒙) = 𝒙𝟐 − 𝟓𝒙 + 𝟏.


Solution:
Given, 𝑥0 = 1 and 𝑓(𝑥) = 𝑥 2 − 5𝑥 + 1
𝑓 ′ (𝑥) = 2𝑥 − 5
𝑓(1) = 1 − 5 + 1 = −3
𝑓 ′ (1) = 2 − 5 = −3
Using Newton Raphson method:
𝑓(𝑥0 )
𝑥1 = 𝑥0 −
𝑓 ′ (𝑥0 )
−3
=1−
−3
=0

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

So, after 4 iterations Solution is 0.2087

Page -50

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy