Adaptive Quadrature 1
6.8 Adaptive Quadrature
1. For each of the following integrals, compute S(a, b), S(a, c) and S(c, b), where
c= (a+b)/2. Compute the estimate for the error in S(a, c) + S(c, b) and
compare this to the actual error is S(a, c) + S(c, b).
(a) R1
0e−xdx (b) R2
1
1
xdx (c) R4
0x√x2+ 9dx (d) R1
0tan−1xdx
(a) With f(x) = e−x,a= 0 and b= 1, we find
which compares favorably with the actual error
(b) With f(x) = 1
x,a= 1 and b= 2, we find
2Section 6.8
(c) With f(x) = x√x2+ 9,a= 0 and b= 4, we find
(d) With f(x) = tan−1x,a= 0 and b= 1, we find
2. Repeat Exercise 1 using Boole’s rule (the closed Newton-Cotes formula with
n= 4).
(a) With f(x) = e−x,a= 0 and b= 1, we find
Adaptive Quadrature 3
The estimate for the error in B0,1
2+B1
2,1is then
(b) With f(x) = 1
x,a= 1 and b= 2, we find
(c) With f(x) = x√x2+ 9,a= 0 and b= 4, we find
0
(d) With f(x) = tan−1x,a= 0 and b= 1, we find
4Section 6.8
3. Repeat Exercise 1 using the two-point Gaussian quadrature rule.
(a) With f(x) = e−x,a= 0 and b= 1, we find
(b) With f(x) = 1
x,a= 1 and b= 2, we find
Adaptive Quadrature 5
(c) With f(x) = x√x2+ 9,a= 0 and b= 4, we find
0
(d) With f(x) = tan−1x,a= 0 and b= 1, we find
4. Repeat Exercise 1 using the three-point Gaussian quadrature rule.
(a) With f(x) = e−x,a= 0 and b= 1, we find
6Section 6.8
(b) With f(x) = 1
x,a= 1 and b= 2, we find
(c) With f(x) = x√x2+ 9,a= 0 and b= 4, we find
(d) With f(x) = tan−1x,a= 0 and b= 1, we find
Adaptive Quadrature 7
5. For each of the integrals in Exercise 1, compute the Simpson’s rule approxima-
tion and the Boole’s rule approximation. Confirm that the difference between
these two values approximates the error in the Simpson’s rule value.
(a) With f(x) = e−x,a= 0 and b= 1, we find
(b) With f(x) = 1
x,a= 1 and b= 2, we find
(c) With f(x) = x√x2+ 9,a= 0 and b= 4, we find
(d) With f(x) = tan−1x,a= 0 and b= 1, we find
6. For each of the integrals in Exercise 1, compute the two-point Gausssian quadra-
ture rule approximation and the three-point Gaussian quadrature rule approxi-
mation. Confirm that the difference between these two values approximates the
error in the two-point Gaussian quadrature rule value.
(a) With f(x) = e−x,a= 0 and b= 1, we find
(b) With f(x) = 1
(c) With f(x) = x√x2+ 9,a= 0 and b= 4, we find
Adaptive Quadrature 9
(d) With f(x) = tan−1x,a= 0 and b= 1, we find
7. Determine the number of function evaluations which would be needed to guar-
antee an accuracy of 10 decimal places in the approximation to the value of
I=Z5
0
50
π(1 + 2500x2)dx
using the composite Simpson’s rule and the composite two-point Gaussian quadra-
ture rule. Compare with the number of function evaluations required by the
corresponding adaptive routines listed in the second example above.
The solution of this inequality is n≥169679.64; therefore, we use n= 169680, and
In Exercises 8 – 16, approximate the value of the given integral to six (6) and
to ten (10) decimal places using the adaptive quadrature scheme of your choice.
10 Section 6.8
8. R1
0e−x4dx
Using the adaptive Simpson’s rule with ǫ= 5 ×10−7, we find
Thus, to guarantee an absolute error of no greater than 5×10−7from the composite
Simpson’s rule, the value of nmust be selected to satisfy the inequality
using 361 function evaluations. To guarantee an absolute error of no greater than
9. R5
0
1
√1+x3dx
Using the adaptive Simpson’s rule with ǫ= 5 ×10−7, we find
Adaptive Quadrature 11
Thus, to guarantee an absolute error of no greater than 5×10−7from the composite
Simpson’s rule, the value of nmust be selected to satisfy the inequality
using 1013 function evaluations. To guarantee an absolute error of no greater than
5×10−11 from the composite Simpson’s rule, the value of nmust be selected to
10. R2
1
sin x
xdx
Using the adaptive Simpson’s rule with ǫ= 5 ×10−7, we find
Thus, to guarantee an absolute error of no greater than 5×10−7from the composite