Simpson
a = 0; % Lower limit
b = 2; % Upper limit
n = 4; % Number of subintervals
if mod(n, 2) ~= 0
end
% Step size
h = (b - a) / n;
fprintf('The integral of the function over [%f, %f] is approximately %f\n', a, b, integral);