Answer to Quiz 9 Fri 31 Oct 2003

    Consider
                     1
                    /
                    |  sin(pi*x) dx
                    /
                     0
    
    
    1. Apply the composite trapezoidal rule to approximate this integral, using n = 1,2, and 4 subintervals of [0,1]. Give all the symbolic formulas before numerical evaluation. Write the numbers with four decimal places in scientific format.

      Answer:

         n=1, h=1: T(1) = 1/2*(sin(pi*0) + sin(pi*1)) = 0.000E+0
      
         n=2, h=1/2 : T(2) = T(1)/2 + 1/2*sin(Pi/2) = 5.000E-1
      
         n=4, h=1/4 : T(4) = T(2)/2 + 1/4*(sin(Pi/4) + sin(3*Pi/4)
                           = 6.036E-1
      
    2. Apply extrapolation (Romberg integration) to improve the approximations from above. As above, give all the symbolic formulas before numerical evaluation. Write the numbers with four decimal places in scientific format.

      Answer:

      
        T(1) = t[1,0]   
                        t[2,0]*2^2 - t[1,0]
                       --------------------- = t[2,1]
                               2^2 - 1                  t[3,1]*2^4 - t[2,1]
        T(2) = t[2,0]                                  --------------------- = t[3,2]
                        t[3,0]*2^2 - t[2,0]                    2^4 - 1
                       --------------------- = t[3,1]
                               2^2 - 1
        T(4) = t[3,0]
      
      
                   5.000E-1*4 - 0.000E+0
        t[2,1] = ------------------------- = 6.667E-1
                            4 - 1
      
                   6.036E-1*4 - 5.000E-1
        t[3,1] = ------------------------- = 6.381E-1
                            4 - 1
      
                   6.381E-1*16 - 6.667E-1
        t[3,2] = ------------------------- = 6.362E-1
                            16 - 1