0% found this document useful (0 votes)
64 views15 pages

Finite Divided Difference Formula

Uploaded by

junayed.rafid
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)
64 views15 pages

Finite Divided Difference Formula

Uploaded by

junayed.rafid
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/ 15

CSE330(Numerical Methods)

LECTURE 4 – FINITE DIVIDED DIFFERENCE

INSTRUCTOR: NAHIAN IBN HASAN


L E C T U R E R , D E PA R T M E N T O F E E E ,
B R A C U N I V E R S I T Y, D H A K A , B A N G L A D E S H

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 1


Finite Divided Difference
❑Finite Divided Difference is useful for determining the differentiation value numerically. There are usually
three different kinds of finite divided difference formula used usually –

1. Forward Finite Divided Difference (Uses present function value to determine the next differentiation value)
2. Backward Finite Divided Difference (Uses present function value to determine the previous differentiation value)
3. Central Finite Divided Difference (Uses previous and the next function value to determine the present differentiation
value)

➢There are different orders possible within each category (e.g. first order, second order and etc.) to determine the first
order differentiation, second order differentiation and etc., respectively.

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 2


Forward Finite Divided Difference(1st Order)
❑The Taylor series for finding the next value of a function based on the present value is –

′ ′′ 1 2 𝑓𝑛 (xi) 𝑛
f(xi+1) = f(xi) + 𝑓 (𝑥𝑖) (xi+1 – xi) + 𝑓 (𝑥𝑖) 2! (xi+1 – xi) +……..+ 𝑛!
(xi+1 – xi) + R……………….(1)

❑If we truncate the series after the first derivative term, we will get,

f(xi+1) = f(xi) + 𝑓 ′ (𝑥𝑖) (xi+1 – xi) + R1 ;{R1 due to error terms accumulating after first derivative}

or,
f(xi+1) − f(xi) R1 f(xi+1) − f(xi) ∆𝑓𝑖
𝑓 ′ (𝑥𝑖) = - = - O(xi+1 – xi) =
(xi+1 – xi) (xi+1 – xi) (xi+1 – xi) h + O(h)……………….(2)

where ∆𝑓𝑖 is referred to as the first forward difference and h is called the step size, that is, the length of the interval
over which the approximation is made. It is termed a “forward” difference because it utilizes data at i and i+1 to
∆𝑓
estimate the derivative. The entire term h 𝑖 is referred to as a first order finite forward divided difference.

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 3


Backward Finite Divided Difference(1st Order)
❑The Taylor series for finding the previous value of a function based on the present value is represented as-

1 𝑛
′ ′′ 2 𝑛 𝑓 (xi)
f(xi-1) = f(xi) - 𝑓 (𝑥𝑖) (xi – xi-1) + 𝑓 (𝑥𝑖) 2! (xi – xi−1) −……..+ (−1) 𝑛! (xi – xi−1)𝑛 + R…………..(3)

❑If we truncate the series after the first derivative term, we will get,

f(xi-1) = f(xi) - 𝑓 ′ (𝑥𝑖) (xi – xi-1) + R1 ;{R1 due to error terms accumulating after first derivative}

or,
f(xi) − f(xi−1) R1 f(xi) − f(xi−1) ∇𝑓 𝑖
𝑓 ′ (𝑥𝑖) = + = + O(xi – xi−1) =
(xi – xi−1) (xi – xi−1) (xi – xi−1) h + O(h)………………..(4)

Where ∇𝑓𝑖 is referred to as the first backward difference and h is called the step size, that is, the length of the
interval over which the approximation is made. It is termed a “backward” difference because it utilizes data at i and
∇𝑓
i+1 to estimate the derivative. The entire term h 𝑖 is referred to as a first order finite backward divided difference.

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 4


Central Finite Divided Difference (1st Order)

❑Central divided difference formula can be obtained by subtracting equation 3 from equation 1.
1 1
f(xi+1) - f(xi-1) = 𝑓 ′ (𝑥𝑖) (xi+1 – xi) + 𝑓 ′ (𝑥𝑖) (xi – xi-1) + 𝑓 ′′′ (𝑥𝑖) 3! (xi+1−xi)3 + 𝑓 ′′′ (𝑥𝑖) 3! (xi − xi−1)3
Since,
xi+1 – xi = xi – xi−1 = h

We get,
1
f(xi+1) - f(xi-1) = 2𝑓 ′ (𝑥𝑖) h + 2 𝑓 ′′′ (𝑥𝑖) 3! h3 + …..

After algebraic manipulation,


f(xi − f(xi 1 f(xi+1) − f(xi−1)
𝑓 ′ (𝑥𝑖) = +1)2ℎ −1) - 𝑓 ′′′ (𝑥𝑖) 3! h2 - ….. = 2ℎ
- O(h2
) ……………………..(5)

This equation is termed as first order finite central divided difference. Notice that the truncation error is of the
order of h2 in contrast to the forward and backward approximations that were of the order of h. Consequently, the
Taylor series analysis yields the practical information that the centered difference is a more accurate
representation of the derivative than forward or backward difference.

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 5


Finite Divided Difference (1st Order) Example
❑Example 1:
Use forward and backward difference approximations of O(h) and a centered difference
approximation of O(h2) to estimate the first derivative of
f(x) = -0.1𝑥 4 -0.15𝑥 3 -0.5𝑥 2 - 0.25𝑥 + 1.25
at x=0.5 using a step size h=0.5. Repeat the computation using h=0.25. Also for each of the case
determine the percentage true relative error.
Solution:
Using equation 1, 3 and 5 we can determine the value of first order differentiation using forward,
backward and central difference, respectively. Please think about how you can find the
percentage true relative error.
The result is summarized bellow.

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 6


Finite Divided Difference (1st Order) Example

Function Finite Divided Result for h=0.5 Result for h=0.25


Difference 𝑓 ′ (0.5) |ϵt(0.5)|% 𝑓 ′ (0.25) |ϵt(0.25)|%
Forward -1.45 58.9% -1.155 26.5%
f(x) Backward -0.55 39.7% -0.714 21.7%
Central -1.0 9.6% -0.934 2.4%

The example shows that the central divided difference formula provides the best approximation to the
true value. Also, as we decrease the value of h, the result gets closer to the true value and ,hence, the
error percentage decreases.

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 7


Finite Divided Difference(2nd Order)
❑If we want to determine the value of f(xi+2) using the current value of f(xi), the formula of forward Taylor
series(equation 1) remains the same except the step (h) is replaced by double step (2h). It’s because, we are
predicting the value two step forward. Similarly, for determining the value of f(xi+3) using f(xi), we need to
replace step(h) by triple step(3h).
❑The formula for double step Taylor series can be written as –
′ ′′ 1 2 𝑓𝑛 (xi)
f(xi+2) = f(xi) + 𝑓 (𝑥𝑖) (xi+2 – xi) + 𝑓 (𝑥𝑖) (xi+2 – xi) +……..+ (xi+2 – xi)𝑛 + R……………….(6)
2! 𝑛!

Since, xi+2 – xi = (xi+2 – xi+1)+ (xi+1 – xi) = h + h = 2h


The formula becomes,
′ ′′ 1 2 𝑓𝑛 (xi)
f(xi+2) = f(xi) + 𝑓 (𝑥𝑖) (2h) + 𝑓 (𝑥𝑖) (2h) +……..+ (2h)𝑛 + R……………….(7)
2! 𝑛!

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 8


Finite Divided Difference(2nd Order)
❑Multiplying equation 1 by 2 and then subtracting it from equation 7, we get
7
f(xi+2) - 2f(xi+1) = - f(xi) + 𝑓 ′′ (𝑥𝑖) h2 + 𝑓 ′′′ (𝑥𝑖) h3 + 𝑓 IV (𝑥𝑖) h4 ……………………..
12

After manipulating, we get


f(xi+2) − 2f(xi+1) + f(xi) f(xi+2) − 2f(xi+1) + f(xi)
𝑓 ′′ (𝑥𝑖) = - 𝑓 ′′′ (𝑥𝑖) h - ……… = - 𝑂(ℎ)…………………(8)
ℎ2 ℎ2

Similar manipulation for backward and central difference, we can get the following equations,
f(xi) − 2f(xi−1) + f(xi−2)
𝑓 ′′ (𝑥𝑖) = - 𝑂(ℎ)…………………(9)
ℎ2
f(xi+1) − 2f(xi) + f(xi−1)
𝑓 ′′ (𝑥𝑖) = - 𝑂(ℎ2)…………………(10)
ℎ2

Equation 8, 9 and 10 represent the second order finite forward, backward and central divided difference formula,
respectively.
Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 9
Increasing Accuracy
❑We have considered up to the first derivative term in case of determining the divided
difference formula of the first order for all of forward, backward and central differences. The
formula changes if we include higher derivative terms in the equation. In that case the formula
changes and the remainder term incorporates higher order derivative terms (i.e. O(h2),O(h3) and
etc.)
❑The same goes for higher order divided difference formula.
❑We can try to determine these formulae. Try at home and let me know.

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 10


Formulae for Forward Divided Difference

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 11


Formulae for Backward Divided Difference

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 12


Formulae for Central Divided Difference

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 13


Conclusion
Upon completing this lesson, we have
❑Learnt how Taylor series can be used in approximating the value of differentiation numerically.
❑Formulated the first order forward, backward and central divided difference formula.
❑Formulated the Second order forward, backward and central divided difference formula.
❑Learnt that central divided difference formula always provides better approximation to the
differentiation than forward or backward difference.
❑The accuracy of any difference formula can be increased by incorporating higher order differential
term from the Taylor Series.

These formulae will be used thoroughly throughout the remainder of the course. So, you try to
understand the Taylor series and the divided difference formulae.

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 14


Thank You

Nahian Ibn Hasan DEPARTMENT OF EEE, BRAC UNIVERSITY 15

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