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

Antidifferences


                                                  b
                                                 ∫  fx() x =  fb() fa()                                (7.39)
                                                                 –
                                                       d
                                                  a
                we have the fundamental theorem of sum calculus which states that

                                                   )
                                            α +  (  n –  1 h   –      α +
                                                               1
                                               ∑     p x() =  Δ p x()    nh                            (7.40)
                                                                 n
                                                      n
                                              x =  α                  α
                Example 7.5
                Derive a simple expression, in closed form, that computes the sum of the cubes of the first   odd
                                                                                                       n
                integers.

                Solution:

                An odd number can be expressed as 2m 1–    , and thus its cube is  2m 1–(  )  3 . To use (7.40), we
                must express this term as a factorial polynomial. Recalling from (7.12) that

                                              n ()
                                           x ()    xx 1 x2 …  –  )  (  x –  n + 1 )                    (7.41)
                                                          (
                                                          )
                                                    ( =
                                                       –
                and using the MATLAB expand(f) function where f is a symbolic expression, we execute
                syms m; f = (2*m−1)^3; expand(f)
                and we obtain

                ans =
                8*m^3-12*m^2+6*m-1
                Thus

                                                                     2
                                                              3
                                                                            –
                                        pm()=  (  2m – 1 )  3  =  8m – 12m +  6m 1                     (7.42)
                Following the procedure of Example 7.3, we find p m() with MATLAB as
                                                                 n
                pm=[8  −12  6  −1];
                d0=[1 0];
                [q0,r0]=deconv(pm,d0)
                d1=[1  −1];
                [q1,r1]=deconv(q0,d1)
                d2=[1  −2];
                [q2,r2]=deconv(q1,d2)
                d3=[1  −3];
                [q3,r3]=deconv(q2,d3)

                q0 =
                     8   -12     6


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