0% found this document useful (0 votes)
79 views14 pages

ID-302 Lecture 1A

1) Taylor's theorem states that a function f(x) can be approximated using its value, derivatives, and incremental changes in x from a given point. 2) The forward difference approximation of the first derivative is derived by substituting the incremental change Δx into the Taylor series and ignoring higher order terms, yielding f'(x) ≈ [f(x + Δx) - f(x)]/Δx. 3) Similarly, the backward and central difference approximations can be derived by considering points before or around x, yielding more accurate approximations of order Δx.

Uploaded by

Jahangir Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views14 pages

ID-302 Lecture 1A

1) Taylor's theorem states that a function f(x) can be approximated using its value, derivatives, and incremental changes in x from a given point. 2) The forward difference approximation of the first derivative is derived by substituting the incremental change Δx into the Taylor series and ignoring higher order terms, yielding f'(x) ≈ [f(x + Δx) - f(x)]/Δx. 3) Similarly, the backward and central difference approximations can be derived by considering points before or around x, yielding more accurate approximations of order Δx.

Uploaded by

Jahangir Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Derive the forward difference

approximation from Taylor series

' f 'at a point


Taylors theorem says that if you know the value of a function
and
xi all its derivatives at that point, provided the derivatives are

continuous betweenxi and xi 1 , then

f xi 1

f xi
xi 1 xi 2
f xi f xi xi 1 xi
2!

Substituting for conveniencex xi 1 xi


f xi
x 2
2!
f xi 1 f xi f xi
x
f xi

x
2!

f xi 1 f xi f xi x

f xi
1/25/17

f xi 1 f xi
0 x
x

Derive the forward difference


approximation from Taylor series Cont.

x shows that the error in the approximation is of the orde


The 0
term

you now derive from Taylor series the


of xCan
formula forbackward
divided difference approximation of the first derivative?
As shown above, both forward and backward divided
difference
approximation of the first
derivative are accurate on the order of

0 x

Can we get better approximations? Yes, another method to approximate

the first derivative is called the Central difference approximation of


the first derivative.
1/25/17

Graphical Representation Of
Forward Difference
Approximation

Figure 1 Graphical Representation of forward difference approximation of first derivative

1/25/17

Differentiation Continuous
Functions
Forward Difference
Approximation

f x x f x
f x
x 0
x
lim

For
finite

a' x'

f x x f x
f x
x
1/25/17

Backward Difference Approximation of


the First Derivative

We know

lim f x x f x
f x
x 0
x
For a finite' x' ,

f x

f x x f x
x

If ' x'is chosen as a negative number,

f x

1/25/17

f x x f x
x

f x f x x
x

Backward Difference Approximation


of the First Derivative Cont.
This is a backward difference approximation as you are taking a point
, we may choose
backward from x. To find the value fof
x at x xi
another
point ' x' behind as x x . This gives

f xi

f xi f xi 1
x
f xi f xi 1
xi xi 1

where

x xi xi 1

1/25/17

i 1

Backward Difference Approximation of


the First Derivative Cont.

f(x)

x-x

Figure 2 Graphical Representation of backward difference


approximation of first derivative

1/25/17

Derive the forward difference


approximation from Taylor series Cont.

From Taylor series


f xi 1 f xi f xi x

f xi
x 2 f xi x 3
2!
3!

f xi 1 f xi f xi x

f xi
x 2 f xi x 3
2!
3!

Subtracting equation (2) from equation (1)


f xi 1 f xi 1 f xi 2x

f xi

f xi
1/25/17

2 f xi
x 3
3!

f xi 1 f xi 1 f xi
x 2

2x
3!

f xi 1 f xi 1
2
0 x
2x

Central Divided
Difference

Hence showing that we have obtained a more accurate formula as


the
error is of the order of0 x 2 .
f(x)

x-x

x+x

Figure 3 Graphical Representation of central difference approximation of first

derivative
1/25/17

Finite Difference
Approximation of Higher
Derivatives

10

One can use Taylor series to approximate a higher order derivative.


For example, to approximatef x , the Taylor series for
f xi 2 f xi f xi 2x


f xi
2x 2 f xi 2x 3
2!
3!

where
xi 2 xi 2x
f xi 1 f xi f xi x

where

xi 1 xi x
1/25/17


f xi
x 2 f xi x 3
2!
3!

Finite Difference
Approximation of Higher
Derivatives Cont.

11

Subtracting 2 times equation (4) from equation (3) gives

f xi 2 2 f xi 1 f xi f xi x f xi x
2

f xi

f xi

1/25/17

f xi 2 2 f xi 1 f xi

f xi x

f xi 2 2 f xi 1 f xi

0 x

(5)

Higher order accuracy of higher


order derivatives

12

The formula given by equation (5) is a forward difference approximation of


the second derivative and has the error
of the order of x . Can we get
a formula that has a better accuracy? We can get the central difference
approximation of the second derivative.
The Taylor series for
f xi 1 f xi f xi x

where

xi 1 xi x
1/25/17



f xi
x 2 f xi x 3 f xi x 4
2!
3!
4!

(6)

Higher order accuracy of higher


order derivatives Cont.

13

f xi 1 f xi f xi x



f xi
x 2 f xi x 3 f xi x 4
2!
3!
4!

where
xi 1 xi x
Adding equations (6) and (7), gives
f xi 1 f xi 1 2 f xi f xi x
2

f xi

f xi
1/25/17

f xi 1 2 f xi f xi 1

x 2

f xi x

12

f xi 1 2 f xi f xi 1

x 2

x
f x

0 x

12

(7)

THE END

1/25/17

14

You might also like