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

Solutions to End−of−Chapter Exercises


                   b. fx() =  sin  , x  f0() =  , 0  f' x() =  cos  , x  f' 0() =  , 1  f'' x() =  – sin  , x  f'' 0() =  , 0
                       f''' x() =  – cos x  , f''' 0() =  – 1 , and so on. Therefore,


                                                                 ----- –
                                                            ----- +
                                                 f x() =  x –  x 3  x 5  x 7  …
                                                                     ----- +
                                                  n
                                                                 5!
                                                                     7!
                                                            3!
                      MATLAB displays the same result.
                      x=sym('x'); fn=taylor(sin(x)); pretty(fn)
                                       3          5
                              x - 1/6 x  + 1/120 x
                   c. fx() =  sin hx ,  f0() =  , 0  f' x() =  cos hx  ,  f' 0() =  1  ,  f'' x() =  sin hx ,  f'' 0() =  , 0
                      f''' x() =  cos hx , f''' 0() =  1 , and so on. Therefore,
                                                             3    5   7
                                                 f x() =  x +  x  x  x   …
                                                                     ----- +
                                                            ----- +
                                                                 ----- +
                                                 n
                                                            3!
                                                                 5!
                                                                     7!
                      MATLAB displays the same result.
                      x=sym('x'); fn=taylor(sinh(x)); pretty(fn)
                                  3          5
                         x + 1/6 x  + 1/120 x
                8.
                                                            f'' a()    2  f''' a()   3
                                                    (
                                                         )
                                 f x() =  fa() +  f' a() x – a +  ------------ x –(  2!  a )  +  ------------- x –(  3!  a )  +  …
                                  n
                                                                                                        ⁄
                                                                                      )
                                                                                  (
                               ⁄
                                             (
                                                )
                   a. fx() =  1x  , fa() =  f – 1 =  –  , 1  f' x() =  – 1 x ⁄  2 , f' a() =  f' – 1 =  –  , 1  f'' x() =  2x 3 ,
                                                                     (
                                (
                                   )
                                                                         )
                      f'' a() =  f'' – 1 =  – 2 , f''' x() =  – 6 x ⁄  4 , f''' a() =  f''' – 1 =  – 6 , and so on. Therefore,
                                                     (
                                                          )
                                                    –
                                          f x() =  – 1 x +  1 –  (  x +  1 )  2  –  (  x +  1 )  3  +  …
                                           n
                      or
                                             f x() =  – 2 x (  – –  x +  1 )  2  –  (  x +  1 )  3  +  …
                                             n
                      MATLAB displays the same result.
                      x=sym('x'); y=1/x; z=taylor(y,4,−1); pretty(z)
                                     2          3
                     -2 - x - (x + 1)  - (x + 1)
                                                                                            (
                                                                                                         ⁄
                                                                                                  )
                                                                                                ⁄
                                                    )
                                                             ⁄
                                              (
                                                  ⁄
                   b. fx() =  sin  , x  fa() =  f – π 4 =  –  22 ,  f' x() =  cos  , x  f' a() =  f' – π 4 =  22 ,
               Numerical Analysis Using MATLAB® and Excel®, Third Edition                             6−59
               Copyright © Orchard Publications
   271   272   273   274   275   276   277   278   279   280   281