computing integrals print 'exact integral:'i_exact evalf( - - np random seed( i_expected computed with this seed i_computed montecarlo_doublelambda xynp sqrt( ** ** )gx nprint 'mc approximation % samples) ( ** i_computedassert abs(i_expected i_computed - (see the file mc_double py exercises exercise hand calculations for the trapezoidal method compute by hand the area composed of two trapezoids (of equal widththat apr proximates the integral dx make test function that calls the trapezoidal function in trapezoidal py and compares the return value with the handcalculated value filenametrapezoidal_test_func py exercise hand calculations for the midpoint method compute by hand the area composed of two rectangles (of equal widththat apr proximates the integral dx make test function that calls the midpoint function in midpoint py and compares the return value with the hand-calculated value filenamemidpoint_test_func py exercise compute simple integral apply the trapezoidal and midpoint functions to compute the integral /dx with and subintervals compute the error too filenameintegrate_parabola py exercise hand-calculations with sine integrals rb we consider integrating the sine function sin /dx alet and use two intervals in the trapezoidal and midpoint method compute the integral by hand and illustrate how the two numerical methods approximates the integral compare with the exact value bdo awhen filenameintegrate_sine pdf exercise make test functions for the midpoint method modify the file test_trapezoidal py such that the three tests are applied to the function midpoint implementing the midpoint method for integration filenametest_midpoint py