Encompassing current mathematical software and technology in teaching and research

Wei-Chi Yang
Department of Mathematics and Statistics
Radford University
www.runet.edu/~wyang
e-mail: wyang@runet.edu

Abstract

This paper is divided into two parts. One is to discuss the technology in teaching and the other is the technology in research in the area of numerical integration. First, I shall use examples to demonstrate how Maple and Scientific WorkPlace (SWP) can be best used in classroom teaching interactively. I shall use one example to demonstrate how SWP can be used in understanding the Riemann Sum and use Maple to generate the animations. The Maple source codes will be also provided. I shall give references on lots of teaching modules, which can be found in my homepage. Second, I will also discuss problems in numerical integrations motivated by Maple and Mathematica. What type of problems both Maple and Mathematica have trouble in finding numerical answers. I will give some successful adaptive quadratures in one and two dimensions, which I generated by using Maple as a conjecture tool.

The impact of mathematical software and technology on my teaching and research

  1. I use SWP as a wordprocessor and a computational tool. I save the documents in LaTeX files and post them as *.tex, *.msg, or *.dvi files in the WWW so interested people can view or download them.
  2. I use Maple

    1. to generate animations and computer programs.
    2. to make educational mathematical conjectures. For example, one can use the plot for a finite sum of functions to predict the behavior of the plot for an infinite sum of functions.
    3. to write programs in experimenting quadratures in numerical integration and use it as a conjecture before I run traditional programing, which saves me lots of time.

Preferably one should have access to both Scientific WorkPlace and Maple. However, if only you have the access to SWP but no Maple

  1. Then you can do many live computations but not programing, animations and etc.
  2. You could use latex2html to transfer *.tex, generated by SWP, to *.html and jump to a free Maple web site set up by Simon Fraser University, Canada. For sample documents, see

    www.runet.edu/~wyang/121.html.

If you and students have access to Maple or SWP

  1. Put the your SWP or Maple documents in the WWW and point the browser to SWP-pro.exe or maplev4.exe (or maplev3.exe depending on the version of Maple you have). Then the documents can be viewed and experimented.
  2. For an html file and an animation generated by Maple, see ''http://www.runet.edu/~wyang/SWP/ictcm9/
    anti.html''.
  3. For an SWP file, go to ''http://www.runet.edu/~wyang/SWP/ictcm9/
    ictcm9.tex''.

Each Software package has its own strength and weakness

  1. There is no software can handle all kinds of demands. For example, not all the software packages can do symbolic, numerical, wordprocessor, programing, animations, and external links effectively at the same time.
  2. The question is how do we link up all these investments nicely?

One possible solution will be to use SWP as a wordprocessor and a basic computational tool and use Maple as a programing tool to generate animations and etc. I also found that Java will be an important tool to incorporate software in WWW technology. But when do we write a Java script? It will be too much time consuming if we have to write Java scripts for every subject. Maybe using Java to link with animations done by software is more efficient. There are two interactive web sites I would like share:

  1. ''http://www.calculus.net'', there are some nice VRML on teaching calculus, and a plug in for MathView.
  2. ''http://www.campusnet.or.jp/~tsuyuki/java/iesjava.html''. there are some interactive example on trigonometry.

Example on Teaching the Riemann Sum with SWP and Maple

Introduction

One of the topics that are studied in a first course in integral calculus is the process of approximating a given integral tex2html_wrap_inline300 by various types of sums. In studying this topic, we are not just concerned with the act of finding approximations to the integral. An approximate value of an integral can be obtained by a single click on Evaluate Numerically with SWP. The purpose of this topic is to acquaint students with a variety of different kinds of sums such as left sums, right sums, trapezoidal sums, midpoint sums and Simpson sums, to point out that some of these sums will approximate a given integral more closely than others and to show that all of them provide better approximations when the interval of integration is more finely partitioned. We would like to know how much better the better sums are and how much better the sums become when the interval is more finely partitioned.

In this example, we shall show how Scientific WorkPlace can be used to study the left sums, right sums, trapezoidal sums, midpoint sums and Simpson sums of a given function f on an interval tex2html_wrap_inline304 and how a course in integral calculus can thus be enriched with the help of Scientific WorkPlace.

The Approximating Sums

In this section we introduce the notions of left sum, right sum, trapezoidal sum, midpoint sum and Simpson sum of a given function f over a partition of an interval tex2html_wrap_inline308 We begin with a brief review of the definition of a Riemann integral.

In a first course in integral calculus, the Riemann integral  of a bounded function f on an interval tex2html_wrap_inline304 is described as the limit of a sequence of sums of the type tex2html_wrap_inline314where tex2html_wrap_inline316 and where, for each tex2html_wrap_i
nline318 we have tex2html_wrap_inline320 Sums of this type are called Riemann sums  of the function f over the interval The sense in which the limit is taken is that if we define the mesh  of the partition tex2html_wrap_inline326 to be the largest of the lengths of the intervals tex2html_wrap_inline328 then the above Riemann Sum can be made as close as we like to tex2html_wrap_inline300 by making this mesh small enough.

The simplest type of partition of a given interval tex2html_wrap_inline304 is a partition tex2html_wrap_inline326 for which all of the intervals tex2html_wrap_inline328 have the same length. In this case the partition is said to be regular and for each tex2html_wrap_inline318 we have tex2html_wrap_inline340 and tex2html_wrap_inline342Since the mesh of this partition is tex2html_wrap_inline344 we make it approach 0 by letting tex2html_wrap_inline348

Given a<b and a positive integer n, we have described the regular partition tex2html_wrap_inline326 as being the finite sequence of numbers defined by tex2html_wrap_inline356for each tex2html_wrap_inline358 Before we give this definition to Scientific W orkPlace, we shall make the notation a bit more precise. We shall replace the notation xj by tex2html_wrap_inline362 in order to account for the fact that this number depends also upon the value of n and upon the interval that is being partitioned. Accordingly, the first step in the procedure is to point at the equation tex2html_wrap_inline366 and to click on Define and New Definition.

Since the various approximating sums all depend upon the function f that we wish to integrate, we need to let Scientific WorkPlace know that the symbol f stands for a function before we write down the definitions of the approximating sums. In order to achieve this, we make the nominal definition tex2html_wrap_inline372 by pointing at the equation tex2html_wrap_inline372 and clicking on Define and New Definition.

Note that this definition of f is purely temporary. We can change it at any time and all the sums will change accordingly.

Defining The Approximating Sums

The left sum of a given function f over the partition defined above is the Riemann sum tex2html_wrap_inline380where, for each j, the number tj is the left endpoint of the interval that runs from tex2html_wrap_inline386 to tex2html_wrap_inline388 In other words, we define the left sum by pointing at t he equation tex2html_wrap_inline390 and clicking on Define and New Definition. Similarly, the right sum of f is tex2html_wrap_inline3
94 and we define it by pointing at the equation and clicking on Define and New Definition. The arithmetic mean of the left and right sums is the trapezoidal sum tex2html_wrap_inline396 which we define by pointing at the equation tex2html_wrap_inline398

Alternatively we could observe that

tex2html_wrap_inline400and use this equation for the definition of the trapezoidal sum. As we shall see from the examples that follow, the trapezoidal sum is frequently a much better approximation to the integral than either the left or the right sum. An even better approximation than the trapezoidal sum is the midpoint sum tex2html_wrap_inline402 which we define by pointing at the equation tex2html_wrap_inline404

In this sum the function f is evaluated for each j at the midpoint of the interval that runs from tex2html_wrap_inline386 to tex2html_wrap_inline388

Finally, the Simpson sum tex2html_wrap_inline414 of f over the given partition is defined by pointing at the equation tex2html_wrap_inline418

As you may know, the Simpson sum is used only when the number n is even.

A Simple Example

Having supplied the definitions of the sums to Scientific WorkPlace as described in the previous section, we can evaluate the sums for any specified function f, interval tex2html_wrap_inline304 and any specified value of n. In this section we work out some approximations to the integral tex2html_wrap_inline428 We know, of course, that

tex2html_wrap_inline430

To work out the various approximating sums, we begin by pointing at the equation tex2html_wrap_inline432 and clicking on Define and New Definition.

Approximations with 20 Subdivisions

By pointing and clicking on Evaluate Numerically we obtain

Lf(1,5,20)=65.52

Rf(1,5,20)=81.52

Tf(1,5,20)=73.52

Mf(1,5,20)=73.24

Sf(1,5,20)=73.33333.

And we can see at once that the midpoint sum is better than the trapezoidal sum which, in turn, is much better than the left and right sums. We see also that the Simpson sum is the best of all. As a matter of fact, the exact value of the Simpson sum is tex2html_wrap_inline434which is exactly equal to the integral. It can be proved that the Simpson sum is always exactly correct when the function being integrated is a polynomial of degree 3 or less.

An animation

  1. For Maple animation of the leftbox, rightbox and etc. see Appendix or click here .
  2. For an avi animation file, click here .

Numerical Integrations in Maple and Mathematica

The facts about some of the algorithms set up by Maple and Mathematica are as follows:

  1. They are not reliable for treating functions with singularities in higher dimensions.
  2. We know that the double integral of the function tex2html_wrap_inline436 if x2+y2>0 and f(x,y)=0 if x2+y2=0 in the region tex2html_wrap_inline444 does not exist and yet the value of its repeated integrals is 0. Both Maple V Release 4 and Mathematica 2.01 give the ''wrong'' answer 0.
  3. Both Mathematica and Maple can't handle singularities which lie on the diagonal of a region, examples will be given later.

These facts motivate me to develop new algorithms which shall use my theoretical integration backgrounds.

Numerical integration and theoretical integration

Numerical integration experts can handle functions which are so called absolute integrals. The non-absolute integrals, such as the following highly oscillatory function tex2html_wrap_inline450 is not Lebesgue integrable but is Henstock integrable (see [L]). Most experts in numerical integration do not talk about how to integrate this type of function directly.

Uniform regular matrices

We introduce one way of partition an interval unevenly.

Definition. A matrix A with positive tex2html_wrap_inline454is called uniformly regular if the following conditions are satisfied: (1) tex2html_wrap_inline456 uniformly over k. (2) tex2html_wrap_inline460

For example, we may use the finite sum formula, tex2html_wrap_inline462 m=1,2,..., to form uniform regular matrices. For m=1, we define the matrix tex2html_wrap_inline468. For details, see [YC].

Quadratures

Consider the following closed type quadrature:

tex2html_wrap_inline470

We would like to experiment this quadrature with the Scientific Workplace (which uses Maple as a tool for computation). But first we need to make the following adjustments for computation purpose. We define the right and left endpoints as follows:tex2html_wrap_inline472 and tex2html_wrap_inline474 which correspond to un,k and tex2html_wrap_inline478respectively.

We define our first closed type quadrature as follows: tex2html_wrap_inline480

We note that the first term of Q1(n), (1/2)a(n,1)f(r(n,1)), is a tail term to take care of functions with a singularity, and the second term of Q1(n), denoted by Q(n) is a trapezoidal sum. Thus, we may call the quadrature, Q1(n), to be the adaptive trapezoidal sum. We shall use the combination of Q1(n) and Q(n) to come up with the rule for Richardson extrapolation integration as follows tex2html_wrap_inline496

Example: Consider the function tex2html_wrap_inline498, if tex2html_wrap_inline500, and f(0)=0. (We notice that f has a singularity at x=0.) Use Q1(n) to approximate tex2html_wrap_inline510 If we use Evaluate numerically with Scientific Workplace under ''Maple'', we get the following numeric results:

Q1(300)=-2.720856531

Q1(400)=-2.720938148

Q1(430)=-2.720950937

By using Maple V R4 on R(n), we obtained the following info:

R(300)=-2.721249539

R(400)=-2.721164891

R(430)=-2.721149108

We observed that the Ricahrdson extrapolation gives better estimate, the answer above is accurate up to 4 digits. We note that when we increase n, we will be warned of the existence of the singularity at x=0 . For a maple worksheet on this quadrature, click here or go to the Appendix. To further investigate the convergence or divergence of this integral, we could write a separate computer program to run our quadrature.

Open type in two dimensions

We mention an open type quadrature in two dimensions (see [YC[) by using two uniformly regular matrices, cnk, dml, and denote them by c(n,k) and d(m,l) for computation purpose. Now set tex2html_wrap_inline526 tex2html_wrap_inline528, and consider the function tex2html_wrap_inline530 if tex2html_wrap_inline500, and tex2html_wrap_inline534, and g(x,y)=0 if x=y=0. First, we define the followings:

tex2html_wrap_inline540

Next we define the following open quadrature: tex2html_wrap_inline542

g(l(n,k),r(m,l))+g(r(m,l),l(n,k))+g(l(n,k),l(m,l))))

We obtain the following information:

Q(20,20)=3.94397632

Q(30,30)=3.97226585

Q(40,40)=3.98311667

For the Maple workshet on this open type quadrature, click here or go to the Appendix section. We could speed up the rate of convergence for this type of function by considering the following closed type quadrature. We consider a closed type quadrature, which is an extension of Qn1(f), as follows: tex2html_wrap_inline55

tex2html_wrap_inline57

tex2html_wrap_inline59

tex2html_wrap_inline61 If we use tex2html_wrap_inline63 and tex2html_wrap_inline65,we obtain the following information from Maple V Release 4:

tex2html_wrap_inline67

By comparing the open type and closed type quadratures, we see that closed type quadrature is more efficient in this case.

Singularities lie on a diagonal line

Consider evaluating the following numerical integral tex2html_wrap_inline554

Both Maple and Mathematica could not give an answer due the singularities lie along x=y. What we will do is to transform the singularities to the boundary first and apply a quadrature which uses uniformly regular matrices for computations.

Note that the function tex2html_wrap_inline558 is symmetric with respect to y=x, so we consider the integration over the triangle with vertices O=(0,0), P=(1,0) and Q=(1,1). After the transformation with change of variables, u=x, and v=x-y, the singular points are shifted to x- axis, and the Jacobian is tex2html_wrap_inline574 Thus, equation (1) becomes tex2html_wrap_inline578 By using the uniformly regular matrices tex2html_wrap_inline580 and tex2html_wrap_inline582 and write a corresponding Pascal program, we obtain the following information

tex2html_wrap_inline584

Another Example

Estimate tex2html_wrap_inline586 We use the transformation u=1-x, v=1-y, to transform the singular points to u and v axes, and also the point (1,1); note that the Jacobian is 1.

Thus consider the new integral tex2html_wrap_inline600 By using the open type quadrature in two dimensions mentioned earlier, with the uniformly regular matrices, tex2html_wrap_inline526 tex2html_wrap_inline604 we implement the Pascal program. Partial results are shown below:

tex2html_wrap_inline606

Remarks

  1. We can predict that given a function with two variables, there should be an optimal choice for picking the uniform regular matrices, ank, and bnk.
  2. We have the Richardson Extrapolation for the quadrature in one dimension as we mentioned earlier. We should be able to apply the Richardson Extrapolation for the two dimensional quadrature to speed up the convergence.

Appendix

  • A Maple animation file .
  • A Maple Worksheet on one dimensional adaptive quadrature.
  • A Maple Worksheet on two dimensional open adaptive quadrature.
  • The SWP file of this paper.

    References

    DR
    Davis and Rabinowitz, Method of Numerical Integration, 2nd Ed.., Academic Press 1983.

    L
    P.Y. Lee, Lanzhou Lectures on Henstock Integration, World Scientific 1989.

    LY
    P.Y. Lee and W.-C. Yang, Henstock Integral and Numerical Integration, preprint.

    Y
    W.-C. Yang, The Errors for the Closed and Open Type Adapted Quadratures, preprint.

    YC
    W.-C. Yang and M. Chung, Experimenting Integration Quadrature with Software, Proceedings of ATCM95, National Institute of Education, Singapore.

    About this document ...

    This document was generated using the LaTeX2HTML translator Version 96.1-h (September 30, 1996) Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.

    The command line arguments were:
    latex2html 121.

    The translation was initiated by Wei-Chi Yang on Wed Jan 29 10:59:51 EST 1997