% Employing the Composite Trapezoidal Rule

% Input endpoints
a=0;
b=1;
% Input number of subintervals 
n=10;

h=(b-a)/n;
XI0=intf(a)+intf(b);
XI1=0;

for i=1:n-1
   X=a+i*h;
   XI1=XI1+intf(X);
   end
XI=h*(XI0+2*XI1)/2;
display(XI)


