<<

CAS, An introduction to the HP

Background

Any mathematician will quickly appreciate the advantages offered by a CAS, or Computer Algebra System 1, which allows the user to perform complex symbolic algebraic manipulations on the calculator. Algebraic integration by parts and by substitution, the solution of differential equations, inequalities, simultaneous equations with algebraic or complex coefficients, the evaluation of limits and many other problems can be solved quickly and easily using a CAS. Importantly, solutions can be obtained as exact values such as 5− 1 , 2≤x < 5 or 4π rather than the usual decimal values given by numeric methods of successive approximation. Values can be displayed to almost any degree of accuracy required, allowing the user to view, for example, the exact value of a number such as 100 factorial.

The HP CAS

The HP CAS system was created by Bernard Parisse, Université de Grenoble, for the HP 48Gii and HP 49g+ calculator 2. The HP CAS system offers the user a vast array of functions and abilities as well as an easy user interface which displays equations as they appear on the page.

It also includes the ability to display many algebraic calculations in ‘step-by-step’ mode, making it an invaluable teaching tool in universities and schools. Functions are grouped by category and accessed via choose boxes of menus at the bottom of the screen.

Copyright© 2005, Applications in Mathematics Learning to use the CAS

Learning to use the CAS is very easy but, as with any powerful tool, truly effective use requires familiarity and time. On the HP the learning process is greatly aided by an incredibly detailed help system which offers a detailed explanation, in both French and English, of the syntax of each function. These help pages include cross references to related functions and examples which can be pasted into the CAS with the press of a single button. Simply press HELP when selecting the function in a choose box to access the help.

Some introductory examples

The examples which follow are designed to illustrate the functioning of the CAS on the HP 48Gii and HP 49G+.

In this text buttons which appear on the keyboard are represented as far as possible using images of the button: ƒor 4. When the function is ‘shifted’, appearing above or below a key, then it is written as, for example, @Oor ~t. Screen menu buttons such as the ones on the right are shown as TOOL or SIMP . A choice from a menu is shown as ISOLATE or LINSOLVE .

In the examples which follow it will be assumed that the CAS is in its default settings. To ensure this, enter the MODE/CAS settings by pressing HCAS , and, ensure that the settings are similar to the ones on the right. Then choose OK twice to validate the choice and quit the mode dialog box.

On the calculator, enter the equation writer, the best environment to use the Computer Algebra System by pressing @O. You should see the screen right. To exit again, press $.

Copyright© 2005, Applications in Mathematics Example 1: Algebraic entry and manipulation

The task we will be performing in this example will be to expand and then factorise the expression ( x−4)( x +−− 5) ( x 40 ) over the set of complex numbers.

• Press X-4 then press to highlight this expression.

Multiply this expression by (4+5) by pressing *!ÜX+5.

Highlight the entire binomial expression by pressing ! then append another expression to this by pressing -! ÜX-40

At this point the screen should appear as shown on the right.

• 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 on the right.

• Press SIMP to simplify this portion of the expression by expanding the brackets without affecting the rest of the expression.

• Now simplify the entire expression.

Press ,SIMP . The result is shown on the right.

Copyright© 2005, Applications in Mathematics • We now wish to factorise this expression. It is already highlighted so choosing the FACTOR command will apply it to the entire expression as we require.

Press the P key, choose ALGEBRA and then FACTOR from the menu that appears and press ` (note, you can also use the FACTOR menu as a shortcut). The screen should now appear as shown to the right. The result will simply be a return of the expression x2 + 20 . The reason for this is that the default setting of the CAS is to only factorise over the set of real numbers. This needs to be altered using the CAS configuration menu.

• To change the CAS configuration, press the ` key twice (only once in RPN mode) and then enter the CAS configuration screen by pressing H CAS and set the complex option as displayed on the screen on the right. Validate by pressing ` twice. Then press the key to continue editing the equation in the equation writer.

• Re-apply the factor command to the expression to get the result shown on the right.

Copyright© 2005, Applications in Mathematics Example 2: Linear systems of equations

In this task we will use the default setting of “step-by-step” mode to show working as we solve the 3 by 3 system of linear equations with algebraic coefficients shown right. If desired, this default setting can later be changed back to non step by step if it is more convenient. Note, this example assumes that you are in algebraic mode.

• From the home screen, set the CAS in step by step mode by selecting the step by step option in the CAS configuration screen (press H and CAS ) and set the options as see on the right. Quit by pressing ` twice.

• From the P menu, select SOLVER and then LINSOLVE (P5`2`)

• Then, enter the matrix writer to enter the 3 equations: press !²and begin by entering the expression 3x+ y + 2 z with the following key sequence. 3*X+~y+2*~z‚ Å5` (press WID › twice to enlarge the display and get the screen on the right)

• Enter the 2 other equations by pressing: X- 2*~y+~z‚Å3` to enter x-2*y+z=3 and 4*X+6*~y+~p* ~z ‚Å~q`

• Exit the matrix writer by pressing ` and return to the command line. Your screen should be as displayed on the right.

Copyright© 2005, Applications in Mathematics • Press ‚í to enter the 2 nd argument to LINSOLVE (the variable to solve for) and then !² to return to the equation writer.

Enter the 3 variable to solve for by pressing ~X`~y`~z` and validate by pressing `again as shown on the screen on the right.

• Execute the LINSOLVE command by pressing ` one more time. The Computer Algebra system will display a series of screen (going to the next one on each press of OK ) that show the steps used by the CAS to reduce the matrix. Note, when arrows are present on the border of the screen such as in the 6 th and 7 th screen, this indicate that the user can move the screen to see the whole matrix by using the arrow keys.

• The best way to look at the final result (obtained by pressing OK on the last screen) is to use the viewer, accessible by pressing I VIEW . Then press ‚ to go to the end of the expression and scroll left a little using to view the result for the other unknown.

Copyright© 2005, Applications in Mathematics

Further information

More information on the CAS can be found in your manual. In addition to this a detailed manual in both French and English by Renée de Graeve, a colleague of Bernard Parisse, can be found on the web 3.

1 CAS systems for personal computers began to appear in the 1970s as an outgrowth of research into artificial intelligence. Current market leading products are Mathematica ® and ®. 2 The HP CAS ancestors were two programs for the HP48: Erable and ALG48, by Mika Heiskanen and Claude-Nicolas Fiechter, both available at www.hpcalc.org . The part deriving from Erable is also available as a free for the HP49G at www-fourier.ujf-grenoble.fr/~parisse/english.html#hpcas . 3 Documentation by Renée De Graeve, in both French and English, explaining the use of the HP CAS in considerably more detail than appears in the calculator manual can be found at www-fourier.ujf-grenoble.fr/~parisse/english.html#hpcas .

Copyright© 2005, Applications in Mathematics