function result = midpoint1(integrand, a, b, N)
dx = (b - a)/N;
x = a + dx*( (1:N) - 0.5 );
result = sum( integrand(x) ) * dx;
