function value=rsum2(f,a,b,n)
%RSUM2: Computes a Riemann Sum for the function f on  
%the interval [a,b] with a regular partition of n points.  
%The points on the intervals are chosen randomly.
value = 0;
dx = (b-a)/n;
for k=1:n
    c = dx*rand + (a + (k-1)*dx);
    value = value + f(c);
end
value = dx*value;
