function I = Simpson38(f, a, b, N) 
h = abs(b-a)/N;

suma =0;

for k=0:N-1
    x0 = a + h*k;
    x1 = x0 + h/3;
    x2 = x0 + 2*h/3;
    x3 = x0 + h;
    suma = suma + f(x0) + 3*f(x1) + 3*f(x2) + f(x3);
end;

I = h*suma/8;
end