Comparing the Midpoint and Trapezoid Rules Apply the Midpoint and Trapezoid Rules to the following integrals. Make a table similar to Table 7.4 showing the approximations and errors for n = 4,8, 16, and 32. The exact values of the integrals are given for computing the error.

Solution:-Step1Given thatApply the Midpoint and Trapezoid Rules to the following integrals.n = 4,8, 16, and 32The exact values of the integrals are given for computing the error. Step2To find Make a table showing the approximations and errors for n = 4,8, 16, and 32.Step3 a=-2 , b=6, n=4Using midpoint ruleStep4Midpoint sum for N=4++-------+)++-------+)=-2.624Error for N=4 for midpoint rule===1.656Step5Using midpoint ruleMidpoint sum for N=8++-------+)++-------+)=-1.1483Error for N=8 for midpoint rule===1.2871Step6Using midpoint ruleMidpoint sum for N=16++-------+)++-------+)=0.8719Error for N=16 for midpoint rule===0.78202Step7Using midpoint ruleMidpoint sum for N=32++-------+)++-------+)=2.2843Error for N=32 for midpoint rule==0.42893Step8Table for midpoint approximation and errorNApproximationError4-2.6241.6568-1.14831.2871160.87190.78202322.28430.42893Step9N=4Using trapezoidal ruleTrapezoidal sum for N=4=6Error for N=4 for Trapezoidal rule==0.5Step10N=8Using trapezoidal ruleTrapezoidal sum for N=8=4.5Error for N=8 for Trapezoidal rule==0.125Step11N=16Using trapezoidal ruleTrapezoidal sum for N=16=4.125Error for N=16 for Trapezoidal rule==0.03125Step12N=32Using trapezoidal ruleTrapezoidal sum for N=32=4.0313Error for N=32 for Trapezoidal rule==0.0078125Step 13Table for Trapezoidal approximation and errorNApproximationError460.584.50.125164.1250.03125324.03130.0078125