Evaluate the following integral by executing Boole_Comp (see Problem 56) with n = 20. Also…
Evaluate the following integral by executing Boole_Comp (see Problem 56) with n = 20. Also evaluate using the quad function. Use format long.
Problem 56
In estimating Boole’s rule uses five equally spaced points to form a fourth-degree polynomial that approximates the integrand f(x). The formula for Boole’s rule is derived as
The composite Boole’s rule applies the above formula to four adjacent intervals at a time. Therefore, interval [a,b] must be divided into a number of subintervals that is a multiple of 4. Write a user-defined function with function call I = Boole_Comp(f,a,b,n) that estimates the integral of f from a to b using the composite Boole’s rule. Execute this function to evaluate
using n = 20. Also evaluate using the quad function and compare the results. Use format long.