close all; clc; clear; % Problem EPage 82; Example EPage 79 % % Part (i): approx = simp2v( 'c_4_p_17_fn_i', -pi, +pi, -1, +1, 1000 ); truth = 4 * pi^(4+1) / ( 4 + 1 )^2; disp( sprintf('Part i : truth= %16.6f approx= %16.6f', truth, approx) ); % Part (ii): approx = simp2v( 'c_4_p_17_fn_ii', -pi, +pi, -1, +1, 1000 ); truth = 4 * pi^(10+1) / ( 10 + 1 )^2; disp( sprintf('Part ii: truth= %16.6f approx= %16.6f', truth, approx) );