]> Examples:

Examples:

  1. Estimate the integral of the function 0 π 1 2 sin ( x ) d x using Simpson’s Method with N=4 and thus h= π /4. This integral is of course equal to 1.

     f(0) 0
     f( π /4) 0.3535533
     f( π /2) 0.5
     f(3 π /4) 0.3535533
     f( π ) 0

    0 π 1 2 sin ( x ) d x π / 4 3 [ 0 + 4 ( 0.3535533 ) + 2 ( 0.5 ) + 4 ( 0.3535533 ) + 0 ] 0 π 1 2 sin ( x ) d x 1.002279

    Thus the error is 1.0022791 1 =.002279=.2279%

  2. Use the same intergral but now use N=8 subintervals and h= π /8.

     f(0) 0
     f( π /8) 0.1913417
     f( π /4) 0.3535533
     f(3 π /8) 0.4619397
     f( π /2) 0.5
     f(5 π /8) 0.46193975
     f(3 π /4) 0.3535533
     f(7 π /8) 0.19134174
     f( π ) 0

    0 π 1 2 sin ( x ) d x π / 8 3 [ 0 + 4 ( 0.1913417 ) + 2 ( 0.3535533 ) + 4 ( 0.4619397 ) + 2 ( 0.5 ) + 4 ( 0.4619397 ) + 2 ( 0.3535533 ) + 4 ( 0.1913417 ) + 0 ] 0 π 1 2 sin ( x ) d x 1.000134

  3. We expect that when we increase the number of intervals by a factor of 2 (8/4=2), that our error will be reduced by a factor of 24=16. That means that our answer will be 16 times more accurate, or our error will be 1/16 of the error in the first approximation.

    Let's see if that's the case for this example.

    Recall, that the error when N=4 was 1.0022791 1 =.002279=.2279%

    We can now compute the error when N=8. It is ~0.01% 1.0001341 1 =.000134=.0134%

    which is approximately 0.002279 0.000134 =17.0074 times better than the approximation with N=4.

    This result is comparable to the 2 4 =16 improvement we would expect when we increase the number of intervals from 4 to 8.