Some Thoughts on Calculus 
Laboratories

by 
Marvin L. De Jong
Department of Mathematics-Physics
College of the Ozarks
Pt. Lookout, MO 65726

Mathematica in Education
Vol.3 No.3
Summer 1994
(c) TELOS/Springer-Verlag

Introduction

In August of 1992 we were notified that our Instrumentation and Laboratory Improvement (ILI) proposal to NSF had been funded.  Our proposal was to "use Computers and Computer-Based Tools to Revitalize Mathematics and Physics Instruction at College of the Ozarks."  Among other things, we used the grant to purchase 12 Macintosh II ci computers and Mathematica for each machine.  This past semester we inaugurated our first calculus class with a laboratory component consisting of a two-hour laboratory each week of our 15-week semester.  The laboratories were, for the most part, Mathematica notebooks with titles such as:

Arithmetic, Algebra, and Functions
Solving Equations
Limits
Growth Rates
Derivatives
Maxima and Minima
Graphs of Polynomial and Rational Functions
Finding Areas
Integration

Although these appear to be rather traditional topics, our approach was intuitive rather than formal, frequently numerical rather than symbolic, and rather than "telling" we tried to guide the students to discover concepts that would be covered in class at a later, but not too distant, date.  In the process we discovered some things about the interaction of students and Mathematica in the context of a laboratory, some of which we share with you in this paper.

How Much Of Mathematica Do You Teach?

Our primary goal is to use Mathematica to help students understand calculus.  A secondary goal is to empower students to use Mathematica as a tool in their classes.  Essentially all of our students come into the laboratory with no experience with Mathematica.  Since our foremost goal is to teach calculus, not Mathematica, we think it is wise to choose some subset of Mathematica  functions and concentrate on those. Of the published calculus laboratory books of which we are aware, Finch /Lehmann1 and Kerckhove/Hall2 seem to adopt a similar philosophy, while Sparks, Davenport and Braselton3 utilize many Mathematica functions.  (Because it resonated with the spirit of our plans for a calculus laboratory, we were especially pleased with the Finch/Lehmann book, but we chose to write our own laboratory notebooks because we did not wish to increase the financial burden of our students and we had some of our own ideas we wanted to try.)

Aside from the obvious arithmetic operations and functions such as x^n, Sqrt[], Sin[], ArcSin[], Abs[], etc., the following Mathematica functions are the ones we have chosen for our introductory calculus course (Calculus I):

Limit[], D[] and f'[x], Integrate[], Table[], Expand[],      Factor[], Simplify[], Plot[], ListPlot[], Plot3D[], PolarPlot[], Solve[], FindRoot[], Sum[], Clear[].

Note: By including the bracket notation when expressing a function I hope to constantly remind the students about this piece of Mathematica syntax.  One of the most common errors that students make is to either forget the square brackets or use parantheses instead.

I am sure that others would choose a slightly different subset, and indeed, for Calculus II and Calculus III we will add a few more functions. There were situations, not many, when we wrote functions that we expected the students to use without necessarily understanding how the functions were implemented.  Also, if we wanted to put bells and whistles on a graph, we did so ourselves without asking the student to either understand or remember.  In terms of graphing, all we expected of them was to use the Plot[] command or one of its derivatives.  Although your list of essential functions may differ from ours,  I think it makes good sense to consciously limit the number of functions a student must learn.

Finally, I think it is best to teach Mathematica in the context of a math (or physics) course, not as its own entity.  The syntax of Mathematica is, in general, very good, and the students can pick it up as they go along, rather than as a separate subject.  I also note here that I never tested them over Mathematica, although some bonus points on tests depended on knowing simple Mathematica commands.

Critical Mass And Other Thoughts

One of our goals was to empower students to use Mathematica as a tool in classes they might be taking.  Our experience has been that students acquire the confidence and ability to do this neither quickly nor easily.  They need a certain critical mass of experience before they will come into the computer laboratory on their own, fire up a computer, bring up Mathematica and begin to use it to solve homework problems.  Couple this with the fact that when working in pairs some students will always hang back and not get involved with the details of the computerÐmice, double clicks, pull-down menusÐ and the result is that a few students never acquire this confidence or ability. 	Fortunately there are other students who are empowered to use Mathematica as a tool, and who, after about five laboratories, begin to use it on their own.

What is the solution to the empowerment problem?  One solution is repetition; that is, the students must repeat the use of a command many times until they feel confidence.  This means that you must give them quite a few problems or exercises where they must use a command on their own.  "On their own" means more than putting the cursor in the command line and pressing "enter."  It means translating a mathematical operation in a book or on a sheet of paper to a Mathematica expression in an input cell in a notebook.  For example, give them a set of simple max-min or area problems.  Then they must turn the computer on, bring up Mathematica, enter functions using the proper syntax, and translate the answer back to a piece of paper.  Also, when they have a syntax question, teach them to use the "?" command to refresh their memory.  It is helpful to keep an eye out for students who become passive at the computer.  Make sure they are actively involved even if it means that you ask one student to sit  back and let the other run the controls for awhile.

Give some homework assignments that they must start and complete in a fresh, new Mathematica notebook; a page of derivatives or a page of integrals, for example.  You need not do this frequently, and bright students may well wonder what the purpose of such an exercise is.  I remember one such time when a student asked me "What are we learning by doing this?"  I had to tell him that it was practice, he wasn't really learning anything new.

Using Mathematica to Understand the Integral

What follows is a brief description of something we do in a calculus laboratory that is related to integration.  Before doing anything associated with an integral or the fundamental theorem of calculus in class, we have a calculus lab on finding areas under curves. We begin with an area defined by an interval [0, 2] and a function such as f(x) =x2 because we do not want a linear function.  We have the students sketch this area and approximate it by inscribed or circumscribed rectangles. The students must begin by finding the sum of the areas of these rectangles more or less by hand, at least with no more than a calculator.

Having found an approximation to the area with two rectangles and three rectangles by hand, we move them on in this way.  Suppose the area under the curve between zero and two is approximated by four rectangles of equal width that circumscribe the area under the curve.  Find this area using Mathematica.

They must first define the function

f[x_]:=x^2

The width of each interval is (2 - 0)/4 = 1/2 so the area is

f[1/2] 1/2 + f[1] 1/2 + f[3/2] 1/2 + f[2] 1/2

where each term in the sum is the area of a rectangle.  Clearly this gets tedious very quickly as the number of rectangles increases.

Now we introduce the Sum[] function in an attempt to automate the calculations.  They start by seeing some simple situations like summing the first ten counting numbers with

Sum[x, {x,1,10}]

To see that the interval width does not have to be an integer, we have them explain what

Sum[x, {x,1, 2,1/2}]

does.  Then we show them that Sum[]can operate on a function, which we illustrate with

Sum[x^2, {x,1,4}]

and with

Sum[f[x], {x,1,4}]

which, of course, give the same answer.  At this point we also have one or two simple exercises where they must use the Sum[] function.

Now we have them evaluate the following sums.

Sum[f[x] 1, {x, 0+1, 2, 1}]
Sum[f[x] 2/3, {x, 0+2/3, 2, 2/3}]
Sum[f[x] 1/2, {x, 0+1/2, 2, 1/2}]

Having earlier calulated by hand the sum for two, three, and four rectangles, we hope that they remember the answers they obtained earlier and see that this is a simpler way to calculate such sums.  (Note: By expressing the first x-value as "0 + 1" or "0 + 2/3" we help to set the stage for expressing the right-hand sum in terms of the initial point in the interval [0, 2].)

Next we attempt to generalize even more with these assignments:

n = 2;
a = 0;
b = 2;
h =(b - a)/n;
Sum[f[x] h, {x, a+h, b, h}]

It is worth pointing out to them once again that the product of f[x] and h gives the area of one rectangle, and the Sum[] function adds the areas of n rectangles.   It is also worth pointing out that the rectangles are found in the interval [a, b], and the left-most rectangle has a height f[a + h], hence the use of "a + h" as the starting point in the Sum[] function.

At this point you might have them try to use Mathematica to find a sum of the areas of inscribed rectangles, but it is also good to choose to move forward and and experiment to see what happens as n is increased and address this important question.

What is happening to the sum of the areas of the rectangles as n gets larger?

Here are some questions we ask our students:  Is the sum getting smaller and smaller?  If it is getting smaller and smaller, is it approaching zero? Or negative infinity?  Does it approach some number other than zero?  What number?  So the sum can get smaller and smaller, but not go to zero, as we add more rectangles, right or wrong?  So this sum appears to have a limit, what is this limit?

Now, if you haven't already done so, is the time to do sums of inscribed rectangles, with the height of each rectangle being determined by the value of the function at the left-hand side of each interval.  (Note: Now the starting point of the Sum[] function is a rather than a + h, but it ends at b Ð h, the sum being taken over the interval [a, b].)

Next, we have a small but very important discussion of upper sums and lower sums, and we note that, because the function is increasing on [0, 2], using the height of the rectangle as the value of the function on the right-hand side of an interval yields an upper sum.  If the function were decreasing on [0, 2], then the "right-hand sum" would be a lower sum.

The step that follows is neat, because without Mathematica or another language it is too time consuming to do.  We begin by slowly introducing the Table[] function to the students.  For our purposes here we can go directly to make a table of the sums for n = 1 to 20.   Here it is for reference purposes:

Clear[f,a,b,h,n,uppersum]
f[x_]:=x^2
a=0;
b=2;
h=(b-a)/n;
uppersum=Table[{n, Sum[N[f[x] h],{x, a+h, b, h}]},
          {n, 1, 20}]

Then we have the students plot this list:

ListPlot[uppersum];

This gives a marvelous demonstration of the upper sum apparently decreasing to some limiting value as the number of rectangles increases.

We also construct a lower sum:

lowersum=Table[{n, Sum[N[f[x] h],{x, a, b-h, h}]},
          {n, 1, 20}]

Then we plot both on the same graph.

ListPlot[Union[uppersum, lowersum]];

Notice how nicely we have been able to show, intuitively at least, that the upper sum and the lower sum approach the same number, and it seems obvious to define this number as the area under the curve.  At this point you might want to introduce the integral name and symbolism.  We choose not to introduce the symbolism at this point; it comes later, in class.  It would also be tempting to introduce the concept of numerical integration at this point, we also choose to delay this concept since they do not yet know what non-numerical integration is. The goal of course is to have the students think of an integral as a sum, rather than always and forever identifying the integral with the Fundamental Theorem of Calculus.

Before proceeding, perhaps we should point out that our calculus text4 defines the definite integral of f from a to b as that number I for which

Lf(P) ² I  ² Uf(P)

for all partitions P of [a, b].  Clearly, with this lab we are setting the stage for the students to understand this definition.

We could, of course, have constructed Mathematica  functions for the upper and lower sums.  Here we make a function to produce the plots of the upper and lower sums.  Thus,

upandlowsum[f_, a_, b_, n_]:=
	Module[{h, x, k, upsum, lowsum},
	h = (b-a)/k;
	upsum = Table[{k, Sum[N[f[x] h],
		{x,a+h,b,h}]}, {k,1,n}];
	lowsum = Table[{k,Sum[N[f[x] h],
		{x,a,b-h,h}]}, {k,1,n}];
	ListPlot[Union[upsum, lowsum]]];

Next, we use this function:

upandlowsum[f, 0, 2, 50];

Of course, we can use it on other functions as well, and we give our students exercises to do this, including one to help them find the area of a circle.

Continuing, we can now suggest using the average of the area of the circumscribed rectangle and the inscribed rectangle, which turns out to be the same as a trapezoidal sum.  Thus,

avgsum[f_,a_,b_,n_]:= Block[{h,x,k}, h=(b-a)/k;
    trap=Table[{k,Sum[N[(f[x]+f[x+h])/2 h],
    {x,a,b-h,h}]},{k,1,n}];
    ListPlot[trap];];

Then we use avgsum[].

avgsum[f,0,2,20]

Now they can plot all three sums to see how much faster the trapezoidal sum converges.

ListPlot[Union[uppersum,lowersum,trap]];

It is also worthwhile to have them try to find area using the value of the function at the midpoint of each interval as the height of a rectangle.  For the most part they can copy the Mathematica commands that we have used.  In any case, the convergence of the two sums, or any other Riemann sum, is much more intuitive after having done this work, and, of course, it leads quite naturally to numerical integration schemes which we cover somewhat later in the course.

We think the laboratory we have outlined is a worthwhile one.  It should be followed in a few days by a more formal "lecture" on partitions, upper sums, lower sums, Riemann sums, and integrals.  Even the FTC becomes more suprising and wonderful after doing integrals numerically in the laboratory and/or with tricky sums in the classroom.

On Animations

We have prepared several animations including one to demonstrate limits and one to show a secant line evolving into a tangent line.  Both animations received a "ho-hum" response.  Perhaps if the students were guided into making the animations themselves, then the animation might be more significant.   In any case, we have not yet been able to turn this feature of Mathematica into a pedagogical advantage.

Improving Mathematica for Calculus Instruction

From my own perspective the syntax of Mathematica is excellent.  On the other hand, students sometimes see two different notations, such as an integral sign in their calculus text and Integrate[] in Mathematica, and to them the different notations are not trivial.  If I could change the Mathematica interface to meet the needs of my students, I would add a tool bar somewhere along the top of the screen, and it would contain buttons with limit, derivative, integral, summation, square root,  and other widely used commands, perhaps even buttons for the infinity symbol.  The buttons would show the traditional mathematical symbols, and when clicked for an input cell, the same appropriately formatted mathematical notation would appear in the input cell.  The student would only need to provide the function.  It is extraordinairly unlikely that traditional mathematical notation is likely to change to the syntax of Mathematica, so why not have Mathematica change to look like mathematics.  Computers should help us rather than make things more difficult.  These changes in the user interface seem simple, useful, and constructive, if not easy to implement.

References

1.  Exploring Calculus with Mathematica, J. K. Finch and M. Lehmann, Addison-Wesley Publishing Co., Inc., 1992.

2.  Calculus Laboratories with Mathematica, M. G. Kerckhove and V. C. Hall, McGraw-Hill Inc., 1993.

3.  Calulus Labs Using Mathematica, A. G. Sparks, J. W. Davenport, and J. P. Braselton, HarperCollins College Publishers, 1993.

4.  Calculus, Salas, S.L., and Hille, E., John Wiley and Sons, 1990.

Acknowledgments

This work  is supported by a National Science Foundation ILI grant (USE-9250242) and College of the Ozarks.  I am deeply appreciative of their support.

About the Author

Marvin L. De Jong
Department of Mathematics-Physics
College of the Ozarks
Pt. Lookout, MO 65726
(417) 334-6411 ext 4234
dejongcofomo@applink.apple.com