Answer to Exam 2(b) Mon 7 Nov 2005

    1. Consider the points (0,0), (1,1), and (2,3).
      Use the method of Neville to find the value of the interpolating polynomial at the point 1.5.
        0  0   
               (1.5-0)0 - (1.5-0)1
               ------------------- = 1.5 
                      0 - 1                (1.5-2)1.5 - (1.5-0)2
        1  1                               --------------------- = 1.875
               (1.5-2)1 - (1.5-1)2                  0 - 2
               ------------------- = 2
                      1 - 2
        2  3
      
    2. Prove the formula of Neville: if p[i,..,j-1](x(k)) = f(k), for k=i,..,j-1, and p[i+1,..,j](x(k)) = f(k), for k=i+1,..,j, then
                        (x(k)-x(j))*p[i,..,j-1](x(k)) - (x(k)-x(i))*p[i+1,..,j](x(k))
      p[i,..,j](x(k)) = -------------------------------------------------------------
                                                 x(i) - x(j)  
      
      for k=i,..,j.
                                   (x(i)-x(j))
        for k=i: p[i,..,j](x(i)) = ----------- p[i,..,j-1](x(i)) = f(i)
                                   (x(i)-x(j))               (induction)
        for k=j: similar
      
        for k, i < k < j:
                           (x(k)-x(j))f(k) - (x(k)-x(i))f(k)
         p[i,..,j](x(k)) = --------------------------------- = f(k)
                                      x(i) - x(j)
      
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    
  1. Consider the Maclaurin expansion of f(x) = (1-x^2)^(1/2):
                     1  2   1  4   1   6    5   8    7   10    / 12\
                 1 - - x  - - x  - -- x  - --- x  - --- x   + O\x  /
                     2      8      16      128      256             
    
    Set up the system of linear equations which must be solved to construct a Pade approximation of f as a quotient of two quadrics.
    Do NOT solve the system.
           a(x)   a0 + a1*x + a2*x^2
       q = ---- = ------------------    p = 1 + 0*x - x^2/2 + 0*x^3 - x^4/8
           b(x)   b0 + b1*x + b2*x^2
                5 unknowns                      5 given coefficients
    
       a(x) - b(x)*p(x) = 0
       (a0 + a1*x + a2*x^2) - (1+b1*x+b2*x^2)*(1+0*x-x^2/2+0*x^3-x^4/8) = 0
    
       1   : a0 - 1 = 0
       x   : a1 - b1 = 0
       x^2 : a2 - b2 + 1/2 = 0
       x^3 : 1/2*b1 = 0
       x^4 : 1/8 + 1/2*b2 = 0
    
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    
  2. Derive the first order extrapolation formula to compute f'(x0) using forward differences Delta f(x0,h) for any h > 0, reducing h by the factor r, 0 < r < 1.
       f(x0+h) = f(x0) + h*f'(x0) + h^2*f'(x0)/2! + O(h^3)
    
                       f(x0+h) - f(x0)
       Delta f(x0,h) = --------------- = f'(x0) + C1*h + O(h^2)
                               h
    
                       Delta f(x0,r*h) = f'(x0) + C1*r*h + O(h^2)
    
    
      r*Delta f(x0,h) - Delta f(x0,h) = (r-1)*f'(x0) + O(h^2)
    
                          Delta f(x0,h)*r - Delta f(x0,h*r)
      Delta f(x0,h,r*h) = ---------------------------------
                                        r - 1
    
                        = f'(x0) + O(h^2)
    
                                                            +--------+
                                                            |    /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.5), compute central differences delta f(0.5,h), for h=.5,.25,.125.
                           f(0.5+0.5) - f(0.5-0.5)
        delta f(0.5,0.5) = ----------------------- = 0
                                      1
      
                            f(0.5+0.25) - f(0.5-0.25)
        delta f(0.5,0.25) = ------------------------- = 0
                                       0.5
      
                             f(0.5+0.125) - f(0.5-0.125)
        delta f(0.5,0.125) = --------------------------- = 0
                                        0.25
      
    2. Apply extrapolation using the values for delta f(0.5,h).
        delta f(0.5,0.5)
                          delta f(0.5,0.5,0.25) 
      
                            delta f(0.5,0.5)*.25 - delta f(0.5,0.25)
                          = ---------------------------------------- = 0
                                             .25 - 1
        delta f(0.5,0.25)
                          delta f(0.5,0.25,0.125)
                     
                            delta f(0.5,0.25)*.25 - delta f(0.5,0.125)
                          = ------------------------------------------ = 0
                                              .25 - 1
        delta f(0.5,0.125)
      
      The last extrapolation is
      
        delta f(0.5,0.5,0.25)*1/16 - delta f(0.5,0.25,0.125)
        ---------------------------------------------------- = 0
                              1/16 - 1
      
    3. How accurate is your final approximation for f'(0.5)? Justify your answer.
        Because of the symmetry in the data, extrapolation does not
        improve the answers.  The error is expected to be O(h^6),
        with h = .125, we may expect 6 correct decimal places,
        as (.125)^6 = 3.8E-6.
      
                                                            +--------+
                                                            |    /30 |
                                                            +--------+
    
    1. Consider the quadrature rule
           +h
           /
           | f(x) dx = w0 f(x0) + w1 f(x1), for h > 0.
           /
           -h
      
      Set up the system of equations in the weights w0, w1 and nodes x0, x1 to be satisfied for the highest possible algebraic degree of accuracy.
      Do NOT solve this system.
                 +h
                 / 
         f=1 :   | 1 dx = 2*h = w0 + w1
                 /
                 -h
      
                 +h
                 / 
         f=x :   | x dx = 0 = w0*x0 + w1*x1
                 /
                 -h
      
                 +h
                 / 
         f=x^2 : | x^2 dx = 2*h^3/3 = w0*x0^2 + w1*x1^2
                 /
                 -h
      
                 +h
                 / 
         f=x^3 : | x^3 dx = 0 = w0*x0^3 + w1*x1^3
                 /
                 -h
      
    2. What is the algebraic degree of accuracy attained by this rule?
      Justify your answer.
        Since the rule integrates the basis functions 1, x, x^2, x^3
        exactly, and since the integral operator is linear,
        every cubic polynomial is integrated exactly.
        Thus the algebraic degree of accuracy equals 3.
      
                                                            +--------+
                                                            |    /15 |
                                                            +--------+