Docsity

Differentiation Using Difference Operators-Numerical Analysis-Lecture Handouts, Lecture notes of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Numerical Analysis –MTH603 VU
© Copyright Virtual University of Pakistan 1
D
DI
IF
FF
FE
ER
RE
EN
NT
TI
IA
AT
TI
IO
ON
N
U
US
SI
IN
NG
G
D
DI
IF
FF
FE
ER
RE
EN
NC
CE
E
O
OP
PE
ER
RA
AT
TO
OR
RS
S
I
In
nt
tr
ro
od
du
uc
ct
ti
io
on
n
C
Co
on
ns
si
id
de
er
r
a
a
f
fu
un
nc
ct
ti
io
on
n
o
of
f
s
si
in
ng
gl
le
e
v
va
ar
ri
ia
ab
bl
le
e
y
y
=
=
f
f
(
(x
x)
).
.
I
If
f
t
th
he
e
f
fu
un
nc
ct
ti
io
on
n
i
is
s
k
kn
no
ow
wn
n
a
an
nd
d
s
si
im
mp
pl
le
e,
,
w
we
e
c
ca
an
n
e
ea
as
si
il
ly
y
o
ob
bt
ta
ai
in
n
i
it
ts
s
d
de
er
ri
iv
va
at
ti
iv
ve
e
(
(s
s)
)
o
or
r
c
ca
an
n
e
ev
va
al
lu
ua
at
te
e
i
it
ts
s
d
de
ef
fi
in
ni
it
te
e
i
in
nt
te
eg
gr
ra
al
l
H
Ho
ow
we
ev
ve
er
r,
,
i
if
f
w
we
e
d
do
o
n
no
ot
t
k
kn
no
ow
w
t
th
he
e
f
fu
un
nc
ct
ti
io
on
n
a
as
s
s
su
uc
ch
h
o
or
r
t
th
he
e
f
fu
un
nc
ct
ti
io
on
n
i
is
s
c
co
om
mp
pl
li
ic
ca
at
te
ed
d
a
an
nd
d
i
is
s
g
gi
iv
ve
en
n
i
in
n
a
a
t
ta
ab
bu
ul
la
ar
r
f
fo
or
rm
m
a
at
t
a
a
s
se
et
t
o
of
f
p
po
oi
in
nt
ts
s
x
x0
0,
,x
x1
1,
,…
…,
,x
xn
n,
,
w
we
e
u
us
se
e
o
on
nl
ly
y
n
nu
um
me
er
ri
ic
ca
al
l
m
me
et
th
ho
od
ds
s
f
fo
or
r
d
di
if
ff
fe
er
re
en
nt
ti
ia
at
ti
io
on
n
o
or
r
i
in
nt
te
eg
gr
ra
at
ti
io
on
n
o
of
f
t
th
he
e
g
gi
iv
ve
en
n
f
fu
un
nc
ct
ti
io
on
n.
.
W
We
e
s
sh
ha
al
ll
l
d
di
is
sc
cu
us
ss
s
n
nu
um
me
er
ri
ic
ca
al
l
a
ap
pp
pr
ro
ox
xi
im
ma
at
ti
io
on
n
t
to
o
d
de
er
ri
iv
va
at
ti
iv
ve
es
s
o
of
f
f
fu
un
nc
ct
ti
io
on
ns
s
o
of
f
t
tw
wo
o
o
or
r
m
mo
or
re
e
v
va
ar
ri
ia
ab
bl
le
es
s
i
in
n
t
th
he
e
l
le
ec
ct
tu
ur
re
es
s
t
to
o
f
fo
ol
ll
lo
ow
w
w
wh
he
en
n
w
we
e
s
sh
ha
al
ll
l
t
ta
al
lk
k
a
ab
bo
ou
ut
t
p
pa
ar
rt
ti
ia
al
l
d
di
if
ff
fe
er
re
en
nt
ti
ia
al
l
e
eq
qu
ua
at
ti
io
on
ns
s.
.
I
In
n
w
wh
ha
at
t
f
fo
ol
ll
lo
ow
ws
s,
,
w
we
e
s
sh
ha
al
ll
l
d
de
er
ri
iv
ve
e
a
an
nd
d
i
il
ll
lu
us
st
tr
ra
at
te
e
v
va
ar
ri
io
ou
us
s
f
fo
or
rm
mu
ul
la
ae
e
f
fo
or
r
n
nu
um
me
er
ri
ic
ca
al
l
d
di
if
ff
fe
er
re
en
nt
ti
ia
at
ti
io
on
n
o
of
f
a
a
f
fu
un
nc
ct
ti
io
on
n
o
of
f
a
a
s
si
in
ng
gl
le
e
v
va
ar
ri
ia
ab
bl
le
e
b
ba
as
se
ed
d
o
on
n
f
fi
in
ni
it
te
e
d
di
if
ff
fe
er
re
en
nc
ce
e
o
op
pe
er
ra
at
to
or
rs
s
a
an
nd
d
i
in
nt
te
er
rp
po
ol
la
at
ti
io
on
n.
.
S
Su
ub
bs
se
eq
qu
ue
en
nt
tl
ly
y,
,
w
we
e
s
sh
ha
al
ll
l
d
de
ev
ve
el
lo
op
p
N
Ne
ew
wt
to
on
n-
-C
Co
ot
te
es
s
f
fo
or
rm
mu
ul
la
ae
e
a
an
nd
d
r
re
el
la
at
te
ed
d
t
tr
ra
ap
pe
ez
zo
oi
id
da
al
l
r
ru
ul
le
e
a
an
nd
d
S
Si
im
mp
ps
so
on
n’
’s
s
r
ru
ul
le
e
f
fo
or
r
n
nu
um
me
er
ri
ic
ca
al
l
i
in
nt
te
eg
gr
ra
at
ti
io
on
n
o
of
f
a
a
f
fu
un
nc
ct
ti
io
on
n.
.
W
We
e
a
as
ss
su
um
me
e
t
th
ha
at
t
t
th
he
e
f
fu
un
nc
ct
ti
io
on
n
y
y
=
=
f
f
(
(x
x)
)
i
is
s
g
gi
iv
ve
en
n
f
fo
or
r
t
th
he
e
v
va
al
lu
ue
es
s
o
of
f
t
th
he
e
i
in
nd
de
ep
pe
en
nd
de
en
nt
t
v
va
ar
ri
ia
ab
bl
le
e
x
x
=
=
x
x0
0
+
+
p
ph
h,
,
f
fo
or
r
p
p
=
=
0
0,
,
1
1,
,
2
2,
,
…
…
a
an
nd
d
s
so
o
o
on
n.
.
T
To
o
f
fi
in
nd
d
t
th
he
e
d
de
er
ri
iv
va
at
ti
iv
ve
es
s
o
of
f
s
su
uc
ch
h
a
a
t
ta
ab
bu
ul
la
ar
r
f
fu
un
nc
ct
ti
io
on
n,
,
w
we
e
p
pr
ro
oc
ce
ee
ed
d
a
as
s
f
fo
ol
ll
lo
ow
ws
s
C
Ca
as
se
e
I
I:
:
U
Us
si
in
ng
g
f
fo
or
rw
wa
ar
rd
d
d
di
if
ff
fe
er
re
en
nc
ce
e
o
op
pe
er
ra
at
to
or
r
∆
∆
a
an
nd
d
c
co
om
mb
bi
in
ni
in
ng
g
e
eq
qu
ua
at
ti
io
on
ns
s
() ( )Ef x f x h
=
+
a
an
nd
d
1E
∆
=−
log log(1 )hD E
=
=+∆
Remember the Differential operator, D is known to represents the property
2
2"
2
() () ()
() () ()
d
Df x f x f x
dx
d
Dfx fx f x
dx
′
==
==
T
Th
hi
is
s
w
wo
ou
ul
ld
d
m
me
ea
an
n
t
th
ha
at
t
i
in
n
t
te
er
rm
ms
s
o
of
f
∆
∆
:
:
2345
1
2345
Dh

∆∆∆∆
=∆−+−+−


"
Therefore
23
00
00 0
45
00
0
() ()
1
() () () 23
() ()
( )
45
fx fx
Df x f x f x
h
fx fx d
f
x
dx
∆∆
′
==∆− +
∆∆
−+−=
"
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Differentiation Using Difference Operators-Numerical Analysis-Lecture Handouts and more Lecture notes Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

DIDIFFFFEERREENNTTIIAATTIIOONN UUSSIINNGG DDIIFFFFEERREENNCCEE OOPPEERRAATTOORRSS

In Inttrroodduuccttiioonn

CCoonnssiiddeerr aa ffuunnccttiioonn ooff ssiinnggllee vvaarriiaabbllee^ y =y= ff ((xx)).. IIff tthhee ffuunnccttiioonn iiss kknnoowwnn aanndd ssiimmppllee,,

wwee ccaann eeaassiillyy oobbttaaiinn iittss ddeerriivvaattiivvee ((ss)) oorr ccaann eevvaalluuaattee iittss ddeeffiinniittee iinntteeggrraall

HHoowweevveerr,, iiff wwee ddoo nnoott kknnooww tthhee ffuunnccttiioonn aass ssuucchh oorr tthhee ffuunnccttiioonn iiss ccoommpplliiccaatteedd aanndd iiss

ggiivveenn iinn aa ttaabbuullaarr ffoorrmm aatt aa sseett ooff ppooiinnttss xx 00

,,xx (^11)

,…,…,,xx nn

, w,wee uussee oonnllyy nnuummeerriiccaall mmeetthhooddss ffoorr

ddiiffffeerreennttiiaattiioonn oorr iinntteeggrraattiioonn ooff tthhee ggiivveenn ffuunnccttiioonn..

WWee sshhaallll ddiissccuussss nnuummeerriiccaall aapppprrooxxiimmaattiioonn ttoo ddeerriivvaattiivveess ooff ffuunnccttiioonnss ooff ttwwoo oorr mmoorree

vvaarriiaabblleess iinn tthhee lleeccttuurreess ttoo ffoollllooww wwhheenn wwee sshhaallll ttaallkk aabboouutt ppaarrttiiaall ddiiffffeerreennttiiaall eeqquuaattiioonnss..

IInn wwhhaatt ffoolllloowwss,, wwee sshhaallll ddeerriivvee aanndd iilllluussttrraattee vvaarriioouuss ffoorrmmuullaaee ffoorr nnuummeerriiccaall

ddiiffffeerreennttiiaattiioonn ooff aa ffuunnccttiioonn ooff aa ssiinnggllee vvaarriiaabbllee bbaasseedd oonn ffiinniittee ddiiffffeerreennccee ooppeerraattoorrss aanndd

iinntteerrppoollaattiioonn..

SSuubbsseeqquueennttllyy,, wwee sshhaallll ddeevveelloopp NNeewwttoonn--CCootteess ffoorrmmuullaaee aanndd rreellaatteedd ttrraappeezzooiiddaall rruullee aanndd

SSiimmppssoonn’’ss rruullee ffoorr nnuummeerriiccaall iinntteeggrraattiioonn ooff aa ffuunnccttiioonn..

WWee aassssuummee tthhaatt tthhee ffuunnccttiioonn^ yy ==^ ff^ (( xx )) iiss ggiivveenn ffoorr tthhee vvaalluueess ooff tthhee iinnddeeppeennddeenntt vvaarriiaabbllee

xx^ ==^ xx 0 0

++ phph , f,foorr pp = 0=0,, 11,, 22,, …… aanndd ssoo oonn.. TToo ffiinndd tthhee ddeerriivvaattiivveess ooff ssuucchh aa ttaabbuullaarr

ffuunnccttiioonn,, wwee pprroocceeeedd aass ffoolllloowwss

CCaassee II::

UUssiinngg ffoorrwwaarrdd ddiiffffeerreennccee ooppeerraattoorr^ ∆∆^ aanndd ccoommbbiinniinngg eeqquuaattiioonnss

E f ( ) x = f ( x + h )

aanndd

∆ = E − 1

hD = log E = log(1 + ∆)

Remember the Differential operator, D is known to represents the property

2 2 " 2

d Df x f x f x dx

d D f x f x f x dx

TThhiiss wwoouulldd mmeeaann tthhaatt iinn tteerrmmss ooff ∆∆ ::

2 3 4 5 1

D

h

Therefore

2 3 0 0 0 0 0

4 5 0 0 0

f x f x Df x f x f x h

f x f x d f x dx

in other words

2 3 4 0 0 0 0 0 0

y y y Dy y y h

AAllssoo,, wwee ccaann eeaassiillyy vveerriiffyy

2 3 4 2 2 2

D

h

2 3 4 5 2

h 12 6

2 3 2 0 0 (^2 ) (^0 2 02 4 ) 0 0

y y d y D y y dx h (^) y y

 +^ ∆^ −^ ∆^ + 

CCaassee IIII::

UUssiinngg bbaacckkwwaarrdd ddiiffffeerreennccee ooppeerraattoorr ,, wwee hhaavvee^ ∇

hD = − log(1 − ∇)

OOnn eexxppaannssiioonn,, wwee hhaavvee^

2 3 4 1

D

h

wwee ccaann aallssoo vveerriiffyy tthhaatt

2 2 3 4 2 2

D

h

2 3 4 5 2

h 12 6

Hence

2 3 4 1

n n n

n n n n

d y Dy y dx

y y y y h

= =^ ′

and

2

2 3 4 5 2

n n

n n n n

y D y

y y y y h

TThhee ffoorrmmuullaaee ffoorr DDyy 00

aanndd DD

yy 00

aarree uusseeffuull ttoo ccaallccuullaattee tthhee ffiirrsstt aanndd sseeccoonndd ddeerriivvaattiivveess aatt

tthhee bbeeggiinnnniinngg ooff tthhee ttaabbllee ooff vvaalluueess iinn tteerrmmss ooff ffoorrwwaarrdd ddiiffffeerreenncceess;; wwhhiillee ffoorrmmuullaaee ffoorr

yy’’ n n

anandd yy’’’’ nn

2 2 4 6 2

D

h

wwhhiillee ffoorr ccoommppuuttiinngg tthhee ffiirrssttddeerriivvaattiivvee aatt aann iinntteerriioorr ttaabbuullaarr ppooiinntt,, wwee iinn ggeenneerraall uussee

aannootthheerr ccoonnvveenniieenntt ffoorrmm ffoorr DD,, wwhhiicchh iiss ddeerriivveedd aass ffoolllloowwss.. MMuullttiippllyy tthhee rriigghhtt hhaanndd

ssiiddee ooff

(^1 1 3 )

d y y Dy y y y dx h

by

2 1 ( 4)

wwhhiicchh iiss uunniittyy aanndd nnoottiinngg tthhee BBiinnoommiiaall eexxppaannssiioonn

1 2 2 2

4 6

δ δ

δ δ

−    +^  =^ −^ +  

×

we get

2 4

3 5

D

h

 −^ +^ − 

OOnn ssiimmpplliiffiiccaattiioonn,, wwee oobbttaaiinn

D

h

TThheerreeffoorree tthhee eeqquuaattiioonn ccaann aallssoo bbee wwrriitttteenn iinn aannootthheerr uusseeffuull ffoorrmm aass

y D y y y h

TThhee llaasstt ttwwoo eeqquuaattiioonnss ffoorr yy”” aanndd yy’’ rreessppeeccttiivveellyy aarree kknnoowwnn aass SSttiirrlliinngg’’ss ffoorrmmuullaaee ffoorr

ccoommppuuttiinngg tthhee ddeerriivvaattiivveess ooff aa ttaabbuullaarr ffuunnccttiioonn.. SSiimmiillaarr ffoorrmmuullaaee ccaann bbee ddeerriivveedd ffoorr

ccoommppuuttiinngg hhiigghheerr oorrddeerr ddeerriivvaattiivveess ooff aa ttaabbuullaarr ffuunnccttiioonn ..

TThhee eeqquuaattiioonn ffoorr yy’’ ccaann aallssoo bbee

wwrriitttteenn aass 2 2 2 2 2 2 1 3 (1) (2) 5 (1) (2) (3) 7

y y y y y h

μ δ δ δ δ

IInn oorrddeerr ttoo iilllluussttrraattee tthhee uussee ooff ffoorrmmuullaaee ddeerriivveedd ssoo ffaarr,, ffoorr ccoommppuuttiinngg tthhee ddeerriivvaattiivveess ooff aa

ttaabbuullaatteedd ffuunnccttiioonn,, wwee sshhaallll ccoonnssiiddeerr ssoommee eexxaammpplleess iinn tthhee nneexxtt lleeccttuurree..