function integration_test1
O = '---- integration_test1 ---- = O'
hold off
linestyle = ['+-k';'o-k';'^-k'];
logMN = [4,5,6]
for j=1:numel(logMN)
   times = []; %clear it out
   for i=0:logMN(j)
      N = 10^i
      M = 10^(logMN(j)- i)
      t0 = cputime;
      err = midpoint2(@improper, 0, 1, M, N) - 2
      execution_time = cputime - t0
      times(i+1) = execution_time; % save for plotting
   end
   semilogy(0:logMN(j), times, linestyle(logMN-(3),:))
   hold on
end


title('Trading off memory for speed','fontsize',18)
xlabel('log10 N (memory requirement)','fontsize',16)
ylabel('Execution time (seconds)','fontsize',16)


legend('MN = 1e4 steps','MN = 1e5 steps','MN = 1e6 steps')
hold off