Page 235 - Applied Numerical Methods Using MATLAB
P. 235
224 NUMERICAL DIFFERENTIATION/ INTEGRATION
h 1 1 h 2
3
2
3
p 2 (t) dt = c 1 t + c 2 t + c 3 t = c 1 h + 2c 3 h
−h 3 2 −h 3
2h f k+1 + f k−1 h
= − f k + 3f k = (f k−1 + 4f k + f k+1 )
3 2 3
This is the Simpson integration formula (5.5.4).
Now, as a preliminary work toward diagnosing the errors of the above inte-
gration formulas, we take the Taylor series expansion of the integral function
x
(2)
(3)
g(x) = f(t) dt with g (x) = f(x), g (x) = f (x), g (x) = f (2) (x)
x k
(5.5.6)
about the lower bound x k of the integration interval to write
1 1
(2) 2 (3) 3
g(x) = g(x k ) + g (x k )(x − x k ) + g (x k )(x − x k ) + g (x k )(x − x k ) +· · ·
2 3!
Substituting Eq. (5.5.6) together with x = x k+1 and x k+1 − x k = h into this yields
2 3 4 5
h h (2) h (3) h (4)
x k+1
f(x) dx = 0 + hf (x k ) + f (x k ) + f (x k ) + f (x k ) + f (x k ) +· · ·
2 3! 4! 5!
x k
(5.5.7)
First, for the error analysis of the midpoint rule, we substitute x k−1 and −h =
x k−1 − x k in place of x k+1 and h in this equation to write
2 3 4 5
x k−1 h h (2) h (3) h (4)
f(x) dx = 0 − hf (x k ) + f (x k ) − f (x k ) + f (x k ) − f (x k ) +· · ·
2 3! 4! 5!
x k
and subtract this equation from Eq. (5.5.7) to write
x k+1 x k−1 x k+1 x k
f(x) dx − f(x) dx = f(x) dx + f(x) dx
x k x k x k x k−1
2h (2) 2h (4)
3 5
x k+1
= f(x) dx = 2hf (x k ) + f (x k ) + f (x k ) +· · · (5.5.8)
3! 5!
x k−1
Substituting x k and x mk = (x k + x k+1 )/2 in place of x k−1 and x k in this equation
and noting that x k+1 − x mk = x mk − x k = h/2, we obtain
3
h (2)
x k+1
f(x) dx = hf (x mk ) + f (x mk )
3 × 2 3
x k
h 5 (4)
+ f (x mk ) +· · ·
5 × 4 × 3 × 2 5
x k+1
3 5
h (2) h (4) 3
f(x) dx − hf (x mk ) = f (x mk ) + f (x mk ) +· · · = O(h )
24 1920
x k
(5.5.9)