function s = hw08trapesoidal(f, a, b)
%HW08TRAPESOIDAL Computes the integral via trapesoidal rule in the interval [a,b]
    h = (b - a)/(length(f) - 1);
    s = h/2 * (f(1) + 2*sum(f(2:end-1)) + f(end));
end
