Write the following integration routines: 1) a Left Handed Riemann Sum routine 2
ID: 3610858 • Letter: W
Question
Write the following integration routines:
1) a Left Handed Riemann Sum routine
2) a Right Handed Riemann Sum routine
3) A trapazoidal Riemann Sum routine
4) A routine which uses Simpson's rule (see:http://en.wikipedia.org/wiki/Simpson's_rule for moreinformation.)
C++ prototypes:
double lhrs(double f[], double x[], int num)
double rhrs(double f[], double x[], int num)
double trap(double f[], double x[], int num)
double simpsons(double f[], double x[], int num)
where f[] holds values of the function to be integrated and x[]the x coordinates of the points such that f[i]=f(x[i]), and botharrays are of length num.