THE DEFINITE INTEGRAL BY COMPUTING RIEMANN SUMS WITH MAPLE
Remember that a Riemann sum comes from partitioning an interval on which a function is defined. If that interval is [a, b] then the partition takes the form:
The ith subinterval is
given by
. If, for each i,
is a point in
this ith subinterval then a Riemann sum for this partition is given by
where
is the length of
the ith subinterval.
![]()
One can
use Maple to get both Riemann sums and the limit of those sums. However, because of the nature of any
computational device we are limited by Maple to finding Riemann sums in which
the partition points
are chosen with
some type of pattern as well as
. The easiest
choice is to use a regular partition, one in which all subintervals have the
equal length
. For this type
of partition the partition points are given by:
and so on. In general
.
There are several natural
choices for
:

To us Maple to compute
these Riemann sums we must define all of the above components: the function, the length of the
subintervals, the partition points
, and the points at which the function is evaluated
. These are done
in Maple as follows:

The Riemann sum itself is then given by:
Compute
using Riemann
sums.
The interval of interest
here is [1, 4]. The function is
. We will choose
the midpoint of each subinterval at which to evaluate the function. Enter the following commands:
> dx:=(4-1)/n;
> f:=x -> x^3+1;
> x:=i -> 1+i*dx;
> t:=i -> (1/2)*x(i-1) + (1/2)*x(i);
> sum(f(t(i))*dx,i=1..n);
> su:=simplify(%);
> subs(n=10,su);
> limit(su,n=infinity);
We note
that the Riemann sum for n=10 is given by issuing the command >subs(n=10,su)
which gives a result of
. Thus the error
made in approximating the integral with this sum is abs
In general the error made using the midpoint as the evaluation point is given by

Use Maple to compute the following definite integrals by computing limits of
Riemann sums. For each integral use all three choices
for
, i.e. get three
Riemann sums for each integral.
a)
b)
c)
d)
e)
a)
b)
c)
d)
e)
![]()
a)
b)
c)
d)
e)
![]()
a)
b)
c)
d)
e)
where a, b, c, d are all positive real numbers with a < b.
a)
b)
c)
d)
e)
For each problem answer the following questions:
a) Since you have computed three Riemann sums for each integral, which is the largest one?
b) Which is the smallest?
c) How much over-approximation is there in the largest sum?
d) How much under-approximation is there in the smallest sum:
e) Which of the three sums is the most accurate?
Write up your results to these questions in paragraph form. Now choose four of your own integrals and experiment to find at least one which Maple cannot do using limits of Riemann sums. Why do you suppose Maple will not handle these functions? (An attempt to compute the Riemann sums by hand may shed light upon the problem.)
Created by:
Department of Mathematics and Computer Science
The College of Wooster