#include <math.h>

main()
{double a,b,h; float Integ,y(); int i,M;
 /* Numerical integration of (x3+8)1/2 */
 printf("\na="); scanf("%lf",&a);
 printf("b="); scanf("%lf",&b);
 printf("h="); scanf("%lf",&h);
 Integ=y(a)+y(b);
 M=(b-a)/(2*h);
 for(i=1;i<M;i++) Integ+=2*y(a+2*i*h);
 for(i=0;i<M;i++) Integ+=4*y(a+(2*i+1)*h);
 Integ*=h/3;
 printf("Numerical integral of (x3+8)1/2 between %lf and %lf=%lf",a,b,Integ);
 getch();
}

float y(double x)  
{return sqrt(x*x*x+8);}
 
