Write a program which calculate the integral of the function


Write a program which calculates the integral of the function

f(x)=A*exp(-x^2)+(B*x^n)/m! 

on the interval from a to b (0a.
Call the function Integr() to evaluate the integral.

Your main program should be followed by three functions: 

double Integr(double n, int m, double A, double B, double a, double b)

double func(double x, double n, int m, double A, double B)

double mfact(int m)

................................................................

Your output should look like this:

Enter the exponents (double)n and (int)m: 1.25 5

Enter the coefficients A and B: 2.1 -3.15

Enter the bounds for the integration interval, a < b : 1.2 4.05

Integrate f(x) on [a,b]
Enter the number of trapezoids: 10000

The length of the subinterval del_x = 0.000285

The value of the integral is -0.0869732 .

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a program which calculate the integral of the function
Reference No:- TGS0136383

Expected delivery within 24 Hours