Carry out the steps of Computer Problem 1 for adaptive Simpson’s Rule, developed in Computer Problem 2.
Computer Problem 1
Use Adaptive Trapezoid Quadrature to approximate the definite integral within 0.5 × 10−8. Report the answer with eight correct decimal places and the number of subintervals required
Computer Problem 2
Modify the Matlab code for Adaptive Trapezoid Rule Quadrature to use Simpson’s Rule instead, applying the criterion (5.42) with the 15 replaced by 10. Approximate the integral in Example 5.12 within 0.005, and compare with Figure 5.5(b). How many subintervals were required?
Use Adaptive Quadrature to approximate the integral
Figure 5.5(a) shows the result of the Adaptive Quadrature algorithm for f (x), with an error tolerance of 0.005. Although 140 intervals are required, only 11 of them lie in the “calm’’region [−1,0]. The approximate definite integral is 2.502 ± 0.005. In a second run, we change the error tolerance to 0.5 × 10−4 and get 2.5008, reliable to four decimal places, computed over 1316 subintervals.