Math 609D Programming Assignment #4 Due Date: March 31, 2008
Write a program or programs to approximate definite integrals using the composite Trapezoid, Simpson, and
Midpoint Rules, adaptive integration, and Romberg integration.
Specific Instructions:
1. Try to approximate each integral below using the composite Trapezoid, Simpson, and Midpoint Rules
with n = 100.
2. Try to approximate each integral with adaptive integration with a total error less than 10-5 .
3. Try to approximate each integral using Romberg integration with 7 rows.
Output:
1. Turn in a well documented program or programs.
2. When using adaptive integration, print the endpoints of the intervals on which Simpson's rule was
accepted.
3. When using Romberg integration, print the full Romberg table.
4. Turn in a short summary of your results.
Integrals:
2
a) sin(10x 2 ) dx
0
1 1
b) dx
-1 1 + x2
2
c) x dx
0
1 1
d) dx
0 x
sin x
e) dx
0 x
