Question: Please Write on Python Integrate a function by the trapezoidal rule 5 points We can easily improve the formula by approximating the area under the

Please Write on Python
Integrate a function by the trapezoidal rule 5 points We can easily improve the formula by approximating the area under the functionf(x) 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
