Page 229 - Applied Numerical Methods Using MATLAB
P. 229
218 NUMERICAL DIFFERENTIATION/ INTEGRATION
Table 5.3 The Difference Approximation Formulas for the First and Second Derivatives
O(h) forward difference approximation for the first derivative:
f 1 − f 0
D f 1 (x, h) = (5.1.4)
h
2
O(h ) forward difference approximation for the first derivative:
2D f 1 (x, h) − D f 1 (x, 2h) −f 2 + 4f 1 − 3f 0
D f 2 (x, h) = = (5.1.5)
2 − 1 2h
O(h) backward difference approximation for the first derivative:
f 0 − f −1
D b1 (x, h) = (5.1.6)
h
2
O(h ) backward difference approximation for the first derivative:
2D b1 (x, h) − D b1 (x, 2h) 3f 0 − 4f −1 + f −2
D b2 (x, h) = = (5.1.7)
2 − 1 2h
2
O(h ) central difference approximation for the first derivative:
f 1 − f −1
D c2 (x, h) = (5.1.8)
2h
4
O(h ) forward difference approximation for the first derivative:
2
2 D c2 (x, h) − D c2 (x, 2h) −f 2 + 8f 1 − 8f −1 + f −2
D c4 (x, h) = = (5.1.9)
2
2 − 1 12h
2
O(h ) central difference approximation for the second derivative:
(2) f 1 − 2f 0 + f −1
D (x, h) = (5.3.1)
c2 2
h
4
O(h ) forward difference approximation for the second derivative:
(2)
(2)
2
2 D (x, h) − D (x, 2h)
(2) c2 c2 −f 2 + 16f 1 − 30f 0 + 16f −1 − f −2
D (x, h) = =
c4 2 2
2 − 1 12h
(5.3.2)
2
O(h ) central difference approximation for the fourth derivative:
(4) f −2 − 4f −1 + 6f 0 − 4f 1 + f 2
D (x, h) = (from difapx(4,[-2 2]) (5.3.6)
c2
h 4