** Next:** Exercises
**Up:** Labs and Projects for
** Previous:** Labs and Projects for

In Exercise 1 we look at the definite integral as the limit of Riemann sums (see Sections 5.3 to 5.5 of the text). In Exercise 2 we show how Maple can, in many cases, give us antiderivatives (see Section 5.1). In Exercise 3 we use Maple to implement the amazing theorem about definite integrals given in Section 5.6 - do you know what theorem this is? Exercise 4 gives you an antiderivative problem with two different looking answers. In Exercise 5 we take a look at the kind of approach that could be used on a problem for which there was no practical way to apply that amazing theorem from Section 5.6.

For Exercise 1 ....

It is not claimed that the following procedure is efficient. Rather, it is presented as an educational demonstration in the hope that you will develop a greater appreciation of how the definite integral arises as a limit of Riemann sums.

We use a right sum with *n* subintervals to set up a Riemann sum.
Then we simplify this sum and use summation techniques to reduce the
Riemann sum to a function of *n*. Finally, the limit as *n* goes
to infinity is taken.

Here are Maple commands to carry out the steps outlined above for the
given *g* on the interval [2,5]. Notice the use of the **sum**
command. More information about **sum** can be found in Maple's
online help.

> with(student):

> g:=x->x^2+2*x-4;

> rightsum(g(x),x=2..5,n);

> expand(``);

> R:=(12/n)*sum(1,i=1..n)+(54/n^2)*sum(i,i=1..n)+(27/n^3)*sum(i^2,i=1..n);

> expand(R);

> limit(``,n=infinity);

For Exercise 2 ....

In Maple the **int** command can be used to obtain antiderivatives.
All you need to do is list the function and the variable of
integration. Here is a sample of the syntax

> int((sin(x))^2,x);

For Exercise 3 ....

The **int** command can also be used to evaluate definite
integrals. If possible, Maple will find the needed antiderivative and
then apply the Fundamental Theorem of Calculus. Here is a sample of
the syntax.

> int((sin(x))^2,x=0..Pi);

For Exercise 4 ....

A theorem mentioned on the first day of class will be useful here.

Exercise 5 ....

When a usable antiderivative cannot be found, a definite integral then has to be approximated by one of what are called numerical integration techniques. Here we will approximate a definite integral by using a midpoint rule Riemann sum (see Lab 1).

An approximation to a quantity is usually not of much use unless we have some idea of by how much the approximation might be ``off'' from the actual value of the quantity. We now discuss such an error bound for midpoint rule approximations.

The midpoint rule with *n* subintervals (designated as *M*_{n})
usually gives better accuracy than either the left endpoint rule
(*L*_{n}) or the right endpoint rule (*R*_{n}). This means that, for a
given *n*, *M*_{n} is generally closer to *A*, the value of the
definite integral under discusion, than either *L*_{n} or *R*_{n}. In
numerical analysis texts it is shown that the error, *EM*_{n}, in using
*M*_{n} to approximate the area under *y* = *f*(*x*) on [*a*,*b*]
satisfies

where *B* is the global maximum of on [*a*,*b*]. In practice, *B* is often approximated by a number
*K* that is an upper bound for *B*, that is *B* < *K*. For instance,
if on might be taken as 4.
Do you see why? For more complicated functions, Maple can be used to
get a value for *K* that is close to *B*. Note that the error
bound formula gives a worst case estimate, the accuracy achieved for a
given number of subintervals *n* may be much better than the
guarantee given by the formula.

In Section 10.3 (part of MA 1023) you can see two additional numerical
integration techniques. Note that when, for a definite integral, you
use **evalf** with **int**, Maple invokes a powerful numerical
approximation routine.

The function *g* given in this exercise is not the kind of function
for which a numerical integration technique is required since it has a
``nice'' antiderivative. However, it yields a good illustration of
the technique under discussion and also permits us to make a useful
comparison in part (d) of the exercise.

4/5/1999