integrate a function by the trapezoidal rule we can easily improve the formula by approximating the area under the function by two equally-spaced trapezoids. derive a formula for this approximation and implement it in a function trapezint2( f,a,b ). for instance, the result of trapezint2( math.sin,0,0.5*math.pi ) should be 0.9481 (with some numerical error). the result of trapezint2( abs,-1,1 ) should be 1.0.



Answer :

Other Questions