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:-

Step1

Given that

Compare the errors in the Midpoint and Trapezoid Rules with n =4, 8, 16, and 32 subintervals

n = 4,8, 16, and 32

The exact values of the integrals are given for computing the error.

dx= 0.490874

Step2

To 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.5708, n=4

Using midpoint rule

Step4

Midpoint sum for N=4

++-------+)

++-------+)

=0.490874

Error for N=4 for midpoint rule

===1.348

Step5

Using midpoint rule

Midpoint sum for N=8

++-------+)

++-------+)

=0.490874

Error for N=8 for midpoint rule

===2.57919

Step6

Using midpoint rule

Midpoint sum for N=16

++-------+)

++-------+)

=0.490874

Error for N=16 for midpoint rule

===2.39792

Step7

Using midpoint rule

Midpoint sum for N=32

++-------+)

++-------+)

=0.490874

Error for N=32 for midpoint rule

===1.61971

Step8

N=4

Using trapezoidal rule

Trapezoidal sum for N=4

=0.490874

Error for N=4 for Trapezoidal rule

===2.3427

Step9

N=8

Using trapezoidal rule

Trapezoidal sum for N=8

=0.490874

Error for N=8 for Trapezoidal rule

===1.84535

Step10

N=16

Using trapezoidal rule

Trapezoidal sum for N=16

=0.490874

Error for N=16 for Trapezoidal rule

===1.05164

Step11

N=32

Using trapezoidal rule

Trapezoidal sum for N=32

=0.490874

Error for N=32 for Trapezoidal rule

===1.72478

Step 12</p>

Table for approximation and error

N |
Approximation (Midpoint Rule) |
Error(Midpoint Rule) |
Approximation (Trapezoidal Rule) |
Error(Trapezoidal Rule) |

4 |
0.0490874 |