Answers to Exam 2(c) Mon 7 Nov 2005

    1. Consider the points (0,0), (1,1), and (2,3).
      Use these points to compute the table of divided differences and give the Newton form of the interpolating polynomial through these points.
         0   0
                   1 - 0
                  ------- = 1
                   1 - 0           3/2 - 1
         1   1                     ------- = 1/2
                   3 - 0             1 - 0
                  ------- = 3/2
                   2 - 0
         2   3
      
         p(x) = 0 + 1*(x-0) + 1/2*(x-0)(x-1)
      
    2. Give an argument why the divided differences are independent of the order of the points, i.e.: f[x_0,x_1,x_2] = f[x_1,x_0,x_2].
         f[x0,x1,x2] is the leading coefficient in the polynomial
         interpolating x0, x1, x2 and of course also
         interpolating x1, x0, x2.
         Since the interpolating polynomial does not depend on the
         order of the points and is unique, the divided differences
         are independent of the order.
      
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    
  1. Consider the quotient
                                             3  2
                                         1 - - x 
                                             4   
                                    q := --------
                                             1  2
                                         1 - - x 
                                             4   
    
    Compute a continued fraction representation of q. Count the number of arithmetical operations it takes to evaluate q, before and after the conversion.
        -3/4*x^2 + 1   | -1/4*x^2 + 1
     - (-3/4*x^2 + 1 ) |--------------
    ------------------ |  3                   2                8
                 - 2             q = 3 - ------------ = 3 + -------
                                          1 - 1/4*x^2       x^2 - 4
    
    Cost of evaluating q, before the conversion:
      3* (or 4* if x^2 not stored);
      2- and 1 division.
    
    Cost after the conversion:
      2* (or 1* if denominator is a monic polynomial);
      2- and 1 division.
    
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    
  2. Why does Romberg integration for the integral of f(x) over [a,b] use only even powers of 2? Explain.
      If we perform a coordinate transformation on the integral
      of g(t) over [0,N] in the Euler Maclaurin summation formula
      from [0,N] to [a,b]: t -> x = a + h*t, with h = b-a/N, dx = h*dt,
    
         N                 b
         /                 /
         | g(t) dt becomes | f(x) 1/h dx.
         /                 /
         0                 a
    
      Moreover, g(0)/2 + g(1) + .. + g(N-1) + g(N)/2 becomes
      the trapezoidal rule T(h) applied to the integral of f over [a,b].
      We have g'(t) = h*f'(x) and g^(2*l-1)(t) = h^(2*l-1)*f^(2*l-1)(x).
      After multiplication by h, we see only even powers of h in the
      error expansion of T(h).
    
                                                            +--------+
                                                            |    /15 |
                                                            +--------+
    
  3. Consider the values in the table below:
    +-----------------------------------------------------------------------------------------------+
    |  x  | 0.00000 | .125000 | .250000 | .375000 | .500000 | .625000 | .750000 | .875000 | 1.00000 |
    +-----------------------------------------------------------------------------------------------+
    |f(x) | 0.00000 | .382683 | .707107 | .923880 | 1.00000 | .923880 | .707107 | .382683 | 0.00000 |
    +-----------------------------------------------------------------------------------------------+
    
    Perform all your calculations with six significant decimal places.
    Write all numbers in scientific notation.
    1. To approximate f'(0.0), compute forward differences Delta f(0.0,h), for h=.5,.25,.125.
                            f(0.5) - f(0.0)
         Delta f(0.0,0.5) = --------------- = 2.00000E+0
                               0.5 - 0.0
      
                             f(0.25) - f(0.0)
         Delta f(0.0,0.25) = ---------------- = 2.82843E+0
                                0.25 - 0.0
      
                              f(0.125) - f(0.0)
         Delta f(0.0,0.125) = ----------------- = 3.06146E+0
                                 0.125 - 0.0
      
    2. Apply extrapolation using the values for Delta f(0.0,h).
         2.00000E+0   
                      (2.00000E+0)*.5 - 2.82843E+0
                      ---------------------------- = 3.65686E+0
                                   .5 - 1
         2.82843E+0
                      (2.82843E+0)*.5 - 3.06146E+0
                      ---------------------------- = 3.29449E+0
                                   .5 - 1
         3.06146E+0
      
      The last extrapolation is
      
         (3.65686E+0)*.25 - 3.29449E+0
         ----------------------------- = 3.17370E+0
                      .25 - 1
      
    3. How accurate is your final approximation for f'(0.0)? Justify your answer.
        Comparing consecutive approximations, we pessimistically expect
        one decimal place to be correct.  Using O(h^3) to estimate the
        error with h = .125, we obtain 2.0E-3, or about 3 decimal places.
      
                                                            +--------+
                                                            |    /30 |
                                                            +--------+
    
    1. Consider the quadrature rule
           b
          /
          |  f(x) dx = w0 f(a) + w1 f((a+b)/2) + w2 f(b). 
          /
           a
      
      Set up the system of equations in the weights w0, w1, and w2 to be satisfied for the highest possible algebraic degree of accuracy.
      Do NOT solve this system.
               b
               /
        f=1:   | 1 dx = b - a = w0 + w1 + w2
               /
               a
      
               b
               /
        f=x:   | x dx = (b^2-a^2)/2 = w0*a + w1*(a+b)/2 + w2*b
               /
               a
      
               b
               /
        f=x^2: | x^2 dx = (b^3-a^3)/3 = w0*a^2 + w1*((a+b)/2)^2 + w2*b^2
               /
               a
      
    2. What is the algebraic degree of accuracy attained by this rule?
      Justify your answer.
         Because 1, x, and x^2 are integrated exactly by this rule,
         and because the integral operator is linear, every quadratic
         polynomial is integrated exactly.
         Therefore, the algebraic degree of accuracy equals two.
      
                                                            +--------+
                                                            |    /15 |
                                                            +--------+