Comparing the Midpoint and Trapezoid Rules Compare the errors in the Midpoint and Trapezoid Rules with n =4, 8, 16, and 32 subintervals when they are applied to the following integrals (with their exact values given).

Solution:-Step1Given thatCompare the errors in the Midpoint and Trapezoid Rules with n =4, 8, 16, and 32 subintervalsn = 4,8, 16, and 32The exact values of the integrals are given for computing the error. -Step2To find Compare the errors in the Midpoint and Trapezoid Rules with n =4, 8, 16, and 32 subintervals when they are applied to the following integrals (with their exact values given).Step3 a=0 , b=1, n=4Using midpoint ruleStep4Midpoint sum for N=4++-------+)++-------+)=0.219239Error for N=4 for midpoint rule===0.00298308Step5Using midpoint ruleMidpoint sum for N=8++-------+)++-------+)=0.222026Error for N=8 for midpoint rule===0.000195816Step6Using midpoint ruleMidpoint sum for N=16++-------+)++-------+)=0.222210Error for N=16 for midpoint rule===0.0000121536Step7Using midpoint ruleMidpoint sum for N=32++-------+)++-------+)=0.222221Error...