Module

for

Riemann Sums, Midpoint Rule and Trapezoidal Rule

   

Definition.  Definite Integral as a Limit of a Riemann Sum.   Let  [Graphics:Images/RiemannSumMod_gr_1.gif]  be continuous over the interval  [Graphics:Images/RiemannSumMod_gr_2.gif],  
and let  [Graphics:Images/RiemannSumMod_gr_3.gif]  be a partition,  then the definite integral is given by

    [Graphics:Images/RiemannSumMod_gr_4.gif],  

where  [Graphics:Images/RiemannSumMod_gr_5.gif]  and the mesh size of the partition goes to zero in the "limit,"  i.e . [Graphics:Images/RiemannSumMod_gr_6.gif].  

Proof  Riemann Sums  Riemann Sums  

 

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 [Graphics:Images/RiemannSumMod_gr_7.gif] in the definition.

Mathematica Subroutine (Left Riemann Sum).

[Graphics:Images/RiemannSumMod_gr_8.gif]

The Right Riemann sum uses [Graphics:Images/RiemannSumMod_gr_9.gif] in the definition.

Mathematica Subroutine (Right Riemann Sum).

[Graphics:Images/RiemannSumMod_gr_10.gif]

The midpoint rule uses [Graphics:Images/RiemannSumMod_gr_11.gif] in the definition.

Improvements can be made in two directions, the midpoint rule evaluates the function at  [Graphics:Images/RiemannSumMod_gr_12.gif],  which is the midpoint of the subinterval [Graphics:Images/RiemannSumMod_gr_13.gif], i.e. [Graphics:Images/RiemannSumMod_gr_14.gif] in the Riemann sum.  

Mathematica Subroutine (Midpoint Rule).

[Graphics:Images/RiemannSumMod_gr_15.gif]

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

Mathematica Subroutine (Trapezoidal Rule).

[Graphics:Images/RiemannSumMod_gr_16.gif]

Example 1.   Let  [Graphics:Images/RiemannSumMod_gr_17.gif]  over  [Graphics:Images/RiemannSumMod_gr_18.gif].  Use the left Riemann sum  with  n = 25, 50, and 100  to approximate the value of the integral.
Solution 1.

 

Example 2.   Let  [Graphics:Images/RiemannSumMod_gr_34.gif]  over  [Graphics:Images/RiemannSumMod_gr_35.gif].  Use the right Riemann sum  with  n = 25, 50, and 100  to approximate the value of the integral.
Solution 2.

 

Example 3.   Let  [Graphics:Images/RiemannSumMod_gr_51.gif]  over  [Graphics:Images/RiemannSumMod_gr_52.gif].  Use the midpoint rule with  n = 25, 50, and 100  to approximate the value of the integral.
Solution 3.

 

Example 4.   Let  [Graphics:Images/RiemannSumMod_gr_68.gif]  over  [Graphics:Images/RiemannSumMod_gr_69.gif].  Use the trapezoidal rule with  n = 25, 50, and 100  to approximate the value of the integral.
Solution 4.

 

Example 5.   Let  [Graphics:Images/RiemannSumMod_gr_85.gif]  over  [Graphics:Images/RiemannSumMod_gr_86.gif].  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  [Graphics:Images/RiemannSumMod_gr_96.gif]  over  [Graphics:Images/RiemannSumMod_gr_97.gif].  
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  [Graphics:Images/RiemannSumMod_gr_119.gif]  over  [Graphics:Images/RiemannSumMod_gr_120.gif].  
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  [Graphics:Images/RiemannSumMod_gr_142.gif]  over  [Graphics:Images/RiemannSumMod_gr_143.gif].  
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  [Graphics:Images/RiemannSumMod_gr_159.gif]  over  [Graphics:Images/RiemannSumMod_gr_160.gif].  
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  [Graphics:Images/RiemannSumMod_gr_176.gif]  over  [Graphics:Images/RiemannSumMod_gr_177.gif].  Use the Left Riemann Sum to approximate the value of the integral.
Solution 10.

 

Example 11.   Let  [Graphics:Images/RiemannSumMod_gr_201.gif]  over  [Graphics:Images/RiemannSumMod_gr_202.gif].  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.

[Graphics:Images/RiemannSumMod_gr_226.gif]

Example 12.   Let  [Graphics:Images/RiemannSumMod_gr_227.gif]  over  [Graphics:Images/RiemannSumMod_gr_228.gif].  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.

[Graphics:Images/RiemannSumMod_gr_253.gif]

Example 13.   Let  [Graphics:Images/RiemannSumMod_gr_254.gif]  over  [Graphics:Images/RiemannSumMod_gr_255.gif].  Use the Upper Riemann Sum to approximate the value of the integral.
Solution 13.

 

Example 14.  Let  [Graphics:Images/RiemannSumMod_gr_280.gif]  over  [Graphics:Images/RiemannSumMod_gr_281.gif].  Use the Midpoint Rule to approximate the value of the integral.
Solution 14.

 

Example 15.  Let  [Graphics:Images/RiemannSumMod_gr_305.gif]  over  [Graphics:Images/RiemannSumMod_gr_306.gif].  Use the Trapezoidal Rule to approximate the value of the integral.
Solution 15.

 

Animations (Riemann Sums  Riemann Sums).  

Animations (Trapezoidal Rule  Trapezoidal Rule).  

 

Research Experience for Undergraduates

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

 

Download this Mathematica Notebook Riemann Sums, Midpoint Rule and Trapezoidal Rule

 

Return to Numerical Methods - Numerical Analysis

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004