Page 293 - Numerical Analysis Using MATLAB and Excel
P. 293

Newton’s Divided Difference Interpolation Method


                and this can be simplified with the MATLAB collect(f) function as follows.


                syms n; sum=collect(2*(n+1)*n*(n−1)*(n−2)+4*(n+1)*n*(n−1)+(n+1)*n−(n+1)+1)
                sum =
                2*n^4-n^2
                that is,
                                           ∑  cubes =  2n – n =   n 2n –  1 )                          (7.48)
                                                                       2
                                                                   2
                                                             2
                                                         4
                                                                    (
                We can verify that this is the correct expression by considering the first   odd integers
                                                                                             4
                 ,,,
                1 35 and 7   . The sum of their cubes is
                                                   1 +  27 + 125 +  343 =  496
                This is verified with (7.48) since

                                                        2
                                                              2
                                                                  )
                                         n 2n –(  2  2  1 =  4 24 – 1 =  16 31 =  496
                                                   )
                                                         (
                                                            ⋅
                                                                         ⋅
                One important application of finite differences is interpolation. Newton’s divided−difference inter-
                polation method, Lagrange’s interpolation method, Gregory−Newton forward, and Gregory−
                Newton backward interpolation methods are discussed in Sections 7.4 through 7.7 below. We
                will use spreadsheets to facilitate the computations. Interpolation using MATLAB is discussed in
                Section 7.8 below.


                7.4 Newton’s Divided Difference Interpolation Method

                                                                           ,
                                                                     ,
                                                                        ,
                                                                  ,
                This method, has the advantage that the values x x x … x     n  need not be equally spaced, or
                                                                       2
                                                                    1
                                                                 0
                taken in consecutive order. It uses the formula
                               fx() =  fx (  0 )  +  (  xx )  –  0  fx x ) (  0 ,  1  +  (  x –  x )  0  (  xx )  –  1  fx x x ) (  0 ,  1 ,  2
                                       xx )+  (  –  0  (  x – x )  1  (  x – x )  2  fx x x x ) (  0 ,  1 ,  2 ,  3  (7.49)
                where fx x,(  0  1 )  , fx x x,(  0  1 ,  2 )  , and fx x x x,(  0  1 ,  2 ,  3 )   are the first, second, and third divided differ-
                ences respectively.



                Example 7.6

                Use Newton’s divided−difference method to compute f2()    from the experimental data shown in
                Table 7.10.








               Numerical Analysis Using MATLAB® and Excel®, Third Edition                             7−15
               Copyright © Orchard Publications
   288   289   290   291   292   293   294   295   296   297   298