hp 39gs and hp 40gs graphing calculators Mastering the hp 39gs & hp 40gs A guide for teachers, students and other users of the hp 39gs & hp 40gs Edition 1.
Notice REGISTER YOUR PRODUCT AT: www.register.hp.com THIS MANUAL AND ANY EXAMPLES CONTAINED HEREIN ARE PROVIDED "AS IS" AND ARE SUBJECT TO CHANGE WITHOUT NOTICE. HEWLETT-PACKARD COMPANY MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS MANUAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. HEWLETT-PACKARD CO.
Table of Contents Introduction .......................................................................................................................7 Getting Started ..................................................................................................................9 Some Keyboard Examples ...............................................................................................10 Keys & Notation Conventions ..............................................................................
The Statistics Aplet - Univariate Data..............................................................................114 The Expert: Simulations & random numbers...................................................................120 The Statistics Aplet - Bivariate Data................................................................................123 The Expert: Manipulating columns & eqns......................................................................133 The Inference Aplet ...........................
Working with Notes & the Notepad...............................................................................217 Independent Notes and the Notepad Catalog ............................................................219 Creating a Note .........................................................................................................220 Working with Sketches ..................................................................................................222 The DRAW menu..........................
Appendix A: Some Worked Examples............................................................................298 Finding the intercepts of a quadratic ..........................................................................298 Finding complex solutions to a complex equation ......................................................299 Finding critical points and graphing a polynomial......................................................300 Solving simultaneous equations........................................
2 INTRODUCTION This book is intended to help you to master your hp 39gs or hp 40gs calculator but will also be useful to users of earlier models such as the hp 39g, hp 40g and hp 39g+. These are very sophisticated calculators, having more capabilities than a mainframe computer of the 1970s, so you should not expect to become an expert in one or two sessions. However, if you persevere you will gain efficiency and confidence. The hp 39gs vs.
Many of the markets targeted by the hp 40gs do not allow infra-red communication in assessments and so, on the hp 40gs, this ability is permanently disabled, substituting instead a mini-serial cable supplied with the calculator (see page 237). The previous models, the hp 39g & hp 40g shared a common chip and, although it was never intended to be possible, a hacker released a special aplet for the hp 39g which would ‘convert’ it into an hp 40g and activate the CAS.
3 GETTING STARTED Let’s begin by looking at the fundamentals - the layout of the keyboard and the positions of the important keys used frequently. The sketch below shows most of the important keys. As can be seen on the previous pages, the keyboards for the hp 39gs and hp 40gs are exactly the same except for the different color schemes.
4 SOME KEYBOARD EXAMPLES Shown below are snapshots of some typical screens (called “views”) which you might see when you press the keys shown on the previous page. Exactly what you see depends on which aplet is active at the time. See page 14 for an introduction to aplets. The Function aplet is used below to illustrate this. The normal use of the Function aplet is to graph and analyze Cartesian functions.
5 KEYS & NOTATION CONVENTIONS There are a number of types of keys/buttons that are used on the hp 39gs and hp 40gs. The basic keys are those that you see on any calculator including scientific ones, such as the numeric operators and the trig keys. Most of these keys have two or more functions, with the second function accessed via the SHIFT key and the alphabetic character accessed via the ALPHA key. Take for example the COS key shown left. If you just press the key, you get the COS function.
The Screen keys A special type of key unique to the hp 39gs, hp 40gs and family is the row of blank keys directly under the screen. These keys change their function depending on what you are doing at the time. The easiest way to see this is to press the APLET key. As you can see right, the functions are listed at the bottom of the screen. All you have to is to press the key under the screen definition you want to use. These buttons are normally referred to as SK1 to SK6, where SK is “Screen Key”.
You can also use these memories in calculations. Type in the following, not forgetting the ALPHA key before the D…. (3+D)/5 ENTER The calculator will use the value of 12 stored earlier in D to evaluate the expression (see image). In case you haven’t worked it out for yourself, the / symbol comes from the divide key and the * symbol from the . multiply key More information on memories and detailed information on the HOME view in general is given on pages 39.
6 EVERYTHING REVOLVES AROUND APLETS! A built in set of aplets are provided in the APLET view on the hp 39gs and hp 40gs. This effectively mean that it is not just one calculator but a dozen (or more), changing capabilities according to which aplet is chosen. The best way to think of these aplets is as “environments” or “rooms” within which you can work.
The Sequence aplet (see page 99) Handles sequences such as Tn = 2Tn−1 + 3; T1 = 2 or Tn = 2 n−1 . Allows you to explore recursive and non-recursive sequences. The Solve aplet (see page 105) Solves equations for you. Given an equation such as A = 2π r ( r + h ) it will solve for any variable if you tell it the values of the others. The Statistics aplet (see page 114 & 123) Handles descriptive statistics. Data entry is easy, as is editing.
The PLOT view is used to display the function as a graph… key. This gives access to a At the bottom of the PLOT view is the number of other useful tools allowing further analysis of the function. Some of these tools have their own sub-menus. The PLOT SETUP view controls the settings for the PLOT view… The NUM SETUP view controls the settings for the NUM table view… Although these views are superficially different in other aplets, the basic idea is usually similar.
A mini-USB cable (see page 237) and software were provided with your hp 39gs and hp 40gs which you can use to connect your PC to your calculator via the USB port and then download aplets from the computer to the calculator or to save your work to the computer. If you have an earlier model such as the hp 38g, hp 39g or hp 40g then you need to buy the cable separately from an HP reseller and download the software from Hewlett-Packard’s website. More information on this can be found on pages 245 - 274.
7 THE HOME VIEW In addition to the aplets, there is also the HOME view, which can best be thought of as a scratch pad for all the others. This is accessed via the HOME key and is the view in which you will do your routine calculations such as working out 5% of $85, or finding √35. The HOME view is the view that you will most often use, so we will explore that view first. What is the HOME view? This is the HOME base for the calculator.
Exploring the keyboard The first step in efficient use of the calculator is to familiarize yourself with the mathematical functions available on the keyboard. If we examine them row by row, you will see that they tend to fall into two categories - those which are specific to the use of aplets, and those which are commonly used in mathematical calculations. The screen keys The first row of blank keys are context defined.
The APLET key is used to choose between the various different aplets available. Everything in the calculator revolves around aplets, which you can think of either as miniature programs or as environments within which you can work. The hp 39gs and hp 40gs come with twelve standard aplets - Finance, Function, Inference, Parametric, Polar, Linear Solver, Triangle Solver, Quadratic Explorer, Sequence, Solve, Statistics and Trig Explorer. Which one you want to work with is chosen via the APLET key.
The VIEWS key pops up a menu from which you can choose various options. Part of the VIEWS menu for the Function aplet is shown right. See page 85 for more detailed information. A summary only is given below. Essentially the VIEWS menu is provided for two purposes… Intro to the VIEWS menu Firstly, within the standard aplets (Function, Sequence, Solve etc.) it provides a list of special views available to enhance the PLOT view.
The VARS key The VARS key is used, mainly by programmers, as a compact way to access all the different variables stored by the calculator including aplet environment variables. Shown right are two views of the VARS screen, the first from the HOME list showing the graphic variables (memories) G1, G2…. and the next from the APLET list showing some of the variables in the set controlling PLOT. The VARS key is not generally used much, and you may not have followed this explanation.
The ALPHA key gives access to the alphabetical characters, shown below and right of most keys. Pressing SHIFT ALPHA gives lower case. Calculator Tip If you press and hold down the ALPHA key you can ‘lock’ alpha mode, although this doesn’t work for lower case. Many people use this to type in functions by hand rather than going through the MATH menu. Some views, such as the Notepad, also offer a screen key function that lets you lock either upper or lower case alpha mode.
The MODES view The MODES view (see right) controls the numeric format used in displaying numbers and angles in aplets. At the bottom of the screen you will see that one of the screen keys has been given the function . Pressing this key pops up a menu of choices from which you can select the option which suits you. The default angle setting is radians. Calculator Tip If you don’t want to use the menu then, rather than pressing , highlight the field and then press the ‘+’ key repeatedly.
The screens right show the same two numbers displayed as in turn as; Fixed 4, Scientific 4 and Engineering 4. Calculator Tip If you have Labels turned on when you in (or out) on a graph or choose a Trig scale then you may end up with axes whose numeric labels are horrible decimals (see below right). The setting of Fraction can be quite deceptive to use and is discussed in more detail on page 33.
The ANS key If you are not confident about using brackets, then the ANS key can be quite useful. For example, you could calculate the value of 3− 7× 2 by using 22 + 53 brackets… …. or you could use the ANS key. A better alternative to using the ANS key is to use the History facility and function. This is discussed on page 37. the The negative key Another important key is the (-) key shown left.
The DEL and CLEAR keys Another important key is the DEL key at the top right of the keyboard. This serves as a backspace key when typing in formulas or calculations, erasing the last character typed. If you have used the left/right arrow keys to move around within a line of typing, then the DEL key will delete the character at the cursor position. The CLEAR key above DEL can be thought of as a kind of ‘super delete’ key.
Angle and Numeric settings It is critical to your efficient use of the hp 39gs and hp 40gs that you understand how the angle and numeric settings work. For those few who may be upgrading from the original hp 38g released in the mid ‘90s this is particularly important, since the behavior is significantly different. On the hp 39gs and hp 40gs, when you set the angle measure or the numeric format in the MODES view, it applies both to the aplet and to the HOME view.
Suppose we define a trig function in the Function aplet as shown. The default setting for the Function aplet is radians, so if we set the axes to extend from - π to π , the graph would look as shown right. In the PLOT view shown, the first positive root has been found (see page 57) as x=1.0471… On the hp 39gs and hp 40g, if we now change to the HOME view, retrieve the root and perform the calculation shown right, we expect that the answer should be zero, as indeed it is.
Settings made in the MODES view also apply to the appearance of equations and results displayed using the SHOW command, covered on page 38. Calculator Tip Under the system used on the hp 39gs and hp 40gs, if you want to work in degrees then you will need to choose that setting in the MODES view and possibly set it again if you change to another aplet. Some people choose to go through and change the setting on all the aplets at once so that they don’t have to remember that it might change.
As you can see in the screen snapshot on the previous page, my calculator has a number of extra aplets. Two of them, Statistics2 and Statistics3 are simply copies of the normal Statistics aplet containing data that I did not want to lose. The top two aplets Curve Area and Coin Tossing are teaching aplets that I have downloaded from the internet.
The GRAPHICS MANAGER There are two views, shown right, for which the only access is via the MEMORY MANAGER screen. The first of these, the GRAPHICS MANAGER, shows some memory in use on my calculator due to the screen captures I am performing to show you these views. Yours will probably be empty. If you have loaded an aplet from the internet then it may have used a GROB (Graphics Object) to store an image as part of its working.
Fractions on the hp 39gs and hp 40gs Earlier we examined the use of the MODES view, and the meaning of Number Format. We discussed the use of the settings Fixed, Scientific and Engineering, but left the setting of Fraction for later. The reason for this is that the Fraction setting can be a little deceptive. Begin by selecting Fraction in the MODES view, leaving the accompanying number as the default value of 4.
The second point to remember involves the method the hp 39gs and hp 40gs use when converting decimals to fractions, which is basically to generate (internally and unseen by you) a series of continued fractions which are approximations to the decimal entered. The final fractional approximation chosen for display is the first one found which is ‘sufficiently close’ to the decimal. Look up ‘continued fractions’ on the web or in a textbook if you don’t know what these are.
The Fraction setting is thus far more powerful than most calculators but can require that you understand what is happening. It should also be clear now why a special fraction button was not provided: the ‘fractions’ are never actually stored or manipulated as fractions at all! Pitfalls in Fraction mode As you can see above right, a setting of Fraction 4 produces a strange (but actually correct) result for 0.666, while adding one more 6 (to take the decimal beyond 4 d.p.) will give the desired result of 2/3.
The reason for this ‘error’ is that the 1/3 and 4/5 were converted to decimals and added to give 1.133333…. This was converted back to a fraction using Fraction 2 to give 8/7 (1.1428..). This may seem odd but it does match sufficiently closely in Fraction 2 to be accepted. Generally it is not a good idea to go below the default setting of Fraction 4. In fact, a Fraction 6 setting tends to be more reliable. A new feature of the hp 39gs and hp 40gs is the setting of Mixed Fraction in the MODES view.
The HOME History The HOME page maintains a record of all your calculations called the History. You can re-use any of the calculations or their results in subsequent calculations. Try this for yourself now. Type in at least four calculations of any kind, pressing the ENTER key after each one to tell the calculator to perform the calculation. You will now be looking at a screen similar to the one on the right (except probably with different calculations).
SHOWing results key you will see another screen key labeled . This key will display an expression Next to the the way you would write it on the page rather than in the somewhat difficult to read style that is forced on the label calculator when it must show the whole expression on one line. This works anywhere the appears, not just in HOME.
Storing and Retrieving Memories Each of the alphabetic characters shown in orange below the keys can function as a memory. Some examples of this are shown in the third of the four examples above where the values of 1, -3 and -4 are stored into A, B and C prior to the use of the quadratic formula. All of this storing of values is done with the key, which is one of the screen keys listed at the bottom of the HOME view.
Referring to other aplets from the HOME view. Once functions or sequences have been defined in other aplets, they can be referenced in the HOME view. e.g. 1 Suppose we use the Function aplet to define F1(X)=X²-2 and F2(X)=eX as shown right. These functions now become accessible not only from within the HOME view but also within any other aplet also. This is shown by the screen shots below. The results shown will, of course, depend on your settings in the MODES view.
A brief introduction to the MATH Menu The MATH menu holds all the functions that are not used often enough to be worth a key of their own. There is a very large supply of functions available, many of them extremely powerful, listed in their own chapter beginning on page 165. When you press the MATH key you will see the pop up screen shown right. The left hand menu is a list of topics.
Resetting the calculator It is probably inevitable as the line between calculators and computers becomes blurred that calculators will inherit one of the more frustrating characteristics of computers: they crash! The hp 39gs and hp 40gs can sometimes do this due to the very complex and flexible operating system they use. If you find that the calculator is beginning to behave strangely, or is locking up then there are a number of ways to deal with this.
Hard reboot (with loss of memory) To completely reset the calculator’s memory back to factory settings press ON+SK1+SK6. (SK1=”screen key 1”) When doing this, don’t press them all at once; hold down the ON key and, while still holding it down, press the first and then the last screen keys. Release them in the opposite order. Don't release SK1 and SK6 together - release SK6, then SK1, then ON.
• • • Take the batteries out, including the round backup battery. Press and hold the ON button for 2 minutes to remove any possible remaining power from the internal capacitors. Leave the calculator overnight and re-insert fresh batteries. If this happened when running a game or aplet that you've downloaded from the internet then consider that this may be the source of the problem. Backup anything that you want to keep to the PC and do a full reboot to restore factory settings.
Summary • The up/down arrow key moves the history highlight through the record of previous calculations. key can be used to retrieve any earlier results for editing When the highlight is visible, the using the left/right arrow keys and the DEL key. • Care must be taken to ensure the your idea of order of operations agrees with the calculator’s. For example, (-5) 2 must be entered as (-5) 2 rather than as -52, and √(5+4) rather than √5 + 4.
8 THE FUNCTION APLET The Function aplet is probably the one that you will use most of all.
The SYMB view key. When you do, your screen should change Now press the so that it appears like the one on the right. This is the SYMB view. Notice that the screen title is supplied so that you will know where you are (if you didn’t already). Calculator Tip Pressing ENTER rather than would have had the same effect. Whenever there is an obvious choice pressing ENTER will usually produce the desired effect.
The NUM view If you now press the NUM key, you will see the screen on the right. It shows the calculated function values for F1(X), starting at zero and increasing in steps of 0.1 Make sure the highlight is in the X column as shown on the previous page, and then press 4 and ENTER. You will find that the numbers will now start at four instead of zero. It is also possible to change the step size key, which can be convenient at times, particularly for trig functions.
Auto Scale Auto Scale attempts to fit the best possible vertical scale to the horizontal scale you have chosen. It is not always successful but will often give you a good starting point from which to refine the scale. In the example which follows it is assumed that you have plotted the graph as shown on the previous page. In the PLOT view, press the VIEWS key. Use the arrow keys to scroll down to Auto Scale and press ENTER.
The PLOT SETUP view In the information that follows it will be assumed that you have performed the tasks on the previous page. If you press SHIFT then PLOT you will see something like the view on the right. The highlight should be on the first value of XRng. Enter the value -4. Calculator Tip Don’t use the subtract key to enter a negative. You MUST use the negative key labeled (-). Similarly, don’t use a (-) when you mean a subtract. For example, 2 (-) X will produce -2*X not 2 – X.
Simultaneous The first option Simult controls whether each graph is drawn separately (one after the other) or whether they are all drawn at the same time, sweeping from left to right on the screen. My preference is to turn this off. I find that if there are more than two functions defined then drawing them all at the same time can be confusing. Turning off Simult means that they are drawn one after the other, in the order that they are defined.
The default axis settings The default scale is displayed in the PLOT SETUP view shown right. It may seem a strange choice for axes but it reflects the physical properties of the LCD screen, which is 131 pixels wide by 63 pixels tall. A ‘pixel’ is a ‘picture element’ and means a dot on the screen. The default scale means that each dot represents a ‘jump’ in the scale of 0.1 when tracing graphs. The y value is determined by the graph, of course, and has nothing to do with your choice of scale.
The Menu Bar functions In the examples and explanations which follow, the functions and settings used are: Trace is quite a useful tool. The dot next to the word means that it is instead then press the key currently switched on. If yours shows underneath to turn it on. Leave it on for now. Press the left arrow 5 or 6 times to see a similar display to that shown right. Pressing up or down arrow moves from function to function.
Goto This function allows you to move directly to a point on the graph without having to trace along the graph. It is very powerful and useful. Suppose we begin with the cursor at x = 0 on F1(X) as shown right. Press and then to see the input form shown right. Type the value 3 and press ENTER. The cursor will jump straight to the value x = 3, displaying the (X,Y) coordinates at the bottom of the screen.
The Zoom Sub-menu . Pressing the key under The next menu key we’ll examine is pops up a new menu, shown right. The list which follows covers the purpose of the first nine options shown right, down to “Set Factors”. The four final options which follow these are also on the VIEWS menu and are covered on page 85 as part of the detailed examination of the VIEWS menu. Center This redraws the graph with proportionally the same scale for each axis but re-centered around the current position of the cursor.
As you move the cursor to a position at the diagonally opposite corner of a rectangle, the selection box will appear on the screen. Pressing expands the box to fill the screen. …and then at the other corner. You’ll notice that the scale has been disrupted so that the labels are no longer very helpful. PLOT SETUP would give better end points for the axes or let you switch off the labels option. Alternatively you could use the MODES view to set two decimal places.
The FCN menu Note: Before continuing, set the axes back to the way we set them at the top of page 53. Looking at the menu functions again, you will see that the only one we . This key pops up the have not yet examined is the one labeled Function Tools FCN menu and is the most useful of them all. is switched on (ie showing Before you use this key, make sure ) and then move the cursor so that it is in roughly the position shown right. Root key.
Intersection menu is Intersection. If you choose The next function tool in the this option, then you will be presented with a choice similar to the one in the screen shown right. The Intersection option only appears if there is more than one function in the PLOT view. Exactly what is in the menu depends on how many functions you have showing.
Signed area… menu is the Signed Area tool. Before we begin to use it, make Another very useful tool provided in the is switched on, and that the cursor is on F1(X) - the quadratic. The Signed Area tool is sure that similar to the Box Zoom in that it requires you to choose start and end points of the area to be calculated. Definite integrals Suppose we want to find the definite integral: 3 ∫x −2 2 − 5x − 4 dx and then Signed Area.
Tracing the integral in PLOT key, an alternative method is to use the Rather than using the tracing facility. The advantage of this is that the ‘area’ is shown visually as you go by shading, as can be seen right. The disadvantage of this is that you can only trace to values which are permitted in the scale you are using. the shading stops. In this case, due to the scale we chose, if you try to trace to the As soon as you use values x = -3 or x = 2 you will find that they are not accessible.
Areas between and under curves If we are wanting to find true areas rather than the ‘signed areas’ given by a simple definite integral then we must take into account any roots of the function. The difficulty with this is that for most functions the roots and intersections are quite unlikely to be whole numbers and rounding them off will produce inaccuracies in the calculation. There are ways to get around this and the process is shown in detail on page 75.
9 THE EXPERT: WORKING WITH FUNCTIONS EFFECTIVELY Finding a suitable set of axes This is probably the most frustrating aspect of graphical calculators for many users and there is unfortunately no simple answer. Part of the answer is to know your function – this is why we still expect you to learn mathematics instead of expecting the calculator to do it all! If you know, for example, that your function is hyperbolic then that immediately gives information about what to expect.
Change into the NUM view and scroll through the window from zero to 100. As you do so, take note of the values that the function takes. From the display it seems that the function peaks around y=30 and then declines steadily. Change into the PLOT SETUP view and enter an x axis of 0 to 100 with a ‘tick’ value of 20, and a y axis of -10 to 35 with a tick value of 5. The result of this is a PLOT view as shown right. This would be ideal for answering questions on the domain stated.
The advantage of doing it this way is that if you zoom in or out by a factor of 2 or 4 or 5, the cursor jumps will stay at (relatively) nice values allowing you to trace more easily. In this case, the cursor now moves in jumps of 0.05, which is ideal for most purposes. If you are not interested in tracing along the graph then this may not be important.
On the other hand there is a way to further simplify the expression. the result and enclose it with the POLYFORM function as shown . right, adding a final ‘,X’ as shown, then highlight it and press The calculator will expand the brackets and gather terms. Calculator Tip These functions can all be graphed but the speed of graphing is slowed first. This is because the composite function is if you don’t press internally re-evaluated for each point graphed.
Differentiating There are different approaches that can be taken to differentiating, most of which are best done in the SYMB view of the Function aplet. The syntax of the differentiation function is: ∂X ( function) where function is defined in terms of X. The function can be already defined in the SYMB view of the Function aplet as shown in functions F1(X) and F2(X) in the screen shot above. Alternatively it can be directly entered into the brackets as shown in function F3(X).
Algebraic differentiation is most easily handled in the SYMB view of Function. The best method is to define your function as F1(X) and its derivative as F2(X) (see below)… press Calculator Tip Doing your differentiation in the Function aplet is much easier and offers the additional advantage of being able to graph the two functions. Circular functions There are two issues that influence the graphing of circular functions, both related to the scale chosen.
The simplest way to deal with this is to use scales which are multiples of the default scales. For example by using −13 ≤ x ≤ 13 and −6.2 ≤ y ≤ 6.4 . These are a scale factor of 2 from the default axes of −6.5 ≤ x ≤ 6.5 and −3.1 ≤ y ≤ 3.2 . You can also use the Square option on the ZOOM menu. This adjusts the y axis so that it is ‘square’ relative to whatever x axis you have chosen. The second issue is caused by the domain of the circle being undefined for some values.
However, for the scale of -6 to 6 the pixels are no longer 'nice' values of 0.1. If you try to trace the circle you'll see that the pixels fall on 0, 0.0923077, 0.1846154..... In particular, near x=3 the pixel values are 2.953846 and 3.046154. This means that the calculator can't draw anything past 2.953846 because the next value doesn't exist, being outside the circle. This is what causes the gap in the circle. There's nothing to join to past that last point.
Retaining calculated values When you find an extremum or an intersection, the point is remembered until you move the cursor even if it is not actually on a value that would normally be accessible for the scale you have chosen. For example, if you find an intersection and then immediately return to menu and choose Slope, the slope calculated will be for the the intersection just found rather than for the nearest pixel point. If you have key and entering the value Root will return the cursor to it.
Automatic vs. Build Your Own Looking at the NUM SETUP view you will see an entry called NumType with the default value of Automatic. The alternative to Automatic is the setting of Build Your Own. Under this setting the NUM view will be empty, waiting for you to enter your own values for X. Typing in the values of (for example): 3 ENTER (-) 2 ENTER 5 ENTER … will give… In this situation the function values are being calculated as you input the X values.
Integration: The definite integral using the ∫ function The situation for integration is very similar to that of differentiation. As with differentiation, the results for algebraic integration are better in the Function aplet. The ∫ symbol is obtained via the keyboard. The syntax of the integration function is: ∫ (a, b, function, name) where: a and b are the limits of integration and function is defined in terms of name. eg. ∫ (1, 3, x 2 + 5, x) or ∫ (0.
Integration: The algebraic indefinite integral Algebraic integration is also possible (for simple functions), in the following fashions: • If done in the SYMB view of the Function aplet, then the integration must be done using the symbolic variable S1 (or S2, S3, S4 or S5). If done in this manner then the results are satisfactory, except that there is no constant of integration ‘c’.
A caveat when integrating symbolically… This substitution process has one implication which you need to be wary of and so it is worth examining the process in more detail. The expanded version of what is happening is shown below. x = S1 ⎡ x3 ⎤ 2 −1dx = x ⎢ − x⎥ ∫0 ⎣3 ⎦ x=0 S1 ⎞ ⎛ 03 ⎞ ⎛ S13 =⎜ − S1⎟ − ⎜ − 0 ⎟ 3 3 ⎝ ⎠ ⎝ ⎠ 3 S1 = − S1 3 The potential problem lies with the second line, where the substitution of zero results in the second bracket disappearing. This will not always happen.
Integration: The definite integral using PLOT variables As was discussed earlier, when you find roots, intersections, extrema or signed areas in the PLOT view, the results are stored into variables for later use. Root to find the x intercept of For example, if we use 2 f ( x) = x − 2 then the result is stored into a variable called Root, which can be accessed anywhere else. Similar variables called Isect, Area, tools.
Suppose we want to find the area between f ( x) = x 2 − 2 and g ( x) = 0.5x −1 from x = -2 to the first positive intersection of the two graphs. From the hand shaded screenshot shown above right it can be seen that to find the area we need to split it into two sections, with the boundaries being -2 and the two intersections. After finding the first intersection using Intersection we change into the HOME view and store the results into memory variable A.
Piecewise defined functions It is possible to graph piecewise defined functions using the Function aplet, although it involves literally splitting the function into pieces. For example: ⎧x + 3 ⎪ f ( x) = ⎨ x 2 − 2 ⎪3 − x ⎩ ; x < −2 ; −2 ≤ x ≤1 ; x ≥1 To graph this we need to enter it into the SYMB view as three separate functions: F1(X)=(X+3)/(X < -2) F2(X)=(X2-2)/(X ≥ -2 AND X ≤ 1) F3(X)=(3-X)/(X ≥ 1) Note: The AND function can be found on top of the (-) key.
‘Nice’ scales As discussed earlier, the reason for the seemingly strange default scale of -6.5 to 6.5 is to ensure that each dot on the screen is exactly 0.1 apart. There are other scales, basically multiples of these numbers, that also give nice values if you want to along the graph. For example, halving each of -6.5 and 6.5 will place the dots 0.05 apart. To zoom out instead of in simply double the values, producing dots that are 0.2 apart.
Nice scales in the PLOT-TABLE view A time when ‘nice’ scales are more important is when you use the PlotTable option in the VIEWS menu. If you use the default axes you will find that the dots, and hence the table values are no longer ‘nice’ because of the dots consumed by the line down the middle of the screen. This can be solved by changing the x axis scale to -6.4 to 6.4, which gives table values of 0.2. Using -3.2 to 3.
Problems when evaluating limits In evaluating limits to infinity using substitution, problems can be encountered if values are used which are too large. For example: ex x →∞ 2e x + 6 lim It is possible to gain an idea of the value of this limit by entering the function F1(X)=e^X/(2*e^X+6) into the Function aplet, changing to the NUM view and then trying increasingly large values. As you can see (right) the limit appears to be 0.5, which is correct.
A related effect happens when investigating the behavior of the commonly used n ⎛ 1⎞ calculus limit of lim ⎜ 1 + ⎟ . One of the common tasks given to students in introductory calculus classes is n⎠ n→∞ ⎝ to evaluate this expression for increasing values of n to see that it tends towards e. This can easily be done in the Function aplet using the NUM view but there is a trap in store for the unwary! Begin as follows: 1. Entering the function into the SYMB view as F1(X)=(1+1/X)^X 2.
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.00000000003X graph to a section of a 1.00000000002X graph (which has a shallower gradient). This section is maintained until the next drop, and so on.
Gradient at a point as the limit of the slope of a chord The true gradient at a point is available in a number of ways. For example, via the Slope tool in the PLOT view or via the δ differentiation operator. For students first being introduced to calculus a common task is to investigate the slope of the chord joining two points as the length of the chord tends towards zero. ie. ⎛ f ( x + h) − f ( x) ⎞ lim ⎜ ⎟ h→0 h ⎝ ⎠ This can be effectively introduced via the Function aplet.
Finding and accessing polynomial roots The POLYROOT function can be used to find roots very quickly, but the results are often difficult to see in the HOME view due to the number of decimal places spilling off the edge of the screen, particularly if they include complex roots. This can be dealt with easily by storing the results to a matrix. For example, suppose we want to find the roots of f ( x) = x3 − 3x 2 + 3 . We will use the POLYROOT function and store the results into M1.
10 THE VIEWS MENU In addition to the views of PLOT, SYMB and NUM (together with their SETUP views), there is another key which we have so far only used very fleetingly - the VIEWS key. It may seem odd to devote an entire chapter to what might appear to be an inconsequential key. In fact, however, this button is very useful to the effective use of the calculator, and crucial if you intend to use aplets downloaded from the internet.
Plot-Detail Choosing Plot-Detail from the menu splits the screen into two halves and re-plots the graph in each half. The right hand side can now be used to without affecting the left screen. The idea is that you on the left screen and the result appears on the right screen. For example a Box zoom shows the result on the right allowing easy comparison of ‘before’ and ‘after’ views. The left hand graph is always the active one, with results of actions shown on the right.
Plot-Table The next item on the VIEWS menu is Plot-Table. This option plots the graph on the right, with the Numeric view on the right half screen. Using the left/right arrow keys moves the cursor in both the graph and the numeric windows. See page 79 for information on how to keep nice scales in the table view. When more than one function defined in the SYMB view, pressing the up or down arrows changes the table focus from one to another. In this case, with only one, it centers the table.
Nice table values What makes this view even more useful is that the table keeps its ‘nice’ tools are being used. As you can see scale even while the usual in the screenshot left, the table is automatically repositioned to show the closest pixel value to that of the extremum found. The Signed Area tool is also available in this view and when the cursor is moved the values in the table follow it.
Auto Scale Auto Scale is an good way to ensure that you get a reasonable picture of the graph if you are not sure in advance of the scale. After using Auto Scale you can then use the PLOT SETUP view to adjust the results. It is important to understand two points about how Auto Scale works. 1. Auto Scale uses the X-axis range that is currently chosen in PLOT SETUP. It then adjusts the Y-axis range to include as much of the graph as possible. It will not adjust the x axis. . If 2.
The Integer option is similar to decimal, except that it sets the axes so that each pixel is 1 rather than 0.1 thus giving an X scale of −65 ≤ X ≤ 65 . The usual result of this is rather horrible to be honest. The final option of Trig is designed for graphing trig functions. It sets the scale so each pixel is π .
Downloaded Aplets from the Internet The most powerful feature of the hp 39gs & hp 40gs is that you can download aplets and programs from the internet to help you to learn and to do mathematics. Two quick examples of aplets that are available are shown here. More are listed in the supplementary appendix on “Teaching Calculus using the hp 39gs & hp 40gs” and examples are also given in the chapter on programming. In each case the aplet is controlled by a menu.
11 THE PARAMETRIC APLET This aplet is used to graph functions where x and y are both functions of a third independent variable T. It is generally very similar to the Function aplet and so we will look mainly at the ways that it differs. An example of a graph from this aplet is: x(t ) = 5cos ( t ) ⎫⎪ ⎬ 0 ≤ t ≤ 2π y (t ) = 3sin ( 3t ) ⎪⎭ which gives: Although you can graph equations of this type, only some of the usual PLOT tools are present.
The effect of TRng The X and Y ranges control the lengths of the axes. They determine how much of the function, when drawn, is on and shows the T value, will be visible. See the examples below. Notice that in both cases, followed by an ordered pair giving (X,Y). gives a graph of: whereas.. gives a graph of: Unlike XRng & YRng, the effect of TRng is to decide how much of the graph is drawn at all, not how much is displayed of the total picture.
Calculator Tip Decreasing TStep beyond a certain point will slow down the graphing process without smoothing the graph any further. Using 0.05 is generally enough. Since trig functions are often used in parametric equations, one should always be careful that the angle measure chosen in MODES is correct. The default for all aplets is radian measure. As usual, the NUM view gives a tabular view of the function. In this case there are three columns, since X1 and Y1 both derive from T.
12 THE EXPERT: VECTOR FUNCTIONS Fun and games Apart from the normal mathematical and engineering applications of parametric equations, some interesting graphs are available through this aplet. Three quick examples are given below.
Vectors The Parametric aplet can be used to visually display vector motion in one and two dimensions. Example 1 A particle P is moving in a straight line. Its velocity v (in ms-1) at any time t (in seconds, t>0) is given by v(t ) = 2t − 5t 2 + 2t − 3 . Illustrate its motion during the first 2.5 seconds. 3 Enter the motion equation from (v) as X(T) and enter Y(T)=T. The only purpose of this second equation is to move the particle up the y axis as it traces out its path, thereby making it easier to view.
Example 2 Two ships are traveling according to the vector motions given below, where time is in hours and distance in kilometers. Illustrate their motion during the first ten hours. ⎛ −100 ⎞ ⎛ 20 ⎞ ⎟+⎜ ⎟t ⎝ 500 ⎠ ⎝ −30 ⎠ Ship A : x A = ⎜ Ship B : x B = ⎜ ⎛ 200 ⎞ ⎛ −15 ⎞ ⎟+⎜ ⎟t ⎝ 400 ⎠ ⎝ −20 ⎠ Enter the equations of motion as shown right. Now change to the PLOT SETUP view and set the axes to suitable values. Possible values are shown below. Now press PLOT to see the ships paths appear.
13 THE POLAR APLET This aplet is used to graph functions of the type where the radius r is a function of the angle θ (theta). As with the Parametric aplet, it is very similar to the Function aplet and so the space devoted to it here is limited mainly to the way it differs. Some examples of functions of this type, together with their graphs are: R1(θ ) = 4 cos(3θ ) R2(θ ) = 0.
14 THE SEQUENCE APLET This aplet is used to deal with sequences, and indirectly series, in both non-recursive form (where Tn is a function of n) and implicit/recursive/iterative form (where Tn is a function of Tn-1 ). Recursive or non-recursive Examples of these types of sequences are: (explicit/non-recursive) Tn = 3n − 1 ..... Tn = n 2 ..... Tn = 2 n ..... {2, 5,8,11,14,.....} {1, 4, 9,16, 25,.....} {2, 4,8,16, 32,.....} (implicit/recursive) Tn = 2Tn−1 − 1 ;T1 = 2 ..... Tn = 5 − Tn−1 .....
If the definition is recursive but only involves Tn−1 rather than both Tn−1 and Tn−2 then you need not enter a value for U1(2). For example, for the sequence Tn = Tn−1 + 3; T1 = 2 you need only enter the value 5 into U1(1) and the expression U1(N-1)+4 into U1(N). The value of U1(2) will be ignored in the SYMB view but filled in by the calculator automatically in the NUM view.
The NUM SETUP view offers more useful features. Change to that view now and change the NumStep value to 10. If you then swap back to the NUM view you will see (as right) that the sequence jumps in steps of 10. In case you don’t realize… 2.1475E9 is ‘computer speak’ for 2 ⋅1475 ×109 . Now go back to the NUM SETUP view and change the Automatic setting to Build Your Own by moving the highlight to it and pressing the .
15 THE EXPERT: SEQUENCES & SERIES Defining a generalized GP and the sum to n terms for it. If we define our GP using memory variables then it becomes far more flexible. The advantage of this method is that you now need only change the values of A and R in the HOME view to change the sequence. Defining a series (sum to n terms of a sequence) is fairly straight-forward using a similar method. Note the reference to U1 in the definition of U2. Once U2 is defined in this way you can change both U1 & U2.
Population type problems are also easily dealt with in this way. For example, “A population of mice numbers 5600 and is growing at a rate of 12.5% per month. How long will it be until it numbers more than one million?” Pressing CLEAR (above DEL) clears out the existing expressions, and we can enter the formula for the GP modeling the situation shown right. Because this is a non-recursive rule, the two initial values of 5600 and 6300 will be automatically calculated when you enter the rule into U1(N).
Modeling loans Suppose that I need to see the progress of a loan of $10,000 at a compound interest of 5.5% p.a. calculated each quarter, starting Jan. 1 1995, with a quarterly repayment rate of $175. This problem can be modeled by a sequence. To do this, set up U1 and U2 as shown above. The first sequence U1 simply models the year, showing the quarters as .25, .5 and .75. The second sequence U2 models the loan itself. Each quarter the remaining balance is multiplied by 1 + 0.
16 THE SOLVE APLET This aplet will probably rival the Function aplet as your ‘most used’ tool. It solves equations, finds zeros of expressions involving multiple variables, and even involving derivatives and integrals. Equations vs. expressions To ensure that we are using the same terminology, let's define our terms first. An equation includes an = sign, and can usually be solved: ⎫ ⎪ v = u + 2ad ⎪ ⎪ b a + 3 ⎬ …are all equations. +1 = ⎪ c d ⎪ x 2 − 6x + 5 = 0 ⎪⎭ y = x2 2 eg.
Suppose you had the problem: “What acceleration is needed to increase the speed of a car from 16 ⋅ 67 m/s (60kph or ~38mph) to 27 ⋅ 78 m/s (100kph or 60mph) in a distance of 100m (~110 yd)?” We’ll assume that you have already entered the equation into E2 (as above) and have made sure that it is ed. Solving for a missing value If you press NUM to change to the NUM view, you will see something similar to the screen on the right.
Multiple solutions and the initial guess Our first example was fairly simple because there was only one solution so it did not much matter where we began looking for it. When there is more than one possible answer you are required to supply an initial estimate or guess. The Solve aplet will then try to find a solution which is ‘near’ to the estimate. Example 1 The volume of a cylinder is given by V = 2π r ( r + h ) . Find the radius of a cylinder which has a volume of 1 liter and a height of 10cm.
The PLOT view on the previous page shows two curves. The horizontal line is the left side of the equation which, when the known value of Y=1 is substituted, forms a constant straight line. The other curve is the right hand side of the equation which, since X is the active variable, forms a cubic. In this case the scale chosen is appropriate but this will not always be the case and some adjustment might be required in the PLOT SETUP view.
Example 4 “Let X be a random variable, representing the heights of basketball players. If X is normally distributed, with µ = 184 ⋅ 5 and σ 2 = 105 then find the height which cuts off the tallest 5% of players.” The MATH function which allows you to work with the normal distribution is UTPN (see page 207) which gives the upper-tailed probability. The syntax is UTPN( mean, variance, value). In the Solve aplet, set E1 to P=UTPN(M,V,X). Enter the NUM view press to obtain 201.
A detailed explanation of PLOT in Solve The PLOT view in the Solve aplet is a little more complex than most others, since the active variable (x, t, theta etc) changes according to the value for which you are trying to solve. As an example, we will enter the equation A* B 2 + C = ⋅5* B into E1. Suppose that we know the values of A and C but need to find B. Now change to the NUM view and enter the values shown right. Ensure that the highlight is on B as shown and then press PLOT.
Now press and you will see the calculator find the nearest to verify that the solution solution to your guess. Finish by pressing is valid. See page 106 for more information regarding this. Obviously the next step is to change back to the PLOT view, move the for that one too. cursor near to the second intersection and If we now change the active variable then there is an immediate change in the PLOT view to reflect this.
The meaning of messages On pages 106, the values used were V= 27 ⋅ 78 , U= 16 ⋅ 67 and D=100 and we were solving for A. Thus: v 2 = u 2 + 2ad became: ( 27 ⋅ 78 ) − (16 ⋅ 67 ) − 2 × a ×100 = 0 2 When you press 2 when substituted and re-arranged. there are a number of possible positive responses.
17 THE EXPERT: EXAMPLES FOR SOLVE Easy problems Have you ever thought “There has to be an easier way!” when confronted in a test with something like: ( x −1) − 1 = 2 − ( 3 − x ) 3 9 4 If you’re sure there is only one answer to a problem, as there is in this case, then solving it is simply a matter of entering the equation into the SYMB view and solving it.
18 THE STATISTICS APLET - UNIVARIATE DATA One of the major strengths of the hp 39gs & hp40gs is the tools they provide for dealing with statistical data. The Statistics aplet and its companion the Inference aplet provide very powerful yet easy to use tools with which to analyze statistical data. The calculator treats univariate and bivariate data quite differently and those differences are reflected in the SYMB and PLOT views.
Sorting data inserts space for a new number by shifting all the The key labeled does exactly what it says… it sorts the numbers down one space. data into ascending or descending order. The extra fields in the screen shot right are used with bivariate sorts or frequency tables and will be to stop the sort. explained in that section of the notes. Press key provides access to a larger font size and The is the really useful one. last key labeled vs. we have already discussed.
Registering columns as ‘in use’ Change into the SYMB view and edit yours so that it looks like the one ed, because only on the right. You must make sure that H2 is checked columns will show in the view. Note that a screen key is provided to give you the letter C without having to use the ALPHA key. The stats are should now be available for both columns of data. Return to the NUM view and press see them.
If you use the left/right arrows and look at the bottom of the screen you’ll see that the frequencies and ranges are listed. It is probably worth tidying up this graph up a little by going into PLOT SETUP and (on the second page) setting the YTick value to be 5 instead of 1. In the graph ed. to the right the Labels option has also been You probably noticed a lot of other options in the first page of PLOT SETUP. Their explanations follow.
The effect of HRng The effect of HRng is rather different. It controls what range of data is displayed on the graph, regardless of what axes are used. It is normally set automatically to be the maximum and minimum values for the data. For example histogram H1 (shown right) has an HRng of -2 to 7. If HRng were changed in PLOT SETUP to 0 to 7 then the graph will lose the left column representing the value of -2 as shown below.
The HWidth variable controls the width of the columns, with the initial starting value and end value set by HRng. In the frequency table on the previous page the interval width was 10. By setting HWidth to 10 in the PLOT SETUP view as shown right we can produce the graph shown below. Note the changes to Xtick and Ytick also. Centering columns in the histogram Another use for the variables HWidth and HRng is to re-orient the columns so that they are centered on the data point.
19 THE EXPERT: SIMULATIONS & RANDOM NUMBERS New columns as functions of old You have already seen the use of one trick when we created a new column C1 by storing 2*C1 into C2 using the HOME view. This can be used to create new columns as functions of any number of others. For example, a set of data that you suspect is exponential could be ‘straightened’ by storing LN(column) into a fresh column. Changes of scale and origin can be investigated in this way by storing (say) -2*C1 + 3 into C2.
Simulation of a normal die Similarly the expression INT(RANDOM*6+1) will simulate one roll of the die. This means that MAKELIST(INT(RANDOM*6+1),X,1,500,1) will simulate 500 rolls of a normal die. We therefore need only store the resulting list into a Statistics aplet column to analyze and graph it. This is shown in the series of screen shots to the right.
Example 4: Simulate 100 observations on a normal random variable N(µ=80, σ2=50). Ensure that MODES is set to radian measure and type: MAKELIST(80+ 50*( (-2*LN(RANDOM))*sin(2*RANDOM)),X,1,100,1) C2 Example 5: Simulate 50 observations on an exponential distribution with mean = 2. In the HOME view type: MAKELIST(-2*LN(1-RANDOM),1,50,1) C2 As an illustration, the result of this particular simulation is shown graphically on the right. Its mean turned out to be 2.067 (3 decimal places.).
20 THE STATISTICS APLET - BIVARIATE DATA As mentioned in the Univariate section, one of the major strengths of the hp 39gs & hp 40gs is the tools they provide for dealing with statistical data. Unlike the others, the Statistics aplet begins in the NUM view which offers easy input and editing of values, while the SYMB view is reserved for specifying which columns contain data and which ones frequencies, as well as for indicating pairing of columns for bivariate data. Uni vs.
Move the highlight into column C1 and enter the xi values, pressing the ENTER key after each one. Then do the same for the yi values in C2. The result is shown right. Looking at the bottom of the screen you will see a series of tools is not worth bothering with. The key provided for you. As before, inserts space for a new number by shifting all the numbers down one space. The key labeled vs. we have already discussed. provides access to a larger font size (for us old fogeys) and is the really useful one.
The cursor If you now press PLOT you will see the result shown right. If you look at the screen you will see a small cross and, at the bottom of the screen, a listing of S1[1]: 1,5. This is telling you that the cross is currently on the first point in data set S1 whose value is (1,5). Using the left/right arrow keys you can move this cross through the data set with the values being reported at the bottom of the screen.
Choosing from available fit models The Statistics aplet is the only one which has a SYMB SETUP view, and mode. This view is supplied to allow you to even then only in specify what type of fit equation is to be used.
The User Defined model When you set the model to user defined it means that you are expected to supply the complete equation, including the values of any coefficients. The calculator will not calculate the values of any variables you include. For example, if you were to supply an equation of A/(X–B) as your model then the calculator would use the values of A and B currently in memory. By repeatedly adjusting the values of A and B in HOME you could find the best version of the curve for the data.
Calculator Tip If you have trouble seeing the small dots that the calculator uses in its scatter-graphs by default then you will be interested in the settings circled on the right. If you move the highlight onto the mark for the data set you are using and press then you will see the menu shown below from which you can choose a different mark. The contrast is illustrated below. Two Variable Statistics As with univariate statistics, summary statistics are key in the NUM view.
Now change to PLOT SETUP view and set the axes as shown right. From the NUM view, press the key and you will obtain the results listed in the screens shown below. Calculator Tip Make sure that your data set is defined and ed in the SYMB SETUP view before you try to obtain these results. Results are only given for data sets that are defined and ed. Showing the line of best fit If you now press the PLOT key you will see the graph shown right.
In the SYMB view (see right) the equation is given to so many decimal places that it doesn’t fit onto the screen. The simplest way to see the entire equation is to position the highlight on the equation and press the key. When you do you will obtain the view seen right which gives the equation of the line of best fit as ŷ = 0.8199 x +1.1662 . With a correlation coefficient of 0.7829 (from the summary stats seen previously) this would probably not be regarded as reliable.
Predicting using the PLOT view Using the PLOT view is the probably the more visually appealing method of obtaining predicted values. When you have plotted a set of data and its fit curve then pressing up arrow will change the focus of the values at the bottom of the screen from the data points to the PREDY values. In the screen snapshots shown right the focus changes from data point 3:(2,2), to the PREDY value for x = 2 of 2.806.
Alternatively, when data is non-linear in nature you can transform the data mathematically so that it is linear. Let's illustrate this briefly with exponential data. As you can see, I chose a very simple rule for the data of y = 2 x . If you set up a linear fit for the data in S1, and then view the bivariate stats, you will find that the correlation for a linear fit is 0.9058 As you can easily see from the graph left, a linear fit is not a very good choice.
21 THE EXPERT: MANIPULATING COLUMNS & EQNS New columns as functions of old As with univariate statistics, you can use functions of old columns as new sets of data. See the Univariate version of this section for two different ways of doing this. For example, a set of data (C1,C2) that you suspect is exponential could be straightened by setting up S2: as (C1,LN(C2)).
If we now switch to the HOME view, we can recall these values and use them in a calculation to find the upper and lower cut off points for acceptance of data. As you can see on the left, the range for acceptance is -3.46 to 10.38, which makes the value of 55 almost certainly an error. There are two ways to obtain these values. You can type them into the HOME view using the ALPHA key, or you can use the VARS key instead.
Obtaining coefficients from the fit model The function PREDY from MATH gives a predicted y value using the last line of best fit that was calculated. This means that you must use the SYMB view to ensure that your set of data is the only one ed and key to make sure SYMB SETUP is set to the correct fit model, and also use the PLOT screen and the ensure that your set of data was the last one graphed and that it has had its curve of best fit displayed.
Cubic - a*X^3+b*X^2+cX+d ⎡a ⎤ ⎡ 0 ⎢ ⎥ ⎢ ⎢b ⎥ = ⎢ 1 ⎢c ⎥ ⎢ 8 ⎢ ⎥ ⎢ ⎢⎣ d ⎥⎦ ⎢⎣ 27 Exponent - b*EXP(m*X) Trigonometric - a*SIN(b*X+c)+d −1 0 0 1⎤ ⎡ PREDY (0) ⎤ ⎥ ⎢ 1 1 1⎥ PREDY (1) ⎥⎥ ⎢ × ⎢ PREDY (2) ⎥ 4 2 1⎥ ⎥ ⎢ ⎥ 9 3 1⎥⎦ ⎢⎣ PREDY (3) ⎥⎦ b = PREDY(0) m = PREDY(1)/PREDY(0) There is no easy way to retrieve the coefficients in the trigonometric equation.
While the value of S xy will not change if the roles of independent and dependent columns are reversed, the value of ( S x ) on the bottom means that this formula will give a different value if you change which column is 2 regarded as x (independent) and which as y (dependent). This different value for b will also mean a different value for a and these will not be the values which would result from the simple inverse function.
key. In Now position the highlight on column C2 and press the the SORT SETUP screen (shown right) enter C1 as the Dependent column. This will have the effect of pairing columns C1 and C2 and then sorting column C2 into ascending order, re-arranging column C1 to . The results retain the existing data pairings. When ready, press of this sort are shown right. The final column C3 has not been re-arranged. With a few alterations, it will contain the rankings.
eg. 2 A population of bacteria is known to follow a growth pattern governed by the equation N = N 0 e kt ; t ≥ 0 . It is observed that at t = 3 hours, there are 100 colonies of bacteria and also that at t = 10 hours there are 10 000 colonies. i. Find the values of N 0 and of k. ii. Predict the number of bacteria colonies after 15 hours. iii. How long does it take for the number of colonies to double? i. Find N 0 and k. and enter the Start up the Statistics aplet, set it to data given.
(iii) Find t so that N = 2N 0 . The value of N 0 is the y intercept of the line of best fit. These values from the curve of best fit are not directly accessible but can be retrieved using the PREDY function (see page 135). This is shown in the screen shown right. Store the results into memories A and K. This saves having screen. to re-type them from the Now switch to the Solve aplet and enter the equation to be solved.
22 THE INFERENCE APLET This aplet is a very flexible tool for users investigating inference problems. It provides critical values for hypothesis testing and confidence intervals, and does this not only quickly but in a visually helpful format. It will be assumed in the explanations that follow that the reader is familiar with the concepts of hypothesis testing. In the Inference aplet the SYMB view is used to choose the test to be applied.
Change now to the NUM SETUP view to enter the required values. key. If you have Rather than entering them by hand, press the more than one copy of the Statistics aplet (under other names) then you will be presented with a list of aplets from which to choose. Once you have chosen the aplet, you need to nominate the column from which to import the data. The default is column C1, which is what we key to select from a list want in this case, but you can press the of any other columns which contain data.
Confidence interval: T-Int 1-µ In the previous example we found that the evidence of our sample indicated that the mean number of matches in the boxes was not 50. Suppose we now want to know, at the 95% confidence level, within what range of values the true population mean lies. the method of Conf Change back to the SYMB view and Interval. The type of interval is converted to the equivalent type of T-INT: 1 µ.
Hypothesis test: T-Test µ1 -µ2 A farmer compared the 15-day mean weight of two sets of chicks, one group receiving feed supplement A and the other supplement C. Twenty two chicks only one day old were assigned randomly to the two groups. To distinguish between the two groups of eleven, which were caged together to minimize other influences, the heads of the chicks were stained red and purple respectively with a harmless vegetable dye. The individual weights were recorded in the table below.
The NUM view shows the critical values. We can see that the probability of obtaining a test student-t value of 3.38 is 0.0015 and this is well below the permitted test level of 1%. The PLOT view also shows that the vertical line representing the value of x1 − x2 or ∆x is well into the region of rejection indicated by the R .
The hypotheses are: H0: The sample is drawn from a population whose mean is the same as the standardized population ( µ = µ0 ) . HA: The sample is drawn from a population whose mean is larger than that of the standardized population ( µ > µ0 ) . Change to the NUM SETUP view, you can use the import facility to import the summary statistics from the Statistics aplet. Enter the values for the mean and standard deviation of the standardized test, and the significance level of 0.05 (5%).
23 THE EXPERT: CHI2 TESTS & FREQUENCY TABLES We will start with a small digression to look at a simple inferential problem which can be solved using only the Statistics and Solve aplets. Using the Chi2 test on a frequency table “Four coins are tossed 400 times and the number of heads noted for each toss. The results are shown below. Using the Chi2 test at a 5% level of confidence, indicate whether the coins may be biased.
In the MATH menu, Probability section (see page 208), there is a function called UTPC (Upper-Tailed Probability Chi-squared) which will give the critical X2 probability for a supplied number of degrees of freedom and a value. In this case we would like the value for a given probability so we will enter the formula into the Solve aplet. Change to the NUM view, enter the known parameters of D=4 and for the critical X2 value. P=0.05, and Since our value of 16.387 is larger than the critical value of 9.
To create it, go to the Program Catalog view and press the key. Enter any name you want, such as ‘CCreate’. Now type in the code below. The program is set up to take a frequency table defined in columns C8 and C9 and convert them into a single column stored in column C0. The program uses columns 8, 9 & 10 because there is seldom data in them. We’ll now use this program to expand the frequency table I built earlier. The first thing we need to do is to move columns C1 and C2 to C8 and C9.
24 THE LINEAR SOLVER APLET This is a very easy aplet to use. It is designed to solve simultaneous linear equations in 2 or 3 unknowns. If there is a solution it will display it. Otherwise it will indicate whether there is no solution or an infinite number of solutions. Example 1 Solve the system of equations: 2x + 3 y − z = 2.5⎫ ⎪ x + z = 1.5 ⎬ 3y − 2 z = 1.5 ⎪⎭ In the Aplet view, right.
Example 3 Solve the system of equations: 3x − y + 7 z = 5 ⎫ ⎪ x − 5z = 2 ⎬ − y + 22 z = −1⎪⎭ Although it may not be obvious at first glance, this system of equations corresponds to a ‘spindle’ of planes in 3-space as shown in the diagram above right. This situation allows infinite solutions anywhere along the line of intersection of the three planes. As you can see right, the calculator has correctly indicated the situation.
25 THE TRIANGLE SOLVE APLET This aplet allows you to solve for missing sides and angles in a triangle, either right angled or not. Unlike most aplets it does not have a SYMB, NUM and PLOT view but only the dual view discussed below. When you first start the aplet you will be presented with one of two views. The view right is for a general triangle, while the second view assumes a right triangle. Obviously the amount of information which must be supplied is less for the right triangle.
Since this is not a right triangle, the first step is to ensure that is not selected, as is shown right. Any of the three angles α , β or δ can be used to represent the 115o angle. In this case I will use δ for no other reason than that it is at the top of the illustration, just as it is in the diagram of the triangle. This means that the 15 cm goes into the A field and the 7 cm into the B field. Enter those values, using the arrow keys to move from one to another.
Example 3 6 cm Solve the triangle shown right. 20° 10 cm This is an example of a triangle that has two possible solutions, generally referred to as “The Ambiguous Case”. The calculator will give both possible solutions. Begin by setting the calculator into Degree mode, if it is not already. Change into the SYMB view and ensure that the non-right triangle is selected as shown. Purely to maintain orientation, we will select C as the side that is 10cm long and enter the values shown right.
26 THE FINANCE APLET This aplet is designed to allow users to solve time-value-of-money (TVM) and amortization style problems quickly and easily, as well as ordinary compound interest problems. Compound interest problems involve bank accounts, mortgages and similar situations where “money earns money”. TVM problems involve the use of the idea that the value of money changes with time - a dollar today is worth more than the same dollar some years from now.
PMT - This is the size of the periodic payment. The assumptions made are that all payments are the same size and that no payments will be skipped. Payments can occur at the beginning or the end of a compounding period, depending on the setting of Mode. FV - The future value of the investment or loan.
Annuities An engineer retires with $650,000 available for investment. She invests the money in a portfolio which is expected to have an average return of 5% per annum. She wants to have the account pay a monthly income to her and asks the accountant to assume that the income must last for 20 years. What income can be withdrawn? The PV for this problem is negative because, from the point of view of the engineer, the money flow is outward from her to the investment portfolio.
Amortization The second page of this aplet allows amortization calculations in order to determine the amounts applied towards the principal and interest in a payment or series of payments. Suppose we borrow $20,000 at an interest rate of 6.5% and make monthly payments of $300. The initial situation is as shown in the screen on the right. button to change to the amortization screen. Press the The initial appearance is as shown. As can be seen, the default number of payments to amortize over is 12.
27 THE QUAD EXPLORER TEACHING APLET Rather than being a multi-purpose aplet, this is a teaching aplet specialized to the single use of exploring graphs of quadratics. As such it does not have the normal SYMB, NUM and PLOT views, but only a single multi-purpose view. Objectives Using the Quadratic Explorer aplet, the student will investigate the behavior of the graph of y = a ( x + h ) + v 2 as the values of a, h and v change.
As can be seen in the screen shots right, the bottom half of the screen shows the roots (if any), the value of the discriminant and the equation in the form y=ax2+bx+c. changes the ‘step size’ of the movements on the The key labeled screen. Possible values for the increment are 0.5, 1 and 2. will Pressing SYMB on the calculator, or the screen key labeled change the emphasis from the graph to the equation in the right hand half of the screen.
There are two levels of ‘questions’ denoted by the keys and on the screen. An question will be in the main screen ( one can be anywhere in the 5 to 5 on each axis), whereas a also affects the difficulty larger screen (see right). The setting of but you can substitute of the question. The first is always or . another by pressing mode you must use the arrow keys to change the parameters In ‘a’, ‘h’ and ‘v’ until they match the graph shown.
28 THE TRIG EXPLORER TEACHING APLET Rather than being a multi-purpose aplet like most of the others covered so far, this is a teaching aplet specialized to the single use of exploring the graphs of trigonometric functions. As such it does not have the normal SYMB, NUM and PLOT views, but only a single multi-purpose view. The SYMB and PLOT keys do have meanings but not the normal ones.
The operation of the two modes is summarized below. The PLOT mode The underlying concept in PLOT mode is that the graph controls the equation. The user has control of the graph via two manipulation points (see above and below) and any changes to the graph are reflected in the equation at the top of the screen. Looking at the screens on the right it will be seen that the third screen key toggles the point of control for the graph. It is only visible in PLOT mode.
The c coefficient is shown as a multiple of π in radian mode rather than as a decimal. The currently active coefficient is highlighted and can be changed using the up/down arrow keys in increments of 0.1 for the coefficients a, b and d. The default increment for c is π to either π labeled 9 6 or π but this can be changed using the key 4 . mode, the increments are 20o, 30o or 45o with 30o When in being the default.
29 THE MATH MENUS The MATH menu is accessed via the key below the APLET key. Any time that you are typing a value into any formula or setup screen you can insert mathematical functions via the MATH key. In reality the MATH button gives you access not just to one menu but to four. The menus are: • The MATH menu - this is the default menu containing the majority of commonly used commands. The commands in this list are available on both the hp 39gs and hp 40gs.
Accessing the MATH menu commands The mechanics of accessing the MATH menu is very simple. We will illustrate the process using the Polynomial function POLYFORM, which is an extremely useful one. Change into the HOME view and then press the MATH key. When you do you will see the screen on the right. The menu always first appears with the Real functions highlighted.
On the pages which follow we will look at most of the functions in each group. Some of the functions are not likely to be used at school level and so will not be covered since this book is primarily aimed at teachers and students of high school, as are the hp 39gs & hp 40gs. If you need the higher level commands then consult the manual. You can obtain ‘help’ for any function in the HOME view by using the SYNTAX key to obtain the word HELPWITH and then typing the function name.
The PHYS menu commands The PHYS menu is divided up into three sections by learning area. These sections are: • • • Chemistry Physics Quantum Physics The contents are simply the numerical values of various physical constants that are useful in calculations and formulae.
The MATH menu commands The MATH menu is divided up into sections by mathematical topics. These topics are: Real Stat-Two Symbolic Tests Trig Calculus Complex Constants Convert Hyperb. List Loop Matrix Polynom. Prob. - rounding, roots, some conversions and percentage functions. bivariate statistical functions. functions for manipulating equations and symbols. used in programming more than normal work. contains the trig functions not found on the keyboard. E.g. sec, cosec.
The ‘Real’ group of functions CEILING() This is a ‘rounding’ function but different in that it always rounds up to the integer above. Mainly of interest to programmers. Eg. Note: CEILING(3.2) = 4 CEILING(32.99) = 33 CEILING((12+ 6)/7) = CEILING(2.0642…) = 3 CEILING(-2.56) = -2 not -3. The CEILING function rounds up to the next integer above, which is -2. See also: ROUND, TRUNCATE, FLOOR, INT DEG RAD() This function converts degrees to radians. Eg. DEG DEG RAD(30) = 0.5235… RAD(180) = 3.
FNROOT(,,) This function is like a mini version of the Solve aplet. If you feed it an algebraic expression and an initial guess it will start from your guess and find the value which makes the expression zero. Don’t bother. It’s a lot easier to use the Solve aplet. This is a tool for programmers so that they can access the Solve abilities within programs. You need to tell it what variable is the active one in the expression, in addition to providing it with an initial guess.
HMS (
) This function works with time and angles. It converts degrees, minutes and seconds to degrees, and also hours, minutes and seconds to decimal time. The calculator can convert a value such as 45 23′17′′ if you put it into the form 45.2317 and then use the HMS function. D E.g. sin( 45 23′17′′ ) would be SIN(HMS D cos( 5 3′7′′ ) would be COS(HMS D This function, together with E.g. (5.0307)) HMS, can also be used to deal with time. What time will it be 1 hr 34 min. and 15 sec.INT() This function is related to the FLOOR and CEILING functions. Unlike those two, which consistently move down or up respectively, the INT function simply drops the fractional part of the number. Eg. INT(3.786) = 3 INT(-5.84) = -5 See also: FLOOR, CEILING, ROUND, TRUNCATE, FRAC MANT() This function returns the mantissa (numerical part) of the number you feed it when transformed into scientific notation.
MIN(num1,num2) As with MAX, this function is used mainly by programmers. It returns the smaller of the two numbers entered. Eg. MIN(3,5) = 3 See also: MAX MOD For those not familiar with modulo arithmetic, it will suffice to say that this function gives you the remainder when one number is divided by another. It is considered to be an mathematical operator in the same way that a plus, minus, times or divide sign is.
%CHANGE(,) This function calculates the percentage change moving from X to Y using the formula 100(Y-X)/X. It can be used to calculate (for example) percentage profit and loss. Eg. I buy a fridge for $400 and sell it for $440. What is my profit as a percentage? Use: %CHANGE(400,440) I sell a toy for $5.95 that normally sells for $6.50 What is the discount as a percentage of the usual price? Use: %CHANGE(6.50,5.
ROUND(,) This function rounds off a supplied number to the specified number of decimal places (d.p.). Eg. Round 66.65 to 1 d.p. Use: ROUND(66.65,1) = 66.7 Round 34.56784 to 2 d.p. Use: ROUND(34.56784,2) = 34.57 This function is also capable of rounding off to a specified number of significant figures (s.f.). To do this, simply put a negative sign on the second argument. Round 32345 to the nearest thousand. Use: ROUND(32345,-2) = 32000 Round 3405.63475 to 6 s.f. Use: ROUND(3405.
TRUNCATE() This function operates similarly to the ROUND function, but simply drops the extra digits instead of rounding up or down. It is somewhat similar in effect to the FLOOR function but the TRUNCATE function will work to any number of decimal places or significant figures instead of always dropping to the nearest lower integer value. Eg. TRUNCATE(3405.6375,-6) = 3405.63 TRUNCATE(32.889,1) = 32.
The ‘Stat-Two’ group of functions PREDY() This function predicts the y value for a pair of columns set up as bivariate data in the Statistics aplet. This is discussed in more detail in the section covering the Statistics aplet, but a brief summary will be given here. It assumes that: (i) the bivariate data is entered into a pair of columns (eg.
The ‘Symbolic’ group of functions The = ‘function’ Although this is listed in the MATH menu as if it were a function, it is not really. Except in programming, the = sign is simply used in exactly the way that you would expect it to be, mainly in the Solve aplet. It’s easier to obtain the = sign directly from the keyboard. The reason that it is found in the MATH menu is that the original calculator, the hp 38g, had less keys on the keyboard and had no room for it. It was added in later models.
LINEAR?(,) This is another of those functions which is probably aimed more at the programmer than at the normal user. It is designed to test whether a supplied expression is linear or non-linear in the variable you specify, returning zero for non-linear and 1 for linear. Eg. Suppose we use the expression AX 2 − B + 4 If X is the variable and A and B are both constants (say A=4, B=5) then the expression AX 2 − B + 4 would become 4 X 2 − 5 + 4 which would be non-linear.
3+ 5 rather than 2.6180 then you would have to COPY the result, edit 2 the line to remove all but the decimal root and square it to find the original discriminant. If you would like a solution such as If you are fortunate enough to have an hp 40gs rather than an hp 39gs then you can do all this far more easily in the CAS. See page 309 for details on finding roots of real and complex polynomials using the CAS on the hp 40gs.
The ‘Tests’ group of functions These are all functions which are of interest only to programmers, and consequently we will not cover them here. For anyone who has done any programming their use is obvious. They can also be found, far more conveniently, in the CHARS view. A fairly thorough introduction to programming on the calculator is given in an later chapter (see page 255). Those wanting more detail than is given there must consult the manual.
Some further functions are available in the Hyperbolic group of functions. They are duplicates of functions available on the face of the calculator but give more accurate answers. They would primarily be of use to those people, such as architects and engineers, for whom high accuracy is paramount. These are: EXP() This function gives a more accurate answer than the key labeled e^ which appears above the LN key on the calculator.
LNP1() As in the previous function, this is supplied to supplement the LN function and gives a more accurate value when x is near zero. Again, this is not something which would normally be of concern at school level. The ‘Calculus’ group of functions function, the differentiate, or function and the This group consists of three functions, the integrate, or TAYLOR function.
TAYLOR(,,) Briefly, a Taylor polynomial allows you to approximate a complicated function via a simpler polynomial function. The supplied is approximated with respect to by terms of a polynomial up to power. The screen shot on the right shows the calculator deriving the Taylor polynomial for sin(x) up to the 7th power.
The ‘Complex’ group of functions Complex numbers on the hp 39gs & hp 40gs can be entered in either of two ways. Firstly, in the same way as they are commonly written in mathematical workings: a + bi. Secondly, as an ordered pair: (a,b). For example, 3 + 2i could be entered into the calculator exactly as it is written, with the ‘i’ obtained using SHIFT ALPHA to get a lowercase i. Alternatively you can enter it directly as an ordered pair.
In addition to the trig functions, there are other functions that take complex arguments. ABS() or ABS() The absolute function, which is found on the keyboard above the left bracket key, returns the absolute value of a real number. Eg. ABS(-3) returns a value of 3. When you use the absolute function on a complex number a + bi it returns the magnitude of the complex number as a 2 + b 2 . Note the requirement for double brackets in this case.
CONJ() This function returns the complex conjugate. Eg. If z = 2 + 3i , then find the complex conjugate Answer (see right): z . z = 2 − 3i See also: IM,ARG,RE IM() and RE(complex) These functions return the imaginary and real parts of the complex number supplied. See also: CONJ,ARG,RE Note: As mentioned earlier, a very useful function ( ) can be found on the keyboard as the SHIFT function for .
The ‘Constant’ group of functions These ‘functions’ consist of a set of commonly occurring constants. Two of them, MAXREAL and MINREAL are mainly of use to programmers except for an important influence on the evaluation of limits (see page 80). They consist, respectively, of the largest and smallest numbers with which the calculator is capable of dealing, and are there for use by programmers as a check to ensure that calculations within a program have not overflowed the capacity of the calculator.
The ‘List’ group of functions CONCAT(, ) This function concatenates two lists - appending one on to the end of the other in the order that you specify. Lists must be enclosed in curly brackets unless list variables are used. Eg. L1={2,5,-2,10,3.75} L2={1,2,3,4,5} CONCAT(L1,L2) = {2,5,-2,10,3.75,1,2,3,4,5} CONCAT(L1,{5}) L1 would add another element of value 5 onto the end of list L1, storing the resulting longer list back into L1.
Eg. 1 MAKELIST( X2,X,1,10,2) L1 produces { 1, 9, 25, 49, 81 } as X goes from 1 to 3 to 5 to … and also stores the result into L1. Eg. 2 MAKELIST(RANDOM,X,1,10,1) produces a set of 10 random numbers. The X in this case serves only as a counter since it does not appear in the expression. Eg. 3 MAKELIST(3,X,1,10,2) produces {3,3,3,3,3,3,3,3,3,3}. The MAKELIST function can also be used to simulate observations on random variables. For example, suppose we wish to simulate 10 Bernoulli trials with p = 0.75.
SIZE() or SIZE() This function returns the size of the list or matrix specified. Since normal users would probably know anyway, and could find out easily via the list catalog, this is clearly another of those functions which are of more use to programmers (who won’t know when they write their program just how long the list you will ask it to deal with will be when you eventually run the program). If the object is a matrix then the return value is a two element list as {rows, columns}.
The ‘Loop’ group of functions This is a group of functions that may be of use for students studying discrete functions and sequences but are primarily of use to programmers. ITERATE(,,,) This function evaluates an expression in terms of a variable, starting with a supplied initial value, for a specified number of iterations. Each iteration uses the answer to the previous evaluation as the value for the variable in the next evaluation. Eg.
RECURSE This functions is provided for programmers to let them define functions in the Sequence aplet. For example, typing RECURSE(U,U(N-1)*N,1,2) U1(N) seemingly produces no useful result in the HOME view, but would produce the result shown right in the SYMB view of the Sequence aplet. The resulting sequence is the factorial numbers. The syntax is: RECURSE(,,<1st term>,<2nd term>) and it must be stored into a sequence such as U1,U2..U9,U0 for it to have any meaning.
The ‘Matrix’ group of functions This group of functions is provided to deal with matrices. The scope of functions & abilities covered in this group is in fact vastly greater than would be required by the average high school student or teacher. In many cases supplying an explanation in more detail than the manual of what the function is used for would occupy many pages to no real useful gain. Consequently although some will include detailed examples, some of the functions will be covered only very briefly.
DET() This function finds the determinant of a square matrix. See page 213 for an example of its use in finding an inverse matrix. Eg. If ⎡ 2 3⎤ A=⎢ ⎥ then find det(A). ⎣ −1 5⎦ Ans: det (A) = 2x5-3x(-1) = 13 See also: INVERSE, RREF DOT([vector],[vector]) This function returns the dot product of two vectors. Vectors for this function are written as single row matrices. For example, ⎛ 3⎞ a = (3, 4) or ⎜ ⎟ would be written as ⎝ 4⎠ [3,4]. See page 214 for a worked example.
INVERSE() This function produces the inverse matrix of an n x n square matrix, where possible. A fully worked example of the use of an inverse matrix to solve a 3 by 3 system of equations is given in the chapter on Using Matrices on page 211 and in Appendix A on page 302. An error message is given (see right) when the matrix is singular (det. zero).
LSQ(,) The least squares function displays the minimum norm least squares matrix (or vector). LU() This LU Decomposition function is similar to the LQ function on the previous page. It factors a square matrix into three matrices, returning them in the form of a list variable. {[[lower triangular]],[[upper triangular]],[[permutation]]} The upper triangular has ones on its diagonal. The matrices can be separated in the same method outlined for the LQ function.
ROWNORM() Finds the row norm of a matrix: the maximum, over all rows contained in the matrix, of the absolute values of the sum of the elements in each row. ⎡ 1 2 3⎤ Eg. For the matrix M 1 = ⎢ 4 5 6 ⎥ , the row with the largest absolute sum of 15 is row 2. ⎢ ⎥ ⎢⎣ −1 5 4 ⎥⎦ RREF() This function takes an augmented matrix of size n by n+1 and transforms it into reduced row echelon form, with the final column containing the solution. x − 2 y + 3 z = 14 ⎫ ⎪ Eg.
For example, suppose we use the system of equations below, in which the third equation is a linear combination of the first two but the constant is not consistent with this - ie no solution. ⎧x + y + z = 5 ⎪ ⎨ 2x − y = −6 ⎪ 3 y + 2 z = 13 ⎩ If we solve this in the same way as before, the matrix which results is: The final line of [0 0 0 1] indicates no solution. See the chapter “Working with Matrices” for more examples.
SVD() This function performs a Singular Value Decomposition on an m × n matrix. The result is two matrices and a vector: {[[m × m square orthogonal]],[[n × n square orthogonal]],[real]}. SVL() This function returns a vector containing the singular values of the supplied matrix. TRACE() This function finds the trace of a square matrix. The trace is equal to the sum of the diagonal elements or the sum of the eigenvalues.
The ‘Polynomial’ group of functions This group of functions is provided to manipulate polynomials. f(x) We will use the function shown right to illustrate some of the tools in the Polynomial group. Its equation is: 14 12 10 f ( x) = (x − 2)(x + 3)(x −1) = x3 − 7x + 6 8 6 4 2 1 -5 -4 -3 -2 -1 2 3 4 5 x -2 -4 POLYCOEF([root1,root2,…]) This function returns the coefficients of a polynomial with roots x1 , x2 , x3 ,... The roots must be supplied in vector form means in square brackets.
POLYFORM(,) This is a very powerful and useful polynomial function. It allows algebraic manipulation and expansion of an expression into a polynomial. The expected parameters for the function are firstly the expression to be expanded, and secondly the variable which is to be the subject of the resulting polynomial. If the expression contains more than one variable then any others are treated as constants. Eg.
POLYROOT([coeff1,coeff2,…]) This function returns the roots of the polynomial whose coefficients are specified. The coefficients must be input as a vector in square brackets. Eg. Using our earlier function of f ( x) = (x − 2)(x + 3)(x −1) = x3 − 7x + 6 we can enter the coefficients as [1, 0, -7, 6]. As you can see in the screen shot, the roots of 2, -3 and 1 have been correctly found. See page 309 for details on finding roots of real and complex polynomials using the CAS on the hp 40gs.
The ‘Probability’ group of functions This group of functions is provided to manipulate and evaluate probabilities and probability distribution functions (p.d.f.’s). COMB(,) This function gives the value of Eg. n Cr using the formula nCr = n! . (n − r )!r ! Find the probability of choosing 2 men and 3 women for a committee of 5 people from a pool of 6 men and 5 women. ⎛ 6 ⎞⎛ 5 ⎞ ⎜ ⎟⎜ ⎟ 2 3 p = ⎝ ⎠⎝ ⎠ = 0.3247 ⎛ 11⎞ ⎜ ⎟ ⎝5⎠ Notes: 1.
PERM(,) This function gives the value of the formula Eg. n Pr = n Pr using n! . (n − r )! How many ways can 3 Math, 4 English, and 6 German books be arranged on a shelf if all the books from a subject must be together? Ans: ( 3 P3 × 4 P4 × 6 P6 ) × 3! = 622080 RANDOM This function supplies a random 12 digit number between zero and one. If you want a series of random numbers, just keep pressing ENTER after the first one. Eg. Produce a set of random integers between 5 and 15 inclusive.
UTPN(,,) This function, the ‘Upper-Tail Probability (Normal)’, gives the probability that a normal random variable is greater than or equal to the value supplied. Note that the variance must be supplied, NOT the standard deviation. Eg. 1. Find the probability that a randomly chosen individual is more than 2 meters tall if the population has a mean height of 1.87m and a standard deviation of 10.4cm 2m x = 1.87m, σ = 0.104m ⇒ σ 2 = 0.010816 Ans: P(height>2m) = 0.1056 Eg. 2.
The second value can be found by using the symmetry properties of the Normal Distribution, but it is probably just as fast to go back to the SYMB view, change the 0.1 to 0.9 and then re. Remember that an key is provided in the SYMB view to allow you to change the expression without having to retype it. Final answer… 47.06% and 82.94% are the cut-offs. Calculator Tip The normal order for the arguments in the UTPN function is UTPN(mean, variance, value) and this results in the upper-tailed probability.
30 WORKING WITH MATRICES The hp 39gs & hp 40gs deal very well with matrices. They offer many powerful tools as well as a special MATRIX Catalog with full editing facilities. The MATRIX Catalog The MATRIX Catalog is entered by pressing MATRIX (located above the 4). It allows storage of ten matrices (M1,M2,..M9,M0) which can be any size, depending only on available memory. In the example shown right, the catalogue contains two matrices, a 3 x 3 and a 3 x 1.
If you look at the list of screen keys on the bottom of the view, you will . This determines which way the highlight will see one labeled move (across or down) when you enter a number. If you press the key (across), to repeatedly you will see it change from (no movement). (down), to key, and an key that can be You will also see the usual used to insert an extra row or column into an existing matrix. The keyboard DEL key can be used to delete a row or column.
Another method is to store the result into a third matrix and then to view it through the Edit screen of the MATRIX Catalog. This is shown below. Matrix M3 is created left and edited right. Probably the most common functions that you will use are INVERSE, DET and TRN (transpose), so some worked examples are included which use them. There are also a number of further worked examples involving matrices in the section at the back of the book. Solving a system of equations Eg.
Step 2. Enter the 3x3 matrix of coefficients in M1. Step 3. Enter the 3x1 matrix of into M2. in order to make entering numbers Note the change to easier. Step 4. Change to the HOME view, evaluate A−1 × b using any of the following three methods (all of which are acceptable to the hp 39gs or hp 40gs), and store the result into M3. (a) M1-1*M2 (b) M2/M1 (c) INVERSE(M1)*M2 The best of these is probably the first. The inverse x-1 function is on the keyboard and this makes it more convenient to use.
Finding an inverse matrix 1 4⎤ 1 3 ⎥⎥ ⎢⎣ −2 4 −1⎥⎦ ⎡2 Eg. 2 Find the inverse matrix A−1 for the matrix A = ⎢⎢ 1 The first step is to store the matrix A into M1. If you now simply store its inverse into M2 you will find, depending on the determinant, that the result is probably a collection of decimal values (see right). This answer is correct and we could stop there. However, this is not the best way to display the answer.
The dot product 5 Eg. 4 4 Find the angle between the vectors a = (3, 4) and b = (4,1) . (3,4) 3 2 θ 1 Using the formula that -5 -4 -3 -2 -1 -1 a • b = a . b .cos θ 1 2 3 (4,1) 4 5 -2 -3 where a • b is the dot product, -4 we can rearrange to obtain: -5 a•b cos θ = a.b This substitutes to give a solution of: cos θ = = (3, 4) • (4,1) (3, 4) . (4,1) 3 × 4 + 4 ×1 32 + 42 .
31 WORKING WITH LISTS A list in the hp 39gs or hp 40gs is the equivalent of a mathematical set. As with a set, it is written as numbers separated by commas and enclosed with curly brackets. Eg. {2,5,-2,10,3.75} The list variables Using the HOME view these lists can be stored in special list variables. There are ten of these L1,L2,..L9,L0. Eg. {2,5,-2,10,3.75} L1 Operations on lists Typing L1 and then ENTER will then retrieve the list.
There are also a number of special functions available for list variables which are contained in the List group of functions in the MATH menu. See page 190. List functions A special List Catalog is provided which allows easier entering and editing of lists. If you look above the 7 key you will see a label of LIST which gives you access to this catalog. When you enter this catalog you will see the screen on your right.
32 WORKING WITH NOTES & THE NOTEPAD The hp 39gs & hp 40gs provide access to Notes which can either be attached to an aplet or exist independ ently. The notes belonging to the standard aplets are blank unless you add to them, but copies you transfer from a computer or another calculator may have had notes added to them as instructions on how to use them. In particular, any special aplets you download to your calculator from the internet may have instructions as a note and/or perhaps a sketch.
If you the menu and press NOTE on this particular aplet then you would see the attached Note shown right. This is quite common with downloaded aplets. Since they are non-standard, the author often ensures you have some instructions, although most of the documentation is generally in a Word® or PDF® document that comes with the aplet. This particular set of notes consists of a number of pages, but most aplet Notes are not that extensive.
Independent Notes and the Notepad Catalog Most users are far more concerned with the Notepad Catalog. Notes held in it are independent of any aplet rather than being attached to only one. This cable is These notes can be sent to (received from) another calculator or from a supplied with the and keys in the Notepad Catalog. On the hp computer via the hp 40gs. 39gs this is done via the infra-red link.
Creating a Note Let’s create a small Note containing some commonly used formulas. Press SHIFT NOTEPAD (not SHIFT NOTE ) and you will see the Notepad Catalog shown right. Yours will probably be empty. an existing The keys at the bottom of the screen allow you to one or to and Notes to or from another calculator (or a computer). A Note, create a Note is deleted using the DEL key, while the SHIFT CLEAR key will delete all Notes in the catalog. key to begin a fresh Note.
The CHARS view Generally most characters you will need are on the keyboard, but additional special characters can be obtained through the CHARS view. The three pages of the CHARS view are shown below. As you can see, there are many special characters available for use. Once you have finished, and perhaps added some more formulas of your own, just press SHIFT NOTEPAD again to return to the catalog level. You will find that your new Note is now listed.
33 WORKING WITH SKETCHES If you have not already done so, read the previous chapter. As is explained there, every aplet has associated with it a Sketch view, made up of a number of pages (the default is one page). It can be viewed by pressing SKETCH, located above the VIEWS key. Sketches for the standard aplets start blank but you may find that an aplet that you download from the Internet will have a Sketch attached.
There are two font sizes available via the key, with the default key then it will change to size being large. If you press the . Although there is no apparent change when you are typing in the text, the font will become smaller when it appears in the window. Only uppercase is available in this small font. key. New sketch pages can be produced by pressing the The DRAW menu key gives access to a slightly enlarged menu of simple The key seen on the far right exits from this menu drawing tools.
CIRCLE The circle command is similar to the box command. You should position , move the cursor at the center of the proposed circle. Pressing the cursor outwards from the center, forming a radius. As you do so you will see a small arc appear, giving you an indication of the curvature of the circle. Pressing (or ENTER ) will then complete the circle. Finally, press to leave the drawing tools view.
You will now find yourself back in the graphics screen with a rectangle representing the size of the GROB to be pasted. . Move the rectangle to the desired position and press The contents of the stored GROB will appear. Simple Animations This pasting technique can be very useful in building a Sketch, particularly when used in conjunction with the ability to capture PLOT screens and store them in GROBs (see below).
34 COPYING & CREATING APLETS ON THE CALCULATOR This chapter assumes a reasonable degree of familiarity with the majority of the built-in aplets. As has been discussed before, the designers of this calculator provided a set of standard aplets for you to use, changing the capabilities of the calculator as you change aplet. These standard aplets will cover most, if not all, of your requirements but to a certain extent you can also modify them to suit your needs and copy them for your friends.
Different models use different methods to communicate As has been discussed on page 7, the hp 39gs and hp 40gs were aimed at different markets. Both of them require communication with a PC and so both come with a standard “mini-USB” port and cable. The mini-USB cable (shown left) is identical to one commonly used with digital cameras and replacements can be bought very cheaply in any electronics store.
Sending/Receiving via the infra-red link or cable. Any aplet, note, program, matrix or list can be copied from one calculator to another via the infra-red link at the top of the calculator on an hp 39gs or via the supplied cable on an hp 40gs. A sketch can be transferred by sending the aplet to which it belongs. and its companion The key to this ability is the screen key labeled . This is shown in the APLET view on the right.
The process is essentially: • Press the key on the sending calculator and the key on the receiving calculator. • Choose the option for your particular calculator. On an hp 39gs this will be “HP39 (IrDA)” and on an hp 40gs it will be “HP39/40 (Ser)”. • Press on both calculators and the transmission process will begin. Calculator Tip If you begin to receive “Time Out” messages when transmitting aplets or notes then this means that the connection was lost and the transmission failed.
Creating a copy of a Standard aplet. Imagine either of these two scenarios…. • you are a student and you have filled the Function aplet with a set of equations needed for tonight’s homework and set up the PLOT screen so that it looks exactly the way you want it to. Now you find that you need the Function aplet to do something else equally important which will mean wiping all that work.
Our student’s newly created copy of the Function aplet is now totally independent of its parent aplet. The student can now (if desirable) the original Function aplet back to factory defaults and go on with the because the calculator is no longer sure extra work that she wanted to do. A saved aplet cannot be . Pressing on a normal aplet is what to reset it to. To remove a saved aplet you need only press .
Some examples of saved aplets The Triangles aplet the Solve aplet and it under the new In the APLET view, it and enter the formulas shown. name of “Triangles”. Now The theta character can be obtained from the keyboard on the zero button using ALPHA. Change into the MODES view and set the angle mode to Degrees (unless you want to use another mode). By changing into the NUM view you can now use this to solve problems in right triangles.
Equations E1 and E2 These two equations can be used for calculations involving individual and cumulative Binomial probabilities. eg. Find the probability of at most 3 heads when tossing a coin 10 times. ed and enter Ensure that formula E2 is the values shown right. The value in J is irrelevant as it is merely the summation variable. . Highlight V and press Answer: 0.1719 Note: If N is larger than 200 then you should use a Normal approximation.
Equation E6 This equation gives P ( a ≤ x ≤ b ) for an exponential distribution. To calculate P ( x ≤ a ) use P ( 0 ≤ x ≤ a ) . To calculate P ( x ≥ a ) just find P ( x ≤ a ) and then use the HOME view to calculate the complement. Equations E7 and E8 Finally, equations E7 to E0 concern the Normal distribution, with E7 giving P ( X ≥ x ) , E8 giving P ( X ≤ x ) , E9 giving P ( a ≤ x ≤ b ) and E0 allowing calculation of questions such as “what distance either side of the mean will give a probability of 0.
Change to the HOME view and perform the calculation shown right and finally press PLOT. The result is a triangle with corners at (1,1), (2,1) and (1,3), along with its image after reflection in the x axis. We can now For example: matrix M1 so that it contains another matrix. ⎡ −1 0⎤ ⎢ ⎥ ⎣⎢ 0 1 ⎥⎦ To see the effect of this new matrix, simply return to the HOME view, the previous calculation and press ENTER. The new image will be stored into matrix M3.
The repetition of the first point is to ensure that the line forming the triangle is closed by connecting back to its starting point. The function formed by X2(T) and Y2(T) perform the same function with matrix M3. To use a different shape you need only change the points in matrix M2. If your new shape has more than three vertices you will need to change the TRange values in the PLOT SETUP view.
35 STORING APLETS & NOTES TO THE PC Overview Many users create elaborate collections of notes and aplets over time, particularly if they begin to share resources with their friends. Students may load aplets onto their calculator at the request of a teacher and wish to keep them to refer to later.
Software is required to link to a PC The connectivity software for the hp 39gs and hp 40gs was being rewritten at the time when this book was being published. The version on the CD which came with your calculator may not be the most recent version. For the latest version of the software for your calculator you should consult Hewlett Packard’s web site (http://www.hp.com/calculators) or the author’s website at http://www.hphomeview.com (this site tends to be updated more often).
Both models use the same cable As has been discussed elsewhere the hp 39gs and hp 40gs were aimed at different markets. Both of them require communication with a PC and so both come with a standard “mini-USB” port and cable. The mini-USB cable, shown left, is identical to the one commonly used with digital cameras and replacements can be bought very cheaply in any electronics store.
Before beginning you should install the Connectivity software. This can be found on the CD that came with your calculator but it is best to download a fresh version from the web so as to obtain the most recent version (see page 237). Begin by plugging the cable into the mini-USB ports at the top of the calculator. The other end plugs into any vacant USB port on the PC. Make sure you are using the correct cable and the correct port (see the previous page).
The next stage is to use the software to transmit the aplet, list, matrix or note to the PC. The instructions which follow apply to the transmission of an aplet via the APLET LIBRARY view but the process is the same for any and keys such as the List view, Matrix view, Program view and Notepad other view which has view. To receive or send an object you must be in the appropriate view. Ensure that the calculator is in the APLET view, with the highlight on the aplet you wish to send to the PC.
Normally the result of this will be a series of small pop up boxes on the PC showing the progress of the file transfer. Since most objects on the calculator are small the pop ups don’t tend to stay visible very long. Some aplets will take up to 45 seconds to transmit if they contain large amounts of data or if they contain linked programs. Don’t unplug until you are SURE that everything has been transmitted. Sometimes there is an extended pause between files.
Attached programs If your aplet is one that has been given to you by someone else such as your teacher, rather than simply a copy of one of the standard ones, then it may have one or more ‘helper’ programs associated with it. For example, almost all the aplets available from the Hewlett-Packard web site come with sets of up to 6 or 7 programs to do the work, and without which they are totally useless.
Receiving from PC to calculator The process of retrieving objects that have been stored to the PC is almost identical to that of sending them in the first place. Connect the calculator, run the software and choose the folder in which the aplets, notes, or other objects are stored. Then press the button and again choose the “USB Disk drive…” option from the menu. The Connectivity software will respond with a list of objects contained in the folder you selected.
36 APLETS FROM THE INTERNET The calculator comes with a number of aplets built into the chip. In addition to these there are hundreds of aplets available to do things such as explore graphs, solve vector problems, explore matrices or analyze time series data, as well as many common tasks called for in Physics and Chemistry. Some of these aplets are straight forward and task oriented. Others are designed to be teaching aplets which allow you to explore concepts and learn for yourself.
You may notice separate download icons for the 38G and for the 39G, 40G and 39g+ with no mention of the new hp 39gs and hp 40gs. This will change as the sites update the contents to reflect the new models. In general, any aplet which is suitable for the older HP39G, HP40G or hp 39g+ will also work on the new hp 39gs and hp 40gs. Some games may not be for two reasons. Firstly the earlier models used a slower chip and this means the older games sometimes run so fast that they are unplayable.
Organizing your collection Shown below and right is the contents of one directory in part of my collection. If you’re only going to download a few aplets then organization will not be as important. If you are a teacher or if you are intending to download lots of aplets then you might consider setting up a logical structure of directories to contain them.
The process of transferring the newly downloaded aplet from the PC to the calculator is exactly the same as it is for an aplet which you have saved to the PC yourself. The instructions for this can be found on page 244. It is important to realise that most sites contain both aplets and programs. Aplets are stored in the APLET view and generally have a PLOT view, SYMB view and NUM view like most normal aplets. Programs do not and are generally less complex and less powerful.
Using downloaded aplets Normally if you press the VIEWS key on your hp 39gs or hp 40gs then you will see a list of options which vary according to which aplet is currently active. The VIEWS menu for the Function aplet is shown right. Any aplet that has been created by a programmer, such as the Curve Areas aplet shown right, will generally have had its VIEWS menu modified by the person who created it. The new VIEWS menu is used to control the aplet, offering a series of choices to the user.
Deleting downloaded aplets from the calculator As was mentioned earlier, most of the aplets you download will have ‘helper’ programs associated with them. These are stored in the Program Catalog. If you want more information on these ‘helper’ programs then read the chapter on programming and, in particular, the SETVIEWS command. Apart from curiosity, there is one important respect in which you need to know about these programs and that is when it comes time to delete an aplet.
Capturing screens using the Connectivity Kit One of the more useful abilities of the Connectivity Software is its ability to capture images of the calculator screen. These images can be pasted into a document or into a Paint program for further processing. This allows teachers to create worksheets that include images of what the student should see. Students can create reports that include graphs and tables from your calculator. Any screen can be captured at any moment, even if it is only partially drawn.
37 EDITING NOTES USING THE CONNECTIVITY SOFTWARE In addition to allowing you to save and retrieve objects from the calculator to the PC, the Connectivity Software will also allow you to edit it once it is on the PC. On previous models this was done using a separate piece of software called the ADK but with the release of new software with the hp 39gs and hp 40gs this ability was integrated into one program.
To edit a Note you need to look at the row of tabs at the top of the editor. Click on the one labeled “Notes” to see any which may be contained in the folder you have already selected. Assuming that you actually have notes in the folder then you will see something similar to the view shown below right. You can now type your text into the Note using the normal computer keyboard.
The names used to record the Notes on the PC are not terribly imaginative, as can be seen to the right. You must not change these names! They are recorded in the special files HP39DIR.CUR and HP39DIR.000 and the calculator will expect to find them under those names. Highlighting an existing Note and pressing the Copy button will produce a copy of the existing Note with the title “Copy of …………”. You can then change the title in the normal manner to anything desired.
38 PROGRAMMING THE HP 39GS & HP 40GS The design process An overview Although you can choose to simply create programs, it should be remembered that the whole point of working on the hp 39gs or hp 40gs is to use aplets. Working with an aplet means that you inherit its abilities such as auto setting of axes in the PLOT screen and so on. A program shares none of these and must re-create them when needed.
Choosing the parent aplet The first stage in the creation process is to decide which of the standard aplets you wish to make the “parent” of your new child aplet. For some aplets this may not matter, but for others this can be a very important choice. All the abilities of the parent are inherited by the child so the parent choice is crucial if your aplet requires particular abilities.
Most of the options in your VIEWS menu will be triggers for ‘helper’ programs you will write, and when the user chooses an option and presses ENTER, the appropriate ‘helper’ program will be run by the calculator. When the ‘helper’ program terminates the calculator drops into whatever view you as the designer choose. For example, a ‘helper’ program might set up axes based on the data entered and then drop the user into the PLOT view.
Another example of an existing aplet is shown right. It is called “Tangent Lines” and it draws a tangent line onto a graph and then lets the user move it around, displaying the gradient as it does so. This aplet has the Function aplet as its parent because of the need to graph functions. It has also had its VIEWS menu adapted (see next page) to show the options listed right. In this case the menu has far fewer options because the operation of the aplet is very simple.
The SETVIEWS command The VIEWS menu is created by the SETVIEWS command. It follows a repetitive pattern of listing a menu option, followed by the name of the program that should run if the user chooses that option, followed by a code number which tells the calculator which view to drop the user into once the program finishes. Part of the job of the ‘helper’ program is usually to set up this view so that it shows what the programmer wants it to.
Special entries in the SETVIEWS command In addition to the lines which form the menu for your aplet, there are some special entries which are treated differently. • If you include entries called “Start” or “Reset”, then the ‘helper’ programs associated with those or in the APLET view. These entries are entries will be run when the user presses case sensitive and must appear exactly as shown. See the next page for more on the “Start” option.
Shown below is a SETVIEWS program which illustrates this for an aplet with Function as its parent… producing a menu of… The behaviour will be: • Choose “Opt. 1” • Choose “Plot-Table” • Choose “Auto Scale” • Choose “Opt. 2” Runs program .TST.A and then drop the user into the HOME view (view 0) Drop the user immediately into the Plot-Table view (view 16 for Function) Drop the user into the PLOT view after performing a normal Auto Scale (view 18 for the Function aplet) Runs program .TST.
Example aplet #1 – Displaying info This example uses the SETVIEWS command to create a simple (and totally useless) aplet, which illustrates a few of the concepts useful in programming the hp 39gs or hp 40gs. We’ll call it the ‘Message’ aplet and create it as a child of the Function aplet. Change into the APLET view, move the highlight to the Function aplet it. This reset is not necessary but ensures that no settings and are left over that may interfere. Now save it under the new name of this new aplet.
We’ll now create the associated ‘helper’ programs (shown below). Their names/titles are supplied above the code for each one. A short explanation is given. For more information on the various commands see the chapter “Programming Commands” on page 281. .MSG.2 .MSG.1 ERASE clears the screen, ready to DISP a message on lines 4 The MSGBOX command is used to display the traditional first message for programmers and 5 of the screen.
Having created all of the programs that make up the aplet ‘Message’, we can now run the program .MSG.SV, severing the aplet’s link to its current VIEWS menu which was inherited from its parent the Function aplet, and substituting this new menu. Before you do this, check that you are still in the correct aplet. Press the SYMB key and check that the title at the top still says “MESSAGE SYMBOLIC VIEW”.
The next option in the menu is ‘Input value’. Choosing this option will create an input screen. The statement controlling this was: INPUT N; "MY TITLE"; "Please enter N.."; "Do as you're told."; 20: Examine the snapshot on the right and notice the connection between the various parts of the INPUT statement and their effect. Note the suggested value of 20, and note also that the prompt of “Please enter N..” was too long to be displayed.
The final option is ‘Show function’. The program this runs is a little more complex than the ones shown so far and illustrates a useful technique. The line: '((X+2)^3+4)/(X-2)' F1(X): ( x + 2) + 4 ( x − 2) 3 stores the expression into the function F1(X). Notice the way the function is in single quotes so that the algebraic expression itself is used rather than its value when evaluated using the current contents of memory X.
Finally the LINE and BOX commands commands are used to draw an oblique line across the screen and a box near the center. LINE Xmin; Ymin; Xmax; Ymax: BOX 3; 3; -2; -2: Notice the use of Xmin, Xmax, Ymin and Ymax in the LINE command. These are the minimum and maximum limits of the current PLOT view and using them instead of fixed values means that the line would appear the same even if the screen were to be re-sized in the PLOT SETUP view.
Example aplet #2 – The Transformer Aplet If you haven’t already, read pages 234 which explain how to create a copy of the Parametric aplet to explore geometric transformations using matrices. We will now look at using programming to enhance this aplet by automating the process. . Now Start by highlighting the Parametric aplet and pressing the aplet under the new name ‘Transformer’. Press SHIFT NOTE (not NOTEPAD) and enter some explanatory text into the aplet’s Note view. You can use the text shown right.
.TRANSF.SHAPE .TRANSF.MAT (continued…) Since the default contents of any variable is zero and there is no zero’th option on a list this means a program bug waiting to happen unless you preset the value. This program uses the CHOOSE command to offer a list of options. Note the need to pre-load a value into C. This value determines which option is initially highlighted when the menu appears.
Designing aplets on a PC Please note The software used on the PC to edit and create Notes, programs and aplets was in the process of being written at the same time as this book. Consequently the explanations given here may tend to be a little vauge. Screen images and explanations may be different on the final version you are using. However the process should be substantially correct. At the time this book was being written the sofware was called “The Connectivity Kit” but this too may have changed.
Type the code for the program into the code window. At the time this book was written there was some debate going on over whether the code should be saved automatically as you type or whether it was better to have the user click on a “Save” button. So… if there is a “Save” button or an option on the File menu of “Save” then use this now to save your code. If there’s no such option then go on to the next step. Change back to the Folders/Transfers and download your program to the calculator for use.
Example aplet #3 – Transformer revisited Run the Connectivity Kit and use the File menu to create a new folder called “Transformer”, and highlight that folder to hold your aplet. In my experience it is a very good idea to store each aplet in a separate folder but this is not strictly necessary. Change to the Aplet tab view to see the view shown right. Create a new Aplet, selecting a Base Aplet of “Parametric” and using the appropriate button. Change the name of the aplet to “Transformer” as shown.
As you enter each triplet, the boxes will blank ready for the next menu item to be added. You can construct the entire menu at one time OR you can edit the code for the program before proceeding. In many ways it is better to design the entire menu structure before beginning to code but that may not be the way you prefer to work. In the window shown above right you can see that after the view triplet has been added to the menu the Edit View Program button on the far left is enabled.
Example aplet #4 – The Linear Explorer aplet If you would like more practice in using the programming utility then you may wish to use it to create this final example, which is a very useful teaching aplet called “Linr Explorer”. The name would be better as “Linear Explorer” but names of more than 14 characters will not display properly in the calculator’s APLET view. This aplet will be somewhat similar to the Quad and Trig Explorer aplets, except that it will explore linear equations.
If you have done this correctly then your VIEWS menu have three entries shown right when it is transferred to the calculator.
It will probably be easier to understand how the aplet works if you see it in action first so you may wish to download the aplet from The HP HOME View and try it. Alternatively, simply read the summary below. The first option on the VIEWS menu plots a set of axes and must be chosen first. Once this is chosen the user can then choose the second option on the VIEWS menu to explore the equation of a line. As you press the up/down arrows the line moves vertically by changing the value of ‘c’ in y = mx + c.
The second and third lines insert a function into F1(X). This can only be done, of course, if the parent aplet is Function. If you do this when the parent is another aplet then the code will still execute but the function will be inserted into the real Function aplet! The reason for inserting this particular function is that we need a function when the axes are plotted or the normal error message will be displayed (see above right). This is undesirable because it will confuse the user.
Still referring to the code on the previous page, you will see that it refers to PageNum. The sketches in the calculator’s SKETCH view are numbered 1, 2, 3…etc. Sketch number 1 is always present but after that only sketches that have been created are available and the program will crash if you try to access one that does not exist. The aplet variable PageNum is the pointer to the sketch you want and the actual sketch page itself is called Page.
The DISPXY command is a hugely useful command to programmers. It appears in the Prompt section of the MATH menu. It allows you to place a string of text at any position on the screen using two different fonts and has the syntax: DISPXY ;;;
The final check in the line UNTIL K==105.1 END: is to see if the user has pressed the ENTER key. If so then the loop will terminate and the screen will erase. If not then the loop begins again with the new line being displayed. On termination of the program the VIEWS menu will display again, because we chose this when designing the aplet in the ADK. This aplet illustrates most of the commonly used programming techniques.
39 ALTERNATIVES TO HP BASIC PROGRAMMING The hp 39gs and hp 40gs are supplied with a simple and easy to use programming language called HP Basic. This language is compiled rather than interpreted, which means that when you run a program it is translated into machine code before it is run. This saves time when running but causes a slight pause the first time any program is run while the translation process goes on.
The HPG-CC Programming language The hp 39g+ was the first of this family of calculators which didn't use the Saturn 5 as its ROM chip. Up to that point the HP38G, HP39G & HP40G had all shared the same chip along with others in the HP48 family. However, supplies of the chip ran out world wide in about 2003 and so the hp 39g+ took a different route. Instead it uses an extremely fast ARM processor (slowed down slightly to save battery power) and simply emulates the Saturn 5.
The HPG-CC language was originally developed for use on the hp 49g+, which is a more sophisticated graphical calculator aimed at university and professional use. Support for the hp 39gs & hp 40gs was added later. At the time of writing this information in early 2006, HPG-CC had reached Version 2.0 but subsequent to this version the support for the hp 39g+, hp 39gs & hp 40gs had been discontinued.
40 FLASH ROM Unlike all their predecessors, the hp 39gs & hp 40gs contain flash ROM. A ROM chip contains “Read Only Memory” and is used to contain data which must be preserved even when the batteries are removed. For this reason a ROM chip is always used to contain the operating system for the calculator. Data that you create, on the other hand, is stored in RAM (“Random Access Memory”) and this memory lasts only as long as power is supplied to it.
Generally any user memory will be lost as part of the updating process. Even if it is not, the instructions that come with the update will almost certainly require that you perform a full reset after the update. Failing to do so might cause the calculator to lock up, requiring a reset anyway. Consequently it will be necessary to save all your aplets, programs and notes to a PC before the update.
41 PROGRAMMING COMMANDS As was explained in a previous chapter, the hp 39gs and hp 40gs are supplied with a simple and easy to use programming language called HP Basic. All programming commands can by typed in by hand but, as with the MATH commands, can also be obtained from a menu. Press SHIFT CMDS to display this. During the course of using the calculators in the classroom and creating hundreds of aplets and programs for them I have found that there are certain commands which are used regularly.
The Branch commands IF THEN [ELSE ] END Note the need for a double = sign when comparing equalities. Any number of statements can be placed in the true and false sections. Enclosing brackets are not required, as they are in some other languages. CASE …END: This command removes the need for nested IF commands but is only worth it if you have more than two or three nested IFs.
RUN This command runs the program named, with execution resuming in the calling program afterwards. If a particular piece of code is used repeatedly then this can be used to reduce memory use by placing the code in a separate program and calling it from different locations. See the SETVIEWS command for information on how to link a program to an aplet when it does not appear on the primary menu. Note that if the name has spaces in it then it must be enclosed in quotes.
The Drawing commands ARC ;;;; This command draws an arc on the screen. It uses the current values in the PLOT SETUP view as the screen coordinates and the settings in the the MODES view for angle format. This command is unfortunately quite slow. BOX ;;; This draws a rectangular box on the screen using (x1,y1) and (x2,y2) as the corners. The coordinates are relative to the settings in the PLOT SETUP view.
TLINE ;;; This command is the same as LINE except that the line drawn reverses the current set/unset value of all pixels. This means that it can be used to erase previously drawn lines. If you would like to see this command in action, download the aplet called “Sine Define” from the author’s website The HP HOME view (at http://www.hphomeview.com). This aplet contains extensive use of this command.
The Graphics commands See the chapter “Programming the hp 39gs & hp 40gs” beginning on page 255 for examples illustrating some of the graphics commands that I have used regularly. Consult the manual for more. The Loop commands FOR = TO [STEP ] END For those familiar with the Basic language in other forms, this is a standard FOR…NEXT command, except without the ‘NEXT’. The STEP value is optional and is assumed to be 1 if not stated.
BREAK This command will exit from the current loop, resuming execution after the end of it. Calculator Tip There is no GOTO
The Print commands These commands were supplied for use with the battery operated HP infra-red thermal printer that is designed for use with any of the 39g family. This printer was originally designed for the first calculator in this family, the hp 38g, released in 1995. Very few of them sold because it was far easier to simply use the connectivity software to capture screens and images and then just paste them into a document on the PC.
The Prompt commands BEEP ; This will use the piezo crystal in the calculator to create a sound of the specified frequency for the specified duration (in seconds). The resulting frequency is not terribly accurate, varying by up to 5% from one calculator to the next and depending also on the temperature. If you want accuracy then use a piano! The volume is also not very loud because of concerns with interruptions to tests and examinations.
DISP ; This command breaks the display up into 7 lines and allows output to them. Using the DISP command on a line wipes that entire line to the right hand end of the screen before display. This means that it is not possible to write over an existing line and ‘edit’ material already present. The DISPXY command should be used for this purpose but is a little more complex to use.
DISPTIME This command pops up a box displaying the calculator’s internal time and date. These can be set by storing values to the variables Time and Date. Suppose the current time is 3:46:29 pm on the 1st of December, 1998 then you would store 15.4629 to Time and 12.011998 to Date as shown in the screen shot right.
WAIT This command pauses execution for the specified number of seconds. Execution resumes at the next statement after the WAIT command.
42 APPENDIX A: SOME WORKED EXAMPLES The examples which follow are intended to illustrate the ways in which the calculator can be used to help solve some typical problems. In some cases more than one method is shown. In some cases the method is chosen more to illustrate the capabilities of the calculator than because it is necessarily the most efficient method. Sometimes these problems are quoted elsewhere in the book and repeated here for convenience.
Method 3 - Using the POLYROOT function The advantage of this is that it can be done in the HOME view and is quick and easy. It also has the advantage that it returns complex roots as well. See page 84 for a method of copying the results to a matrix so as to gain easier access to them. This method is highly recommended for polynomials in general. Finding complex solutions to a complex equation Find the roots of the complex equation f ( z) = z 2 + z + 1 .
Finding critical points and graphing a polynomial For the function (i) (ii) (iii) (iv) f ( x) = x3 − 4 x 2 + x + 6 … find the intercepts. find the turning points. draw a sketch graph showing this information. find the area under the curve between the two turning points. Step 1. Enter the function into the SYMB view of the Function aplet, so it is available for plotting. Step 2. Use the POLYROOT function to find the roots. This function is in the MATH menu in the Polynom. group.
Step4. Because I know that part (iv) of the question requires me to re use these extremum values in an integration (which I would like to be as accurate as possible), I am going to ‘save’ the extremum value just found. I change into the HOME view and store it as shown in memory A. Note: You MUST store the point of interest before moving the cursor in the PLOT view. As soon as the cursor moves its new position over-writes the extremum value. If you want the y coordinate, just evaluate F(X).
Solving simultaneous equations. Solve the systems of equations below: (i) 2 x − 3 y = −7 ⎫ ⎬ x + 4y = 2 ⎭ 2x − y = 4 −3x + 2 y − z = −10.5 x − 3 y + z = 10.5 (ii) Method 1 - Graphing the lines Because the first set of equations is a 2x2 system it can be graphed in the Function aplet. To do this it is necessary to re-arrange the functions into the form y = …… and store them into F1(X) and F2(X) in the SYMB view of the Function aplet.
Step 3. Change into the HOME view and enter the calculation M1-1*M2. The result is the (x,y) coordinate of the solution displayed as a matrix. A similar method can be used to solve the second 3x3 system of equations. The matrix M1 and the result are shown right. Method 3 - Using the Linear Solver aplet This method uses an aplet called the Linear Solver which was added into the new hp 39gs and hp 40gs. For earlier models there is a similar aplet available from the internet called the “Simult 3x3” aplet.
Expanding polynomials Expand the expressions below. ( 2x + 3) ( 3a − 2b ) (i) 4 (ii) (i) 5 Use POLYFORM((2X+3)^4,X) to expand the polynomial. key to examine the result. Use the Result: 16x + 96 x + 216x + 216x + 81 4 (ii) 3 2 Use POLYFORM((3A-2B)^5,B) to expand the polynomial as a function of B. Then use the polynomial function again, ing the result from the first expansion and expanding key can then be this time as a function of A.
Exponential growth A population of bacteria is known to follow a growth pattern governed by the equation N = N0 kt ; t ≥ 0 . It is observed that at t = 3 hours, there are 100 colonies of bacteria and that at t = 10 hours there are 10,000 colonies. (i) Find the values of N 0 and of k. (ii) (iii) Predict the number of bacteria colonies after 15 hours. How long does it take for the number of colonies to double? (i) Find N 0 and k using the calculator. Step 1.
(ii) Predict N for t = 15 hours. In the PLOT view, press up arrow to move the cursor onto the curve of best fit. Now press and enter the value 15. The cursor will jump to the predicted value for x=15, which is currently off screen. Alternatively, change to the HOME view and use the PREDY function. Result: 268 269 colonies. (iii) Step 1. Find t so that N = 1 N0 . 2 Find the values of N 0 and k and store N 0 into memory A and k into memory K, so that it is un-necessary to re-type them.
Solution of matrix equations A(1 − 2X ) = B Solve for the value of X in A(I − 2X ) = B where 1 − 2X = A−1 B ⎛ 2 3⎞ ⎛ 3 −2 ⎞ A=⎜ ⎟, B = ⎜ ⎟ ⎝ −1 5 ⎠ ⎝1 4 ⎠ −2X = A−1 B − I − 1 −1 X = A B−I 2 ( The algebraic calculation for this process is shown above right. Having done this, we will now see how to calculate this result on the calculator. Store the values of A and B into M1 and M2 respectively.
Finding complex roots i. Find all roots of the complex polynomial f ( z ) = z 3 + iz 2 − 4z − 4i . ii. Find the complex roots of z 5 = 32 . the results into a matrix, since the matrices on The best way to do this is using POLYROOT. I usually the hp 39gs and hp 40gs can be complex vectors, not just real valued matrices. The coefficients can be entered into POLYROOT in the form a+bi or as (a,b). In this case the roots are integers so there is no need to store it into a matrix.
Complex Roots on the hp 40gs i. Find all roots of the complex polynomial f ( z ) = z 3 + iz 2 − 4z − 4i . ii. Find the complex roots of z 5 = 32 . On the hp 40gs you can obtain exact roots for polynomials using the CAS function SOLVEVX. The instructions following assume that the CAS is in its default configuration. See page 324 for more details on the CAS. button to enter the CAS. Press the In the HOME view, press the button to access the Solve menu. Scroll down to find SOLVEVX and press ENTER.
Analyzing vector motion and collisions Ship A is currently at position vector 21i + 21j km and is currently traveling at a velocity of -4i + 6j km/hr. Ship B is at 30j and traveling at 2i + 3j km/hr. If the ships continue on their present courses, show that they will not collide and find the distance between them at the time of their closest approach. The advantage of the approach shown here is that it is very visual. Obviously there are other methods based purely on calculations.
I want to graph this function for the first six seconds but I am not sure what y scale to use so I will set XRng to be 0 to 6 in the PLOT SETUP view and then choose VIEWS - Auto Scale. The result is shown right. Extremum, I find that the time of closest approach is at t = Using 3.4 hours (3:24 pm) with a separation at that time of d = 1.3416 km. The y axis has been adjusted slightly to make the x axis visible.
Inference testing using the Chi2 test A teacher wishes to decide, at the 5% level of significance, whether the performance in a problem solving test is independent of the students’ year at school. The teacher selected 120 students, 40 from each of Years 8, 9 & 10, and graded their performance in a test as either A or B.
Changing into the Solve aplet we can enter a formula which will allow us to calculate values from the Chi2 distribution using the UTPC function. With a 3x2 contingency table the number of degrees of freedom are 2. To find the critical χ 0.05 value, we enter values of 2 for D (the degrees of 2 freedom) and 0.05 for P (the probability) and then move the highlight to V (the value) and press . As it turns out, the required critical value is 5.
43 APPENDIX B: TEACHING OR LEARNING CALCULUS There are many ways that the teaching or learning of functions and calculus concepts can be enhanced with the aid of a graphical calculator. Some of them are listed below: Investigating the graphs of y=xn for n an integer This is a task often given to introductory calculus classes and can be done most economically by setting an investigative task, perhaps for homework. Save a copy of the Function aplet under the name of “X to the 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. i. 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).
ii. When discussing the concept of a domain, the NUM view can be very useful in developing this (see right). ing the In the SYMB view, enter the functions shown right, un first two non-composite functions. In the NUM view shown, 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 f ( x) = x 2 is not the same as f ( x) = x , and why f1 ( f 2 ( x ) ) is not the same as f 2 ( f1 ( x ) ) for x<0. iii.
Gradient at a Point This is best introduced using an aplet called “Chords” downloaded from The HP HOME View web site (at http://www.hphomeview.com), but you can also use the Function aplet. If you use the aplet you will find that there is a worksheet supplied with it. To do it 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).
Gradient Function 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 Slope function which done via the Function aplet by using the gives the gradient of the graph at the position of the cursor (see page 58). If the teacher has the student enter a function in the SYMB view they can then have the student explore the value of the slope at various values using the the cursor precisely.
The Chain Rule If desirable, an aplet is available from The HP HOME View web site (at http://www.hphomeview.com), 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 is pressed, will differentiate the function above.
Area Under Curves This topic is most easily handled using an aplet from The HP HOME View web site (at http://www.hphomeview.com). 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.
Inequalities The topic of inequalities is one that is often included in calculus courses, particularly during the study of domains and this is usually extended to graphing intersecting regions such as {( x, y ) : y ≤ 0.5x + 1 ∩ y ≥ x − 1} . 2 Although the hp 39gs & hp 40gs do not have the in-built ability to plot inequalities, the process is easily handled using an aplet from The HP HOME View web site (at http://www.hphomeview.com) called “Inequations”.
Piecewise Defined Functions Piecewise defined functions can easily be graphed on the calculator by breaking them up into their components. For example: ⎧sin ( x ) ⎪⎪ f ( x) = ⎨x + 2 ⎪ 2 ⎩⎪( x − 2 ) −1 ; x < −2 ; −2 ≤ x ≤1 ; x >1 Using the Function aplet, we enter three separate component functions. You can obtain the inequality signs from the CHARS menu.
Students should also be encouraged to press the 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.
44 APPENDIX C: THE CAS ON THE HP 40GS Introduction This appendix is intended to give a useful introduction and over view to the user who is new to an hp 40gs. It is not intended to fully cover the topic, nor is it intended to serve as a reference text for the advanced user. For those needing a far more extensive coverage than is available here, I can highly recommend the incredibly detailed text “Computer Algebra and Mathematics with the hp 40g, Version 1.
The chances are that one will have a ‘+’ symbol to the left of it, while the other has a ‘-‘. This is telling you that the ‘+’ value is greater than required, while the ‘-‘ value is smaller. As you watch you should see the two values converge to the true answer. But is it? The true answer is actually 3 3000 , as is shown right in the hp 40gs CAS. Unless you were alert enough to spot it you probably would not realize that the value supplied was a cube root.
What is the difference between the hp 39g, hp 40g, hp 39g+ and the hp 39gs & hp 40gs There were two competing sets of requirements at the time that a previous model, the hp 39g, was designed as an upgrade from the original hp 38g. The European market wanted a calculator which had a CAS system but they were highly distrustful of the infra-red communication which was standard on the hp 38g, feeling that it might allow cheating in examinations.
Using the CAS The first step is to activate the CAS. This is done from the HOME view by . pressing screen key 6 (SK6), labeled When you do, you will see an empty screen with a cursor in the center and an extensive menu system at the bottom of the screen. In the examples which follow it will be assumed that the CAS is in its default settings. The CAS MODES screen is shown to the right. More detailed information on this is given on page 362.
Defining new variables In addition to the pre-defined variables you can also define your own using the STORE command. These new variables can have names that are more than one character long and can contain not only numbers but objects such as algebraic expressions. For example, STORE(X2-1,FRED) would define a new variable called “FRED” which will appear in the VARS screen. If you now type FACTOR(FRED) then the result would be (X+1).(X-1).
ii. Assume that we want to show working by evaluating the binomial expression separately. Press , , , , to highlight the right hand bracket and the subtract, then press to transfer the highlight to the left hand expression. The screen should appear as shown right. to evaluate this portion of the expression by expanding Press the brackets without affecting the rest of the expression. iii. Now simplify the entire expression. Press iv. , . The result is shown right.
viii. ix. this time will result in the screen shown below right Pressing which displays the two complex roots. , , CLEAR to clear the highlighted expression, which Press in this case is the whole CAS editing screen.
Pressing down arrow at that point moved down the tree. The default is to move to the left-most node D. This meant that the 2 was highlighted and so when you pressed 3 it was that expression which was cubed. At that point the tree now appears as shown right with the CAS in ‘typing/editing mode’ on node G. A + B 81 * Pressing up arrow three times placed the highlight successively on nodes 2 was pressed it squared the entire G, then D, then B. When expression defined by node B which was ‘23X’.
After typing the 5, press up arrow once to highlight that node S. If you now press left arrow you will find that the highlight will jump horizontally to node A, highlighting the entire numerator. Pressing R down arrow four times moves down through the tree from A to P to B to D to F. To access and change the power of 2, press up arrow twice to move up to node B, then press right arrow to move from node B to node Q.
Special characters As in the HOME view, special characters such as inequalities are available from the CHARS view, although the appearance of the CHARS view is somewhat different as can be seen right. There are no page up/down buttons, which makes it more difficult to move through. The initial two rows are invalid characters that can’t be used – exactly why they were included is not clear.
Special editing commands – Undo, multi-select & swap Unlike most calculators the CAS editing screen has an undo function. If you have performed some operation that was incorrect then pressing SHIFT MEMORY will undo the operation. Unlike programs on the PC which have more memory to work with and so allow multiple levels of undo, this will only undo a single operation. However, this can be very convenient at times.
iv. SHIFT swaps the currently Pressing SHIFT highlighted/selected branch for the one on the immediate left. For example, suppose you have selected the middle term and then extended the selection using SHIFT right: … then pressing SHIFT as shown will result in: The main use for this is when you want to substitute a previous result into a new expression but the terms are not in the right order to do so. See page 352 for an example of this (specifically part 5 of the example).
Changing Font Although the default font is very easy to read, it is quite large and often makes parts of the expression or result extend off the screen. Changing to a small font can help with this, at the cost of making the characters a little more difficult to read. The Change Font command is found on the menu. It is a toggle command – it changes to small font if in large mode and vice versa.
If you want to delete the entire expression then the simplest method is to press HOME, exit the CAS and then re-enter it with a blank screen. Alternatively you can highlight part or all of the expression and then press SHIFT ALPHA CLEAR. The highlighted section will be cleared. Cutting and pasting of all or part of an expression can be easily done menu. This provides access to commands of Cut, using the Copy and Paste which behave in exactly the same manner as they do in any word processor.
The PUSH and POP commands Occasionally it is desirable to transfer results from the normal HOME view to the CAS screen or vice versa. This is done using the PUSH and POP commands. Suppose we have just expanded (2x+3)4 in the CAS, as shown right. If we press HOME to exit the CAS and then type POP in the HOME view then the result will be retrieved to the HOME screen as shown. The use of the POP command erases the last line of the CAS History so using it a second time will generally produce different results.
If you choose the Function aplet then you will be asked to nominate a destination. The current contents of each function is shown to allow you to choose whether to overwrite or not. All you need then do is exit the CAS and enter the Function aplet. You will then need to manually the new function if you want to PLOT it. See page 342. Evaluating algebraic expressions When an expression is highlighted, pressing ENTER will cause it to be algebraically evaluated and any functions to be applied accordingly.
Notice the lack of a ‘+c’ indefinite constant in the integration result. Here, this is because we are using the definite integral (see page 73 and the page following). A better alternative is to use the INTVX function as shown below, even though it still does not add the ‘+c’ (see page 73 for reasons). Calculator Tip The result of the 40! example above extends off the edge of the screen and pressing will not scroll it.
Examples using the CAS In these examples we will begin with exercises which demonstrate the basic abilities of the CAS to simplify expressions and then move on to the use of the functions available through the various menus. In the initial examples the exact keystrokes will be supplied but in later ones this may not always be the case. Example 1: Simplifying a fraction with working Suppose you are required to simplify the expression shown right, giving your answer as a proper fraction. i.
Example 2: Simplifying surds Simplify the surd expression: i. Begin by entering the expression: 2 SHIFT 18 SHIFT SHIFT ii. 2 18 − 72 + 75 SHIFT 72 75 Now simplify each surd in turn (assuming working is desired): ENTER ENTER iii. ENTER Finally, select the entire expression with SHIFT and press ENTER to simplify: iv. If you want the result as a decimal, press NUM. Pressing SHIFT NUM will cause the calculator to analyze the decimal and re-instate the surd.
There are two ways that functions can be used in the CAS. The first is to use them as the expression is entered. In this method the order is to choose the function and then to fill in the parameters required. The second is to apply a function to all or part of an expression that has perhaps resulted from a previous calculation or been typed in first. If you highlight an expression and then choose a function the expression will appear as the first parameter in the function.
iii) 2x x→∞ 2 x + 5 Find lim Limits to infinity are also permitted using the lim function, with infinity entered using the shortcut SHIFT 0.
Example 4: Factorizing expressions If you highlight an expression such as (2x+3)4 and press ENTER then the CAS will expand the bracket. Since the result extends beyond the screen we will scroll through it using the arrow keys. The results can be factorized again using the COLLECT function. In this example we will also illustrate the use of the CAS History to fetch a previous calculation.
Example 5: Solving equations Solve the equation x − 1 = 3 , giving i) real solutions and ii) complex solutions. 4 From within the CAS, press SHIFT MODES to access the configuration menu and ensure that you are in real mode by, if necessary, ing Complex mode, as shown right. un- Now use the SOLVEVX function, typing: The SOLVEVX function assumes that the active variable is being used. The default active variable is X and if no = sign is included then the expression is assumed to be equal to zero.
The LINSOLVE function can also be used to solve problems with symbolic coefficients such as the one below. Solve the system of equations: The command is LINSOLVE( 2.X+K.Y-1 AND (Q+3).X-Y-5, X AND Y) and it produces the results shown. Press VIEWS to see the final solution in a scrollable format. or the CAS will interpret KY as the name of a Note that “KY” above must be entered as K*Y using variable. In the CAS variables can have more than one letter, as is discussed on page 328.
Example 7: Solving a simultaneous integration A continuous random variable X, has a probability distribution function given by: ⎧ a + bx + x 2 ⎪ f ( x) = ⎨ 9 ⎪0 ⎩ Given that P ( x ≤ 2 ) = for 1 ≤ x ≤ 4 elsewhere 5 , find the values of a and b. 27 From the fact that it is a probability distribution function we know that ∫ f ( x ) dx = 1 . We can use this to get 4 1 the first expression in terms of a and b. As can be seen above, the initial integration gives an equation involving a fraction.
We can now use the LINSOLVE function to find A and B. While the second linear equation is still highlighted, fetch the LINSOLVE command from the menu. Then press and highlight the linear expression again as shown right. to Now, while the entire expression is highlighted, as shown above, press SHIFT (-) to obtain the ‘AND’. The result should be as shown right.
Example 8: Defining a user function The DEF function allows you to define your own functions, which are then available for use. In the example below it has been used to define Fermat’s prime function f ( x ) = 22 + 1 . Note that the sequence of keys is: x ENTER ALPHA SHIFT = 2 + 1 ENTER F ( 2 The CAS will then echo the function back to you and, if you press VARS to go to the VARS view, you will find that it is now a defined variable.
We can now test to see if this is a prime number by using the ISPRIME? function from the MATH menu. This is found in the Integer section of the CAS function list as shown right. It returns a value of 0 (false) indicating that it is not a prime number. Using the FACTOR function from the are 641 and 6700417. Note: menu shows that its factors The ISPRIME? function gives correct results for integers up to 14 10 . Beyond that level the results are highly probable to be correct but not guaranteed.
Example 9: Investigation of a complex function 1 2 z + z in parametric form and graph it. Show 2 ⎛π ⎞ that it is symmetrical about the x axis and evaluate f ⎜ ⎟ as an exact surd. ⎝3⎠ Rewrite the function i. The first step is to enter the function. 1 ii. f ( z) = 2 ALPHA Z ALPHA Z We now transform it into exponential form by using the SUBST function to replace z with SHIFT ALPHA Z SHIFT = SHIFT SHIFT i SHIFT ALPHA t SHIFT Note: iii.
iv. And, having linearized it, we store it as a variable M in case we need to refer to it again. ALPHA M ENTER When the STORE command is executed the expression is echoed back to the screen. Press SHIFT ALPHA CLEAR to clear the screen. At this point, any reference to M will be equivalent to the expression shown right. Note that the screen image above is in small font purely to allow the entire expression to be seen. Your screen will not be unless you’ve selected small font earlier. v.
vi. Clear the current contents of the screen using SHIFT ALPHA CLEAR. Then perform the same definition assignment for Y1(t) as the imaginary part of M. ALPHA M MATH ENTER ENTER Note: As before, the button jumps to the first function with that letter (L), in this case IM. ENTER SHIFT = ALPHA Y 1 ( ALPHA SHIFT T SHIFT vii. SHIFT ENTER In order to show that the function is symmetrical about the x axis we need to show that (X1(-t),Y1(-t)) is equivalent algebraically to (X1(t), -Y1(t)).
viii. We can see symmetry visually if the function is graphed and the aplet best suited to this is the Parametric aplet. When a function is sent to the Parametric aplet the real part is sent to the x and the imaginary part to the y component of the parametric equation selected. Calculator Tip Although X1 and Y1 were chosen as names for the functions defined earlier this has no relevance for the pasting into the Parametric aplet. They could just as easily have been defined as Fred(t) and Jim(t).
One additional step is required. For some reason the Parametric aplet doesn’t seem to properly accept the functions. If you press PLOT now you will receive the “Undefined Name” error. The trick is to . Don’t make any changes, just press ENTER or . highlight each function in turn and press This seems to make the calculator accept that it is a valid function, since it has had the chance to examine the function as if you had typed it in yourself. Pressing PLOT at this point will produce the screen shown right.
Example 10: First order linear differential equation In order to illustrate the use of the CAS help pages discussed on page 361 we will the example provided in them rather than making one up. The functions available for solving differential equations are DESOLVE and LDEC. Begin by pressing SHIFT SYNTAX to open the help menu and scroll down to the DESOLVE function as shown right. Pressing will jump immediately to the ‘D’s. Pressing ENTER will display the screen shown right.
The CAS menus There are a variety of different places that functions are stored, often overlapping for greater convenience. The Screen menus , On the main screen of the CAS you will see six labels of , , , and . The menu is , discussed beginning on page 335. The others each pop up a menu of functions that are the most commonly used ones in each category but there are others that you can access via the MATH button or the SHIFT CMDS menu. The screen menu functions are listed in their categories below: Algb.
The MATH menu Pressing the MATH button in the CAS has a different effect than in the HOME screen. In the HOME screen the result is as shown right. As was discussed on page 165, these commands are broken into broad groups of MTH (mathematical), CONS (constants) and CAS. The default set is the main mathematical functions shown right because they are the ones most often used in the HOME view but there are other menus accessible via the keys at the bottom of the screen (see page 165).
The CMDS menu All of the functions listed in the table on the previous page are also available via the SHIFT CMDS menu where they are in alphabetical order rather than categorized. In addition to these there are also a number of other functions which appear only in that menu.
On-line help One of the most helpful features of the hp 40gs CAS is the on-line help provided by the SYNTAX button (SHIFT 2). Pressing SYNTAX will display the menu shown to the right. You can use the up or down arrow keys to scroll through this list but it is very extensive and it is far quicker to press the button corresponding to the first letter of the function on which you require information.
Configuring the CAS In most of the examples which precede this section it was assumed that the CAS was in its default settings. Two versions of the configuration screen are shown to the right. These screens can be accessed within the CAS in a number of ways: • • • • from the HOME screen, pressing SHIFT by pressing SHIFT MODES within the CAS by pressing SHIFT SYMB within the CAS via the CFG menu entry shown right. This appears as the first entry on most of the menus within the CAS.
Below the title bar you can see the first section of a series of alternatives which let you manipulate the configuration. Most alternatives are toggles having only two values. For example, choosing Complex and pressing ENTER will cause the menu to momentarily disappear and then re-display with the new setting of Real. Pressing ENTER again will revert back to Complex.
Num. Factor mode When the Num. Factor setting is selected, approximate roots are used when factoring. For example, is irreducible over the integers but has approximate roots over the reals. With Num. Factor set, the approximate roots are returned. [Default: unselected] Comment: Some polynomials, particularly ones with complex coefficients, will not factorize using the FACTOR function without being in Num. Factor mode. See the example on page 346. Complex vs.
Increasing-powers mode When Increasing-powers mode is selected, polynomials will be listed so that the terms will have increasing powers of the independent variable (which is the opposite to how polynomials are normally written). [Default: unselected.] Comment: Who cares really? Rigorous setting When Rigorous mode is selected, any algebraic expression of the form |X|, i.e., the absolute value of X, is not simplified to X. [Default: selected.
Tips & Tricks - CAS • In CAS, angles are always expressed in radians and no other setting is possible. When you are the calculator HOME screen, you can use the MODES view to change this default but this does not affect the CAS. • Step by step mode might appear to be quite useful for students but is quite limited in what it actually displays. Those hoping for the CAS to show complete working such as that required by a teacher will be disappointed.