numerical differentiation integration
DESCRIPTION
Numerical differentiation integrationTRANSCRIPT
![Page 1: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/1.jpg)
![Page 2: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/2.jpg)
NUMERICAL DIFFERENTIATIONNUMERICAL DIFFERENTIATION
The derivative of f (x) at x0 is:
h
xfhxfxf Limit
h
)( 0000
An approximation to this is:
h
xfhxfxf
)( 000
for small values of h.
Forward Difference Formula
![Page 3: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/3.jpg)
810 . and ln)(Let xxxfFind an approximate value for 81.f
0.1 0.5877867 0.6418539 0.5406720
0.01 0.5877867 0.5933268 0.5540100
0.001 0.5877867 0.5883421 0.5554000
).( 81f ).( hf 81 h
fhf ).().( 8181 h
The exact value of 555081 .. f
![Page 4: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/4.jpg)
Assume that a function goes through three points:
., and ,,, 221100 xfxxfxxfx
)()( xPxf
221100 xfxLxfxLxfxLxP
Lagrange Interpolating Polynomial
![Page 5: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/5.jpg)
21202
10
12101
20
02010
21
))((
))((
))((
))((
))((
))((
xfxxxx
xxxx
xfxxxx
xxxx
xfxxxx
xxxxxP
221100 xfxLxfxLxfxLxP
![Page 6: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/6.jpg)
)()( xPxf
21202
10
12101
20
02010
21
))((
2
))((
2
))((
2
xfxxxx
xxx
xfxxxx
xxx
xfxxxx
xxxxP
![Page 7: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/7.jpg)
20000
000
10000
000
00000
0000
)()2()2(
)(2
)2()()(
)2(2
)2()(
)2()(2
xfhxhxxhx
hxxx
xfhxhxxhx
hxxx
xfhxxhxx
hxhxxxP
If the points are equally spaced, i.e.,
hxxhxx 20201 and
![Page 8: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/8.jpg)
2212020 2
2
2
3xf
h
hxf
h
hxf
h
hxP
2100 432
1xfxfxf
hxP
hxfhxfxfh
xf 2432
10000
Three-point formula:
![Page 9: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/9.jpg)
hxxhxx 0201 and If the points are equally spaced with x0 in the middle:
20000
000
10000
000
00000
0000
)()()(
)(2
)()()(
)(2
)(()(
)()(2
xfhxhxxhx
hxxx
xfhxhxxhx
hxxx
xfhxxhxx
hxhxxxP
![Page 10: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/10.jpg)
2212020 22
0xf
h
hxf
h
hxf
hxP
hxfhxfh
xf 000 2
1
Another Three-point formula:
![Page 11: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/11.jpg)
Alternate approach (Error estimate)
Take Taylor series expansion of f(x+h) about x:
xfh
xfh
xfhxfhxf 33
22
!32
xfh
xfh
xfhxfhxf 33
22
!32
xfh
xfh
xfh
xfhxf 32
2
!32.............. (1)
![Page 12: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/12.jpg)
hOxfh
xfhxf
hOh
xfhxfxf
h
xfhxfxf
Forward Difference
Formula
xfh
xfh
hO 32
2
!32
![Page 13: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/13.jpg)
xfh
xfh
xfhxfhxf 33
22
!3
8
2
422
xfh
xfh
xfhxfhxf 33
22
!3
8
2
422
xfh
xfh
xfh
xfhxf 32
2
!3
4
2
2
2
2
................. (2)
![Page 14: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/14.jpg)
xfh
xfh
xfh
xfhxf 32
2
!32.............. (1)
xfh
xfh
xfh
xfhxf 32
2
!3
4
2
2
2
2
................. (2)
2 X Eqn. (1) – Eqn. (2)
![Page 15: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/15.jpg)
xfh
xfh
xf
h
xfhxf
h
xfhxf
43
32
!4
6
!3
2
2
22
2
43
32
!4
6
!3
2
2
342
hOxf
xfh
xfh
xf
h
xfhxfhxf
![Page 16: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/16.jpg)
2
2
342hOxf
h
xfhxfhxf
2
2
342hO
h
xfhxfhxfxf
h
xfhxfhxfxf
2
342
Three-point Formula
xfh
xfh
hO 43
32
2
!4
6
!3
2
![Page 17: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/17.jpg)
Take Taylor series expansion of f(x+h) about x:
xfh
xfh
xfhxfhxf 33
22
!32Take Taylor series expansion of f(x-h) about x:
xfh
xfh
xfhxfhxf 33
22
!32
The Second Three-point Formula
Subtract one expression from another
xfh
xfh
xfhhxfhxf 66
33
!6
2
!3
22
![Page 18: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/18.jpg)
xfh
xfh
xfhhxfhxf 66
33
!6
2
!3
22
xfh
xfh
xfh
hxfhxf 65
32
!6!32
xfh
xfh
h
hxfhxfxf 6
53
2
!6!32
![Page 19: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/19.jpg)
2
2hO
h
hxfhxfxf
xfh
xfh
hO 65
32
2
!6!3
h
hxfhxfxf
2
Second Three-point Formula
![Page 20: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/20.jpg)
h
xfhxfxf
Forward Difference
Formula
Summary of Errors
xfh
xfh
hO 32
2
!32Error term
![Page 21: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/21.jpg)
h
xfhxfhxfxf
2
342
First Three-point Formula
Summary of Errors continued
xfh
xfh
hO 43
32
2
!4
6
!3
2Error term
![Page 22: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/22.jpg)
h
hxfhxfxf
2
Second Three-point Formula
xfh
xfh
hO 65
32
2
!6!3Error term
Summary of Errors continued
![Page 23: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/23.jpg)
Example:
xxexf
Find the approximate value of 2f
1.9 12.703199
2.0 14.778112
2.1 17.148957
2.2 19.855030
x xf
with 10.h
![Page 24: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/24.jpg)
Using the Forward Difference formula:
0 0 0
1f x f x h f x
h
12 2 1 2
0 11
17 148957 14 7781120 1
23 708450
f f . f.
. ...
![Page 25: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/25.jpg)
Using the 1st Three-point formula:
032310.22
855030.19
148957.174778112.1432.0
1
)2.2()1.2(4)2(31.02
12
ffff
hxfhxfxfh
xf 2432
10000
![Page 26: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/26.jpg)
Using the 2nd Three-point formula:
228790.22
703199.12148957.172.0
1
)9.1()1.2(1.02
12
fff
The exact value of 22.167168 :is 2f
hxfhxfh
xf 000 2
1
![Page 27: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/27.jpg)
Comparison of the results with h = 0.1
Formula Error
Forward Difference 23.708450 1.541282
1st Three-point 22.032310 0.134858
2nd Three-point 22.228790 0.061622
2f
The exact value of 2f is 22.167168
![Page 28: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/28.jpg)
Second-order Derivative
xfh
xfh
xfhxfhxf 33
22
!32
xfh
xfh
xfhxfhxf 33
22
!32
Add these two equations.
xfh
xfh
xfhxfhxf 44
22
!4
2
2
22
2 4
2 42 22
2 4!
h hf x h f x f x h f x f x
![Page 29: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/29.jpg)
xfh
xfh
hxfxfhxf 42
22 !4
22
xfh
h
hxfxfhxfxf 4
2
22
!4
22
2
2 2
h
hxfxfhxfxf
![Page 30: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/30.jpg)
NUMERICAL INTEGRATIONNUMERICAL INTEGRATION
b
a
dxxf )( area under the curve f(x) between
. to bxax
In many cases a mathematical expression for f(x) is unknown and in some cases even if f(x) is known its complex form makes it difficult to perform the integration.
![Page 31: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/31.jpg)
y
xx 0 = a x 0 = b
f(a)
f(b)f(x)
![Page 32: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/32.jpg)
y
xx 0 = a x 0 = b
f(a)
f(b)
f(x)
![Page 33: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/33.jpg)
Area of the trapezoid
The length of the two parallel sides of the trapezoid are: f(a) and f(b)
The height is b-a
)()(
)()()(
bfafh
bfafab
dxxfb
a
2
2
![Page 34: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/34.jpg)
Simpson’s Rule:
2
0
2
0
x
x
x
x
dxxPdxxf )()(
hxxhxx 20201 and
![Page 35: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/35.jpg)
2 2
0 0
2
0
2
0
1 20
0 1 0 2
0 21
1 0 1 2
0 12
2 0 2 1
x x
x x
x
x
x
x
( x x )( x x )P x dx f x dx
( x x )( x x )
( x x )( x x )f x dx
( x x )( x x )
( x x )( x x )f x dx
( x x )( x x )
![Page 36: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/36.jpg)
)()(
)()(
210 43
2
0
2
0
xfxfxfh
dxxPdxxfx
x
x
x
![Page 37: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/37.jpg)
y
xx 0 = a x 0 = b
f(a)
f(b)
f(x)
![Page 38: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/38.jpg)
y
xx 0 = a x 0 = b
f(a)
f(b)
f(x)
![Page 39: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/39.jpg)
y
xx 0 = a x 0 = b
f(a)
f(b)
f(x)
![Page 40: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/40.jpg)
y
xx 0 = a x 0 = b
f(a)
f(b)
f(x)
![Page 41: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/41.jpg)
Composite Numerical Integration
![Page 42: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/42.jpg)
Riemann Sum
The area under the curve is subdivided into n subintervals. Each subinterval is treated as a rectangle. The area of all subintervals are added to determine the area under the curve.
There are several variations of Riemann sum as applied to composite integration.
![Page 43: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/43.jpg)
In Left Riemann sum, the left-side sample of the function is used as the height of the individual rectangle.
a b
Left Riemann Sumy
xx
1
2
3 2
1i
x b a / n
x a
x a x
x a x
x a i x
1
nb
iai
f x dx f x x
![Page 44: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/44.jpg)
In Right Riemann sum, the right-side sample of the function is used as the height of the individual rectangle.
a b
Right Riemann Sumy
x
x
1
2
3
2
3
i
x b a / n
x a x
x a x
x a x
x a i x
1
nb
iai
f x dx f x x
![Page 45: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/45.jpg)
In the Midpoint Rule, the sample at the middle of the subinterval is used as the height of the individual rectangle.
a b
Midpoint Ruley
xx
1
2
3
2 1 1 2
2 2 1 2
2 3 1 2
2 1 2i
x b a / n
x a x /
x a x /
x a x /
x a i x /
1
nb
iai
f x dx f x x
![Page 46: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/46.jpg)
Composite Trapezoidal Rule:
Divide the interval into n subintervals and apply Trapezoidal Rule in each subinterval.
)()()( bfxfafh
dxxfn
kk
b
a
1
1
22
where
nkkhaxn
abh k , ... , , ,for and 210
![Page 47: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/47.jpg)
by dividing the interval into 20 subintervals.
Find π
sin0
(x)dx
2021020
20
20
....., , , , ,π
π
kk
khax
n
abh
n
k
![Page 48: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/48.jpg)
9958861
2020
40
22
19
1
1
10
.
πsinπ
sinsinπ
)()()sin(π
k
n
kk
k
bfxfafh
dxx
![Page 49: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/49.jpg)
Composite Simpson’s Rule:
Divide the interval into n subintervals and apply Simpson’s Rule on each consecutive pair of subinterval. Note that n must be even.
)()(
)()(
/
)/(
bfxf
xfafh
dxxf
n
kk
n
kk
b
a
2
112
12
12
4
23
![Page 50: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/50.jpg)
nkkhaxn
abh k , ... , , ,for and 210
where
by dividing the interval into 20 subintervals.
Find π
sin0
(x)dx
2021020
2020
....., , , , ,π
π
kk
khax
n
abhn
k
![Page 51: Numerical differentiation integration](https://reader034.vdocuments.mx/reader034/viewer/2022042422/545550dbaf795994188b482b/html5/thumbnails/51.jpg)
0000062
20
124
20
220
6010
1
9
10
.
)πsin(π)(
sin
πsinsin
π)sin(
π
k
k
k
kdxx