function I = quadrature1(a, b, N)

%
% Generalized trapozoidal method
%
h = (b-a)/(N+1);
I = 0;

I = I + 0.5*h*myfunc(a);

for i=1:N
    xi = a + h*i;
    I = I + h*myfunc(xi);
end

I = I + 0.5*h*myfunc(b);



function f = myfunc(x)

f = 2/sqrt(pi)*exp(-x^2);
