Project 5


Write a program to perform adaptive quadrature.
This program performs adaptive quadrature. To use the program, the user is required to input the function they which to integrate by opening the program and changing the f(double x) function. In addition, the user needs to specify the values of "a" and "b", the starting and ending points of the integral. The program will run until the quadrature approximation is within 10^{-10} times the approximated value of the true integral. Further accuracy is possible by modifying the code to constantly update the approximated value of the true integral. The program will also return the number of function evaluations used to compute the integrals.
The code has been run on the following examples:

With the following results.
Integral Evaluated Quadrature Approximation Function Evaluations
a 108.5552812 1203387
b -1724.966983 848503
c -15.30630799 1629759
d -18.9459493 1530919
e 1.145580834 918351
f 0.6738321005 1066867
g 0.6666666667 241303
h 0.6666666667 241299
i 0.8000000000 381267