% compute the integral of 1/x over the integral [2,5] using trapezoid rule
n = 10;
h = 3/n;
x = 2:h:5;
s = 0;
for k = 1:n
    s = s + 3/(2*n)*(1/x(k)+1/x(k+1));
end
% view the exact value of the integral and the approximate value
[s log(5/2)]