# Teaching Functions and Calculus with an HP Graphical Calculator

Colin Croft, BSc, Dip Ed, Grad Dip Computing
###### This paper was to be handed out as part of a session at a Mathematics teacher's conference in N.S.W. in 2000. N.S.W is one of the last states in Australia still not using graphical calculators in the teaching and/or examining of mathematics. Part of the purpose of my session, sponsored by HP, was to stimulate interest in the local teachers. As it turned out no-one turned up to the session! So, here's the hand-out for anyone interested.

Beyond the simple use of the Function aplet in obvious ways, there are many ways that the teaching of functions and calculus concepts can be enhanced with the aid of an HP38G or HP39G graphical calculator. Some of these are listed below:

 Investigating  for n an integer Domains and Composite Functions Gradient at a Point Gradient Function The Chain Rule Optimisation Area Under Curves
 Fields of Slopes and Curve Families Inequalities Rectilinear Motion Limits Piecewise Defined Functions Sequences and Series Transformations of Graphs

### Investigating  for n an integer

This can be done most economically by setting an investigation, perhaps for homework.
Save a copy of the Function aplet under the name of "X to the N". Saving the aplet will allow you to send it to your students’ calculators.
Into this aplet, enter the functions shown and set the axes as shown. The choice of x axis means that each pixel is 0.02 apart.
This aplet can now be sent to each student’s calculator at the end of a lesson using the IR link. Accompanying questions should address the issues below, and students should be required to either hand in a short written response, or contribute to a verbal discussion the next day.

 All the graphs have two points in common. What are they and why are they common? Why does an increasing value of n mean a lower value of  f(x)=xn between 0 and 1, while it means a higher value for x>1? What happens for x<0? (The scale will need to be changed in PLOT SETUP.) What do the graphs of look like for negative integer values of n?

### Domains and Composite Functions

There are a number of ways that the calculator can help with this. Examples are given below but others will no doubt occur to experienced teachers.

 Rational functions can be investigated using the NUM view. For example, enter the functions F1(X)=X+2 and F2(X)=(X2-4)/(X-2). Discussion will elicit the fact that they are ‘identical’ algebraically but what then about the point X=2 in the NUM view (see right)? Use this in discussion to introduce the convention of graphing with a ‘hole’.

You can also have a great deal of fun with the class by telling them to unCHK F1(X) and then to zoom in repeatedly on X=2 in the PLOT view in an effort to "find the hole". They won’t of course, but you can have a laugh watching them and then discuss why they didn’t - a good way to introduce the idea of limits!

 However - be warned that there is a trick to this! If you use the default axes of -6.5 to 6.5 then there will be a hole (see right) because x=2 falls on a pixel point and so, since it is undefined, the calculator leaves it out. For this to work you need to sabotage their efforts in advance via a scale which does not have x=2 on a pixel. Starting with a scale like this ensures that subsequent box zooms won’t produce the "hole". A good scale is -1 to 6 on both axes and you can rationalise the choice by telling them that it "focuses well on the point we’re interested in". They may still inadvertently sabotage this by choosing their own axes in zooming.
 When discussing the concept of a domain, the NUM view can be very useful in developing this (see right). Composite functions can be introduced and evaluated directly in the symbolic view. For example, enter F1(X)=X2-X and F2(X)=F1(X+3). Move the highlight back to F2(X) and press the EVAL button. If desirable, you can further simplify using POLYFORM. With the highlight on F2(X), press EDIT. Move the highlight to the start of the expression and use the MATH button to enter "POLYFORM(". Now move to the end and add ",X)" to the expression and press OK. Pressing EVAL again now will give the result shown right. Domains of composite functions can be explored in the NUM view. In the SYMB view, enter the functions shown right, unCHKing the first two non-composite functions. In the NUM view shown right, I have used the NUM SETUP view to set the scale to start at -1 and increase in steps of 0.25. Obviously discussion will now center on why  is not the same as , and why  is not the same as for x<0.

 This is best introduced using an aplet called "Chords" downloaded from my web site (next page), but you can also use the Function aplet as shown here.  In the Function aplet, enter the function being studied into F1(X). To examine the gradient at x=3, store 3 into A in the HOME view as shown right, then return to the SYMB view and enter the expression shown right into F2(X). Change to the NUM SETUP view and change the NumType to "Build Your Own". You can now enter successively smaller values for X in the NUM view, since X is taking the role of h in the expression . To investigate the gradient at a different point, change back to the HOME view, enter a new value into A and then return to the NUM view.

The disadvantage of the previous method is that it is not very visual. An alternative is to use the "Chords" aplet which can be downloaded from my web site.
 In this aplet, a menu is provided via the VIEWS key to allow students to choose from a list of predefined functions or enter their own. Once the function has been graphed, the ‘Show slopes’ option will display an animated series of chords of diminishing length, with the gradient displayed at the top of the screen. As the chord shortens the student can see visually, and via the gradient displayed at the top of the screen, how this affects the approximation to the gradient at the point chosen.

 Once the concept of gradient at a point has been established the next step is to develop the idea of a gradient function. This can be done using an aplet from my web site called "Tangent Lines". This aplet will add a moveable tangent line to a graph, allowing the user to move it along the curve with the gradient displayed at the top left of the screen.

There are two worksheets included in the documentation which is bundled with this aplet which will take the student through the process of developing a gradient function.

If it is not desirable to use this aplet then the Statistics aplet can be used to help with the process of finding gradient functions once tabular data has been collected giving x and grad(x) values.  If the student enters the data into C1 and C2, they can then set to 2VAR, plot the data and make a guess as to the appropriate function and use the curve fitting facilities to find an equation. Curves of the form  and can be fitted using the Statistics aplet and this should be enough for the students to deduce the rule  for themselves.  It would be advisable to ensure that the students are familiar with the process of using the Statistics aplet to find equations before commencing, otherwise the two concepts will interfere with each other.

### The Chain Rule

 An aplet is available from my web site, called "Chain Rule", which will encourage the student to deduce the Chain Rule for themselves. It is pre-loaded with five sets of functions, of increasing complexity, the first three of which are shown right. The functions are loaded into F1, F3, F5, F7 and F9, while the functions F2, F4, F6, F8 and F0 contain an expression which, when EVAL is pressed, will differentiate the function above. Through the worksheet which is bundled with the aplet, the student is directed to record the functions and their derivatives and to look for patterns which will allow them to deduce a rule.

### Optimisation

 A method which I find to be efficient in introducing the idea of optimisation is via the maximisation of the volume of an open-topped box. If we start with a sheet of card which is 15cm by 11cm then we can form a box by removing squares from the corners and folding up the sides. I find that it is quite helpful for the students to actually make such a box, choosing for themselves what size square to cut out. They can then explore, using the Function aplet, what cut-out size will produce the maximum volume. As can be seen above right, the width, length and height can be entered into F1, F2 and F3 as functions of the cut-out size X. The volume can then be entered into F4 as F1*F2*F3 and this function can then be plotted and the maximum found either through successive approximations in the NUM view or by using the FCN tools in the PLOT view.

### Area Under Curves

 This topic is most easily handled using an aplet from my web site. This aplet, called "Curve Areas" will draw rectangles either over or under a curve or use trapezoids. A number of curves are supplied pre-set but the user can also enter their own. The user can nominate the interval width and the number of rectangles. A worksheet is bundled with the aplet which will lead the student through the process of deducing an area function.

### Fields of Slopes and Curve Families

 One of the concepts which students find quite difficult to come to grips with is that of sketching a field of slopes from a derivative function and, from this, sketching a family of curves. An aplet from my web site, called "Slope Fields", will assist with this process. In this aplet the user enters the derivative function into F1(X) and then uses the VIEWS menu to produce a field of slopes. A cross-hair is projected onto the field which the user can move around. When the user presses ENTER, a curve is drawn, starting at that point and projecting to the right and then the left, and following the field of slopes. Repetition of this will lead the student to the discovery that there are a family of curves, separated by a constant, which all fit the ‘description’ of the function stored in F1(X).

### Inequalities

 The topic of inequalities is one that is sometimes included in calculus courses, particularly during the study of domains and this is often extended to graphing intersecting regions such as . Although the HP38G and HP39G do not have the in-built ability to plot inequalities, the process is easily handled using an aplet which can be downloaded from my web site called "Inequations". This allows the user to plot individual or overlapping inequalities as shown right. It will not handle dotted functions (y

### Rectilinear Motion

 A topic which is commonly taught as part of any calculus course is rectilinear motion. This can be enhanced by using the Parametric aplet to graphically illustrate the motion of a particle. If this is set up properly then it can be a very helpful teaching aid, as the graph will slow down and speed up as it appears, illustrating the velocity and acceleration of the particle. For example, consider the particle with motion equation . Suppose that we are interested in the first six seconds of its path. We enter this equation as X1(T) in the Parametric aplet and enter Y1(T)=0.1T as its companion. The reason for the Y1(T) equation is firstly because the Parametric equation requires paired equations, and secondly so as to spread the motion up the y axis as the particle moves. Examination of the NUM view will show that an x axis range of -10 to 21 will cover the required T range and, for a T range of 0 to 6, a y axis range of -0.2 to 0.7 will spread it adequately. The value of TStep determines how fast the particle ‘moves’ and a value of 0.05 is usually a good choice. The resulting graph is very illustrative of the motion due to the slowing down near the turning points.  The animation shown right does not entirely capture the feel of the result but may help you get an idea. Try it for yourself and see.

### Limits

 The NUM view is a very powerful tool in teaching limits. Although it does not, of course, offer a theoretical solution, it does offer a way to experimentally determine limits. However one must be careful with this since, as will be seen below, rounding error and overflow can cause incorrect results. The first example is the determination of the value of . Use the Function aplet to evaluate what happens to F1(X)=(1+1/X)^X by changing to the NUM view (see right) and choosing the ‘Build Your Own’ facility. This convergence can also be seen graphically in the PLOT view but is very slow to reach high accuracy. The problem is that the slow convergence will mean that students will often try to graph this function for very large values of x and this can cause problems. The first graph on the right shows the expected graph for the range 0 to 100, but the second graph shows instability developing in the range 0 to 1E11 (). This is caused by the internal rounding of the calculator. It works to 16 bits, which means that it can store 12 significant digits (for reasons only of interest to programmers). This means that when you invert a really large number and add it to one, you lose a lot of accuracy. For example: if X =  then 1/X is. However, when you add 1 to this, the calculator is forced to discard all but the last decimal place. Thus 1 + 1/X = 1.00000000003 (rounded off from 1.00000000002508...) There are naturally a whole range of numbers which will all round off to the same value of 1.00000000003, so that (for that range of numbers) the expression (1+1/X)^X is equivalent mathematically (on the HP) to (1.00000000003)^X. This produces a short section of an exponential graph, which only looks linear because you don't see enough of it. Eventually the calculator reaches a value on the x axis which is large enough that it rounds off to a smaller number than 1.00000000003, which is 1.00000000002. This produces the sudden drop in the graph as the plot changes from a section of a 1.00000000003^X graph to a section of a 1.00000000002^X graph (which has a shallower gradient). This section is maintained then until the next drop, and so on. At the value x = the inverted value is so small that 1+1/X becomes exactly 1 and the graph will become a horizontal line (with the wrong value).  Although this explanation may be beyond the scope of the course it is quite important that students have some understanding of these ideas if they use the calculator to evaluate limits.

 The second example in this section on limits illustrates the problems that can be caused by overflow. Overflow occurs when the calculator tries to store or work with a value which is larger than its capacity which, for the HP38G and HP39G, is . On the HP this value is referred to as MAXREAL and can be found in the MATH menu. Suppose we were trying to evaluate the limit . If we use a similar method of entering the function F1(X)= eX /(2eX+6) and using the ‘Build Your Own’ facility in the NUM view then an odd thing happens (see right) as the value of x increases. The reason for this is that ex has evaluated to larger than MAXREAL. This means that the fraction is appearing to the calculator as , which it then evaluates as equal to 1. On the HP this happens near the value x =1151, which is ln(MAXREAL).

### Piecewise Defined Functions

Piecewise defined functions can be graphed easily on the HP38G and HP39G by breaking them up into their components. For example, suppose we wanted to graph the function:
 Using the Function aplet, we enter three separate component functions. You can obtain the inequality signs from the CHARS menu.
F1(X)=SIN(X)/(X<-2)
F2(X)=(X+2)/(-2<X AND X<1)    .... except using the "less than or equal to" sign from the CHARS view.
F3(X)=((X-2)2-1)/(X>1)
The calculator evaluates the domain as either true (1) or false (0) for each value of x. When it is zero (outside the domain) then dividing by this value causes the function to become undefined and consequently not be graphed. Inside the domain it has no effect.

Note: On the HP38G the word ‘AND’ must be entered using the A..Z button. On the HP39G it is available from the keyboard.

### Sequences and Series

 Through the Sequence aplet the HP38G and HP39G provide very flexible tools for the investigation of sequences. These can also be adapted to investigate series as well. We will look at geometric sequences but the same methods will also work for arithmetic sequences. Begin by storing the values 4 and 0.5 into A and R respectively in the HOME view (see right). In the Sequence aplet, enter the general sequence with U1(1)=A, U1(2)=A*R and U1(N)=U1(N-1)*R, and then the general series with U2(1)=A, U2(2)=A+A*R and U2(N)=U2(N-1)+U1(N).
 If you now change to the NUM view then the values of the sequence and its accompanying series will be visible. Scrolling down through the values will make it obvious that the series is converging on the value 8. Returning to the HOME view, the student can now adjust the values of A and/or R and, through recording his or her results, deduce the formula for the sum to infinity. Note: On the HP38G this process is unfortunately not quite so simple. When the values of A and/or R are changed in HOME, the sequence will not entirely reflect this. For example, if we change the value of A to 10 and then return to the NUM view you will see right that although terms 1 and 2 have changed the main part of the sequence has not. To force them to be correct simply change back to the SYMB view, highlight each of the U(N) terms in turn and press EDIT then OK without changing anything. This will force a re-evaluation and produce the correct results. This bug was fixed in the HP39G. Once the formulae for the sequence and series have been covered an excellent tool can be created by making a copy of the Solve aplet and entering the appropriate formulae. In the APLET/LIB view, COPY the Solve aplet and name it "GP Solver". In the SYMB view enter the three formulae T=A*R^(N-1), S=A*(1-R^N)/(1-R) and S=A/(1-R). These can now be used to solve for any one of the terms they contain given the others. Note: One of the common errors that students make in the Solve aplet is to try to solve for solutions which do not exist. For example, a student will try to solve for N in T=A*R^(N-1) with A=50, R=0.75 and T= -2. The result will be firstly that the calculator will seem to freeze while it tries to find a solution which can only be approached asymptotically. Finally the calculator will give the result as shown right. The problem is that students will misinterpret it as being N=10, when in fact it is simply that the calculator has gone as far along the positive x axis as possible and stopped at MAXREAL of (see right). It is recommended that the teacher should deliberately provoke this error and follow with class discussion. Students should also be encouraged to press the INFO button after finding a solution since a case like this will give ‘Extremum’ whereas a correct solution will result in either ‘Zero’ or ‘Sign Reversal’. See the manual for more information.

### Transformations of Graphs

 This topic can be handled in a number of ways. One of these is to use the Function aplet without enhancement. Enter the basic function into F1(X). For example, you might enter F1(X)=X2. You can then enter transformations into the other functions. Some examples, together with the resulting graphs are shown right. This process will also work with piecewise defined functions (see earlier) which are often the type that are used in examination questions. There are also two aplets which can aid greatly in this process called "Quad Explorer" and "Trig Explorer". On the HP38G these must be downloaded from my web site (or HPs) but on the HP39G they are built in. Both of these aplets allow the student to explore the effect of changing parameters on the shape of the graph, one using a quadratic and the other with the sine and cosine curves. Students can choose to manipulate the graph and see the effect on the parameters, or to manipulate the parameters and see the effect on the graph. In Quad Explorer there is even a TEST facility provided which will present the student with examples of quadratics for which they must provide an equation, with visual feedback on incorrect guesses. Highly recommended.