% this has the integration for the left-hand rule, n can be an even or
% odd number.
% function [area,h,error] = left_hand(a,b,n)

function [area,h,error] = left_hand(a,b,n)

% interval length:
h = (b-a)/(n-1);

for i=1:n
% n mesh points, n-1 intervals:
  x(i) = a + (i-1)*h;
end

area = 0;

for i=1:n-1
% left-hand rule:
   area = area + f(x(i)) ;
% right-hand rule:
%   area = area + f(x(i+1)) ;
end
area = area*h;

error = (f_int(b)-f_int(a))-area;

