Page 236 - Applied Numerical Methods Using MATLAB
P. 236

NUMERICAL INTEGRATION AND QUADRATURE  225
            This, together with Eq. (5.5.2), implies that the error of integration over one
                                                     3
            segment by the midpoint rule is proportional to h .
              Second, for the error analysis of the trapezoidal rule, we subtract Eq. (5.5.3)
            from Eq. (5.5.7) to write

                              h
                 x k+1

                    f(x) dx −  (f (x k ) + f(x k+1 ))
                              2
                x k
                            h 2       h 3  (2)    h 4  (3)    h 5  (4)

                  = hf (x k ) +  f (x k ) +  f  (x k ) +  f  (x k ) +  f  (x k ) +· · ·
                             2         3!         4!          5!
                      h                          h 2        h 3
                                                    (2)         (3)
                    −    f(x k ) + f(x k ) + hf (x k ) +  f  (x k ) +  f  (x k )
                      2                          2          3!
                            h 4  (4)
                          +   f  (x k ) +· · ·
                            4!
                      h 3  (2)   h 4  (3)    h 5  (4)       6       3
                  =−    f  (x k ) −  f  (x k ) −  f  (x k ) + O(h ) = O(h )  (5.5.10)
                      12         24          80
            This implies that the error of integration over one segment by the trapezoidal
                                3
            rule is proportional to h .
              Third, for the error analysis of Simpson’s rule, we subtract the Taylor series
            expansion of Eq. (5.5.4)
                h
                  (f (x k−1 ) + 4f(x k ) + f(x k+1 ))
                 3
                   h                         2h 2  (2)    2h 4  (4)
                 =    f(x k ) + 4f(x k ) + f(x k ) +  f  (x k ) +  f  (x k ) +· · ·
                   3                          2            4!
                            h 3  (2)    h 5  (4)
                 = 2hf (x k ) +  f  (x k ) +  f  (x k ) +· · ·
                             3          36
            from Eq. (5.5.8) to write

                            h                               h   (4)        7
                                                             5
                x k+1
                   f(x) dx −  (f (x k−1 ) + 4f(x k ) + f(x k+1 )) =−  f  (x k ) + O(h )
                             3                              90
               x k−1
                                                              5
                                                        = O(h )         (5.5.11)
            This implies that the error of integration over two segments by Simpson’s rule
                            5
            is proportional to h .
              Before closing this section, let’s make use of these error equations to find
            a way of estimating the error of the numerical integral from the true integral
            without knowing the derivatives of the target (integrand) function f(x).For
            this purpose, we investigate how the error of numerical integration by Simp-
            son’s rule
                                        h
                       I S (x k−1 ,x k+1 ,h) =  (f (x k−1 ) + 4f(x k ) + f(x k+1 ))
                                        3
   231   232   233   234   235   236   237   238   239   240   241