Exam 2(c) Mon 1 Apr 2002

  1. Consider the polynomial p(x) = x^2 - x + 1.

    1. Construct the Newton form of p(x) by divided differences, using the points (x_i,p(x_i)), with x_i = i, for i=0,1,2,3.

    2. Explain why the last element f_0123 in the table of divided differences you constructed above is (or should have been) zero.

    Answers:

    1.       0   1
                    1-1
                   ----- = 0 
                    1-0
                                 1-0
            1   1               ----- = 1
                    3-1          2-1
                   ----- = 1                  1-1
                    2-0                      ----- = 0
                                 2-0          3-2
            2   3               ----- = 1
                    7-3          3-1
                   ----- = 2 
                    3-0
      
            3   7
      
      The Newton form is
            1 + 0*(x-0) + 1*(x-0)*(x-1) + 0*(x-0)*(x-1)*(x-2).
      

    2. The interpolation problem has a unique solution. If f_0123 would not be zero, then two interpolating polynomials would exists: one of degree three and one of degree two (p itself). This is impossible, therefore f_0123 must be zero.
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    
  2. The Maclaurin expansion of sqrt(x+1) is
    
                       2         3          4          5    21   6    33   7
      1 + 1/2 x - 1/8 x  + 1/16 x  - 5/128 x  + 7/256 x  - ---- x  + ---- x  
                                                           1024      2048
    
             429   8    715   9      10
         -  ----- x  + ----- x  + O(x  )
            32768      65536
    
    
    Use this Maclaurin expansion to construct a Padé approximation for sqrt(x+1) as a quotient of two quadrics.

    Answer:

                               2                       2
               a0 + a1 x + a2 x      1 + 5/4 x + 5/16 x
       R(x) = ------------------- = ---------------------
                               2                       2
                1 + b1 x + b2 x      1 + 3/4 x + 1/16 x
    
    where the coefficients are computed as follows:
    
     (                  2         3          4 ) (                2 )
     ( 1 + 1/2 x - 1/8 x  + 1/16 x  - 5/128 x  )*( 1 + b1 x + b2 x  ) 
     (                                         ) (                  )
    
                         2
       - a0 - a1 x - a2 x  = 0
    
    Elaborating the product gives:
                         2
       1 +  b1 x +  b2  x
                         2        3
         + 1/2 x + b1/2 x + b2/2 x
                         2        3         4
                 -  1/8 x - b1/8 x - b2/8  x
                                  3         4
                            1/16 x + b1/16 x  + ...
                                            4
                                   - 5/128 x  + ...
                         2
       - a0 - a1 x - a2 x  = 0
    
    which gives rise to the system
       1 - a0 = 0
       b1 + 1/2 - a1 = 0
       b2 + b1/2 - 1/8 - a2 = 0
       b2/2 - b1/8 + 1/16 = 0
       -b2/8 + b1/16 - 5/128 = 0
    
    Solving the system first for b1 and b2, and then for a0,a1, and a2, gives the coefficients of the Padé approximation.
                                                            +--------+
                                                            |    /20 |
                                                            +--------+
    
  3. Give the continued-fraction representation for x/(x^2 - 7).

    Answer:

        2
       x  - 7  =  x x - 7
    
    
          x           1          1
      -------- = ---------- = ---------
        2           2               7
       x  - 7      x  - 7      x - ---
                  --------          x
                      x
    
                                                            +--------+
                                                            |    /10 |
                                                            +--------+
    
  4. Use central differences and Richardson extrapolation to compute a sixth order approximation for the derivative of arccos(x) at x = 0.7.

    1. Start with h=0.1 and divide h by 2 (i.e.: r = 1/2) to build the first column of the extrapolation table. Show how you applied the formulas (for partial credit). Write your answers with ten decimal places.

    2. How many decimal places are correct in your final answer from Richardson extrapolation? Explain.

    Answers:

    1. 
         arccos(0.8) - arccos(0.6)
        ---------------------------     = -1.418 970 546
                    0.2                                   \
                                                            (a)
         arccos(0.75) - arccos(0.65)                      /
        -----------------------------   = -1.404 776 423
                     0.1                                  \
                                                            (b)
         arccos(0.725) - arccos(0.675)                    /
        ------------------------------- = -1.401 393 842
                      0.05
      
                -1.404 776 423 * 4 - (-1.418 970 546)
        (a) : ----------------------------------------- = -1.400 045 049
                                 4 - 1
      
                -1.401 393 842 * 4 - (-1.404 776 423)
        (b) : ----------------------------------------- = -1.400 266 315
                                 4 - 1
      
          -1.400 266 315 * 16 - (-1.400 045 049)
        ------------------------------------------ = -1.400 281 066
                           16 - 1
      

    2. Comparing two consecutive approximations, we see that the numbers match at five decimal places. More precisely, the error is O(h^6) with h = (1/40)^6 which is approximately 2.4 E-10, so we should have about 9 decimal places right.
                                                            +--------+
                                                            |    /25 |
                                                            +--------+
    
  5. Consider the quadrature rule
                  2a
                 /               
                |   f(x) dx  = w  f(-a) + w  f(a)   for a > 0.
                /               1          2 
                 -2a
    
    Determine the weights w_1 and w_2 so that the rule has the highest possible algebraic degree of precision.

    Answer:

                 2a
                 / 
                |   1 dx  = 4 a  = w  + w
                /                   1    2
                -2a 
    
                 2a         
                 /             
                |   x dx  = 0  = w  (-a) + w  a
                /                 1         2 
                -2a
    
    The solution is
               w  =  2a   w  =  2a
                1          2
    
                                                            +--------+
                                                            |    /15 |
                                                            +--------+
    
  6. How would you compute a least squares approximation using Chebyshev polynomials? For example, suppose we have five samples (x_i,y_i), i=1,2,...,5. We wish to fit the data with a second degree polynomial p(x) = a_0 T_0(x) + a_1 T_1(x) + a_2 T_2(x). Describe how you would find the coefficients a_0, a_1, and a_2.

    Answer:

    We must solve

        [ y_1 ]   [ T_0(x_1)  T_1(x_1)  T_2(x_1) ] 
        [ y_2 ]   [ T_0(x_2)  T_1(x_2)  T_2(x_2) ] [ a_0 ]
        [ y_3 ] = [ T_0(x_3)  T_1(x_3)  T_2(x_3) ] [ a_1 ]
        [ y_4 ]   [ T_0(x_4)  T_1(x_4)  T_2(x_4) ] [ a_2 ]
        [ y_5 ]   [ T_0(x_5)  T_1(x_5)  T_2(x_5) ]
    
    or in matrix notation: Y = X a. To obtain a square system we multiply with the transpose of X and solve the normal equations:
            T       T
           X X a = X Y
    
                                                            +--------+
                                                            |    /10 |
                                                            +--------+