Module

for

Riemann Sums, Midpoint Rule and Trapezoidal Rule

Definition.  Definite Integral as a Limit of a Riemann Sum.   Let    be continuous over the interval  ,
and let    be a partition,  then the definite integral is given by

,

where    and the mesh size of the partition goes to zero in the "limit,"  i.e . .

Animations (Riemann Sums  Riemann Sums).

Animations (Trapezoidal Rule  Trapezoidal Rule).

Computer Programs  Riemann Sums  Riemann Sums

The following two Mathematica subroutines are used to illustrate this concept, which was introduced in calculus.

The Left Riemann sum uses in the definition.

Mathematica Subroutine (Left Riemann Sum).

``````
``````

The Right Riemann sum uses in the definition.

Mathematica Subroutine (Right Riemann Sum).

``````
``````

The midpoint rule uses in the definition.

Improvements can be made in two directions, the midpoint rule evaluates the function at  ,  which is the midpoint of the subinterval , i.e. in the Riemann sum.

Mathematica Subroutine (Midpoint Rule).

``````
``````

The Trapezoidal Rule is the average of the left Riemann sum and the right Riemann sum.

Mathematica Subroutine (Trapezoidal Rule).

``````
``````

Example 1.   Let    over  .  Use the left Riemann sum  with  n = 25, 50, and 100  to approximate the value of the integral.
Solution 1.

Example 2.   Let    over  .  Use the right Riemann sum  with  n = 25, 50, and 100  to approximate the value of the integral.
Solution 2.

Example 3.   Let    over  .  Use the midpoint rule with  n = 25, 50, and 100  to approximate the value of the integral.
Solution 3.

Example 4.   Let    over  .  Use the trapezoidal rule with  n = 25, 50, and 100  to approximate the value of the integral.
Solution 4.

Example 5.   Let    over  .  Compare the left Riemann sum, right Riemann sum, midpoint rule and trapezoidal rule for n = 100 subintervals.  Compare them with the analytic solution.
Solution 5.

Example 6.   Let    over  .
6 (a) Find the formula for the left Riemann sum using n subintervals.
6 (b) Find the limit of the left Riemann sum in part (a).
Solution 6.

Example 7.   Let    over  .
7 (a) Find the formula for the right Riemann sum using n subintervals.
7 (b) Find the limit of the right Riemann sum in part (a).
Solution 7.

Example 8.   Let    over  .
8 (a) Find the formula for the midpoint rule sum using n subintervals.
8 (b) Find the limit of the midpoint rule sum in part (a).
Solution 8.

Example 9.   Let    over  .
9 (a) Find the formula for the trapezoidal rule sum using n subintervals.
9 (b) Find the limit of the trapezoidal rule sum in part (a).
Solution 9.

Various Scenarios and Animations for Riemann Sums.

Example 10.   Let    over  .  Use the Left Riemann Sum to approximate the value of the integral.
Solution 10.

Example 11.   Let    over  .  Use the Right Riemann Sum to approximate the value of the integral.
Solution 11.

The following animations for the lower Riemann sums are included for illustration purposes.

Example 12.   Let    over  .  Use the Lower Riemann Sum to approximate the value of the integral.
Solution 12.

The following animations for the upper Riemann sums are included for illustration purposes.

Example 13.   Let    over  .  Use the Upper Riemann Sum to approximate the value of the integral.
Solution 13.

Example 14.  Let    over  .  Use the Midpoint Rule to approximate the value of the integral.
Solution 14.

Example 15.  Let    over  .  Use the Trapezoidal Rule to approximate the value of the integral.
Solution 15.

Animations (Riemann Sums  Riemann Sums).

Animations (Trapezoidal Rule  Trapezoidal Rule).

Riemann Sums  Riemann Sums  Internet hyperlinks to web sites and a bibliography of articles.

(c) John H. Mathews 2004