(4-1) Numerical Differentiation

Numerical Differentiation and Integration
(4-1) Numerical Differentiation
1
(4-1) Numerical Differentiation
MaSc 352 - PNU
Forward and Backward Difference Formulas:
2
(4-1) Numerical Differentiation
MaSc 352 - PNU
3
(4-1) Numerical Differentiation
MaSc 352 - PNU
Example (1)
4
(4-1) Numerical Differentiation
MaSc 352 - PNU
Obtaining General Derivative Approximation Formula:
108
5
(4-1) Numerical Differentiation
MaSc 352 - PNU
6
(4-1) Numerical Differentiation
MaSc 352 - PNU
Three-Point Formula:
Since
From Eq. (4-3) we get:
7
(4-1) Numerical Differentiation
MaSc 352 - PNU
Three-Point Formula (When nodes are equally spaced):
8
(4-1) Numerical Differentiation
MaSc 352 - PNU
9
(4-1) Numerical Differentiation
MaSc 352 - PNU
10
(4-1) Numerical Differentiation
MaSc 352 - PNU
Five-Point Formula (nodes are equally spaced):
11
(4-1) Numerical Differentiation
MaSc 352 - PNU
Example (2) [Exercise 9 Page 177]:
x
f (x)
2.1
2.2
2.3
2.4
2.5
2.6
-1.7
-1.37
-1.12
-0.92
-0.75
-0.6
1 . f ′( 2 .1)
3-Point Endpoint
5-Point Endpoint
12
(4-1) Numerical Differentiation
MaSc 352 - PNU
2 . f ′( 2 .3 )
3-Point Endpoint
3-Point Midpoint
5-Point Midpoint
13
(4-1) Numerical Differentiation
MaSc 352 - PNU
Example (3) [Exercise 11 Page 177]:
1. Absolute error:
f ′( 2 .2 )
2. The error bound of using 3-Point Midpoint formula
14
(4-1) Numerical Differentiation
MaSc 352 - PNU
The error bound of using 3-Point Endpoint formula
15
(4-1) Numerical Differentiation
MaSc 352 - PNU
High Derivative Formula:
Second Derivative Midpoint Formula:
16
(4-1) Numerical Differentiation
MaSc 352 - PNU
17
(4-1) Numerical Differentiation
MaSc 352 - PNU
Example (4):
Use The second derivative formula (4.9) to approximate f ′′( 2) using the following
data:
x
f (x)
1.8
1.9
2.0
2.1
2.2
10.89
12.7
14.78
17.15
19.86
1. h=
2. h=
18
(4-1) Numerical Differentiation
MaSc 352 - PNU
Round-Off Error Instability:
19
(4-1) Numerical Differentiation
MaSc 352 - PNU
Example (5):
Consider using the values in Table 4.3 to approximate f ′(0.9) where f ( x ) = sin x
Compute the error and the optimal choice of h to reduce the error.
We can notice that the best approximations are at:
20
(4-1) Numerical Differentiation
MaSc 352 - PNU
Optimal Choice of h:
21
(4-1) Numerical Differentiation
MaSc 352 - PNU
Homework:
Exercise Set (4-1)
1 (b) +3 (b)
5 ( f ′(1.2) + f ′(1.4) ) +7 ( f ′(1.2) +f ′(1.4) )
9 ( f ′( 2.4) + f ′(2.6) )
20
22
(4-1) Numerical Differentiation
MaSc 352 - PNU