Numerical integration with 4 point and 5 point Gauss quadraturegiven a range a to b and a function pointer f. Seehttps://en.wikipedia.org/wiki/Gaussian_quadrature for moreinformation. Implement the following two functions:
typedef double (*dfunc)(double);
double gaussquad4(double a, double b, dfunc f);
double gaussquad5(double a, double b, dfunc f);
Use each method to integrate the function 4/(x 2+1) from 0 to 1(you should get pi) and compare the error against M_PI and thesimple integration method shown in class with increasing number ofsteps (10, 100, 1000, 10000, 100000). How many iterations do youneed to get a better answer than gaussquad4 and gaussquad5?
Expert Answer
An answer will be
PayPal Gateway not configured
PayPal Gateway not configured