Page 96 - Excel for Scientists and Engineers: Numerical Methods
P. 96

CHAPTER 4                   NUMBER SERIES                            73


                where  Fk(x)  is  the  kth  derivative  of  the  function  at  the  point x, and < is  the
                remainder  or  error  term.  As  has  been  illustrated  by  examples  we  have  seen
                earlier, the magnitude of ( decreases as k (the number of terms) increases.
                   To obtain a result that closely approximates the true value of a function, we
                need  to  sum  a  number  of  terms.  Clearly,  we  will  not  have  available  to  us
                (without a lot of work) values of a large number of derivatives of the function F,
                up  to  the  kth  derivative.  Fortunately,  we  will  usually  need  only  the  first
                derivative,  the  first  and  second  derivatives,  or  the  first,  second  and  third
                derivatives to obtain results of sufficient accuracy.  We will use the Taylor series
                expansion of a function in several of the subsequent chapters.
                   The order of the approximation is determined by the highest-derivative term
                that  is  included  in  the  approximation;  thus  the  first-order  Taylor  series
                approximation is
                                        F(x + h) = F(x) + hF'(x)                   (4-4)
                the second-order approximation is
                                                            h2
                                   F(x + h) = F(x) + hF'(x) + -F"(x)               (4-5)
                                                            2
                and the third-order approximation is
                                                      h2
                                                                 h3
                             F(x + h) x F(x) + hF'(x) + - F"(x) + -F"'(x)          (4-6)
                                                       2         6
                   Obviously,  the  accuracy  of the  approximation  increases  as the  number  of
                terms is increased.  It is also obvious that the accuracy of the approximation will
                increase as h is made smaller.  Higher-order  terms will become more  important
                as h is increased, or if the function is nonlinear.

                The Taylor Series: An Example
                   The following example will illustrate the use of the Taylor series to evaluate
                a function.  Consider the polynomial ax3 + bx2 + cx + d, with a = 1.25, b = 9, c =
                -5  and d = 11.  At x = 1, F(x) = 16.25.  We wish to evaluate the function at x  =
                1.6.  (Since we are dealing with a known function, we could just evaluate it at x =
                1.6, but here we use a known function for purposes of illustration.  In subsequent
                chapters Taylor series will be used to evaluate functions whose value is known at
                a certain point but whose form is unknown.)
                    From simple calculus, F'(x) = 3ux2 + 2bx + c = 3.75~~ + 18x - 5, F"(x) = 6ax
                          +
                + 2b = 7.5~ 18 and F"'(x) = 6a = 7.5.  At x = 1, F'(x) = 16.75, Ff'(x) = 25.5 and
                F"'(x) = 7.5.  Substituting these values, along with h = 0.6, into equations 4-4, 4-
                5  and 4-6 yields the results  shown  in  Figure 4-2.  As expected,  the third-order
                approximation provides the highest accuracy.
   91   92   93   94   95   96   97   98   99   100   101