Page 222 - Applied Numerical Methods Using MATLAB
P. 222
APPROXIMATION ERROR OF FIRST DERIVATIVE 211
to write
h 2 h 3 h 4 h 5
(2) (3) (4) (5)
f(x + h) = f(x) + hf (x) + f (x) + f (x) + f (x) + f (x) + ···
2 3! 4! 5!
h 2 h 3 h 4 h 5
(2) (3) (4) (5)
f(x − h) = f(x) − hf (x) + f (x) − f (x) + f (x) − f (x) + ···
2 3! 4! 5!
and divide the difference between these two equations by 2h to get the central
difference approximation for the first derivative as
f(x + h) − f(x − h) h 2 (3) h 4 (5)
D c2 (x, h) = = f (x) + f (x) + f (x) +· · ·
2h 3! 5!
2
= f (x) + O(h ) (5.1.8)
2
which has an error of O(h ) similarly to Eqs. (5.1.5) and (5.1.7). This can also be
4
processed to yield an improved version having a truncation error of O(h ).
f(x + h) − f(x − h) f(x + 2h) − f(x − 2h)
2
2 D c2 (x, h) − D c2 (x, 2h) = 4 −
2h 2 · 2h
12h 4
(5)
= 3f (x) − f (x) −· · ·
5!
2
2 D c1 (x, h) − D c1 (x, 2h)
D c4 (x, h) =
2
2 − 1
8f(x + h) − 8f(x − h) − f(x + 2h) + f(x−2h)
=
12h
4
= f (x) + O(h ) (5.1.9)
Furthermore, this procedure can be formularized into a general formula, called
‘Richardson’s extrapolation’, for improving the difference approximation of the
derivatives as follows:
<Richardson’s extrapolation>
n
2 D f,n (x, h) − D f,n (x, 2h)
D f,n+1 (x, h) = (n: the order of error) (5.1.10a)
n
2 − 1
n
2 D b,n (x, h) − D b,n (x, 2h)
D b,n+1 (x, h) = (5.1.10b)
n
2 − 1
2n
2 D c,2n (x, h) − D c,2n (x, 2h)
D c,2(n+1) (x, h) = (5.1.10c)
2n
2 − 1
5.2 APPROXIMATION ERROR OF FIRST DERIVATIVE
In the previous section, we derived some difference approximation formulas
for the first derivative. Since their errors are proportional to some power of