Answers to Exam 2(b) Mon 10 Nov 2003

  1. Compute the Newton form of the polynomial interpolating x^3 + 3 x through the points 0, 1, and 2. Show how to evaluate the Newton form most efficiently at x = 1.5. Write all numbers with four significant decimal places, using scientific format.

    Answer:

           0   0  
                    4-0
                   ----- = 4
                    1-0         7-4
           1   4               ----- = 3
                   14-0         2-1
                   ----- = 7
                    2-0
           2  14
    
    
        p(x) = 0 + 4*(x-0) + 3*(x-0)*(x-1)
             = (3*(x-1) + 4)*x
    
                                 corresponds to Horner form
    
        p(1.5) = (3*(1.5-1)+4)*1.5
    
                  11     3     33 
               = ---- * --- = ----
                   2     2      4
    
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    

  2. Consider the operator D defined by Df(x) = f'(x), and the operator E defined by Ef(x) = f(x+h) for any h > 0. Show that E = e^(hD).

    Answer:

          f(x+h) = f(x) + f'(x)*h + f"(x)*h^2/2! + .. + f^(n)(x)*h^2/n! + ...
    
           Ef(x) = ( I + D*h + D^2*h^2/2! + .. + D^n*h^n/n! + .. ) f(x) 
    
                 = e^(h*D) f(x)  => E = e^(h*D)
    
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    

  3. The Maclaurin expansion of sinh(x) is
                 1   3     1    5     1    7    (  8 )
            x + --- x  + ----- x  + ----- x  + O( x  ).
                 6        120        5040       (    )
    
    Use this Maclaurin expansion to construct a Padé approximation for sinh(x) as a quotient of two quadrics.

    Answer:

      (      1   3 )
      ( x + --- x  )*( 1+ b1*x + b2*x^2 ) - ( a0 + a1*x + a2*x^2 )
      (      6     )
    
             0 - a0 = 0
             1 - a1 = 0
             b1 - a2 = 0
             1/6 + b2 = 0
             1/6*b1 = 0
    
      the solution:
    
             b1 = 0
             b2 = -1/6
             a2 = 0
             a1 =  1
             a0 =  0 
                                      x
      so the quotient is        --------------
                                       1   2
    		              1 - --- x
                                       6
    
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    

  4. Consider
              +Pi/2
             /
             |  cos(x) dx.
             /
              -Pi/2
    
    1. Apply the composite trapezoidal rule to approximate this integral, using 1,2, and 4 subintervals of [-Pi/2,+Pi/2]. Give all symbolic formulas before numerical evaluation. Write the numbers with six decimal places in scientific format.

      Answer:

          h=Pi   : T(Pi) = Pi/2*(cos(-Pi/2) + cos(+Pi/2)) = 0.00000E+0
       
          h=Pi/2 : T(Pi/2) = T(Pi)/2 + Pi/2*cos(0) = 1.57080E+0
      
          h=Pi/4 : T(Pi/4) = T(Pi/2)/2 + Pi/4*(cos(-Pi/4)+cos(+Pi/4))
      
                           = 1.89612 E+0
      
    2. Apply Romberg integration to improve the approximations from above. Write all numbers with six decimal places in scientific format.

      Answer:

          0.00000E+0 = t00
                            t10*2^2 - t00
                           --------------- = t11
                                2^2 - 1             t21*2^4 - t11
          1.57080E+0 = t10                         --------------- = t22
                            t20*2^2 - t10               2^4 - 1
                           --------------- = t21
                                2^2 - 1
          1.89612E+0 = t20
      
      
                 1.57080E+0 * 2^2 - 0.00000E+0
          t11 = ------------------------------- = 2.09440E+0
                              2^2 - 1
      
                 1.89612E+0 * 2^2 - 1.57080E+0
          t21 = ------------------------------- = 2.00456E+0
                              2^2 - 1
      
                 2.00456E+0 * 2^4 - 2.09440E+0
          t22 = ------------------------------- = 1.99857E+0
                              2^4 - 1
      
    3. How many decimal places are correct in the last number computed by Romberg integration? Justify your answer.

      Answer:

          estimate for error = 2.00456 - 1.99857 = 0.00599
          => about three decimal places are correct
      
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    

  5. Consider the quadrature formula
              h
             /
             | f(x) dx ~ w f(x1) + w f(x2).
             /
              0
    
    Formulate the conditions on w, x1, and x2 so that the degree of the polynomials integrated exactly by this quadrature formula is as high as possible. Do not solve this system of equations.

    Answer:

               h
              /
       f=1 :  | 1 dx = w 1 + w 1 = h
              /
               0
    
               h                       2
              /                       h
       f=x :  | x dx = w x1 + w x2 = ---
              /                       2
               0
    
               h                       3
          2   /  2         2      2   h 
       f=x :  | x dx = w x1 + w x2 = ---
              /                       3
               0
    
                                                            +--------+
                                                            |    /20 |
                                                            +--------+