computing integrals awrite function rectangle(fabnheight='left'for computing rb an integral /dx by the rectangle method with height computed based on the value of heightwhich is either leftrightor mid bwrite three test functions for the three unit test procedures described in sect make sure you test for height equal to leftrightand mid you may call the midpoint function for checking the result when height=mid hint edit test_trapezoidal py filenamerectangle_methods py exercise adaptive integration suppose we want to use the trapezoidal or midpoint method to compute an integral rb /dx with an error less than prescribed tolerance what is the appropriate size of nto answer this questionwe may enter an iterative procedure where we compare the results produced by and intervalsand if the difference is smaller than the value corresponding to is returned otherwisewe halve and repeat the procedure hint it may be good idea to organize your code so that the function adaptive_ integration can be used easily in future programs you write awrite function adaptive_integration(fabepsmethod=midpointthat implements the idea above (eps corresponds to the tolerance and method can be midpoint or trapezoidalr btest the method on dx and xdx for and write out the exact error cmake plot of versus oe for xdx use logarithmic scale for filenameadaptive_integration py remarks the type of method explored in this exercise is called adaptivebecause it tries to adapt the value of to meet given error criterion the true error can very seldom be computed (since we do not know the exact answer to the computational problem)so one has to find other indicators of the errorsuch as the one here where the changes in the integral valueas the number of intervals is doubledis taken to reflect the error exercise integrating raised to consider the integral dx