HPg graphing calculator
user’s guide

H
Edition 1
HP part number F2229AA-90006

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 WITHOUTNOTICE. HEWLETT-PACKARD COMPANY MAKES NO WARRANTY
OF ANY KIND WITH REGARD TO THIS MANUAL, INCLUDING, BUT
NOT
LIMITEDTO,THEIMPLIEDWARRANTIESOFMERCHANTABILITY, NON-INFRINGEMENT AND FITNESS FOR A
PARTICULAR PURPOSE.
HEWLETT-PACKARD CO. SHALL NOT BE LIABLE FOR ANY ERRORSOR FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES INCONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE
OF THIS MANUAL OR THE EXAMPLES CONTAINED HEREIN.

© 2003, 2006 Hewlett-Packard Development Company, L.P.
Reproduction, adaptation, or translation of this manual is prohibited without
prior written permission of Hewlett-Packard Company, except as allowed under
the copyright laws.

Hewlett-Packard Company
16399 West Bernardo Drive
MS 8-600
San Diego, CA 92127-1899
USA

Printing History
Edition 1

April 2006

Preface
You have in your hands a compact symbolic and numerical computer that will
facilitate calculation and mathematical analysis of problems in a variety of
disciplines, from elementary mathematics to advanced engineering and science
subjects. Although referred to as a calculator, because of its compact format
resembling typical hand-held calculating devices, the HP 50g should bethought of as a graphics/programmable hand-held computer.
The HP 50g can be operated in two different calculating modes, the Reverse
Polish Notation (RPN) mode and the Algebraic (ALG) mode (see page 1-13 foradditional details). The RPN mode was incorporated into calculators to makecalculations more efficient. In this mode, the operands in an operation (e.g., ‘2’and ‘3’ in the operation ‘2+3’) are entered into the calculator screen, referred
to as the stack, and then the operator (e.g., ‘+’ in the operation ‘2+3’) isentered to complete the operation. The ALG mode, on the other hand, mimics
the way you type arithmetic expressions in paper. Thus, the operation ‘2+3’, in
ALG mode, will be entered in the calculator by pressing the keys ‘2’, ‘+’, and‘3’, in that order. To complete the operation we use the ENTER key. Examples
of applications of the different functions and operations in this calculator are
illustrated in this user’s guide in both modes.
This guide contains examples that illustrate the use of the basic calculator
functions and operations. The chapters are organized by subject in order ofdifficulty. Starting with the setting of calculator modes and display options, andcontinuing with real and complex number calculations, operations with lists,
vectors, and matrices, detailed examples of graph applications, use of strings,
basic programming, graphics programming, string manipulation, advanced
calculus and multivariate calculus applications, advanced differential equations
applications (including Laplace transform, and Fourier series and transforms),
and probability and statistic applications.

For symbolic operations the calculator includes a powerful Computer Algebraic
System (CAS) that lets you select different modes of operation, e.g., complex
numbers vs. real numbers, or exact (symbolic) vs. approximate (numerical)
mode.

The display can be adjusted to provide textbook-type expressions,which can be useful when working with matrices, vectors, fractions,summations, derivatives, and integrals.

The high-speed graphics of thecalculator produce complex figures in very little time.
Thanks to the infrared port, the RS232 port, and the USB port and cableprovided with your calculator, you can connect your calculator with othercalculators or computers. This allows for fast and efficient exchange ofprograms and data with other calculators or computers.

The calculator

provides a flash memory card port to facilitate storage and exchange of datawith other users.
The programming capabilities of the calculator allow you or other users todevelop efficient applications for specific purposes. Whether it is advanced
mathematical applications, specific problem solution, or data logging, theprogramming languages available in your calculator make it into a very
versatile computing device.
We hope your calculator will become a faithful companion for your school andprofessional applications.

Table of contents
Chapter 1 - Getting started ,1-1
Basic Operations ,1-1
Batteries ,1-1
Turning the calculator on and off ,1-2
Adjusting the display contrast ,1-2
Contents of the calculator’s display ,1-2
Menus ,1-3
SOFT menus vs. CHOOSE boxes ,1-4
Selecting SOFT menus or CHOOSE boxes ,1-5
The TOOL menu ,1-7
Setting time and date ,1-7
Introducing the calculator’s keyboard ,1-11
Selecting calculator modes ,1-12
Operating Mode ,1-13
Number Format and decimal dot or comma ,1-17
Angle Measure ,1-23
Coordinate System ,1-24
Beep, Key Click, and Last Stack ,1-25
Selecting CAS settings ,1-26
Selecting Display modes ,1-27
Selecting the display font ,1-27
Selecting properties of the line editor ,1-28
Selecting properties of the Stack ,1-28
Selecting properties of the equation writer (EQW) ,1-29
Selecting the size of the header ,1-30
Selecting the clock display ,1-30

Page TOC-1

Chapter 2 - Introducing the calculator ,2-1
Calculator objects ,2-1
Editing expressions on the screen ,2-3
Creating arithmetic expressions ,2-3
Editing arithmetic expressions ,2-6
Creating algebraic expressions ,2-7
Editing algebraic expressions ,2-8
Using the Equation Writer (EQW) to create expressions ,2-10
Creating arithmetic expressions ,2-11
Editing arithmetic expressions ,2-17
Creating algebraic expressions ,2-19
Editing algebraic expressions ,2-21
Creating and editing summations, derivatives, and integrals ,2-29
Organizing data in the calculator ,2-33
Functions for manipulation of variables ,2-34
The HOME directory ,2-35
The CASDIR sub-directory ,2-35
Typing directory and variable names ,2-37
Creating subdirectories ,2-39
Moving among subdirectories ,2-43
Deleting subdirectories ,2-43
Variables ,2-47
Creating variables ,2-47
Checking variables contents ,2-52
Replacing the contents of variables ,2-55
Copying variables ,2-56
Reordering variables in a directory ,2-59
Moving variables using the FILES menu ,2-60
Deleting variables ,2-61
UNDO and CMD functions ,2-62
Flags ,2-64
Example of flag setting: general solutions vs. principal value ,2-65

Page TOC-2

Other flags of interest ,2-66
CHOOSE boxes vs. Soft MENU ,2-67
Selected CHOOSE boxes ,2-69

Chapter 3 - Calculation with real numbers ,3-1
Checking calculators settings ,3-1
Checking calculator mode ,3-2
Real number calculations ,3-2
Changing sign of a number, variable, or expression ,3-3
The inverse function ,3-3
Addition, subtraction, multiplication, division ,3-3
Using parentheses ,3-4Absolute value function ,3-4
Squares and square roots ,3-5
Powers and roots ,3-5
Base-10 logarithms and powers of 10 ,3-5
Using powers of 10 in entering data ,3-6
Natural logarithms and exponential function ,3-6
Trigonometric functions ,3-6
Inverse trigonometric functions ,3-6
Differences between functions and operators ,3-7
Real number functions in the MTH menu ,3-7
Hyperbolic functions and their inverses ,3-9
Real number functions ,3-11
Special functions ,3-14
Calculator constants ,3-16
Operations with units ,3-17
The UNITS menu ,3-17
Available units ,3-19
Converting to base units ,3-22
Attaching units to numbers ,3-23
Operations with units ,3-25
Units manipulation tools ,3-27

Page TOC-3

Physical constants in the calculator ,3-29
Special physical functions ,3-32
Function ZFACTOR ,3-32
Function F0λ ,3-33
Function SIDENS ,3-33
Function TDELTA ,3-33
Function TINC ,3-34
Defining and using functions ,3-34
Functions defined by more than one expression ,3-36
The IFTE function ,3-36
Combined IFTE functions ,3-37

Chapter 4 - Calculations with complex numbers ,4-1
Definitions ,4-1
Setting the calculator to COMPLEX mode ,4-1
Entering complex numbers ,4-2
Polar representation of a complex number ,4-3
Simple operations with complex numbers ,4-4
Changing sign of a complex number ,4-5
Entering the unit imaginary number ,4-5
The CMPLX menus ,4-5
CMPLX menu through the MTH menu ,4-6
CMPLX menu in keyboard ,4-7
Functions applied to complex numbers ,4-8
Functions from the MTH menu ,4-9
Function DROITE: equation of a straight line ,4-9

Chapter 5 - Algebraic and arithmetic operations ,5-1
Entering algebraic objects ,5-1
Simple operations with algebraic objects ,5-1
Functions in the ALG menu ,5-3
COLLECT ,5-4
EXPAND ,5-4

Page TOC-4

FACTOR ,5-5
LNCOLLECT ,5-5
LIN ,5-5
PARTFRAC ,5-5
SOLVE ,5-5
SUBST ,5-5
TEXPAND ,5-5
Other forms of substitution in algebraic expressions ,5-6
Operations with transcendental functions ,5-7
Expansion and factoring using log-exp functions ,5-7
Expansion and factoring using trigonometric functions ,5-8
Functions in the ARITHMETIC menu ,5-9
DIVIS!,5-9
FACTORS ,5-9
LGCD!,5-10
PROPFRAC ,5-10
SIMP2 ,5-10
INTEGER menu ,5-10
POLYNOMIAL menu ,5-10
MODULO menu ,5-11
Applications of the ARITHMETIC menu ,5-12
Modular arithmetic ,5-12
Finite arithmetic rings in the calculator ,5-14
Polynomials ,5-17
Modular arithmetic with polynomials ,5-17
The CHINREM function ,5-17
The EGCD function ,5-18
The GCD function ,5-18
The HERMITE function ,5-18
The HORNER function ,5-19
The variable VX ,5-19
The LAGRANGE function ,5-19
The LCM function ,5-20
The LEGENDRE function ,5-20
The PCOEF function ,5-21

Page TOC-5

The PROOT function ,5-21
The PTAYL function ,5-21
The QUOT and REMAINDER functions ,5-21
The EPSX0 function and the CAS variable EPS ,5-22
The PEVAL function ,5-22
The TCHEBYCHEFF function ,5-22
Fractions ,5-23
The SIMP2 function ,5-23
The PROPFRAC function ,5-23
The PARTFRAC function ,5-23
The FCOEF function ,5-24
The FROOTS function ,5-24
Step-by-step operations with polynomials and fractions ,5-25
The CONVERT Menu and algebraic operations ,5-26
UNITS convert menu (Option 1) ,5-26
BASE convert menu (Option 2) ,5-27
TRIGONOMETRIC convert menu (Option 3) ,5-27
MATRICES convert menu (Option 5) ,5-27
REWRITE convert menu (Option 4) ,5-27

Chapter 6 - Solution to single equations ,6-1
Symbolic solution of algebraic equations ,6-1
Function ISOL ,6-1
Function SOLVE ,6-2
Function SOLVEVX ,6-3
Function ZEROS ,6-4
Numerical solver menu ,6-5
Polynomial Equations ,6-6
Financial calculations ,6-9
Solving equations with one unknown through NUM.SLV ,6-13
The SOLVE soft menu ,6-26
The ROOT sub-menu ,6-26
Function ROOT ,6-26

Page TOC-6

Variable EQ ,6-26
The SOLVR sub-menu ,6-26
The DIFFE sub-menu ,6-29
The POLY sub-menu ,6-29
The SYS sub-menu ,6-30
The TVM sub-menu ,6-30

Chapter 7 - Solving multiple equations ,7-1
Rational equation systems ,7-1
Example 1 – Projectile motion ,7-1
Example 2 – Stresses in a thick wall cylinder ,7-2
Example 3 - System of polynomial equations ,7-4
Solution to simultaneous equations with MSLV ,7-4
Example 1 - Example from the help facility ,7-5
Example 2 - Entrance from a lake into an open channel ,7-5
Using the Multiple Equation Solver (MES) ,7-9
Application 1 - Solution of triangles ,7-9
Application 2 - Velocity and acceleration in polar coordinates ,7-17

Chapter 8 - Operations with lists ,8-1
Definitions ,8-1
Creating and storing lists ,8-1
Composing and decomposing lists ,8-2
Operations with lists of numbers ,8-2
Changing sign ,8-3
Addition, subtraction, multiplication, division ,8-3
Real number functions from the keyboard ,8-4
Real number functions from the MTH menu ,8-5
Examples of functions that use two arguments ,8-6
Lists of complex numbers ,8-7
Lists of algebraic objects ,8-8
The MTH/LIST menu ,8-8
Manipulating elements of a list ,8-10

Page TOC-7

List size ,8-10
Extracting and inserting elements in a list ,8-10
Element position in the list ,8-11
HEAD and TAIL functions ,8-11
The SEQ function ,8-11
The MAP function ,8-12
Defining functions that use lists ,8-13
Applications of lists ,8-15
Harmonic mean of a list ,8-15
Geometric mean of a list ,8-16
Weighted average ,8-17
Statistics of grouped data ,8-18

Chapter 9 - Vectors ,9-1
Definitions ,9-1
Entering vectors ,9-2
Typing vectors in the stack ,9-2
Storing vectors into variables ,9-3
Using the Matrix Writer (MTRW) to enter vectors ,9-3
Building a vector with ARRY ,9-6
Identifying, extracting, and inserting vector elements ,9-7
Simple operations with vectors ,9-9
Changing sign ,9-9
Addition, subtraction ,9-9Multiplication by a scalar, and division by a scalar ,9-9Absolute value function ,9-10
The MTH/VECTOR menu ,9-10
Magnitude ,9-10
Dot product ,9-11
Cross product ,9-11
Decomposing a vector ,9-11
Building a two-dimensional vector ,9-12
Building a three-dimensional vector ,9-12

Page TOC-8

Changing coordinate system ,9-12
Application of vector operations ,9-15
Resultant of forces ,9-15
Angle between vectors ,9-15
Moment of a force ,9-16
Equation of a plane in space ,9-17
Row vectors, column vectors, and lists ,9-18
Function OBJ ,9-19
Function LIST ,9-20
Function DROP ,9-20
Transforming a row vector into a column vector ,9-20
Transforming a column vector into a row vector ,9-21
Transforming a list into a vector ,9-23
Transforming a vector (or matrix) into a list ,9-24

Chapter 10!- Creating and manipulating matrices,10-1

Definitions ,10-1
Entering matrices in the stack ,10-2
Using the Matrix Writer ,10-2
Typing in the matrix directly into the stack ,10-3
Creating matrices with calculator functions ,10-3
Functions GET and PUT ,10-6
Functions GETI and PUTI ,10-6
Function SIZE ,10-7
Function TRN ,10-7
Function CON ,10-8
Function IDN ,10-9
Function RDM ,10-9
Function RANM ,10-11
Function SUB ,10-11
Function REPL ,10-12
Function DIAG ,10-12
Function DIAG ,10-13

Page TOC-9

Function VANDERMONDE ,10-13
Function HILBERT ,10-14
A program to build a matrix out of a number of lists ,10-14
Lists represent columns of the matrix ,10-15
Lists represent rows of the matrix ,10-17
Manipulating matrices by columns ,10-17
Function COL ,10-18
Function COL ,10-19
Function COL+ ,10-19
Function COL- ,10-20
Function CSWP ,10-20
Manipulating matrices by rows ,10-21
Function ROW ,10-22
Function ROW ,10-23
Function ROW+ ,10-23
Function ROW- ,10-24
Function RSWP ,10-24
Function RCI ,10-25
Function RCIJ ,10-25

Chapter 11 - Matrix Operations and Linear Algebra ,11-1
Operations with matrices ,11-1
Addition and subtraction ,11-2
Multiplication ,11-2
Characterizing a matrix (The matrix NORM menu) ,11-7
Function ABS ,11-8
Function SNRM ,11-8
Functions RNRM and CNRM ,11-9
Function SRAD ,11-10
Function COND ,11-10
Function RANK ,11-11
Function DET ,11-12
Function TRACE ,11-14

Page TOC-10

Function TRAN ,11-15
Additional matrix operations (The matrix OPER menu) ,11-15
Function AXL ,11-16
Function AXM ,11-16
Function LCXM ,11-16
Solution of linear systems ,11-17
Using the numerical solver for linear systems ,11-18
Least-square solution (function LSQ) ,11-24
Solution with the inverse matrix ,11-27
Solution by “division” of matrices ,11-27
Solving multiple set of equations with the same coefficient matrix ,11-28
Gaussian and Gauss-Jordan elimination ,11-29
Step-by-step calculator procedure for solving linear systems ,11-38
Solution to linear systems using calculator functions ,11-41
Residual errors in linear system solutions (Function RSD) ,11-44
Eigenvalues and eigenvectors ,11-45
Function PCAR ,11-45
Function EGVL ,11-46
Function EGV ,11-46
Function JORDAN ,11-47
Function MAD ,11-48
Matrix factorization ,11-49
Function LU ,11-50
Orthogonal matrices and singular value decomposition ,11-50
Function SVD ,11-50
Function SVL ,11-51
Function SCHUR ,11-51
Function LQ ,11-51
Function QR ,11-52
Matrix Quadratic Forms ,11-52
The QUADF menu ,11-52
Function AXQ ,11-53

Page TOC-11

Function QXA ,11-53
Function SYLVESTER ,11-54
Function GAUSS ,11-54
Linear Applications ,11-54
Function IMAGE ,11-55
Function ISOM ,11-55
Function KER ,11-56
Function MKISOM ,11-56

Chapter 12 - Graphics ,12-1
Graphs options in the calculator ,12-1
Plotting an expression of the form y = f(x) ,12-2
Some useful PLOT operations for FUNCTION plots ,12-5
Saving a graph for future use ,12-7
Graphics of transcendental functions ,12-8
Graph of ln(X) ,12-8
Graph of the exponential function ,12-10
The PPAR variable ,12-11
Inverse functions and their graphs ,12-11
Summary of FUNCTION plot operation ,12-13
Plots of trigonometric and hyperbolic functions ,12-16
Generating a table of values for a function ,12-17
The TPAR variable ,12-17
Plots in polar coordinates ,12-18
Plotting conic curves ,12-20
Parametric plots ,12-22
Generating a table for parametric equations ,12-25
Plotting the solution to simple differential equations ,12-26
Truth plots ,12-28
Plotting histograms, bar plots, and scatter plots ,12-29
Bar plots ,12-29
Scatter plots ,12-31
Slope fields ,12-33

Page TOC-12

Fast 3D plots ,12-34
Wireframe plots ,12-36
Ps-Contour plots ,12-38
Y-Slice plots ,12-39
Gridmap plots ,12-40
Pr-Surface plots ,12-41
The VPAR variable ,12-42
Interactive drawing ,12-43
DOT+ and DOT- ,12-44
MARK ,12-44
LINE ,12-44
TLINE ,12-45
BOX ,12-45
CIRCL ,12-45
LABEL ,12-45
DEL ,12-46
ERASE ,12-46
MENU ,12-46
SUB ,12-46
REPL ,12-46
PICT ,12-46
X,Y ,12-47
Zooming in and out in the graphics display ,12-47
ZFACT, ZIN, ZOUT, and ZLAST ,12-47
BOXZ ,12-48
ZDFLT, ZAUTO ,12-48
HZIN, HZOUT, VZIN and VZOUT ,12-48
CNTR ,12-48
ZDECI ,12-48
ZINTG ,12-48
ZSQR ,12-49
ZTRIG ,12-49

Page TOC-13

The SYMBOLIC menu and graphs ,12-49
The SYMB/GRAPH menu ,12-50
Function DRAW3DMATRIX ,12-52

Chapter 13 - Calculus Applications ,13-1
The CALC (Calculus) menu ,13-1
Limits and derivatives ,13-1
Function lim ,13-2
Derivatives ,13-3
Functions DERIV and DERVX ,13-3
The DERIV&INTEG menu ,13-4
Calculating derivatives with ∂ ,13-4
The chain rule ,13-6
Derivatives of equations ,13-7
Implicit derivatives ,13-7
Application of derivatives ,13-7
Analyzing graphics of functions ,13-8
Function DOMAIN ,13-9
Function TABVAL ,13-9
Function SIGNTAB ,13-10
Function TABVAR ,13-10
Using derivatives to calculate extreme points ,13-12
Higher order derivatives ,13-13
Anti-derivatives and integrals ,13-14
Functions INT, INTVX, RISCH, SIGMA and SIGMAVX ,13-14
Definite integrals ,13-15
Step-by-step evaluation of derivatives and integrals ,13-16
Integrating an equation ,13-17
Techniques of integration ,13-18
Substitution or change of variables ,13-18
Integration by parts and differentials ,13-19
Integration by partial fractions ,13-20
Improper integrals ,13-20

Page TOC-14

Integration with units ,13-21
Infinite series ,13-22
Taylor and Maclaurin’s series ,13-23
Taylor polynomial and reminder ,13-23
Functions TAYLR, TAYLR0, and SERIES ,13-24

Chapter 14 - Multi-variate Calculus Applications ,14-1
Multi-variate functions ,14-1
Partial derivatives ,14-1
Higher-order derivatives ,14-3
The chain rule for partial derivatives ,14-4
Total differential of a function z = z(x,y) ,14-5
Determining extrema in functions of two variables ,14-5
Using function HESS to analyze extrema ,14-6
Multiple integrals ,14-8
Jacobian of coordinate transformation ,14-9
Double integral in polar coordinates ,14-9

Chapter 15 - Vector Analysis Applications ,15-1
Definitions ,15-1
Gradient and directional derivative ,15-1
A program to calculate the gradient ,15-2
Using function HESS to obtain the gradient ,15-2
Potential of a gradient ,15-3
Divergence ,15-4
Laplacian ,15-4
Curl ,15-5
Irrotational fields and potential function ,15-5Vector potential ,15-6

Chapter 16 - Differential Equations ,16-1
Basic operations with differential equations ,16-1
Entering differential equations ,16-1

Page TOC-15

Checking solutions in the calculator ,16-2
Slope field visualization of solutions ,16-3
The CALC/DIFF menu ,16-3
Solution to linear and non-linear equations ,16-4
Function LDEC ,16-4
Function DESOLVE ,16-7
The variable ODETYPE ,16-8
Laplace Transforms ,16-10
Definitions ,16-10
Laplace transform and inverses in the calculator ,16-11
Laplace transform theorems ,16-12
Dirac’s delta function and Heaviside’s step function ,16-15
Applications of Laplace transform in the solution of linear ODEs ,16-17
Fourier series ,16-26
Function FOURIER ,16-28
Fourier series for a quadratic function ,16-28
Fourier series for a triangular wave ,16-34
Fourier series for a square wave ,16-38
Fourier series applications in differential equations ,16-40
Fourier Transforms ,16-42
Definition of Fourier transforms ,16-45
Properties of the Fourier transform ,16-47
Fast Fourier Transform (FFT) ,16-47
Examples of FFT applications ,16-48
Solution to specific second-order differential equations ,16-51
The Cauchy or Euler equation ,16-51
Legendre’s equation ,16-51
Bessel’s equation ,16-52
Chebyshev or Tchebycheff polynomials ,16-55
Laguerre’s equation ,16-56
Weber’s equation and Hermite polynomials ,16-57
Numerical and graphical solutions to ODEs ,16-57

Page TOC-16

Numerical solution of first-order ODE ,16-57
Graphical solution of first-order ODE ,16-59
Numerical solution of second-order ODE ,16-61
Graphical solution for a second-order ODE ,16-63
Numerical solution for stiff first-order ODE ,16-65
Numerical solution to ODEs with the SOLVE/DIFF menu ,16-67
Function RKF ,16-67
Function RRK ,16-68
Function RKFSTEP ,16-69
Function RRKSTEP ,16-70
Function RKFERR ,16-71
Function RSBERR ,16-71

Chapter 17 - Probability Applications ,17-1
The MTH/PROBABILITY.. sub-menu - part 1 ,17-1
Factorials, combinations, and permutations ,17-1
Random numbers ,17-2
Discrete probability distributions ,17-3
Binomial distribution ,17-4
Poisson distribution ,17-5
Continuous probability distributions ,17-6
The gamma distribution ,17-6
The exponential distribution ,17-6
The beta distribution ,17-7
The Weibull distribution ,17-7
Functions for continuous distributions ,17-7
Continuous distributions for statistical inference ,17-9
Normal distribution pdf ,17-9
Normal distribution cdf ,17-10
The Student-t distribution ,17-10
The Chi-square distribution ,17-11
The F distribution ,17-12
Inverse cumulative distribution functions ,17-13

Page TOC-17

Chapter 18 - Statistical Applications ,18-1
Pre-programmed statistical features ,18-1
Entering data ,18-1
Calculating single-variable statistics ,18-2
Obtaining frequency distributions ,18-5
Fitting data to a function y = f(x) ,18-10
Obtaining additional summary statistics ,18-13
Calculation of percentiles ,18-14
The STAT soft menu ,18-15
The DATA sub-menu ,18-16
The ΣPAR sub-menu ,18-16
The 1VAR sub menu ,18-17
The PLOT sub-menu ,18-17
The FIT sub-menu ,18-18
The SUMS sub-menu ,18-18
Example of STAT menu operations ,18-19
Confidence intervals ,18-22
Estimation of Confidence Intervals ,18-23
Definitions ,18-23
Confidence intervals for the population mean when the population variance is known ,18-24
Confidence intervals for the population mean when the population variance is unknown ,18-24
Confidence interval for a proportion ,18-25
Sampling distribution of differences and sums of statistics ,18-25
Confidence intervals for sums and differences of mean values ,18-26
Determining confidence intervals ,18-27
Confidence intervals for the variance ,18-33
Hypothesis testing ,18-35
Procedure for testing hypotheses ,18-35
Errors in hypothesis testing ,18-36
Inferences concerning one mean ,18-37
Inferences concerning two means ,18-39

Page TOC-18

Paired sample tests ,18-41
Inferences concerning one proportion ,18-41
Testing the difference between two proportions ,18-42
Hypothesis testing using pre-programmed features ,18-43
Inferences concerning one variance ,18-47
Inferences concerning two variances ,18-48
Additional notes on linear regression ,18-50
The method of least squares ,18-50
Additional equations for linear regression ,18-51
Prediction error ,18-52
Confidence intervals and hypothesis testing in linear regression ,18-52
Procedure for inference statistics for linear regression using the calculator ,18-54
Multiple linear fitting ,18-57
Polynomial fitting ,18-59
Selecting the best fitting ,18-62

Chapter 19 - Numbers in Different Bases ,19-1
Definitions ,19-1
The BASE menu ,19-1
Functions HEX, DEC, OCT, and BIN ,19-2
Conversion between number systems ,19-3
Wordsize ,19-4
Operations with binary integers ,19-4
The LOGIC menu ,19-5
The BIT menu ,19-6
The BYTE menu ,19-7
Hexadecimal numbers for pixel references ,19-7

Chapter 20 - Customizing menus and keyboard ,20-1
Customizing menus ,20-1
The PRG/MODES/MENU menu ,20-1
Menu numbers (RCLMENU and MENU functions) ,20-2

Page TOC-19

Custom menus (MENU and TMENU functions) ,20-2
Menu specification and CST variable ,20-4
Customizing the keyboard ,20-5
The PRG/MODES/KEYS sub-menu ,20-5
Recall current user-defined key list ,20-6
Assign an object to a user-defined key ,20-6
Operating user-defined keys ,20-7
Un-assigning a user-defined key ,20-7
Assigning multiple user-defined keys ,20-7

Chapter 21 - Programming in User RPL language ,21-1
An example of programming ,21-1
Global and local variables and subprograms ,21-2
Global Variable Scope ,21-4
Local Variable Scope ,21-5
The PRG menu ,21-5
Navigating through RPN sub-menus ,21-6
Functions listed by sub-menu ,21-7
Shortcuts in the PRG menu ,21-9
Keystroke sequence for commonly used commands ,21-10
Programs for generating lists of numbers ,21-13
Examples of sequential programming ,21-15
Programs generated by defining a function ,21-15
Programs that simulate a sequence of stack operations ,21-17
Interactive input in programs ,21-19
Prompt with an input string ,21-21
A function with an input string ,21-22
Input string for two or three input values ,21-24
Input through input forms ,21-27
Creating a choose box ,21-31
Identifying output in programs ,21-33
Tagging a numerical result ,21-33
Decomposing a tagged numerical result into a number and a tag ,21-33

Page TOC-20

“De-tagging” a tagged quantity ,21-33
Examples of tagged output ,21-34
Using a message box ,21-37
Relational and logical operators ,21-43
Relational operators ,21-43
Logical operators ,21-45
Program branching ,21-46
Branching with IF ,21-47
The IF…THEN…END construct ,21-47
The CASE construct ,21-51
Program loops ,21-53
The START construct ,21-53
The FOR construct ,21-59
The DO construct ,21-61
The WHILE construct ,21-63
Errors and error trapping ,21-64
DOERR ,21-64
ERRN ,21-65
ERRM ,21-65
ERR0 ,21-65
LASTARG ,21-65
Sub-menu IFERR ,21-65
User RPL programming in algebraic mode ,21-67

Chapter 22 - Programs for graphics manipulation ,22-1
The PLOT menu ,22-1
User-defined key for the PLOT menu ,22-1
Description of the PLOT menu ,22-2
Generating plots with programs ,22-14
Two-dimensional graphics ,22-14
Three-dimensional graphics ,22-15
The variable EQ ,22-15
Examples of interactive plots using the PLOT menu ,22-15

Page TOC-21

Examples of program-generated plots ,22-17
Drawing commands for use in programming ,22-19
PICT ,22-20
PDIM ,22-20
LINE ,22-20
TLINE ,22-20
BOX ,22-21
ARC ,22-21
PIX?, PIXON, and PIXOFF ,22-21
PVIEW ,22-22
PXC ,22-22
CPX ,22-22
Programming examples using drawing functions ,22-22
Pixel coordinates ,22-25
Animating graphics ,22-26
Animating a collection of graphics ,22-27
More information on the ANIMATE function ,22-29
Graphic objects (GROBs) ,22-29
The GROB menu ,22-31
A program with plotting and drawing functions ,22-33
Modular programming ,22-35
Running the program ,22-36
A program to calculate principal stresses ,22-38
Ordering the variables in the sub-directory ,22-38
A second example of Mohr’s circle calculations ,22-39
An input form for the Mohr’s circle program ,22-40

Chapter 23 - Charactor strings ,23-1
String-related functions in the TYPE sub-menu ,23-1
String concatenation ,23-2
The CHARS menu ,23-2
The characters list ,23-3

Page TOC-22

Chapter 24 - Calculator objects and flags ,24-1
Description of calculator objects ,24-1
Function TYPE ,24-2
Function VTYPE ,24-2
Calculator flags ,24-3
System flags ,24-3
Functions for setting and changing flags ,24-3
User flags ,24-4

Chapter 25 - Date and Time Functions ,25-1
The TIME menu ,25-1
Setting an alarm ,25-1
Browsing alarms ,25-2
Setting time and date ,25-2
TIME Tools ,25-2
Calculations with dates ,25-3
Calculating with times ,25-4
Alarm functions ,25-4

Chapter 26 - Managing memory ,26-1
Memory Structure ,26-1
The HOME directory ,26-2
Port memory ,26-2
Checking objects in memory ,26-3
Backup objects ,26-4
Backing up objects in port memory ,26-4
Backing up and restoring HOME ,26-5
Storing, deleting, and restoring backup objects ,26-6
Using data in backup objects ,26-7
Using SD cards ,26-7
Inserting and removing an SD card ,26-7
Formatting an SD card ,26-8
Accessing objects on an SD card ,26-9

Page TOC-23

Storing objects on an SD card ,26-9
Recalling an object from an SD card ,26-10
Evaluating an object on an SD card ,26-10
Purging an object from the SD card ,26-11
Purging all objects on the SD card (by reformatting) ,26-11
Specifying a directory on an SD card ,26-11
Using libraries ,26-12
Installing and attaching a library ,26-12
Library numbers ,26-13
Deleting a library ,26-13
Creating libraries ,26-13
Backup battery ,26-13

Chapter 27 - The Equation Library ,27-1
Solving a Problem with the Equation Library ,27-1
Using the Solver ,27-2
Using the menu keys ,27-3
Browsing in the Equation Library ,27-4
Viewing equations ,27-4
Viewing variables and selecting units ,27-5
Viewing the picture ,27-5
Using the Multiple-Equation Solver ,27-6
Defining a set of equations ,27-8
Interpreting results from the Multiple-Equation Solver ,27-10
Checking solutions ,27-11

Appendices
Appendix A - Using input forms ,A-1
Appendix B - The calculator’s keyboard ,B-1
Appendix C - CAS settings ,C-1
Appendix D - Additional character set ,D-1
Appendix E - The Selection Tree in the Equation Writer ,E-1

Page TOC-24

Appendix F - The Applications (APPS) menu ,F-1
Appendix G - Useful shortcuts ,G-1
Appendix H - The CAS help facility ,H-1
Appendix I - Command catalog list ,I-1
Appendix J - MATHS menu ,J-1
Appendix K - MAIN menu ,K-1
Appendix L - Line editor commands ,L-1
Appendix M - Table of Built-In Equations ,M-1
Appendix N - Index ,N-1
Limited Warranty ,LW-1
Service! ,LW-2
Regulatory information ,LW-4
Disposal of Waste Equipment by Users in Private Household in the European
Union ,LW-6

Page TOC-25

Chapter 1
Getting started
This chapter provides basic information about the operation of your calculator.
It is designed to familiarize you with the basic operations and settings before
you perform a calculation.

Basic Operations
The following sections are designed to get you acquainted with the hardware ofyour calculator.

Batteries
The calculator uses 4 AAA (LR03) batteries as main power and a CR2032
lithium battery for memory backup.
Before using the calculator, please install the batteries according to thefollowing procedure.

To install the main batteriesa. Make sure the calculator is OFF. Slide up the battery compartment cover as
illustrated.

b. Insert 4 new AAA (LR03) batteries into the main compartment. Make sureeach battery is inserted in the indicated direction.

To install the backup battery
a. Make sure the calculator is OFF. Press down the holder. Push the plate to theshown direction and lift it.

Page 1-1

b. Insert a new CR2032 lithium battery. Make sure its positive (+) side is facingup.
c. Replace the plate and push it to the original place.
After installing the batteries, press [ON] to turn the power on.
Warning: When the low battery icon is displayed, you need to replace thebatteries as soon as possible. However, avoid removing the backup battery andmain batteries at the same time to avoid data lost.

Turning the calculator on and off
The $ key is located at the lower left corner of the keyboard. Press it once toturn your calculator on. To turn the calculator off, press the right-shift key @(first key in the second row from the bottom of the keyboard), followed by the$ key. Notice that the $ key has a OFF label printed in the upper rightcorner as a reminder of the OFF command.

Adjusting the display contrast
You can adjust the display contrast by holding the $ key while pressing the+ or - keys. The $(hold) + key combination produces a darker
display. The $(hold) - key combination produces a lighter display

Contents of the calculator’s display
Turn your calculator on once more.

The display should look as indicatedbelow.

Page 1-2

At the top of the display you will have two lines of information that describe thesettings of the calculator. The first line shows the characters:
R D XYZ HEX R= 'X'
For details on the meaning of these symbols see Chapter 2.
The second line shows the characters: { HOME } indicating that the HOME
directory is the current file directory in the calculator’s memory. In Chapter 2
you will learn that you can save data in your calculator by storing them in files
or variables. Variables can be organized into directories and sub-directories.
Eventually, you may create a branching tree of file directories, similar to those in
a computer hard drive. You can then navigate through the file directory tree toselect any directory of interest. As you navigate through the file directory thesecond line of the display will change to reflect the proper file directory andsub-directory.
At the bottom of the display you will find a number of labels, namely,@EDIT @VIEW @@ RCL @@ @@STO@ ! PURGE !CLEAR
associated with the six soft menu keys, F1 through F6:
ABCDEFThe six labels displayed in the lower part of the screen will change dependingon which menu is displayed. But A will always be associated with the firstdisplayed label, B with the second displayed label, and so on.

Menus
The six labels associated with the keys A through F form part of a menu
of functions. Since the calculator has only six soft menu keys, it only display 6
labels at any point in time. However, a menu can have more than six entries.

Page 1-3

Each group of 6 entries is called a Menu page. The current menu, known as
the TOOL menu (see below), has eight entries arranged in two pages. The next
page, containing the next two entries of the menu is available by pressing the
L (NeXT menu) key. This key is the third key from the left in the third row ofkeys in the keyboard. Press L once more to return to the main TOOL menu,
or press the I key (third key in second row of keys from the top of the
keyboard).
The TOOL menu is described in detain in the next section. At this point we will
illustrate some properties of menus that you will find useful while using yourcalculator.

SOFT menus vs. CHOOSE boxes
Menus, or SOFT menus, associate labels in the lower part of the screen with thesix soft menu keys (Athrough F). By pressing the appropriate soft menu
key, the function shown in the associated label gets activated. For example,
with the TOOL menu active, pressing the @CLEAR key (F) activates function
CLEAR, which erases (clears up) the contents of the screen. To see this functionin action, type a number, say 123`, and then press the F key.
SOFT menus are typically used to select from among a number of related
functions. However, SOFT menus are not the only way to access collections ofrelated functions in the calculator. The alternative way will be referred to as
CHOOSE boxes. To see an example of a choose box, activate the TOOL menu(press I), and then press the keystroke combination ‚ã(associated withthe 3 key). This will provide the following CHOOSE box:

Page 1-4

This CHOOSE box is labeled BASE MENU and provides a list of numberedfunctions, from 1. HEX x to 6. BR. This display will constitute the first page ofthis CHOOSE box menu showing six menu functions. You can navigate throughthe menu by using the up and down arrow keys, —˜, located in the upper
right side of the keyboard, right under the E and Fsoft menu keys. To
activate any given function, first, highlight the function name by using the up
and down arrow keys, —˜, or by pressing the number corresponding to
the function in the CHOOSE box. After the function name is selected, press the@@@OK@@@ soft menu key (F). Thus, if you wanted to use function RB (Real to
Binary), you could press 6F.
If you want to move to the top of the current menu page in a CHOOSE box, use„—. To move to the bottom of the current page, use „˜. To move tothe top of the entire menu, use ‚—. To move to the bottom of the entire
menu, use ‚˜.

Selecting SOFT menus or CHOOSE boxes
You can select the format in which your menus will be displayed by changing asetting in the calculator system flags (A system flag is a calculator variable that
controls a certain calculator operation or mode. For more information about
flags, see Chapter 24). System flag 117 can be set to produce either SOFT
menus or CHOOSE boxes. To access this flag use:
H @)FLAGS —„ —˜Your calculator will show the following screen, highlighting the line starting with
the number 117:

By default, the line will look as shown above. The highlighted line (117CHOOSE boxes) indicates that CHOOSE boxes are the current menu display
setting. If you prefer to use SOFT menu keys, press the @@CHK@@ soft menu key(C), followed by @@@OK@@@ (F). Press @@@OK@@@ (F) once more to return tonormal calculator display.

Page 1-5

If you now press ‚ã, instead of the CHOOSE box that you saw earlier,the display will now show six soft menu labels as the first page of the STACKmenu:

To navigate through the functions of this menu, press the L key to move to thenext page, or „«(associated with the L key) to move to the previous
page.
The following figures show the different pages of the BASE menu
accessed by pressing the L key twice:

Pressing the L key once more will takes us back to the first menu page.
Note: With the SOFT menu setting for system flag 117, the keystroke
combination ‚(hold) ˜, will show a list of the functions in the current soft
menu. For example, for the two first pages in the BASE menu, you will get:To revert to the CHOOSE boxes setting, use:
H @)FLAGS —„ —˜@@CHK@@ @@@OK@@@ @@@OK@@@.
Notes:
1. The TOOL menu, obtained by pressing I, will always produce a SOFT
menu.
2. Most of the examples in this User’s Manual are shown using both SOFT
menus and CHOOSE boxes. Programming applications (Chapters 21 and22) use exclusively SOFT menus.
3. Additional information on SOFT menus vs. CHOOSE boxes is presented in
Chapter 2 o f this guide.

Page 1-6

The TOOL menu
The soft menu keys for the menu currently displayed, known as the TOOL menu,
are associated with operations related to manipulation of variables (see pages
for more information on variables):
@EDIT

A

EDIT the contents of a variable (see Chapter 2 and Appendix
L for more information on editing)

@VIEW

B

VIEW the contents of a variable@@ RCL @@C

ReCaLl the contents of a variable@@STO@D

STOre the contents of a variable! PURGEE

PURGE a variable

CLEAR

F

CLEAR the display or stack

The calculator has only six soft menu keys, and can only display 6 labels at any
point in time. However, a menu can have more than six entries. Each group of
6 entries is called a Menu page. The TOOL menu has eight entries arranged
in two pages. The next page, containing the next two entries of the menu areavailable by pressing the L (NeXT menu) key. This key is the third key fromthe left in the third row of keys in the keyboard.
In this case, only the first two soft menu keys have commands associated withthem. These commands are:
@CASCMA CASCMD: CAS CoMmanD, used to launch a command fromthe CAS by selecting from a list

@HELP
B HELP facility describing the commands available
Pressing the L key will show the original TOOL menu. Another way torecover the TOOL menu is to press the I key (third key from the left in thesecond row of keys from the top of the keyboard).

Setting time and date
The calculator has an internal real time clock. This clock can be continuously
displayed on the screen and be used for alarms as well as running scheduled
tasks. This section will show not only how to set time and date, but also thebasics of using CHOOSE boxes and entering data in a dialog box. Dialog
boxes on your calculator are similar to a computer dialog box.
To set time and date we use the TIME choose box available as an alternative
function for the 9 key. By combining the right-shift button, ‚, with thePage 1-7

9 key the TIME choose box is activated. This operation can also be
represented as ‚Ó. The TIME choose box is shown in the figure below:

As indicated above, the TIME menu provides four different options, numbered 1
through 4. Of interest to us as this point is option 3. Set time, date... Using thedown arrow key, ˜, highlight this option and press the !!@@OK#@ soft menu key.
The following input form (see Appendix 1-A) for adjusting time and date isshown:

Setting the time of the day
Using the number keys, 1234567890, start byadjusting the hour of the day. Suppose that we change the hour to 11, bypressing 11 as the hour field in the SET TIME AND DATE input form ishighlighted. This results in the number 11 being entered in the lower line of the
input form:

Press the !!@@OK#@ soft menu key to effect the change. The value of 11 is now
shown in the hour field, and the minute field is automatically highlighted:

Page 1-8

Let’s change the minute field to 25, by pressing: 25 !!@@OK#@ . The seconds
field is now highlighted. Suppose that you want to change the seconds field to45, use: 45 !!@@OK#@
The time format field is now highlighted. To change this field from its current
setting you can either press the W key (the second key from the left in the fifth
row of keys from the bottom of the keyboard), or press the @CHOOS soft menu key( B).
ΘIf using the W key, the setting in the time format field will change to eitherof the following options:o

AM : indicates that displayed time is AM timeoPM : indicates that displayed time is PM timeo24-hr : indicates that that the time displayed uses a 24 hourformat where18:00, for example, represents 6pm

The last selected option will become the set option for the time format byusing this procedure.
Θ

If using the @CHOOS soft menu key, the following options are available.

Use the up and down arrow keys,— ˜, to select among these three
options (AM, PM, 24-hour time). Press the !!@@OK#@ soft menu key to make theselection.

Page 1-9

Setting the date
After setting the time format option, the SET TIME AND DATE input form will
look as follows:

To set the date, first set the date format. The default format is M/D/Y (month/day/year). To modify this format, press the down arrow key. This will highlightthe date format as shown below:

Use the @CHOOS soft menu key to see the options for the date format:

Highlight your choice by using the up and down arrow keys,— ˜, andpress the !!@@OK#@ soft menu key to make the selection.

Page 1-10

Introducing the calculator’s keyboard
The figure below shows a diagram of the calculator’s keyboard with thenumbering of its rows and columns.

The figure shows 10 rows of keys combined with 3, 5, or 6 columns. Row 1
has 6 keys, rows 2 and 3 have 3 keys each, and rows 4 through 10 have 5
keys each. There are 4 arrow keys located on the right-hand side of the
keyboard in the space occupied by rows 2 and 3.
Each key has three, four, or five functions. The main key function correspond tothe most prominent label in the key. Also, the left-shift key, key (8,1), the right-

Page 1-11

shift key, key (9,1), and the ALPHA key, key (7,1), can be combined with someof the other keys to activate the alternative functions shown in the keyboard.
For example, the P key, key(4,4), has the following six functions associatedwith it:P

Main function, to activate the SYMBolic menu„´Left-shift function, to activate the MTH (Math) menu

…N

Right-shift function, to activate the CATalog function~p

ALPHA function, to enter the upper-case letter P~„p

ALPHA-Left-Shift function, to enter the lower-case letter p~…p

ALPHA-Right-Shift function, to enter the symbol P

Of the six functions associated with the key only the first four are shown in the
keyboard itself. This is the way that the key looks in the keyboard:

Notice that the color and the position of the labels in the key, namely, SYMB,
MTH, CAT and P, indicate which is the main function (SYMB), and which of
the other three functions is associated with the left-shift „(MTH), right-shift… (CAT ) , and ~ (P) keys.
For detailed information on the calculator keyboard operation referee toAppendix B .

Selecting calculator modes
This section assumes that you are now at least partially familiar with the use ofchoose and dialog boxes (if you are not, please refer to Chapter 2).
Press the H button (second key from the left on the second row of keys fromthe top) to show the following CALCULATOR MODES input form:

Page 1-12

Press the !!@@OK#@ soft menu key to return to normal display. Examples of selecting
different calculator modes are shown next.

Operating Mode
The calculator offers two operating modes: the Algebraic mode, and theReverse Polish Notation (RPN) mode. The default mode is the Algebraic mode
(as indicated in the figure above), however, users of earlier HP calculators may
be more familiar with the RPN mode.
To select an operating mode, first open the CALCULATOR MODES input form
by pressing the H button. The Operating Mode field will be highlighted.
Select the Algebraic or RPN operating mode by either using the \ key(second from left in the fifth row from the keyboard bottom), or pressing the@CHOOS soft menu key. If using the latter approach, use up and down arrowkeys, — ˜, to select the mode, and press the !!@@OK#@ soft menu key tocomplete the operation.
To illustrate the difference between these two operating modes we will calculate
the following expression in both modes:⎛⎝

3 ⋅ ⎜5 −
23

⎞
⎟
3⋅3⎠
2.5
+e
1

3

Page 1-13

To enter this expression in the calculator we will first use the equation writer,‚O.
Please identify the following keys in the keyboard, besides thenumeric keypad keys:!@.#*+-/R
Q¸Ü‚Oš™˜—`
The equation writer is a display mode in which you can build mathematicalexpressions using explicit mathematical notation including fractions, derivatives,
integrals, roots, etc.
To use the equation writer for writing the expression
shown above, use the following keystrokes:‚OR3*!Ü51/3*3———————/23Q3™™+!¸2.5`
After pressing `the calculator displays the expression:√ (3*(5-1/(3*3))/23^3+EXP(2.5))
Pressing `again will provide the following value. Accept Approx. mode on,
if asked, by pressing !!@@OK#@. [Note: The integer values used above, e.g., 3, 5,
1, represent exact values. The EXP(2.5), however, cannot be expressed as anexact value, therefore, a switch to Approx mode is required]:

You could also type the expression directly into the display without using theequation writer, as follows:
R!Ü3.*!Ü5.-1./!Ü3.*3.™™
/23.Q3+!¸2.5`
to obtain the same result.

Page 1-14

Change the operating mode to RPN by first pressing the H button. Select the
RPN operating mode by either using the \key, or pressing the @CHOOS soft
menu key. Press the !!@@OK#@ soft menu key to complete the operation. The
display, for the RPN mode looks as follows:

Notice that the display shows several levels of output labeled, from bottom totop, as 1, 2, 3, etc. This is referred to as the stack of the calculator. The
different levels are referred to as the stack levels, i.e., stack level 1, stack level 2,
etc.
In RPN mode, instead of writing an operation such as 3 + 2 by pressing
3+2`, we write the operands first , in the proper order, and thenthe operator, i.e., 3`2+. As you enter the operands, they occupy
different stack levels. Entering 3`puts the number 3 in stack level 1.
Next, entering 2pushes the 3 upwards to occupy stack level 2. Finally, bypressing +, we are telling the calculator to apply the operator, or program,+ to the objects occupying levels 1 and 2. The result, 5, is then placed inlevel 1.
Let's try some other simple operations before trying the more complicatedexpression used earlier for the algebraic operating mode:
123/32

123`32/

2

4

4`2Q

3√27

27`3@»

Notice the position of the y and the x in the last two operations. The base in
the exponential operation is y (stack level 2) while the exponent is x (stack level1) before the key Q is pressed. Similarly, in the cubic root operation, y (stacklevel 2) is the quantity under the root sign, and x (stack level 1) is the root.
Try the following exercise involving 3 factors: (5 + 3) × 2
5`3+

Calculates (5 + 3) first.

2X
Completes the calculation.
Let's try now the expression proposed earlier:

Page 1-15⎛⎝

3 ⋅ ⎜5 −
23

⎞
⎟
3⋅3⎠
2.5
+e
1

3

3.` Enter 3 in level 1
5.` Enter 5 in level 1, 3 moves to y
3.` Enter 3 in level 1, 5 moves to level 2, 3 to level 3
3.* Place 3 and multiply, 9 appears in level 1Y

1/(3×3), last value in lev. 1; 5 in level 2; 3 in level 3-

5 - 1/(3×3) , occupies level 1 now; 3 in level 2*

3× (5 - 1/(3×3)), occupies level 1 now.

23.`Enter 23 in level 1, 14.66666 moves to level 2.
3.Q Enter 3, calculate 233 into level 1. 14.666 in lev. 2.
/(3× (5-1/(3×3)))/233 into level 1

2.5 Enter 2.5 level 1!¸

e2.5, goes into level 1, level 2 shows previous value.

+(3× (5 - 1/(3×3)))/233 + e2.5 = 12.18369, into lev. 1.

R√((3× (5 - 1/(3×3)))/233 + e2.5) = 3.4905156, into 1.

Although RPN requires a little bit more thought than the algebraic (ALG) mode,
there are multiple advantages in using RPN. For example, in RPN mode you
can see the equation unfolding step by step. This is extremely useful to detect apossible input error. Also, as you become more efficient in this mode and learn
more of the tricks, you will be able to calculate expression faster and will muchless keystrokes. Consider, for example the calculation of (4×6 - 5)/(1+4×6 - 5).
In RPN mode you can write:4`6*5-`1+/
obviously, even In RPN mode, you can enter an expression in the same order as
the algebraic mode by using the Equation writer. For example,‚OR3.*!Ü5.1/3.*3.
———————/23.Q3™™+!¸2.5`
The resulting expression is shown in stack level 1 as follows:

Page 1-16

Notice how the expression is placed in stack level 1 after pressing `.
Pressing the EVAL key at this point will evaluate the numerical value of that
expression Note: In RPN mode, pressing ENTER when there is no commandline will execute the DUP function which copies the contents of stack level 1 ofthe stack onto level 2 (and pushes all the other stack levels one level up). This isextremely useful as showed in the previous example.
To select between the ALG vs. RPN operating mode, you can also set/clear
system flag 95 through the following keystroke sequence:
H@FLAGS 9 ˜ ˜ ˜ ˜ @CHK@@ `Alternatively, you can use one of the following shortcuts:Θ In ALG mode,
CF(-95) selects RPN modeΘIn RPN mode,
95 \` SF selects ALG mode

For more information on calculator’s system flags see Chapter 2.

Number Format and decimal dot or comma
Changing the number format allows you to customize the way real numbers are
displayed by the calculator. You will find this feature extremely useful inoperations with powers of tens or to limit the number of decimals in a result.
To select a number format, first open the CALCULATOR MODES input form bypressing the H button. Then, use the down arrow key, ˜, to select theoption Number format. The default value is Std, or Standard format. In thestandard format, the calculator will show floating-point numbers with the
maximum precision allowed by the calculator (12 significant digits). To learn

Page 1-17

more about reals, see Chapter 2. To illustrate this and other number formats try
the following exercises:ΘStandard format:
This mode is the most used mode as it shows numbers in the most familiar
notation.
Press the !!@@OK#@ soft menu key, with the Number format set to Std, to returnto the calculator display. Enter the number 123.4567890123456. Noticethat this number has 16 significant figures. Press the ` key. The number
is rounded to the maximum 12 significant figures, and is displayed asfollows:

In the standard format of decimal display, integer numbers are shown withno decimal zeros whatsoever. Numbers with different decimal figures will
be adjusted in the display so that only those decimal figures that arenecessary will be shown. More examples of numbers in standard format
are shown next:ΘFixed format with no decimals: Press the H button. Next, use the downarrow key, ˜, to select the option Number format. Press the @CHOOS soft
menu key, and select the option Fixed with the arrow down key ˜.

Page 1-18

Notice that the Number Format mode is set to Fix followed by a zero (0).
This number indicates the number of decimals to be shown after thedecimal point in the calculator’s display. Press the !!@@OK#@ soft menu key toreturn to the calculator display. The number now is shown as:

This setting will force all results to be rounded to the closest integer (0 digit
displayed after the comma). However, the number is still stored by thecalculator with its full 12 significant digit precision. As we change thenumber of decimals to be displayed, you will see the additional digits
being shown again.

ΘFixed format with decimals:
This mode is mainly used when working with limited precision. For
example, if you are doing financial calculation, using a FIX 2 mode isconvenient as it can easily represent monetary units to a 1/100 precision.
Press the H button. Next, use the down arrow key, ˜, to select theoption Number format. Press the @CHOOS soft menu key, and select theoption Fixed with the arrow down key ˜.

Press the right arrow key, ™, to highlight the zero in front of the option
Fix. Press the @CHOOS soft menu key and, using the up and down arrowkeys, —˜, select, say, 3 decimals.

Page 1-19

Press the !!@@OK#@ soft menu key to complete the selection:

Press the !!@@OK#@ soft menu key return to the calculator display. The number
now is shown as:

Notice how the number is rounded, not truncated. Thus, the number
123.4567890123456, for this setting, is displayed as 123.457, and not
as 123.456 because the digit after 6 is > 5ΘScientific format
The scientific format is mainly used when solving problems in the physicalsciences where numbers are usually represented as a number with limited
precision multiplied by a power of ten.
To set this format, start by pressing the H button. Next, use the downarrow key, ˜, to select the option Number format. Press the @CHOOS soft
menu key and select the option Scientific with the arrow down key ˜.
Keep the number 3 in front of the Sci. (This number can be changed in the

Page 1-20

same fashion that we changed the Fixed number of decimals in theexample above).

Press the !!@@OK#@ soft menu key return to the calculator display. The number
now is shown as:

This result, 1.23E2, is the calculator’s version of powers-of-ten notation,i.e., 1.235 x 102. In this, so-called, scientific notation, the number 3 infront of the Sci number format (shown earlier) represents the number ofsignificant figures after the decimal point. Scientific notation always
includes one integer figure as shown above. For this case, therefore, thenumber of significant figures is four.
ΘEngineering format
The engineering format is very similar to the scientific format, except thatthe powers of ten are multiples of three.
To set this format, start by pressing the H button. Next, use the downarrow key, ˜, to select the option Number format. Press the @CHOOS soft
menu key and select the option Engineering with the arrow down key ˜.
Keep the number 3 in front of the Eng. (This number can be changed in
the same fashion that we changed the Fixed number of decimals in an
earlier example).

Page 1-21

Press the !!@@OK#@ soft menu key return to the calculator display. The number
now is shown as:

Because this number has three figures in the integer part, it is shown withfour significative figures and a zero power of ten, while using theEngineering format. For example, the number 0.00256, will be shown as:ΘDecimal comma vs. decimal point
Decimal points in floating-point numbers can be replaced by commas, if
the user is more familiar with such notation. To replace decimal points forcommas, change the FM option in the CALCULATOR MODES input form tocommas, as follows (Notice that we have changed the Number Format to

Θ

Std):
Press the H button. Next, use the down arrow key, ˜, once, and theright arrow key, ™, highlighting the option __FM,. To select commas,
press the @@CHK@@ soft menu key. The input form will look as follows:

Page 1-22

Θ

Press the !!@@OK#@ soft menu key return to the calculator display. The number
123.456789012, entered earlier, now is shown as:

Angle Measure
Trigonometric functions, for example, require arguments representing planeangles. The calculator provides three different Angle Measure modes forworking with angles, namely:Θ Degrees: There are 360 degrees (360o) in a complete circumference, or
90 degrees (90o) in a right angle. This representation is mainly used when
doing basic geometry, mechanical or structural engineering, andsurveying.
Θ Radians: There are 2π radians (2π r ) in a complete circumference, or π/2
radians (π/2 r ) in a right angle. This notation is mainly used when solving
mathematics and physics problems. This is the default mode of thecalculator.
Θ Grades: There are 400 grades (400 g) in a complete circumference, or
100 grades (100 g) in a right angle. This notation is similar to the degree
mode, and was introduced in order to “simplify” the degree notation but isseldom used now.
The angle measure affects the trig functions like SIN, COS, TAN and associatedfunctions.
To change the angle measure mode, use the following procedure:Θ Press the H button. Next, use the down arrow key, ˜, twice. Selectthe Angle Measure mode by either using the \key (second from left in
the fifth row from the keyboard bottom), or pressing the @CHOOS soft menu

Page 1-23

key. If using the latter approach, use up and down arrow keys,— ˜,
to select the preferred mode, and press the !!@@OK#@ soft menu key tocomplete the operation. For example, in the following screen, the Radiansmode is selected:

Coordinate System
The coordinate system selection affects the way vectors and complex numbers
are displayed and entered. To learn more about complex numbers and vectors,
see Chapters 4 and 9, respectively.
Two- and three-dimensional vector components and complex numbers can be
represented in any of 3 coordinate systems: The Cartesian (2 dimensional) or
Rectangular (3 dimensional), Cylindrical (3 dimensional) or Polar (2dimensional), and Spherical (only 3 dimensional). In a Cartesian or
Rectangular coordinate system a point P will have three linear coordinates(x,y,z) measured from the origin along each of three mutually perpendicularaxes (in 2 d mode, z is assumed to be 0). In a Cylindrical or Polar coordinate
system the coordinates of a point are given by (r,θ,z), where r is a radial
distance measured from the origin on the xy plane, θ is the angle that the radial
distance r forms with the positive x axis -- measured as positive in acounterclockwise direction --, and z is the same as the z coordinate in a
Cartesian system (in 2 d mode, z is assumed to be 0). The Rectangular andPolar systems are related by the following quantities:

x = r ⋅ cos(θ )r = x2 + y 2

y = r ⋅ sin(θ )θ = tan −1 ⎜ ⎟
z=z

⎛ y⎞
⎝ x⎠

In a Spherical coordinate system the coordinates of a point are given by (ρ,θ,φ)where ρ is a radial distance measured from the origin of a Cartesian system, θis an angle representing the angle formed by the projection of the linear
distance ρ onto the xy axis (same as θ in Polar coordinates), and φ is the angle

Page 1-24

from the positive z axis to the radial distance ρ. The Rectangular and Sphericalcoordinate systems are related by the following quantities:

x = ρ ⋅ sin(φ ) ⋅ cos(θ )ρ = x2 + y2 + z2

y = ρ ⋅ sin(φ ) ⋅ sin(θ )θ = tan −1 ⎜ ⎟z = ρ ⋅ cos(φ )

⎛ y⎞
⎝ x⎠
⎛ x2 + y2 ⎞−1 ⎜⎟φ = tan⎜⎟z⎝⎠

To change the coordinate system in your calculator, follow these steps:
Θ Press the H button. Next, use the down arrow key, ˜, three times.
Select the Angle Measure mode by either using the \ key (second fromleft in the fifth row from the keyboard bottom), or pressing the @CHOOS soft
menu key. If using the latter approach, use up and down arrow keys,—˜, to select the preferred mode, and press the !!@@OK#@ soft menu key tocomplete the operation. For example, in the following screen, the Polar
coordinate mode is selected:

Beep, Key Click, and Last Stack
The last line of the CALCULATOR MODES input form include the options:_Beep _Key Click _Last Stack
By choosing the check mark next to each of these options, the corresponding
option is activated. These options are described next:_Beep : When selected, , the calculator beeper is active. This operation
mainly applies to error messages, but also some user functions like
BEEP.
_Key Click : When selected, each keystroke produces a “click” sound.

Page 1-25

_Last Stack: Keeps the contents of the last stack entry for use with the functions
UNDO and ANS (see Chapter 2).
The _Beep option can be useful to advise the user about errors. You may want
to deselect this option if using your calculator in a classroom or library.
The _Key Click option can be useful as an audible way to check that eachkeystroke was entered as intended.
The _Last Stack option is very useful to recover the last operation in case weneed it for a new calculation.
To select, or deselect, any of these three options, first press the H button.
Next,Θ Use the down arrow key, ˜, four times to select the _Last Stack option.
Use the @@CHK@@ soft menu key to change the selection.
Θ Press the left arrow key š to select the _Key Click option. Use the @@CHK@@
soft menu key to change the selection.
Θ Press the left arrow key š to select the _Beep option. Use the @@CHK@@ soft
menu key to change the selection.
Press the !!@@OK#@ soft menu key to complete the operation.

Selecting CAS settings
CAS stands for Computer Algebraic System. This is the mathematical core of
the calculator where the symbolic mathematical operations and functions areprogrammed and performed. The CAS offers a number of settings can be
adjusted according to the type of operation of interest. These are:
Θ The default independent variable
Θ Numeric vs. symbolic modeΘ Approximate vs. Exact modeΘ Verbose vs. Non-verbose modeΘ Step-by-step mode for operations
Θ Increasing power format for polynomials
Θ Rigorous modeΘ Simplification of non-rational expressions
Details on the selection of CAS settings are presented in Appendix C.

Page 1-26

Selecting Display modes
The calculator display can be customized to your preference by selecting
different display modes. To see the optional display settings use the following:Θ First, press the H button to activate the CALCULATOR MODES input form.
Within the CALCULATOR MODES input form, press the @@DISP@ soft menu key
to display the DISPLAY MODES input form.

Θ
Θ

Θ
Θ

To navigate through the many options in the DISPLAY MODES input form,
use the arrow keys: š™˜—.
To select or deselect any of the settings shown above, that require a check
mark, select the underline before the option of interest, and toggle the@@CHK@@ soft menu key until the right setting is achieved. When an option is
selected, a check mark will be shown in the underline (e.g., the Textbook
option in the Stack: line above). Unselected options will show no check
mark in the underline preceding the option of interest (e.g., the _Small,_Full page, and _Indent options in the Edit: line above).
To select the Font for the display, highlight the field in front of the Font:
option in the DISPLAY MODES input form, and use the @CHOOS soft menu key.
After having selected and unselected all the options that you want in the
DISPLAY MODES input form, press the @@@OK@@@ soft menu key. This will takeyou back to the CALCULATOR MODES input form.
To return to normal
calculator display at this point, press the @@@OK@@@ soft menu key once more.

Selecting the display font
Changing the font display allows you to have the calculator look and feelchanged to your own liking. By using a 6-pixel font, for example, you candisplay up to 9 stack levels! Follow these instructions to select your display font:First, press the H button to activate the CALCULATOR MODES input form.
Within the CALCULATOR MODES input form, press the @@DISP@ soft menu key todisplay the DISPLAY MODES input form. The Font: field is highlighted, and theoption Ft8_0:system 8 is selected. This is the default value of the display font.

Page 1-27

Pressing the @CHOOS soft menu key will provide a list of available system fonts, as
shown below:

The options available are three standard System Fonts (sizes 8, 7, and 6) and a
Browse.. option.
The latter will let you browse the calculator memory for
additional fonts that you may have created (see Chapter 23) or downloaded
into the calculator.
Practice changing the display fonts to sizes 7 and 6. Press the OK soft menu
key to effect the selection. When done with a font selection, press the @@@OK@@@ soft
menu key to go back to the CALCULATOR MODES input form. To return tonormal calculator display at this point, press the @@@OK@@@ soft menu key once more
and see how the stack display change to accommodate the different font.

Selecting properties of the line editor
First, press the H button to activate the CALCULATOR MODES input form.
Within the CALCULATOR MODES input form, press the @@DISP@ soft menu key todisplay the DISPLAY MODES input form. Press the down arrow key, ˜, once,
to get to the Edit line. This line shows three properties that can be modified.
When these properties are selected (checked) the following effects areactivated:_SmallChanges font size to small_Full page

Allows to place the cursor after the end of the line

_Indent

Auto intend cursor when entering a carriage return

Detailed instructions on the use of the line editor are presented in Chapter 2 inthis guide.

Selecting properties of the Stack
First, press the H button to activate the CALCULATOR MODES input form.
Within the CALCULATOR MODES input form, press the @@DISP@ soft menu key toPage 1-28

display the DISPLAY MODES input form. Press the down arrow key, ˜, twice,
to get to the Stack line. This line shows two properties that can be modified.
When these properties are selected (checked) the following effects areactivated:_SmallChanges font size to small. This maximized the amount of
information displayed on the screen. Note, this selection
overrides the font selection for the stack display.

_Textbook

Display mathematical expressions in graphical mathematicalnotation

To illustrate these settings, either in algebraic or RPN mode, use the equation
writer to type the following definite integral:‚O…Á0™„è™„¸\x™x`
In Algebraic mode, the following screen shows the result of these keystrokes withneither _Small nor _Textbook are selected:

With the _Small option selected only, the display looks as shown below:

With the _Textbook option selected (default value), regardless of whether the_Small option is selected or not, the display shows the following result:Selecting properties of the equation writer (EQW)
First, press the H button to activate the CALCULATOR MODES input form.
Within the CALCULATOR MODES input form, press the @@DISP@ soft menu key todisplay the DISPLAY MODES input form. Press the down arrow key, ˜, three

Page 1-29

times, to get to the EQW (Equation Writer) line. This line shows two properties
that can be modified. When these properties are selected (checked) the
following effects are activated:_SmallChanges font size to small while using the equation
editor_Small Stack Disp

Shows small font in the stack for textbook style display

Detailed instructions on the use of the equation editor (EQW) are presented
elsewhere in this manual.
For the example of the integral∞∫ e dX , presented above, selecting the−X0_Small Stack Disp in the EQW line of the DISPLAY MODES input form produces
the following display:

Selecting the size of the header
First, press the H button to activate the CALCULATOR MODES input form.
Within the CALCULATOR MODES input form, press the @@DISP@ soft menu key todisplay the DISPLAY MODES input form. Press the down arrow key, ˜, fourtimes, to get to the Header line. The value 2 is assigned to the Header field bydefault. This means that the top part of the display will contain two lines, one
showing the current settings of the calculator, and a second one showing thecurrent sub directory within the calculator’s memory (These lines were describedearlier in the manual). The user can select to change this setting to 1 or 0 to
reduce the number of header lines in the display.

Selecting the clock display
First, press the H button to activate the CALCULATOR MODES input form.
Within the CALCULATOR MODES input form, press the @@DISP@ soft menu key todisplay the DISPLAY MODES input form. Press the down arrow key, ˜, fourtimes, to get to the Header line. The Header field will be highlighted. Use thePage 1-30

right arrow key (™) to select the underline in front of the options _Clock or_Analog. Toggle the @@CHK@@ soft menu key until the desired setting is achieved.
If the _Clock option is selected, the time of the day and date will be shown in
the upper right corner of the display. If the _Analog option is also selected, ananalog clock, rather than a digital clock, will be shown in the upper right cornerof the display. If the _Clock option is not selected, or the header is not present,or too small, the date and time of day will not be shown in the display.

Page 1-31

Chapter 2
Introducing the calculator
In this chapter we present a number of basic operations of the calculator
including the use of the Equation Writer and the manipulation of data objects inthe calculator. Study the examples in this chapter to get a good grasp of thecapabilities of the calculator for future applications.

Calculator objects
Any number, expression, character, variable, etc., that can be created andmanipulated in the calculator is referred to as an object. Some of the mostuseful type of objects are listed below.
Real. These object represents a number, positive or negative, with 12 significant
digits and an exponent ranging from -499 to +499. example of reals are: 1.,-5., 56.41564 1.5E45, -555.74E-95
When entering a real number, you can use the V key to enter the exponent
and the \ key to change the sign of the exponent or mantissa.
Note that real must be entered with a decimal point, even if the number does
not have a fractional part. Otherwise the number is taken as an integer
number, which is a different calculator objects. Reals behave as you would
expect a number to when used in a mathematical operation.
Integers. These objects represent integer numbers (numbers without fractionalpart) and do not have limits (except the memory of the calculator). Example ofintegers are: 1, 564654112, -413165467354646765465487. Note howthese numbers do not have a decimal point.
Due to their storage format, integer numbers are always maintain full precisionin their calculation. For example, an operation such as 30/14, with integer
numbers, will return 15/7 and not 2.142…. To force a real (or floating-point)
result, use function NUM ‚ï.
Integers are used frequently in CAS-based functions as they are designed tokeep full precision in their operation.
If the approximate mode (APPROX) is selected in the CAS (see Appendix C),
integers will be automatically converted to reals. If you are not planning to use

Page 2-1

the CAS, it might be a good idea to switch directly into approximate mode.
Refer to Appendix C for more details.
Mixing integers and reals together or mistaking an integer for a real is acommon occurrence. The calculator will detect such mixing of objects and ask
you if you want to switch to approximate mode.
Complex numbers, are an extension of real numbers that include the unit
imaginary number, i 2= -1. A complex number, e.g., 3 + 2i, is written as (3, 2)
in the calculator.
Complex numbers can be displayed in either Cartesian or polar mode
depending on the setting selected. Note that complex numbers are always
stored in Cartesian mode and that only the display is affected. This allows thecalculator to keep as much precision as possible during calculations.
Most mathematics functions work on complex numbers. There is no need to use
a special “complex +“ function to add complex numbers, you can use the same
+ function that on reals or integers.
Vector and matrix operations utilize objects of type 3, real arrays, and, if
needed, type 4, complex arrays. Objects type 2, strings, are simply lines oftext (enclosed between quotes) produced with the alphanumeric keyboard.
A list is just a collection of objects enclosed between curly brackets andseparated by spaces in RPN mode (the space key is labeled #), or bycommas in algebraic mode. Lists, objects of type 5, can be very useful whenprocessing collections of numbers. For example, the columns of a table can beentered as lists. If preferred, a table can be entered as a matrix or array.
Objects type 8 are programs in User RPL language. These are simply sets of
instructions enclosed between the symbols << >>.
Associated with programs are objects types 6 and 7, Global and Local Names,
respectively. These names, or variables, are used to store any type of objects.
The concept of global or local names is related to the scope or reach of thevariable in a given program.
An algebraic object, or simply, an algebraic (object of type 9), is a valid
algebraic expression enclosed within quotation or tick marks.

Page 2-2Binary integers, objects of type 10, are used in some computer science
applications.
Graphics objects, objects of type 11, store graphics produced by the calculator.
Tagged objects, objects of type 12, are used in the output of many programs toidentify results. For example, in the tagged object: Mean: 23.2, the word Mean:is the tag used to identify the number 23.2 as the mean of a sample, forexample.
Unit objects, objects of type 13, are numerical values with a physical unit
attached to them.
Directories, objects of type 15, are memory locations used to organize yourvariables in a similar fashion as folders are used in a personal computer.
Libraries, objects of type 16, are programs residing in memory ports that areaccessible within any directory (or sub-directory) in your calculator. They
resemble built-in functions, objects of type 18, and built-in commands, objectsof type 19, in the way they are used.

Editing expressions on the screen
In this section we present examples of expression editing directly into thecalculator display (algebraic history or RPN stack).

Creating arithmetic expressions
For this example, we select the Algebraic operating mode and select a Fix
format with 3 decimals for the display. We are going to enter the arithmetic
expression:

1.0
7.5
5.0 ⋅
3.0 − 2.0 3
1.0 +To enter this expression use the following keystrokes:
5.*„Ü1.+1./7.5™/„ÜR3.-2.Q3

Page 2-3

The resulting expression is: 5.*(1.+1./7.5)/(√3.-2.^3).
Press ` to get the expression in the display as follows:

Notice that, if your CAS is set to EXACT (see Appendix C) and you enter yourexpression using integer numbers for integer values, the result is a symbolic
quantity, e.g.,5*„Ü1+1/7.5™/„ÜR3-2Q3
Before producing a result, you will be asked to change to Approximate mode.
Accept the change to get the following result (shown in Fix decimal mode withthree decimal places – see Chapter 1):

In this case, when the expression is entered directly into the stack. As soon as
you press `, the calculator will attempt to calculate a value for the
expression. If the expression is entered between quotes, however, the calculator
will reproduce the expression as entered. In the following example, we enter
the same expression as above, but using quotes. For this case we set theoperating mode to Algebraic, the CAS mode to Exact (deselect _Approx), andthe display setting to Textbook. The keystrokes to enter the expression are thefollowing:³5*„Ü1+1/7.5™/„ÜR3-2Q3`
The result will be shown as follows:

Page 2-4

To evaluate the expression we can use the EVAL function, as follows:μ„î`
As in the previous example, you will be asked to approve changing the CAS
setting to Approx. Once this is done, you will get the same result as before.
An alternative way to evaluate the expression entered earlier between quotes is
by using the option …ï. To recover the expression from the existing
stack, use the following keystrokes: ƒƒ…ïWe will now enter the expression used above when the calculator is set to the
RPN operating mode. We also set the CAS to Exact and the display to
Textbook. The keystrokes to enter the expression between quotes are the sameused earlier, i.e.,³5*„Ü1+1/7.5™/„ÜR3-2Q3`
Resulting in the output

Press ` once more to keep two copies of the expression available in thestack for evaluation. We first evaluate the expression using the function EVAL,
and next using the function NUM.
Here are the steps explained in detail: First, evaluate the expression using
function EVAL. The resulting expression is semi-symbolic in the sense that there
are floating-point components to the result, as well as a √3. Next, we switch
stack locations and evaluate using function NUM:™

Exchange stack levels 1 and 2 (the SWAP command)…ï

Evaluate using function NUM

Page 2-5

This latter result is purely numerical, so that the two results in the stack, although
representing the same expression, seem different. To verify that they are not, we
subtract the two values and evaluate this difference using function EVAL:-

Subtract level 1 from level 2

μEvaluate using function EVAL

The result is zero (0.).
Note: Avoid mixing integer and real data to avoid conflicts in thecalculations. For many physical science and engineering applications,
including numerical solution of equation, statistics applications, etc., the
APPROX mode (see Appendix C) works better. For mathematical applications,e.g., calculus, vector analysis, algebra, etc., the EXACT mode is preferred.
Become acquainted with operations in both modes and learn how to switchfrom one to the other for different types of operations (see Appendix C).

Editing arithmetic expressions
Suppose that we entered the following expression, between quotes, with thecalculator in RPN mode and the CAS set to EXACT:

1
7.5 . The incorrect expression
rather than the intended expression: 5 ⋅3 − 231+

was entered by using:³5*„Ü1+1/1.75™/„ÜR5-2Q3`
To enter the line editor use „˜. The display now looks as follows:

Page 2-6

The editing cursor is shown as a blinking left arrow over the first character in theline to be edited. Since the editing in this case consists of removing somecharacters and replacing them with others, we will use the right and left arrowkeys, š™, to move the cursor to the appropriate place for editing, and thedelete key, ƒ, to eliminate characters.
The following keystrokes will complete the editing for this case:Θ Press the right arrow key, ™, until the cursor is immediately to the rightof the decimal point in the term 1.75
Θ Press the delete key, ƒ, twice to erase the characters 1.
Θ Press the right arrow key, ™, once, to move the cursor to the right ofthe 7Θ Type a decimal point with .
Θ Press the right arrow key, ™, until the cursor is immediately to the rightof the √5Θ Press the delete key, ƒ, once to erase the Character 5
Θ Type a 3 with 3
Θ Press ` to return to the stack
The edited expression is now available in the stack.

Editing of a line of input when the calculator is in Algebraic operating mode isexactly the same as in the RPN mode. You can repeat this example in
Algebraic mode to verify this assertion.

Creating algebraic expressions
Algebraic expressions include not only numbers, but also variable names. As
an example, we will enter the following algebraic expression:

x
R +2L
R+ y
b

2L 1 +

Page 2-7

We set the calculator operating mode to Algebraic, the CAS to Exact, and thedisplay to Textbook. To enter this algebraic expression we use the following
keystrokes:³2*~l*R„Ü1+~„x/~r™/„ Ü ~r+~„y™+2*~l/~„b
Press ` to get the following result:Entering this expression when the calculator is set in the RPN mode is exactly
the same as this Algebraic mode exercise.

Editing algebraic expressions
Editing of an algebraic expression with the line editor is very similar to that ofan arithmetic expression (see exercise above). Suppose that we want to modify
the expression entered above to readx2
R +2 LR+xb

2L 1 +To edit this algebraic expression using the line editor use „˜. This
activates the line editor, showing the expression to be edited as follows:

The editing cursor is shown as a blinking left arrow over the first character inthe line to be edited. As in an earlier exercise on line editing, we will use theright and left arrow keys, š™, to move the cursor to the appropriate placefor editing, and the delete key, ƒ, to eliminate characters.
The following keystrokes will complete the editing for this case:

Page 2-8

Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ

Press the right arrow key, ™, until the cursor is to the right of the xType Q2 to enter the power 2 for the xPress the right arrow key, ™, until the cursor is to the right of the y
Press the delete key, ƒ, once to erase the characters y.
Type ~„x to enter an x
Press the right arrow key, ™, 4 times to move the cursor to the right ofthe *Type R to enter a square root symbol
Type „Ü to enter a set of parentheses (they come in pairs)
Press the right arrow key, ™, once, and the delete key, ƒ, once, todelete the right parenthesis of the set inserted above
Press the right arrow key, ™, 4 times to move the cursor to the right ofthe bType „Ü to enter a second set of parentheses
Press the delete key, ƒ, once, to delete the left parenthesis of the set
inserted above.
Press ` to return to normal calculator display.

The result is shown next:

Notice that the expression has been expanded to include terms such as|R|, the absolute value, and SQ(b⋅R), the square of b⋅R. To see if we cansimplify this result, use FACTOR(ANS(1)) in ALG mode:ΘPress „˜ to activate the line editor once more. The result is now:

Page 2-9

Θ

Pressing ` once more to return to normal display.

To see the entire expression in the screen, we can change the option _Small
Stack Disp in the DISPLAY MODES input form (see Chapter 1). After
effecting this change, the display will look as follows:

Note: To use Greek letters and other characters in algebraic expressions use
the CHARS menu. This menu is activated by the keystroke combination…±. Details are presented in Appendix D.

Using the Equation Writer (EQW) to create expressions
The equation writer is an extremely powerful tool that not only let you enter or
see an equation, but also allows you to modify and work/apply functions on allor part of the equation. The equation writer (EQW), therefore, allows you to
perform complex mathematical operations, directly, or in a step-by-step mode,
as you would do on paper when solving, for example, calculus problems.
The Equation Writer is launched by pressing the keystroke combination …
‚O (the third key in the fourth row from the top in the keyboard). The
resulting screen is the following:

Page 2-10

The six soft menu keys for the Equation Writer activate the following functions:@EDIT: lets the user edit an entry in the line editor (see examples above)@CURS: highlights expression and adds a graphics cursor to it@BIG: if selected (selection shown by the character in the label) the font used in
the writer is the system font 8 (the largest font available)@EVAL: lets you evaluate, symbolically or numerically, an expression highlighted
in the equation writer screen (similar to …μ)@FACTO: lets you factor an expression highlighted in the equation writer screen (iffactoring is possible)@SIMP: lets you simplify an expression highlighted in the equation writer screen(as much as it can be simplified according to the algebraic rules of the CAS)
If you press the L key, two more soft menu options show up as shown below:

The six soft menu keys for the Equation Writer activate the following functions:@CMDS: allows access to the collection of CAS commands listed in alphabeticalorder. This is useful to insert CAS commands in an expression available in the
Equation Writer.
@HELP: activates the calculator’s CAS help facility to provide information andexamples of CAS commands.
Some examples for the use of the Equation Writer are shown below.

Creating arithmetic expressions
Entering arithmetic expressions in the Equation Writer is very similar to entering
an arithmetic expression in the stack enclosed in quotes. The main difference isthat in the Equation Writer the expressions produced are written in “textbook”
style instead of a line-entry style. Thus, when a division sign (i.e., /) isentered in the Equation Writer, a fraction is generated and the cursor placed in
the numerator. To move to the denominator you must use the down arrow key.
For example, try the following keystrokes in the Equation Writer screen:
5/5+2

Page 2-11

The result is the expression

The cursor is shown as a left-facing key. The cursor indicates the current edition
location. Typing a character, function name, or operation will enter thecorresponding character or characters in the cursor location. For example, forthe cursor in the location indicated above, type now:*„Ü5+1/3
The edited expression looks as follows:

Suppose that you want to replace the quantity between parentheses in the
denominator (i.e., 5+1/3) with (5+π2/2). First, we use the delete key (ƒ)
delete the current 1/3 expression, and then we replace that fraction with π2/2,
as follows: ƒƒƒ„ìQ2
When we hit this point the screen looks as follows:

In order to insert the denominator 2 in the expression, we need to highlight theentire π2 expression. We do this by pressing the right arrow key (™) once. At
that point, we enter the following keystrokes: /2
The expression now looks as follows:

Page 2-12

Suppose that now you want to add the fraction 1/3 to this entire expression,i.e., you want to enter the expression:

5
5 + 2 ⋅ (5 +

π

2

2

+
)

1
3

First, we need to highlight the entire first term by using either the right arrow(™) or the upper arrow (—) keys, repeatedly, until the entire expression ishighlighted, i.e., seven times, producing:

NOTE: Alternatively, from the original position of the cursor (to the right of the 2in the denominator of π2/2), we can use the keystroke combination ‚—,interpreted as (‚ ‘ ).
Once the expression is highlighted as shown above, type +1/3 to
add the fraction 1/3. Resulting in:Page 2-13

Showing the expression in smaller-size
To show the expression in a smaller-size font (which could be useful if theexpression is long and convoluted), simply press the @BIG soft menu key. For thiscase, the screen looks as follows:

To recover the larger-font display, press the @BIG soft menu key once more.
Evaluating the expression
To evaluate the expression (or parts of the expression) within the Equation
Writer, highlight the part that you want to evaluate and press the @EVAL soft
menu key.
For example, to evaluate the entire expression in this exercise, first, highlight theentire expression, by pressing ‚ ‘. Then, press the @EVAL soft menu key. If
your calculator is set to Exact CAS mode (i.e., the _Approx CAS mode is notchecked), then you will get the following symbolic result:

If you want to recover the unevaluated expression at this time, use the function
UNDO, i.e., …¯(the first key in the third row of keys from the top of the
keyboard). The recovered expression is shown highlighted as before:

Page 2-14

If you want a floating-point (numerical) evaluation, use the NUM function(i.e., …ï). The result is as follows:

Use the function UNDO ( …¯) once more to recover the original
expression:

Evaluating a sub-expression
Suppose that you want to evaluate only the expression in parentheses in the
denominator of the first fraction in the expression above. You have to use thearrow keys to select that particular sub-expression. Here is a way to do it:
˜ Highlights only the first fraction
˜ Highlights the numerator of the first fraction™
Highlights denominator of the first fraction
˜ Highlights first term in denominator of first fraction™
Highlights second term in denominator of first fraction
˜ Highlights first factor in second term in denominator of first fraction™
Highlights expression in parentheses in denominator of first fraction

Since this is the sub-expression we want evaluated, we can now press the @EVAL
soft menu key, resulting in:Page 2-15

A symbolic evaluation once more. Suppose that, at this point, we want toevaluate the left-hand side fraction only. Press the upper arrow key (—) threetimes to select that fraction, resulting in:

Then, press the @EVAL soft menu key to obtain:

Let’s try a numerical evaluation of this term at this point. Use …ï toobtain:Let’s highlight the fraction to the right, and obtain a numerical evaluation of thatterm too, and show the sum of these two decimal values in small-font format byusing:™ …ï C, we get:To highlight and evaluate the expression in the Equation Writer we use: —D, resulting in:Page 2-16

Editing arithmetic expressions
We will show some of the editing features in the Equation Writer as an exercise.
We start by entering the following expression used in the previous exercises:

And will use the editing features of the Equation Editor to transform it into thefollowing expression:

In the previous exercises we used the arrow keys to highlight sub-expressions forevaluation. In this case, we will use them to trigger a special editing cursor.
After you have finished entering the original expression, the typing cursor (a leftpointing arrow) will be located to the right of the 3 in the denominator of thesecond fraction as shown here:

Page 2-17

Press the down arrow key (˜) to trigger the clear editing cursor. The screen
now looks like this:By using the left arrow key (š) you can move the cursor in the general left
direction, but stopping at each individual component of the expression. For
example, suppose that we will first will transform the expression π 2/2 into theexpression LN(π5/3) . With the clear cursor active, as shown above, press theleft-arrow key (š) twice to highlight the 2 in the denominator of π 2/2. Next,
press the delete key (ƒ) once to change the cursor into the insertion cursor.
Press ƒ once more to delete the 2, and then 3 to enter a 3. At this point,
the screen looks as follows:

Next, press the down arrow key (˜) to trigger the clear editing cursor
highlighting the 3 in the denominator of π 2/3. Press the left arrow key (š)
once to highlight the exponent 2 in the expression π 2/3. Next, press the deletekey (ƒ) once to change the cursor into the insertion cursor. Press ƒ once
more to delete the 2, and then 5 to enter a 5. Press the upper arrow key(—) three times to highlight the expression π 5/3. Then, type ‚¹ toapply the LN function to this expression. The screen now looks like this:

Next, we’ll change the 5 within the parentheses to a ½ by using these
keystrokes:
šƒƒ1/2
Next, we highlight the entire expression in parentheses an insert the square root
symbol by using:————R

Page 2-18

Next, we’ll convert the 2 in front of the parentheses in the denominator into a
2/3 by using:šƒƒ2/3At this point the expression looks as follows:

The final step is to remove the 1/3 in the right-hand side of the expression. Thisis accomplished by using: —————™ƒƒƒƒƒ
The final version will be:

In summary, to edit an expression in the Equation Writer you should use thearrow keys (š™—˜) to highlight expression to which functions will beapplied (e.g., the LN and square root cases in the expression above). Use thedown arrow key (˜) in any location, repeatedly, to trigger the clear editing
cursor. In this mode, use the left or right arrow keys (š™) to move from term
to term in an expression. When you reach a point that you need to edit, use thedelete key (ƒ) to trigger the insertion cursor and proceed with the edition of
the expression.

Creating algebraic expressions
An algebraic expression is very similar to an arithmetic expression, except that
English and Greek letters may be included. The process of creating an
algebraic expression, therefore, follows the same idea as that of creating anarithmetic expression, except that use of the alphabetic keyboard is included.
To illustrate the use of the Equation Writer to enter an algebraic equation wewill use the following example. Suppose that we want to enter the expression:

2
3⎛ x + 2μ ⋅ Δy ⎞
⎟
1/ 3
⎝ θ
⎠

λ + e − μ ⋅ LN ⎜Page 2-19

Use the following keystrokes:
2 / R3 ™™ * ~‚n+ „¸\ ~‚m™™ * ‚¹ ~„x + 2 * ~‚m * ~‚c~„y ——— / ~‚t Q1/3
This results in the output:

In this example we used several lower-case English letters, e.g., x (~„x),several Greek letters, e.g., λ (~‚n), and even a combination of Greek
and English letters, namely, Δy (~‚c~„y). Keep in mind that toenter a lower-case English letter, you need to use the combination: ~„followed by the letter you want to enter. Also, you can always copy special
characters by using the CHARS menu (…±) if you don’t want to memorize
the keystroke combination that produces it. A listing of commonly used~‚keystroke combinations was listed in an earlier section.
The expression tree
The expression tree is a diagram showing how the Equation Writer interprets an
expression. See Appendix E for a detailed example.
The CURS function
The CURS function (@CURS) in the Equation Writer menu (the B key) converts
the display into a graphical display and produces a graphical cursor that canbe controlled with the arrow keys (š™—˜) for selecting subexpressions. The sub-expression selected with @CURS will be shown framed in thegraphics display. After selecting a sub-expression you can press ` to show
the selected sub-expression highlighted in the Equation writer. The following
figures show different sub-expressions selected with and the corresponding
Equation Writer screen after pressing `.

Page 2-20

Editing algebraic expressions
The editing of algebraic equations follows the same rules as the editing ofalgebraic equations. Namely:Θ Use the arrow keys (š™—˜) to highlight expressions
Θ Use the down arrow key (˜), repeatedly, to trigger the clear editing
cursor . In this mode, use the left or right arrow keys (š™) to movefrom term to term in an expression.
Θ At an editing point, use the delete key (ƒ) to trigger the insertion
cursor and proceed with the edition of the expression.
To see the clear editing cursor in action, let’s start with the algebraic expressionthat we entered in the exercise above:

Press the down arrow key, ˜, at its current location to trigger the clear editing
cursor. The 3 in the exponent of θ will be highlighted. Use the left arrow key,
š, to move from element to element in the expression. The order of selectionof the clear editing cursor in this example is the following (press the left arrow
key, š, repeatedly):
1. The 1 in the 1/3 exponent

Page 2-21

2. θ
3. Δy
4. μ
5. 2
6. x
7. μ in the exponential function
8. λ
9. 3 in the √3 term
10. the 2 in the 2/√3 fraction
At any point we can change the clear editing cursor into the insertion cursor bypressing the delete key (ƒ). Let’s use these two cursors (the clear editing
cursor and the insertion cursor) to change the current expression into thefollowing:If you followed the exercise immediately above, you should have the clear
editing cursor on the number 2 in the first factor in the expression. Follow these
keystrokes to edit the expression:™ ~‚2Enters the factorial for the 3 in the square root
(entering the factorial changes the cursor to the selection cursor)
˜˜™™
Selects the μ in the exponential function/3*~‚f Modifies exponential function argument™™™™
Selects ΔyR
Places a square root symbol on Δy(this operation also changes the cursor to the selection cursor)
˜˜™—— SSelect θ1/3 and enter the SIN function
The resulting screen is the following:

Page 2-22

Evaluating a sub-expression( )Since we already have the sub-expression SIN θ 1 / 3 highlighted, let’s press
the @EVAL soft menu key to evaluate this sub-expression. The result is:Some algebraic expressions cannot be simplified anymore. Try the following
keystrokes: —D. You will notice that nothing happens, other than thehighlighting of the entire argument of the LN function. This is because thisexpression cannot be evaluated (or simplified) any more according to the CAS
rules. Trying the keystrokes: —D again does not produce any changes on
the expression. Another sequence of —D keystrokes, however, modifies
the expression as follows:

One more application of the —D keystrokes produces more changes:

This expression does not fit in the Equation Writer screen. We can see theentire expression by using a smaller-size font. Press the @BIG soft menu key toget:Even with the larger-size font, it is possible to navigate through the entire
expression by using the clear editing cursor. Try the following keystroke
sequence: C˜˜˜˜, to set the clear editing cursor atop the factor

Page 2-23

3 in the first term of the numerator. Then, press the right arrow key, ™, tonavigate through the expression.
Simplifying an expression
Press the @BIG soft menu key to get the screen to look as in the previous figure(see above). Now, press the @SIMP soft menu key, to see if it is possible tosimplify this expression as it is shown in the Equation Writer. The result is thefollowing screen:This screen shows the argument of the SIN function, namely, 3 θ , transformed
LN (θ )
3.

into eThis may not seem like a simplification, but it is in the sense thatthe cubic root function has been replaced by the inverse functions exp-LN.
Factoring an expression
In this exercise we will try factoring a polynomial expression. To continue theprevious exercise, press the ` key. Then, launch the Equation Writer again
by pressing the ‚O key. Type the equation:
XQ2™+2*X*~y+~y Q2™~‚a Q2™™+~‚b Q2
resulting inLet’s select the first 3 terms in the expression and attempt a factoring of this subexpression: ‚—˜‚™‚™ . This produces:Now, press the @FACTO soft menu key, to get

Page 2-24

Press ‚¯to recover the original expression. Next, enter the following
keystrokes: ˜˜˜™™™™™™™———‚™ to selectthe last two terms in the expression, i.e.,press the @FACTO soft menu key, to get

Press ‚¯to recover the original expression. Now, let’s select the entire
expression by pressing the upper arrow key (—) once. And press the @FACTO
soft menu key, to get

Press ‚¯to recover the original expression.
Note: Pressing the @EVAL or the @SIMP soft menu keys, while the entire original
expression is selected, produces the following simplification of the expression:

Using the CMDS menu key
With the original polynomial expression used in the previous exercise still
selected, press the L key to show the @CMDS and @HELP soft menu keys. These
two commands belong to the second part of the soft menu available with the
Equation Writer. Let’s try this example as an application of the @CMDS soft menu
key: Press the @CMDS soft menu key to get the list of CAS commands:

Page 2-25

Next, select the command DERVX (the derivative with respect to the variable X,
the current CAS independent variable) by using: ~d˜˜˜ .
Command DERVX will now be selected:

Press the @@OK@@ soft menu key to get:

Next, press the L key to recover the original Equation Writer menu, andpress the @EVAL@ soft menu key to evaluate this derivative. The result is:Using the HELP menu
Press the L key to show the @CMDS and @HELP soft menu keys. Press the @HELP
soft menu key to get the list of CAS commands. Then, press ~ d ˜ ˜˜ to select the command DERVX. Press the @@OK@@ soft menu key to get
information on the command DERVX:

Page 2-26

Detailed explanation on the use of the help facility for the CAS is presented in
Chapter 1. To return to the Equation Writer, press the @EXIT soft menu key. Pressthe ` key to exit the Equation Writer.
Using the editing functions BEGIN, END, COPY, CUT and PASTE
To facilitate editing, whether with the Equation Writer or on the stack, thecalculator provides five editing functions, BEGIN, END, COPY, CUT and PASTE,
activated by combining the right-shift key (‚) with keys (2,1), (2,2), (3,1),(3,2), and (3,3), respectively. These keys are located in the leftmost part ofrows 2 and 3. The action of these editing functions are as follows:
BEGIN: marks the beginning of a string of characters for editing
END:

marks the ending of a string of characters for editing

COPY: copies the string of characters selected by BEGIN and END
CUT:cuts the string of characters selected by BEGIN and END

PASTE: pastes a string of characters, previously copied or cut, into the current
cursor position
To see and example, lets start the Equation Writer and enter the following
expression (used in an earlier exercise):
2 / R3 ™™ * ~‚m + „¸\ ~‚m™™ * ‚¹ ~„x + 2 * ~‚m * ~‚c~„y ——— / ~‚t Q1/3
The original expression is the following:

We want to remove the sub-expression x+2⋅λ⋅Δy from the argument of the LN
function, and move it to the right of the λ in the first term. Here is one
possibility: ˜ššš———‚ªšš—*‚¬The modified expression looks as follows:

Page 2-27

Next, we’ll copy the fraction 2/√3 from the leftmost factor in the expression,and place it in the numerator of the argument for the LN function. Try thefollowing keystrokes:
˜˜šš———‚¨˜˜‚™ššš‚¬The resulting screen is as follows:

The functions BEGIN and END are not necessary when operating in the
Equation Writer, since we can select strings of characters by using the arrow
keys. Functions BEGIN and END are more useful when editing an expression
with the line editor. For example, let’s select the expression x+2⋅λ⋅Δy from thisexpression, but using the line editor within the Equation Writer, as follows:‚—A
The line editor screen will look like this (quotes shown only if calculator in RPNmode):To select the sub-expression of interest, use:™™™™™™™™‚¢™™™™™™™™™™‚¤
The screen shows the required sub-expression highlighted:

Page 2-28

We can now copy this expression and place it in the denominator of the LN
argument, as follows:‚¨™™… (27 times) … ™
ƒƒ… (9 times) … ƒ ‚¬The line editor now looks like this:Pressing ` shows the expression in the Equation Writer (in small-font format,
press the @BIG soft menu key):Press ` to exit the Equation Writer.

Creating and editing summations, derivatives, and integrals
Summations, derivatives, and integrals are commonly used for calculus,
probability and statistics applications. In this section we show some examples
of such operations created with the equation writer. Use ALG mode.

Summations
We will use the Equation Writer to enter the following summation:
∞

1

∑k
k =1

2

Press ‚O to activate the Equation Writer. Then press ‚½to enter thesummation sign. Notice that the sign, when entered into the Equation Writerscreen, provides input locations for the index of the summation as well as for thequantity being summed. To fill these input locations, use the following
keystrokes:~„k™1™„è™1/~„kQ2
The resulting screen is:Page 2-29

To see the corresponding expression in the line editor, press ‚— and theA soft menu key, to show:

This expression shows the general form of a summation typed directly in thestack or line editor:

Σ(index = starting_value, ending_value, summation expression)
Press ` to return to the Equation Writer. The resulting screen shows the valueof the summation,

To recover the unevaluated summation use ‚¯. To evaluate thesummation again, you can use the D soft menu key. This shows again that1 π2 .
=∑
26
k =1 k∞You can use the Equation Writer to prove that∞1

∑ k = +∞ .
k =1This summation (representing an infinite series) is said to diverge.
Double summations are also possible, for example:

Derivatives
We will use the Equation Writer to enter the following derivative:d(α ⋅ t 2 + β ⋅ t + δ )dt
Press ‚O to activate the Equation Writer. Then press ‚¿to enter the(partial) derivative sign. Notice that the sign, when entered into the Equation
Writer screen, provides input locations for the expression being differentiatedPage 2-30

and the variable of differentiation. To fill these input locations, use the following
keystrokes:~„t™~‚a*~„tQ2™™+~‚b*~„t+~‚d
The resulting screen is the following:

To see the corresponding expression in the line editor, press ‚— and theA soft menu key, to show:

This indicates that the general expression for a derivative in the line editor or in∂variable(function of variables)
the stack is:
Press ` to return to the Equation Writer. The resulting screen is not thederivative we entered, however, but its symbolic value, namely,

To recover the derivative expression use ‚¯. To evaluate the derivative
again, you can use the D soft menu key. This shows again thatd(α ⋅ t 2 − β ⋅ t + δ ) = 2α ⋅ t + β .
dtSecond order derivatives are possible, for example:

which evaluates to:Page 2-31

∂( ) is proper of partial derivatives. The proper∂xd( ) . The
notation for total derivatives (i.e., derivatives of one variable) isdx
Note: The notation

calculator, however, does not distinguish between partial and total derivatives.
Definite integrals
We will use the Equation Writer to enter the following definite
integral:τ∫ t ⋅ sin(t ) ⋅ dt . Press ‚O to activate the Equation Writer. Then0press ‚ Á to enter the integral sign. Notice that the sign, when enteredinto the Equation Writer screen, provides input locations for the limits ofintegration, the integrand, and the variable of integration. To fill these input
locations, use the following keystrokes:0™~‚u™~ „t*S~„t™~„t. The resulting screen is the following:

To see the corresponding expression in the line editor, press —— and theA soft menu key, to show:

This indicates that the general expression for a derivative in the line editor or in
the stack is: ∫(lower_limit, upper_limit,integrand,variable_of_integration)
Press ` to return to the Equation Writer. The resulting screen is not thedefinite integral we entered, however, but its symbolic value, namely,

To recover the derivative expression use ‚¯. To evaluate the derivative
again, you can use the D soft menu key. This shows again that

Page 2-32

τ∫ t ⋅ sin(t ) ⋅ dt = sin(τ ) − τ ⋅ cos(τ )0Double integrals are also possible. For example,

which evaluates to 36. Partial evaluation is possible, for example:

This integral evaluates to 36.

Organizing data in the calculator
You can organize data in your calculator by storing variables in a directorytree. To understand the calculator’s memory, we first take a look at the file
directory. Press the keystroke combination „¡ (first key in second row ofkeys from the top of the keyboard) to get the calculator’s File Manager screen:This screen gives a snapshot of the calculator’s memory and of the directorytree. The screen shows that the calculator has three memory ports (or memory
partitions), port 0:IRAM, port 1:ERAM, and port 2:FLASH . Memory ports areused to store third party application or libraries, as well as for backups. The
size of the three different ports is also indicated. The fourth and subsequentlines in this screen show the calculator’s directory tree. The top directory(currently highlighted) is the Home directory, and it has predefined into it a subdirectory called CASDIR. The File Manager screen has three functions
associated with the soft-menu keys:

Page 2-33

@CHDIR:

Change to selected directory@CANCL:

Cancel action@@OK@@:
Approve a selection
For example, to change directory to the CASDIR, press the down-arrow key,
˜, and press @CHDIR. This action closes the File Manager window and returns
us to normal calculator display. You will notice that the second line from the top
in the display now starts with the characters { HOME CASDIR } indicating thatthe current directory is CASDIR within the HOME directory.

Functions for manipulation of variables
This screen includes 20 commands associated with the soft menu keys that canbe used to create, edit, and manipulate variables. The first six functions are thefollowing:@EDIT To edit a highlighted variable@COPY To copy a highlighted variable@MOVE To move a highlighted variable@@RCL@ To recall the contents of a highlighted variable@EVAL To evaluate a highlighted variable@TREE To see the directory tree where the variable is contained
If you press the L key, the next set of functions is made available:@PURGE To purge, or delete, a variable@RENAM To rename a variable@NEW To create a new variable@ORDER To order a set of variables in the directory@SEND To send a variable to another calculator or computer@RECV To receive a variable from another calculator or computer
If you press the L key, the third set of functions is made available:@HALT To return to the stack temporarily@VIEW To see contents of a variable@EDITB To edit contents of a binary variable (similar to @EDIT)@HEADE To show the directory containing the variable in the header@LIST Provides a list of variable names and description@SORT To sort variables according to a sorting criteria
If you press the L key, the last set of functions is made available:@XSEND To send variable with X-modem protocol@CHDIR To change directory

Page 2-34

To move between the different soft menu commands, you can use not only theNEXT key (L), but also the PREV key („«).
The user is invited to try these functions on his or her own. Their applications
are straightforward.

The HOME directory
The HOME directory, as pointed out earlier, is the base directory for memory
operation for the calculator. To get to the HOME directory, you can press the
UPDIR function („§) -- repeat as needed -- until the {HOME} spec isshown in the second line of the display header. Alternatively, you can use„(hold) §, press ` if in the algebraic mode. For this example, the
HOME directory contains nothing but the CASDIR. Pressing J will show thevariables in the soft menu keys:

Subdirectories
To store your data in a well organized directory tree you may want to create
subdirectories under the HOME directory, and more subdirectories within
subdirectories, in a hierarchy of directories similar to folders in modern
computers. The subdirectories will be given names that may reflect thecontents of each subdirectory, or any arbitrary name that you can think of.

The CASDIR sub-directory
The CASDIR sub-directory contains a number of variables needed by the proper
operation of the CAS (Computer Algebraic System, see appendix C). To see
the contents of the directory, we can use the keystroke combination:„¡which opens the File Manager once more:

Page 2-35

This time the CASDIR is highlighted in the screen. To see the contents of thedirectory press the @@OK@@ soft menu key or `, to get the following screen:

The screen shows a table describing the variables contained in the CASDIR
directory. These are variables pre-defined in the calculator memory that
establish certain parameters for CAS operation (see appendix C). The table
above contains 4 columns:• The first column indicate the type of variable (e.g., ‘EQ’ means anequation-type variable, |R indicates a real-value variable, { } means a list,
nam means ‘a global name’, and the symbol
represents a graphic
variable.
• The second column represents the name of the variables, i.e., PRIMIT,
CASINFO, MODULO, REALASSUME, PERIOD, VX, and EPS.
• Column number 3 shows another specification for the variable type, e.g.,
ALG means an algebraic expression, GROB stands for graphics object,
INTG means an integer numeric variable, LIST means a list of data,
GNAME means a global name, and REAL means a real (or floating-point)
numeric variable.
• The fourth and last column represents the size, in bytes, of the variable
truncated, without decimals (i.e., nibbles). Thus, for example, variable
PERIOD takes 12.5 bytes, while variable REALASSUME takes 27.5 bytes (1byte = 8 bits, 1 bit is the smallest unit of memory in computers andcalculators).
CASDIR Variables in the stack
Pressing the $ key closes the previous screen and returns us to normal
calculator display. By default, we get back the TOOL menu:

We can see the variables contained in the current directory, CASDIR, bypressing the J key (first key in the second row from the top of the keyboard).
This produces the following screen:

Page 2-36

Pressing the L key shows one more variable stored in this directory:•••

To see the contents of the variable EPS, for example, use ‚@EPS@. Thisshows the value of EPS to be .0000000001
To see the value of a numerical variable, we need to press only the soft
menu key for the variable. For example, pressing cz followed by `,shows the same value of the variable in the stack, if the calculator is set to
Algebraic. If the calculator is set to RPN mode, you need only press the soft
menu key for `.
To see the full name of a variable, press the tickmark key first, ³, andthen the soft menu key corresponding to the variable. For example, for thevariable listed in the stack as PERIO, we use: ³@PERIO@, which produces
as output the string: 'PERIOD'. This procedure applies to both the
Algebraic and RPN calculator operating modes.

Variables in CASDIR
The default variables contained in the CASDIR directory are the following:
PRIMIT

Latest primitive (anti-derivative) calculated, not a default
variable, but one created by a previous exercise

CASINFOa graph that provides CAS information

MODULO

Modulo for modular arithmetic (default = 13)

REALASSUME

List of variable names assumed as real values

PERIOD

Period for trigonometric functions (default = 2π)

VX

Name of default independent variable (default = X)

EPSValue of small increment (epsilon), (default = 10 -10)

These variables are used for the operation of the CAS.

Typing directory and variable names
To name subdirectories, and sometimes, variables, you will have to type stringsof letters at once, which may or may not be combined with numbers. Rather
than pressing the ~, ~„, or ~‚ key combinations to type eachletter, you can hold down the ~key and enter the various letter. You can also

Page 2-37

lock the alphabetic keyboard temporarily and enter a full name before
unlocking it again. The following combinations of keystrokes will lock thealphabetic keyboard:~~ locks the alphabetic keyboard in upper case. When locked in thisfashion, pressing the „ before a letter key produces a lower case letter, whilepressing the ‚ key before a letter key produces a special character. If thealphabetic keyboard is already locked in upper case, to lock it in lower case,type, „~~~„~ locks the alphabetic keyboard in lower case. When lockedin this fashion, pressing the „ before a letter key produces an upper caseletter. To unlock lower case, press „~To unlock the upper-case locked keyboard, press ~Let’s try some exercises typing directory/variable names in the stack. Assumingthat the calculator is in the Algebraic mode of operation (although the
instructions work as well in RPN mode), try the following keystroke sequences.
With these commands we will be typing the words ‘MATH’, ‘Math’, and ‘MatH’~~math`~~m„a„t„h`~~m„~at„h`
The calculator display will show the following (left-hand side is Algebraic mode,right-hand side is RPN mode):

Note: if system flag 60 is set, you can lock the alphabetical keyboard by justpressing ~. See Chapter 1 for more information on system flags.

Page 2-38

Creating subdirectories
Subdirectories can be created by using the FILES environment or by using thecommand CRDIR. The two approaches for creating sub-directories arepresented next.
Using the FILES menu
Regardless of the mode of operation of the calculator (Algebraic or RPN), we
can create a directory tree, based on the HOME directory, by using thefunctions activated in the FILES menu. Press „¡ to activate the FILES
menu. If the HOME directory is not already highlighted in the screen, i.e.,

use the up and down arrow keys (—˜) to highlight it. Then, press the @@OK@@soft menu key. The screen may look like this:showing that only one object exists currently in the HOME directory, namely, theCASDIR sub-directory. Let’s create another sub-directory called MANS (forMANualS) where we will store variables developed as exercises in this manual.
To create this sub-directory first enter: L @@NEW@@ . This will produce thefollowing input form:

Page 2-39

The Object input field, the first input field in the form, is highlighted by default.
This input field can hold the contents of a new variable that is being created.
Since we have no contents for the new sub-directory at this point, we simply
skip this input field by pressing the down-arrow key, ˜, once. The Name
input field is now highlighted:

This is where we enter the name of the new sub-directory (or variable, as thecase may be), as follows: ~~mans`
The cursor moves to the _Directory check field. Press the @@CHK@@ soft menu key
to specify that you are creating a directory, and press @@OK@@ to exit the input form.
The variable listing for the HOME directory will be shown in the screen as
follows:

The screen indicates that there is a new directory (MANS) within the HOME
directory.
Next, we will create a sub-directory named INTRO (for INTROduction), within
MANS, to hold variables created as exercise in subsequent sections of thischapter. Press the $ key to return to normal calculator display (the TOOLS
menu will be shown). Then, press J to show the HOME directory contents inthe soft menu key labels. The display may look like this (if you have createdother variables in the HOME directory they will show in the soft menu key labels
too):

Page 2-40

To move into the MANS directory, press the corresponding soft menu key (Ain this case), and ` if in algebraic mode. The directory tree will be shown inthe second line of the display as {HOME M NS}. However, there will be nolabels associated with the soft menu keys, as shown below, because there areno variables defined within this directory.
Let’s create the sub-directory INTRO by using:„¡@@OK@@ L @@NEW@@ ˜ ~~intro` @@CHK@@ @@OK@@
Press the $ key, followed by the J key, to see the contents of the MANS
directory as follows:

Press the )!INTRO soft menu key to move into the INTRO sub-directory. This willshow an empty sub-directory. Later on, we will do some exercises in creating
variables.
Using the command CRDIR
The command CRDIR can be used to create directories. This command isavailable through the command catalog key (the ‚N key, second key infourth row of keys from the top of the keyboard), through the programming
menus (the „°key, same key as the ‚N key), or by simply typing it.

•

Through the catalog key
Press ‚N~c. Use the up and down arrow keys (—˜) tolocate the CRDIR command. Press the @@OK@@ soft menu key to activate thecommand.

•Through the programming menus
Press „°. This will produce the following pull-down menu forprogramming:

Page 2-41

Use the down arrow key (˜) to select the option 2. MEMORY… , or justpress 2. Then, press @@OK@@. This will produce the following pull-downmenu:

Use the down arrow key (˜) to select the 5. DIRECTORY option, or justpress 5. Then, press @@OK@@. This will produce the following pull-downmenu:

Use the down arrow key (˜) to select the 5. CRDIR option, and press@@OK@@.
Command CRDIR in Algebraic mode
Once you have selected the CRDIR through one of the means shown above, thecommand will be available in your stack as follows:

At this point, you need to type a directory name, say chap1 :~~„~chap1~`
The name of the new directory will be shown in the soft menu keys, e.g.,

Command CRDIR in RPN mode
To use the CRDIR in RPN mode you need to have the name of the directoryalready available in the stack before accessing the command. For example:~~„~chap2~`
Then access the CRDIR command by either of the means shown above, e.g.,through the ‚N key:

Page 2-42

Press the @@OK@ soft menu key to activate the command, to create the subdirectory:

Moving among subdirectories
To move down the directory tree, you need to press the soft menu key
corresponding to the sub-directory you want to move to. The list of variables ina sub-directory can be produced by pressing the J (VARiables) key. To move
up in the directory tree, use the function UPDIR, i.e., enter „§.
Alternatively, you can use the FILES menu, i.e., press „¡. Use the up anddown arrow keys (—˜) to select the sub-directory you want to move to, andthen press the !CHDIR (CHange DIRectory) or A soft menu key. This will show
the contents of the sub-directory you moved to in the soft menu key labels.

Deleting subdirectories
To delete a sub-directory, use one of the following procedures:
Using the FILES menu
Press the „¡ key to trigger the FILES menu. Select the directory containing
the sub-directory you want to delete, and press the !CHDIR if needed. This willclose the FILES menu and display the contents of the directory you selected. In
this case you will need to press `. Press the @@OK@@ soft menu key to list thecontents of the directory in the screen. Select the sub-directory (or variable) thatyou want to delete. Press L@PURGE. A screen similar to the following will beshown:

Page 2-43

The ‘S2’ string in this form is the name of the sub-directory that is being deleted.
The soft menu keys provide the following options:@YES@
Proceed with deleting the sub-directory (or variable)@ALL@
Proceed with deleting all sub-directories (or variables)!ABORT
Do not delete sub-directory (or variable) from a list@@NO@@Do not delete sub-directory (or variable)
After selecting one of these four commands, you will be returned to the screen
listing the contents of the sub-directory. The !ABORT command, however, willshow an error message:and you will have to press @@OK@@, before returning to the variable listing.
Using the command PGDIR
The command PGDIR can be used to purge directories. Like the command
CRDIR, the PGDIR command is available through the ‚N or through the„°key, or it can simply be typed in.

•

Through the catalog key
Press ‚N~~pg. This should highlight the PGDIR command.
Press the @@OK@@ soft menu key to activate the command.

•

Through the programming menus
Press „°. This will produce the following pull-down menu forprogramming:

Page 2-44

Use the down arrow key (˜) to select the option 2. MEMORY… Then,press @@OK@@. This will produce the following pull-down menu:

Use the down arrow key (˜) to select the 5. DIRECTORY option. Then,press @@OK@@. This will produce the following pull-down menu:

Use the down arrow key (˜) to select the 6. PGDIR option, and press@@OK@@.
Command PGDIR in Algebraic mode
Once you have selected the PGDIR through one of the means shown above, thecommand will be available in your stack as follows:

At this point, you need to type the name of an existing directory, say S4 :~s4`
As a result, sub-directory )@@S4@@ is deleted:

Instead of typing the name of the directory, you can simply press thecorresponding soft menu key at the listing of the PGDIR( ) command, e.g.,

Page 2-45

Press @@OK@@, to get:Then, press )@@S3@@ to enter ‘S3’ as the argument to PGDIR.

Press ` to delete the sub-directory:

Command PGDIR in RPN mode
To use the PGDIR in RPN mode you need to have the name of the directory,
between quotes, already available in the stack before accessing the command.
For example: ³~s2`
Then access the PGDIR command by either of the means shown above, e.g.,through the ‚N key:Press the @@OK@ soft menu key to activate the command and delete the subdirectory:

Page 2-46

Using the PURGE command from the TOOL menu
The TOOL menu is available by pressing the I key (Algebraic and RPN
modes shown):

The PURGE command is available by pressing the @PURGE soft menu key. In thefollowing examples we want to delete sub-directory S1:•

Algebraic mode: Enter @PURGE J)@@S1@@`•

RPN mode:Enter J³@S1@@ `I@PURGE J

Variables
Variables are like files on a computer hard drive. One variable can store one
object (numerical values, algebraic expressions, lists, vectors, matrices,
programs, etc). Even sub-directories can be through of as variables (in fact, inthe calculator, a subdirectory is also a type of calculator object).
Variables are referred to by their names, which can be any combination ofalphabetic and numerical characters, starting with a letter (either English or
Greek). Some non-alphabetic characters, such as the arrow (→) can be used ina variable name, if combined with an alphabetical character. Thus, ‘→A’ is avalid variable name, but ‘→’ is not. Valid examples of variable names are: ‘A’,
‘B’, ‘a’, ‘b’, ‘α’, ‘β’, ‘A1’, ‘AB12’, ‘A12’,’Vel’,’Z0’,’z1’, etc.
A variable can not have the same name than a function of the calculator. You
can not have a SIN variable for example as there is a SIN command in thecalculator. The reserved calculator variable names are the following:
ALRMDAT, CST, EQ, EXPR, IERR, IOPAR, MAXR, MINR, PICT, PPAR, PRTPAR,
VPAR, ZPAR, der_, e, i, n1,n2, …, s1, s2, …, ΣDAT, ΣPAR, π, ∞Variables can be organized into sub-directories.

Creating variables
To create a variable, we can use the FILES menu, along the lines of theexamples shown above for creating a sub-directory. For example, within the
sub-directory {HOME M NS INTRO}, created in an earlier example, we want
to store the following variables with the values shown:

Page 2-47

Name

Contents

Type

A
α

12.5
-0.25

real
real

A12
Q
R
z1
p1

3×105
‘r/(m+r)'[3,2,1]
3+5i<< → r 'π*r^2' >>realalgebraic
vectorcomplexprogramUsing the FILES menu
We will use the FILES menu to enter the variable A. We assume that we are in
the sub-directory {HOME M NS INTRO}. To get to this sub-directory, use
the following: „¡ and select the INTRO sub-directory as shown in thisscreen:Press @@OK@@ to enter the directory. You will get a files listing with no entries (theINTRO sub-directory is empty at this point)

Press the L key to move to the next set of soft menu keys, and press the @@NEW@@soft menu key. This will produce the NEW VARIABLE input form:

Page 2-48

To enter variable A (see table above), we first enter its contents, namely, thenumber 12.5, and then its name, A, as follows: 12.5@@OK@@ ~a@@OK@@. Resulting in the following screen:

Press @@OK@@ once more to create the variable. The new variable is shown in thefollowing variable listing:

The listing indicates a real variable (|R), whose name is A, and that occupies
10.5 bytes of memory. To see the contents of the variable in this screen, press
L@VIEW@.
• Press the @GRAPH soft menu key to see the contents in a graphical format.

•••

Press the @TEXT soft menu key to see the contents in text format.
Press @@OK@@ to return to the variable list
Press $ once more to return to normal display. Variable A should now
be featured in the soft menu key labels:

Page 2-49

Using the STO command
A simpler way to create a variable is by using the STO command (i.e., the Kkey). We provide examples in both the Algebraic and RPN modes, by creating
the remaining of the variables suggested above, namely:

•

Name
α

Contents
-0.25

Type
real

A12
Q
R
z1
p1

3×105
‘r/(m+r)'[3,2,1]
3+5i<< → r 'π*r^2' >>realalgebraic
vectorcomplexprogram

Algebraic modeUse the following keystrokes to store the value of –0.25 into variable α:0.25\ K ~‚a. AT this point, the screen will
look as follows:This expression means that the value –0.25 is being stored into α (thesymbol  suggests the operation). Press ` to create the variable.
The variable is now shown in the soft menu key labels when you press
J:

The following are the keystrokes required to enter the remaining
variables:
A12: 3V5K~a12`
Q: ~„r/„Ü~„m+~„r™™ K~q`
R: „Ô3‚í2‚í1™ K~r`

Page 2-50

z1: 3+5*„¥ K~„z1` (if needed,
accept change to Complex mode)
p1: ‚å‚é~„r³„ì*~„rQ2™™™ K~„p1`.
The screen, at this point, will look as follows:

You will see six of the seven variables listed at the bottom of the screen:
p1, z1, R, Q, A12, α.

•

RPN mode
Use the following keystrokes to store the value of –0.25 into variable α:.25\`³~‚a`. At this point, the screen
will look as follows:

With –0.25 on the level 2 of the stack and 'α' on the level 1 of thestack, you can use the K key to create the variable. The variable is
now shown in the soft menu key labels when you press J:

To enter the value 3×105 into A12, we can use a shorter version of theprocedure: 3V5³~a12` K
Here is a way to enter the contents of Q:
Q: ~„r/„Ü~„m+~„r™™ ³~q` K
To enter the value of R, we can use an even shorter version of theprocedure:
R: „Ô3#2#1™ ³~r K
Notice that to separate the elements of a vector in RPN mode we canuse the space key (#), rather than the comma (‚í ) used
above in Algebraic mode.

Page 2-51

z1: ³3+5*„¥ ³~„z1 K(ifneeded, accept change to Complex mode)
p1: ‚å‚é~„r³„ì*~„rQ2™™™ ³ ~„p1™` K.
The screen, at this point, will look as follows:

You will see six of the seven variables listed at the bottom of the screen:
p1, z1, R, Q, A12, α.

Checking variables contents
As an exercise on peeking into the contents of variables we will use the sevenvariables entered in the exercise above. We showed how to use the FILES menu
to view the contents of a variable in an earlier exercise when we created thevariable A. In this section we will show a simple way to look into the contents
of a variable.
Pressing the soft menu key label for the variableThis procedure will show the contents of a variable as long as the variable
contains a numerical value or an algebraic value, or an array. For example, forthe variables listed above, press the following keys to see the contents of thevariables:
Algebraic mode
Type these keystrokes: J@@z1@@ ` @@@R@@ `@@@Q@@@ `. At this point, thescreen looks as follows:

Next, type these keystrokes: @@A12@ `screen looks as follows:` L @@@A@@@ `. At this point, thePage 2-52

Pressing the soft menu key corresponding to p1 will provide an error message(try L @@@p1@@ `):Note: By pressing @@@p1@@ ` we are trying to activate (run) the p1 program.
However, this program expects a numerical input. Try the following exercise:$@@@p1@ „Ü5`. The result is:

The program has the following structure: << → r 'π*r^2' >>The « » symbols indicate a program in User RPL language. The characters → r
indicate that an input, to be referred to as r, is to be provided to the program.
The action from the program is to take that value of r and evaluate thealgebraic 'π*r^2'. In the example shown above, r took the value of 5, and thus
the value of πr2 = π⋅25 is returned. This program, therefore, calculates the areaof a circle given its radius r.
RPN mode
In RPN mode, you only need to press the corresponding soft menu key label to
get the contents of a numerical or algebraic variable. For the case underconsideration, we can try peeking into the variables z1, R, Q, A12, α, and A,
created above, as follows: J@@z1@@ @@@R@@ @@@Q@@ @@A12@@

Page 2-53

At this point, the screen looks like this:To see the contents of A, use: L @@@A@@@.
To run program p1 with r = 5, use: L5 @@@p1@@@.

Notice that to run the program in RPN mode, you only need to enter the input(5) and press the corresponding soft menu key. (In algebraic mode, you needto place parentheses to enter the argument).
Using the right-shift key ‚ followed by soft menu key labels
In Algebraic mode, you can display the content of a variable by pressing J@ and then the corresponding soft menu key. Try the following examples:J‚@@p1@@ ‚ @@z1@@ ‚ @@@R@@ ‚@@@Q@@ ‚ @@A12@@
Note: In RPN mode, you don’t need to press @ (just J and then thecorresponding soft menu key).
This produces the following screen (Algebraic mode in the left, RPN in the right)

Page 2-54

Notice that this time the contents of program p1 are listed in the screen. To see
the remaining variables in this directory, press L:
Listing the contents of all variables in the screen
Use the keystroke combination ‚˜ to list the contents of all variables in thescreen. For example:

Press $ to return to normal calculator display.

Replacing the contents of variables
Replacing the contents of a variable can be thought of as storing a different
value in the same variable name. Thus, the examples for creating variables
shown above can be used to illustrate the replacement of a variable’s content.
Using the STO command
Using as illustration the six variables, p1, z1, R, Q, A12, a, and A, createdearlier, we will proceed to change the contents of variable A12 (currently anumerical variable) with the algebraic expression ‘β/2’, using the STO
command. First, using the Algebraic operating mode:³~‚b/2™ K @@A12@@ `Check the new contents of variable A12 by using ‚@@A12@@ .
Using the RPN operating mode:³~‚b/2` ³@@A12@@ ` K
or, in a simplified way,³~‚b/2™ ³@@A12@@ K
Using the left-shift „ key followed by the variable’s soft menu key (RPN)
This is a very simple way to change the contents of a variable, but it only works
in the RPN mode. The procedure consists in typing the new contents of thevariable and entering them into the stack, and then pressing the left-shift key

Page 2-55

followed by the variable’s soft menu key. For example, in RPN, if we want tochange the contents of variable z1 to ‘a+b⋅i ’, use:³~„a+~„b*„¥`This will place the algebraic expression ‘a+b⋅i ’ in level 1: in the stack. To enter
this result into variable z1, use: J„@@@z1@@
To check the new contents of z1, use: ‚@@@z1@@
An equivalent way to do this in Algebraic mode is the following:~„a+~„b*„¥` K @@@z1@@ `To check the new contents of z1, use: ‚@@@z1@@
Using the ANS(1) variable (Algebraic mode)
In Algebraic mode one can use the ANS(1) variable to replace the contents ofa variable. For example, the procedure for changing the contents of z1 to‘a+bi’ is the following:„î K @@@z1@@ `. To check the new contentsof z1, use: ‚@@@z1@@

Copying variables
The following exercises show different ways of copying variables from one subdirectory to another.
Using the FILES menu
To copy a variable from one directory to another you can use the FILES menu.
For example, within the sub-directory {HOME MANS INTRO}, we havevariables p1, z1, R, Q, A12, α, and A. Suppose that we want to copy variable
A and place a copy in sub-directory {HOME MANS}. Also, we will copy
variable R and place a copy in the HOME directory. Here is how to do it:
Press „¡@@OK@@ to produce the following list of variables:

Use the down-arrow key ˜ to select variable A (the last in the list), then press@@COPY@. The calculator will respond with a screen labeled PICK DESTINATION:

Page 2-56

Use the up arrow key — to select the sub-directory MANS and press @@OK@@. If
you now press „§, the screen will show the contents of sub-directory
MANS (notice that variable A is shown in this list, as expected):Press $ @INTRO@ `(Algebraic mode), or $ @INTRO@ (RPN mode) to return to
the INTRO directory. Press „¡@@OK@@ to produce the list of variables in{HOME MANS INTRO}. Use the down arrow key (˜) to select variable R,then press @@COPY@. Use the up arrow key (—) to select the HOME directory,
and press @@OK@@. If you now press „§, twice, the screen will show thecontents of the HOME directory, including a copy of variable R:

Using the history in Algebraic mode
Here is a way to use the history (stack) to copy a variable from one directory toanother with the calculator set to the Algebraic mode. Suppose that we arewithin the sub-directory {HOME MANS INTRO}, and want to copy the contents
of variable z1 to sub-directory {HOME MANS}. Use the following procedure:‚@@z1@ K@@z1@ ` This simply stores the contents of z1 into itself (no change
effected on z1). Next, use „§` to move to the {HOME MANS} subdirectory. The calculator screen will look like this:Page 2-57

Next, use the delete key three times, to remove the last three lines in the display:ƒ ƒ ƒ. At this point, the stack is ready to execute the command
ANS(1)z1. Press ` to execute this command. Then, use ‚@@z1@, toverify the contents of the variable.
Using the stack in RPN mode
To demonstrate the use of the stack in RPN mode to copy a variable from one
sub-directory to another, we assume you are within sub-directory {HOME
MANS INTRO}, and that we will copy the contents of variable z1 into the
HOME directory. Use the following procedure:‚@@z1@ `³@@z1@ `This procedure lists the contents and the name of the variable in the stack. The
calculator screen will look like this:Now, use „§„§ to move to the HOME directory, and press K tocomplete the operation. Use ‚@@z1@, to verify the contents of the variable.
Copying two or more variables using the stack in Algebraic mode
The following is an exercise to demonstrate how to copy two or more variables
using the stack when the calculator is in Algebraic mode. Suppose, once more,that we are within sub-directory {HOME MANS INTRO} and that we want tocopy the variables R and Q into sub-directory {HOME MANS}. The keystrokes
necessary to complete this operation are shown following:‚@@ @R@@ K@@@R@@ `‚@@ @Q@@ K@@@Q@@ `„§`ƒ ƒ ƒ`
ƒƒƒƒ`To verify the contents of the variables, use ‚@@ @R@ and ‚@@ @Q.
This procedure can be generalized to the copying of three or more variables.

Page 2-58

Copying two or more variables using the stack in RPN mode
The following is an exercise to demonstrate how to copy two or more variables
using the stack when the calculator is in RPN mode. We assume, again, that
we are within sub-directory {HOME MANS INTRO} and that we want to copy
the variables R and Q into sub-directory {HOME MANS}. The keystrokes
necessary to complete this operation are shown following:‚@@ @R@@ ³@@@R@@ `‚@@ @Q@@ ³@@@Q@@ `„§K K
To verify the contents of the variables, use ‚@@ @R@ and ‚@@ @Q.
This procedure can be generalized to the copying of three or more variables.

Reordering variables in a directory
In this section we illustrate the use of the ORDER command to reorder thevariables in a directory. We assume we start within the sub-directory {HOME
MANS} containing the variables, A12, R, Q, z1, A, and the sub-directory
INTRO, as shown below. (Copy A12 from INTRO into MANS).

Algebraic mode
In this case, we have the calculator set to Algebraic mode. Suppose that wewant to change the order of the variables to INTRO, A, z1, Q, R, A12.
Proceed as follows to activate the ORDER function:„°˜@@OK@@

Select MEMORY from the programming menu˜˜˜˜ @@OK@@

Select DIRECTORY from the MEMORY menu—— @@OK@@

Select ORDER from the DIRECTORY menu

The screen will show the following input line:

Next, we’ll list the new order of the variables by using their names typed
between quotes:„ä ³)@INTRO ™‚í³@@@@A@@@™‚í³@@@z1@@™‚í³@@@Q@@@™
‚í³@@@@R@@@ ™‚í³@@A12@@ `Page 2-59

The screen now shows the new ordering of the variables:

RPN mode
In RPN mode, the list of re-ordered variables is listed in the stack before
applying the command ORDER. Suppose that we start from the same situation
as above, but in RPN mode, i.e.,

The reordered list is created by using:„ä )@INTRO @@@@A@@@ @@@z1@@ @@@Q@@@ @@@@R@@@ @@A12@@ `Then, enter the command ORDER, as done before, i.e.,„°˜@@OK@@
Select MEMORY from the programming menu˜˜˜˜ @@OK@
Select DIRECTORY from the MEMORY menu—— @@OK@@
Select ORDER from the DIRECTORY menu
The result is the following screen:

Moving variables using the FILES menu
To move a variable from one directory to another you can use the FILES menu.
For example, within the sub-directory {HOME MANS INTRO}, we havevariables p1, z1, R, Q, A12, α, and A. Suppose that we want to movevariable A12 to sub-directory {HOME MANS}. Here is how to do it: Press„¡@@OK@@ to show a variable list. Use the down-arrow key ˜ to selectvariable A12, then press @@MOVE@. The calculator will respond with a PICKDESTINATION screen. Use the up arrow key — to select the sub-directory
MANS and press @@OK@@. The screen will now show the contents of sub-directory{HOME MANS INTRO}:

Page 2-60

Notice that variable A12 is no longer there. If you now press „§, thescreen will show the contents of sub-directory MANS, including variable A12:

Note: You can use the stack to move a variable by combining copying withdeleting a variable. Procedures for deleting variables are demonstrated in
the next section.

Deleting variables
Variables can be deleted using function PURGE. This function can be accessed
directly by using the TOOLS menu (I), or by using the FILES menu„¡@@OK@@ .
Using the FILES command
The FILES command can be used to purge one variable at a time. To delete avariable from a given directory you can use the FILES menu. For example, within
the sub-directory {HOME MANS INTRO}, we have variables p1, z1, R, Q, α,
and A left. Suppose that we delete variable A. Here is how to do it: Press„¡@@OK@@ to produce the variable list. Use the down-arrow key ˜ toselect variable A (the last in the list), then press L@PURGE@ @@@YES@@@. The screen
will now show the contents of sub-directory INTRO without variable A.

Using function PURGE in the stack in Algebraic mode
We start again at subdirectory {HOME MANS INTRO} containing now only
variables p1, z1, Q, R, and α. We will use command PURGE to delete

Page 2-61

variable p1. Press I @PURGE@ J@@p1@@ `. The screen will now show
variable p1 removed:

You can use the PURGE command to erase more than one variable by placing
their names in a list in the argument of PURGE. For example, if now we wanted
to purge variables R and Q, simultaneously, we can try the following exercise.
Press :I @PURGE@ „ä³ J@@@R!@@ ™ ‚í ³ J@@@Q!@@
At this point, the screen will show the following command ready to be executed:

To finish deleting the variables, press `. The screen will now show theremaining variables:

Using function PURGE in the stack in RPN mode
We start again at subdirectory {HOME MANS INTRO} containing variables
p1, z1, Q, R, and α. We will use command PURGE to delete variable p1.
Press ³@@p1@@ ` I @PURGE@. The screen will now show variable p1
removed:To delete two variables simultaneously, say variables R and Q, first create a list
(in RPN mode, the elements of the list need not be separated by commas as inAlgebraic mode): J „ä³ @@@R!@@ ™ ³ @@@Q!@@ `. Then, press
I@PURGE@ use to purge the variables.

UNDO and CMD functions
Functions UNDO and CMD are useful for recovering recent commands, or torevert an operation if a mistake was made. These functions are associated with

Page 2-62

the HIST key: UNDO results from the keystroke sequence ‚¯, while CMD
results from the keystroke sequence „®.
To illustrate the use of UNDO, try the following exercise in algebraic (ALG)
mode: 5*4/3`. The UNDO command (‚¯) will
simply erase the result. The same exercise in RPN mode, will follow these
keystrokes: 5`4`*3`/. Using ‚¯ at this point
will undo the most recent operation (20/3), leaving the original terms back inthe stack:To illustrate the use of CMD, let’s enter the following entries in ALG mode. Press` after each entry.

Next, use the CMD function („®) to show the four most recent commands
entered by the user, i.e.,

You can use the up and down arrow keys (—˜) to navigate through thesecommands and highlight any of them that you want to entry anew. Once you
have selected the command to enter, press @@@OK@@@.
The CMD function operates in the same fashion when the calculator is in RPNmode, except that the list of commands only shows numbers or algebraics. It
does not show functions entered. For example, try the following exercise in RPN
mode:
5`2`3/*S³S5*2`.
Pressing „® produces the following selection box:

Page 2-63

As you can see, the numbers 3, 2, and 5, used in the first calculation above,
are listed in the selection box, as well as the algebraic ‘SIN(5x2)’, but not the
SIN function entered previous to the algebraic.

Flags
A flag is a Boolean value, that can be set or cleared (true or false), thatspecifies a given setting of the calculator or an option in a program. Flags in
the calculator are identified by numbers. There are 256 flags, numbered from 128 to 128. Positive flags are called user flags and are available forprogramming purposes by the user. Flags represented by negative numbers arecalled system flags and affect the way the calculator operates.
To see the current system flag setting press the H button, and then the @FLAGS!
soft menu key (i.e., F1). You will get a screen labeled SYSTEM FLAGS listing
flag numbers and the corresponding setting.

(Note: In this screen, as only system flags are present, only the absolute valueof the flag number Is displayed). A flag is said to be set if you see a check
mark () in front of the flag number. Otherwise, the flag is not set or cleared.
To change the status of a system flag press the @@CHK@@! soft menu key while theflag you want to change is highlighted, or use the \ key. You can use the up
and down arrow keys (—˜) to move about the list of system flags.
Although there are 128 system flags, not all of them are used, and some ofthem are used for internal system control. System flags that are not accessible tothe user are not visible in this screen. A complete list of flags is presented in
Chapter 24.

Page 2-64

Example of flag setting: general solutions vs. principal value
For example, the default value for system flag 01 is General solutions. What
this means is that, if an equation has multiple solutions, all the solutions will be
returned by the calculator, most likely in a list. By pressing the @@CHK@@ soft menu
key you can change system flag 01 to Principal value. This setting will force thecalculator to provide a single value known as the principal value of the solution.
To see this at work, first set system flag 01 (i.e., select Principal Value). Press@@OK@@ twice to return to normal calculator display. We will try solving aquadratic equation solution, say, t2+5t+6 = 0, with command QUAD.
Algebraic modeUse the following keystroke sequence: ‚N~q (use the up and downarrow keys, —˜ , to select command QUAD) , press @@OK@@ .

To enter the equation as the first argument of function QUAD, use the following
keystrokes:‚O~ „t Q2™+5*~ „t+6——‚Å0`‚í ~ „t`
The result is:

Now, change the setting of flag 1 to General solutions: H@FLAGS@ @@CHK@@ @@OK@@@@OK@@ . And try the solution again: ——``. The solution now includes
two values:

RPN modeFirst set system flag 01 (i.e., Principal Value). Press @@OK@@ twice to return tonormal calculator display. Then, type the quadratic equation as follows:‚O~ „t Q2™+5*~ „t+6——‚Å0`Page 2-65

` (keeping a second copy in the RPN stack)³~ „t`

Use the following keystroke sequence to enter the QUAD command:‚N~q (use the up and down arrow keys, —˜ , to selectcommand QUAD) , press @@OK@@ . The screen shows the principal solution:

Now, change the setting of flag 01 to General solutions: H@FLAGS@ @@CHK@@@@OK@@ @@OK@@ . And try the solution again:
ƒ³ ~ „t`‚N~q (use the up and down arrow keys, —˜ , to selectcommand QUAD) , press @@OK@@ . The screen now shows the two solutions:

Other flags of interest
Bring up once more the current flag setting by pressing the H button, andthen the @FLAGS! soft menu key. Make sure to clear system flag 01, which wasleft set from the previous exercise. Use the up and down arrow keys (—˜)
to move about the system flag list.
Some flags of interest and their preferred value for the purpose of the exercisesthat follow in this manual are:
02 Constant → symb: Constant values (e.g., π) are kept as symbols
Functions are not automatically evaluated, instead
03 Function → symb:
they are loaded as symbolic expressions.
Complex numbers are represented as ordered pairs
27 ‘X+Y*i’ → (X,Y):The sequence ~~locks the alphabetic keyboard
60 [α][α] locks:
Press @@OK@@ twice to return to normal calculator display.

Page 2-66

CHOOSE boxes vs. Soft MENUIn some of the exercises presented in this chapter we have seen menu lists ofcommands displayed in the screen. These menu lists are referred to as
CHOOSE boxes. For example, to use the ORDER command to reordervariables in a directory, we use, in algebraic mode:„°˜Show PROG menu list and select MEMORY@@OK@@ ˜˜˜˜Show the MEMORY menu list and select DIRECTORY@@OK@@ ——Show the DIRECTORY menu list and select ORDER@@OK@@
activate the ORDER command
There is an alternative way to access these menus as soft MENU keys, by setting
flag 117. To set this flag try the following:
H @FLAGS! ———————

Page 2-67

The screen shows flag 117 not set (CHOOSE boxes), as shown here:

Press the @@CHK@@ soft menu key to set flag 117 to soft MENU. The screen willreflect that change:

Press @@OK@@ twice to return to normal calculator display.
Now, we’ll try to find the ORDER command using similar keystrokes to thoseused above, i.e., we start with „°.
Notice that instead of a menu list, we get soft menu labels with the different
options in the PROG menu, i.e.,

Press B to select the MEMORY soft menu ()@@MEM@@). The display now shows:

Press E to select the DIRECTORY soft menu ()@@DIR@@)The ORDER command is not shown in this screen. To find it we use the L key
to find it:

To activate the ORDER command we press the C(@ORDER) soft menu key.
Although not applied to a specific example, this exercise shows the two options
for menus in the calculator (CHOOSE boxes and soft MENUs).

Page 2-68

Note: most of the examples in this user guide assume that the current setting offlag 117 is its default setting (that is, not set). If you have set the flag but want
to strictly follow the examples in this guide, you should clear the flag before
continuing.

Selected CHOOSE boxes
Some menus will only produce CHOOSE boxes, e.g.,• The APPS (APPlicationS menu), activated with the G key, first key inthe second row of keys from the top of the keyboard:•

The CAT (CATalog menu), activated with the ‚N key, second key
in the fourth row of keys from the top of the keyboard:•

The HELP menu, activated with I L @HELP

Page 2-69

•

The CMDS (CoMmanDS) menu, activated within the Equation Writer,i.e., ‚O L @CMDS

Page 2-70

Chapter 3
Calculation with real numbers
This chapter demonstrates the use of the calculator for operations and functions
related to real numbers. Operations along these lines are useful for mostcommon calculations in the physical sciences and engineering. The user shouldbe acquainted with the keyboard to identify certain functions available in the
keyboard (e.g., SIN, COS, TAN, etc.). Also, it is assumed that the reader
knows how to adjust the calculator's operation, i.e., select operating mode (seeChapter 1), use menus and choose boxes (see Chapter 1), and operate withvariables (see Chapter 2).

Checking calculators settings
To check the current calculator and CAS settings you need to just look at the top
line in the calculator display in normal operation. For example, you may see
the following setting:
RAD XYZ DEC R = ‘X’This stands for RADians for angular measurements, XYZ for Rectangular(Cartesian) coordinates, DECimal number base, Real numbers preferred, =means “exact” results, and ‘X’ is the value of the default independent variable.
Another possible listing of options could be

DEG R∠Z HEX C ~ ‘t’This stands for DEGrees as angular measurements, R∠Z for Polar coordinates,
HEXagesimal number base, Complex numbers allowed, ~ stands for“approximate” results, and ‘t’ as the default independent variable.
In general, this part of the display contains seven elements. Each element is
identified next under numbers 1 through 7. The possible values for eachelement are shown between parentheses following the element description. The
explanation of each of those values is also shown:
1. Angle measure specification (DEG, RAD, GRD)
DEG: degrees, 360 degrees in a complete circle
RAD: radians, 2π radians in a complete circle
GRD: grades, 400 grades in a complete circle

Page 3-1

2. Coordinate system specification (XYZ, R∠Z, R∠∠).

The symbol ∠stands for an angular coordinate.
XYZ: Cartesian or rectangular (x,y,z)R∠Z: cylindrical Polar coordinates (r,θ,z)R∠∠: Spherical coordinates (ρ,θ,φ)
3. Number base specification (HEX, DEC, OCT, BIN)
HEX: hexadecimal numbers (base 16)
DEC: decimal numbers (base 10)
OCT: octal numbers (base 8)
BIN: binary numbers (base 2)
4. Real or complex mode specification (R, C)
R:

real numbers

C:

complex numbers

5. Exact or approximate mode specification (=, ~)=exact (symbolic) mode~

approximate (numerical) mode

6. Default CAS independent variable (e.g., ‘X’, ‘t’, etc.)

Checking calculator mode
When in RPN mode the different levels of the stack are listed in the left-handside of the screen. When the ALGEBRAIC mode is selected there are no
numbered stack levels, and the word ALG is listed in the top line of the display
towards the right-hand side. The difference between these operating modes
was described in detail in Chapter 1.

Real number calculations
To perform real number calculations it is preferred to have the CAS set to Real(as opposite to Complex) mode. In some cases, a complex result may show up,
and a request to change the mode to Complex will be made by the calculator.
Exact mode is the default mode for most operations. Therefore, you may want
to start your calculations in this mode. Any change to Approx mode required tocomplete an operation will be requested by the calculator. There is nopreferred selection for the angle measure or for the number base specification.

Page 3-2

Real number calculations will be demonstrated in both the Algebraic (ALG) and
Reverse Polish Notation (RPN) modes.

Changing sign of a number, variable, or expression
Use the \ key. In ALG mode, you can press \ before entering thenumber, e.g., \2.5`. Result = -2.5. In RPN mode, you need toenter at least part of the number first, and then use the \ key, e.g.,
2.5\. Result = -2.5. If you use the \ function while there is nocommand line, the calculator will apply the NEG function (inverse of sign) to theobject on the first level of the stack.

The inverse function
Use the Ykey. In ALG mode, press Y first, followed by a number or
algebraic expression, e.g., Y2. Result = ½ or 0.5. In RPN mode, enter
the number first, then use the key, e.g., 4`Y. Result = ¼ or 0.25.

Addition, subtraction, multiplication, division
Use the proper operation key, namely, + - * /. In ALG mode,press an operand, then an operator, then an operand, followed by an ` toobtain a result. Examples:
3.7 + 5.2 `6.3 - 8.5 `4.2 * 2.5 `2.3 / 4.5 `The first three operations above are shown in the following screen shot:

In RPN mode, enter the operands one after the other, separated by an `,then press the operator key. Examples:
3.7` 5.2 +6.3` 8.5 4.2` 2.5 *2.3` 4.5 /Page 3-3

Alternatively, in RPN mode, you can separate the operands with a space (#)
before pressing the operator key. Examples:
3.7#5.2 +6.3#8.5 4.2#2.5 *2.3#4.5 /Using parentheses
Parentheses can be used to group operations, as well as to enclose argumentsof functions. The parentheses are available through the keystroke combination„Ü. Parentheses are always entered in pairs. For example, to calculate(5+3.2)/(7-2.2):

In ALG mode:„Ü5+3.2™/„Ü7-2.2`
In RPN mode, you do not need the parenthesis, calculation is done directly on
the stack:5`3.2+7`2.2-/
In RPN mode, typing the expression between quotes will allow you to enter the
expression like in algebraic mode:³„Ü5+3.2™/„Ü7-2.2`μFor both, ALG and RPN modes, using the Equation Writer:‚O5+3.2™/7-2.2
The expression can be evaluated within the Equation writer, by using:————@EVAL@ or, ‚—@EVAL@

Absolute value function
The absolute value function, ABS, is available through the keystroke
combination: „Ê. When calculating in the stack in ALG mode, enter thefunction before the argument, e.g., „Ê \2.32`
In RPN mode, enter the number first, then the function, e.g.,
2.32\„Ê

Page 3-4

Squares and square roots
The square function, SQ, is available through the keystroke combination:„º. When calculating in the stack in ALG mode, enter the function
before the argument, e.g., „º\2.3`
In RPN mode, enter the number first, then the function, e.g.,
2.3\„ºThe square root function, √, is available through the R key. When calculating inthe stack in ALG mode, enter the function before the argument, e.g.,
R123.4`In RPN mode, enter the number first, then the function, e.g.,
123.4R

Powers and roots
The power function, ^, is available through the Q key. When calculating inthe stack in ALG mode, enter the base (y) followed by the Q key, and then the
exponent (x), e.g., 5.2Q1.25
In RPN mode, enter the number first, then the function, e.g.,
5.2`1.25`Q
The root function, XROOT(y,x), is available through the keystroke combination‚». When calculating in the stack in ALG mode, enter the function
XROOT followed by the arguments (y,x), separated by commas, e.g.,‚»3‚í 27`
In RPN mode, enter the argument y, first, then, x, and finally the function call,e.g.,
27`3`‚»

Base-10 logarithms and powers of 10
Logarithms of base 10 are calculated by the keystroke combination ‚Ã(function LOG) while its inverse function (ALOG, or antilogarithm) is calculated
by using „Â. In ALG mode, the function is entered before the argument:‚Ã2.45`„Â\2.3`
In RPN mode, the argument is entered before the function
2.45` ‚Ã
2.3\` „Â

Page 3-5

Using powers of 10 in entering data
Powers of ten, i.e., numbers of the form -4.5´10 -2, etc., are entered by using the
V key. For example, in ALG mode:\4.5V\2`Or, in RPN mode:
4.5\V2\`Natural logarithms and exponential function
Natural logarithms (i.e., logarithms of base e = 2.7182818282) are calculatedby the keystroke combination ‚¹ (function LN) while its inverse function,
the exponential function (function EXP) is calculated by using „¸. In ALG
mode, the function is entered before the argument:‚¹2.45`„¸\2.3`
In RPN mode, the argument is entered before the function
2.45` ‚¹
2.3\` „¸

Trigonometric functions
Three trigonometric functions are readily available in the keyboard: sine (S),cosine (T), and tangent (U). The arguments of these functions are angles,
therefore, they can be entered in any system of angular measure (degrees,radians, grades). For example, with the DEG option selected, we can calculate
the following trigonometric functions:
In ALG mode:
S30`
T45`
U135`
In RPN mode:
30`S
45`T
135`U

Inverse trigonometric functions
The inverse trigonometric functions available in the keyboard are the arcsine(ASIN), arccosine (ACOS), and arctangent (ATAN), available through the
keystroke combinations „¼, „¾, and „À, respectively. Since

Page 3-6

the inverse trigonometric functions represent angles, the answer from thesefunctions will be given in the selected angular measure (DEG, RAD, GRD).
Some examples are shown next:
In ALG mode:„¼0.25`„¾0.85`„À1.35`In RPN mode:
0.25`„¼
0.85`„¾
1.35`„ÀAll the functions described above, namely, ABS, SQ, √, ^, XROOT, LOG,
ALOG, LN, EXP, SIN, COS, TAN, ASIN, ACOS, ATAN, can be combined withthe fundamental operations (+-*/) to form more complex
expressions. The Equation Writer, whose operations is described in Chapter 2,
is ideal for building such expressions, regardless of the calculator operation
mode.

Differences between functions and operators
Functions like ABS, SQ, √, LOG, ALOG, LN, EXP, SIN, COS, TAN, ASIN,
ACOS, ATAN require a single argument. Thus, their application is ALG modeis straightforward, e.g., ABS(x). Some functions like XROOT require twoarguments, e.g., XROOT(x,y). This function has the equivalent keystroke
sequence ‚».
Operators, on the other hand, are placed after a single argument or between
two arguments. The factorial operator (!), for example, is placed after anumber, e.g., 5~‚2`. Since this operator requires a single
argument it is referred to as a unary operator. Operators that require twoarguments, such as + - * / Q, are binary operators, e.g.,
3*5, or 4Q2.

Real number functions in the MTH menu
The MTH (MaTHematics) menu include a number of mathematical functions
mostly applicable to real numbers. To access the MTH menu, use the keystroke

Page 3-7

combination „´. With the default setting of CHOOSE boxes for system
flag 117 (see Chapter 2), the MTH menu is shown as the following menu list:

As they are a great number of mathematic functions available in the calculator,
the MTH menu is sorted by the type of object the functions apply on. For
example, options 1. VECTOR.., 2. MATRIX., and 3. LIST.. apply to those datatypes (i.e., vectors, matrices, and lists) and will discussed in more detail insubsequent chapters. Options 4. HYPERBOLIC.. and 5. REAL.. apply to real
numbers and will be discussed in detailed herein. Option 6. BASE.. is used forconversion of numbers in different bases, and is also to be discussed in a
separate chapter. Option 7. PROBABILITY.. is used for probability applications
and will be discussed in an upcoming chapter. Option 8. FFT.. (Fast Fourier
Transform) is an application of signal processing and will be discussed in adifferent chapter. Option 9. COMPLEX.. contains functions appropriate forcomplex numbers, which will be discussed in the next chapter. Option 10.
CONSTANTS provides access to the constants in the calculator. This option
will be presented later in this section. Finally, option 11. SPECIALFUNCTIONS.. includes functions of advanced mathematics that will be
discussed in this section also.
In general, to apply any of these functions you need to be aware of the number
and order of the arguments required, and keep in mind that, in ALG mode you
should select first the function and then enter the argument, while in RPN mode,
you should enter the argument in the stack first, and then select the function.
Using calculator menus:
1. Since the operation of MTH functions (and of many other calculator menus)
is very similar, we will describe in detail the use of the 4. HYPERBOLIC..
menu in this section, with the intention of describing the general operationof calculator menus. Pay close attention to the process for selecting
different options.
2. To quickly select one of the numbered options in a menu list (or CHOOSEbox), simply press the number for the option in the keyboard. For
example, to select option 4. HYPERBOLIC.. in the MTH menu, simply press
4.

Page 3-8

Hyperbolic functions and their inverses
Selecting Option 4. HYPERBOLIC.. , in the MTH menu, and pressing @@OK@@,
produces the hyperbolic function menu:

The hyperbolic functions are:Hyperbolic sine, SINH, and its inverse, ASINH or sinh-1
Hyperbolic cosine, COSH, and its inverse, ACOSH or cosh-1
Hyperbolic tangent, TANH, and its inverse, ATANH or tanh-1
This menu contains also the functions:
EXPM(x) = exp(x) – 1,
LNP1(x) = ln(x+1).
Finally, option 9. MATH, returns the user to the MTH menu.
For example, in ALG mode, the keystroke sequence to calculate, say, tanh(2.5),
is the following:„´

Select MTH menu

4 @@OK@@

Select the 4. HYPERBOLIC.. menu

5 @@OK@@

Select the 5. TANH function

2.5`
Evaluate tanh(2.5)
The screen shows the following output:

In the RPN mode, the keystrokes to perform this calculation are the following:
2.5`

Enter the argument in the stack„´

Select MTH menu

4 @@OK@@

Select the 4. HYPERBOLIC.. menu

5 @@OK@@

Select the 5. TANH function

Page 3-9

The result is:

The operations shown above assume that you are using the default setting forsystem flag 117 (CHOOSE boxes). If you have changed the setting of this flag(see Chapter 2) to SOFT menu, the MTH menu will show as labels of the soft
menu keys, as follows (left-hand side in ALG mode, right –hand side in RPNmode):

Pressing L shows the remaining options:

Note: Pressing „«will return to the first set of MTH options. Also, using
the combination ‚˜ will list all menu functions in the screen, e.g.

Thus, to select, for example, the hyperbolic functions menu, with this menu
format press )@@HYP@ , to produce:

Finally, in order to select, for example, the hyperbolic tangent (tanh) function,
simply press @@TANH@.

Page 3-10

Note: To see additional options in these soft menus, press the L key or the„«keystroke sequence.
For example, to calculate tanh(2.5), in the ALG mode, when using SOFT menus
over CHOOSE boxes, follow this procedure:„´

Select MTH menu)@@HYP@

Select the HYPERBOLIC.. menu@@TANH@

Select the TANH function

2.5`

Evaluate tanh(2.5)

In RPN mode, the same value is calculated using:
2.5`

Enter argument in the stack„´

Select MTH menu)@@HYP@

Select the HYPERBOLIC.. menu@@TANH@

Select the TANH function

As an exercise of applications of hyperbolic functions, verify the following
values:SINH (2.5) = 6.05020..
COSH (2.5) = 6.13228..
TANH(2.5) = 0.98661..
EXPM(2.0) = 6.38905….

ASINH(2.0) = 1.4436…
ACOSH (2.0) = 1.3169…
ATANH(0.2) = 0.2027…
LNP1(1.0) = 0.69314….

Once again, the general procedure shown in this section can be applied forselecting options in any calculator menu.

Real number functions
Selecting option 5. REAL.. in the MTH menu, with system flag 117 set to
CHOOSE boxes, generates the following menu list:

Page 3-11

Option 19. MATH.. returns the user to the MTH menu. The remaining functions
are grouped into six different groups described below.
If system flag 117 is set to SOFT menus, the REAL functions menu will look likethis (ALG mode used, the same soft menu keys will be available in RPN mode):

The very last option, )@@MTH@, returns the user to the MTH menu.
Percentage functions
These functions are used to calculate percentages and related values as follows:% (y,x): calculates the x percentage of y
%CH(y,x) : calculates 100(y-x)/x, i.e., the percentage change, thedifference between two numbers.
%T(y,x): calculates 100 x/y, i.e., the percentage total, the portion
that one number (x) is of another (y).
These functions require two arguments, we illustrate the calculation of%T(15,45), i.e., calculation 15% of 45, next. We assume that the calculator isset to ALG mode, and that system flag 117 is set to CHOOSE boxes. The
procedure is as follows:„´

Select MTH menu

5 @@OK@@

Select the 5. REAL.. menu

3 @@OK@@

Select the 5. %T function

15

Enter first argument‚íEnter a comma to separate arguments

45Enter second argument`

Calculate function

Page 3-12

The result is shown next:

In RPN mode, recall that argument y is located in the second level of the stack,while argument x is located in the first level of the stack. This means, you should
enter x first, and then, y, just as in ALG mode. Thus, the calculation of%T(15,45), in RPN mode, and with system flag 117 set to CHOOSE boxes, we
proceed as follows:
15`

Enter first argument

45`

Enter second argument„´

Select MTH menu

5 @@OK@@

Select the 5. REAL.. menu

3 @@OK@@

Select the 5. %T function

Note: The exercises in this section illustrate the general use of calculator
functions having 2 arguments. The operation of functions having 3 or morearguments can be generalized from these examples.
As an exercise for percentage-related functions, verify the following values:%(5,20) = 1, %CH(22,25) = 13.6363.., %T(500,20) = 4
Minimum and maximum
Use these functions to determine the minimum or maximum value of twoarguments.
MIN(x,y) : minimum value of x and yMAX(x,y) : maximum value of x and y
As an exercise, verify that MIN(-2,2) = -2, MAX(-2,2) = 2
ModuloMOD: y mod x = residual of y/x, i.e., if x and y are integer numbers, y/x = d+ r/x, where d = quotient, r = residual. In this case, r = y mod x.

Page 3-13

Please notice that MOD is not a function, but rather an operator, i.e., in ALG
mode, MOD should be used as y MOD x, and not as MOD(y,x). Thus, theoperation of MOD is similar to that of +, -, *, /.
As an exercise, verify that 15 MOD 4 = 15 mod 4 = residual of 15/4 = 3
Absolute value, sign, mantissa, exponent, integer and fractional parts
ABS(x): calculates the absolute value, |x|

SIGN(x): determines the sign of x, i.e., -1, 0, or 1.

MANT(x) : determines the mantissa of a number based on log10.
XPON(x) : determines the power of 10 in the numberIP(x): determines the integer part of a real numberFP(x): determines the fractional part of a real number
As an exercise, verify that ABS(-3) = |-3| = 3, SIGN(-5) = -1, MANT(2540) =2.540, XPON(2540) = 3, IP(2.35) = 2, FP(2.35) = 0.35.
Rounding, truncating, floor, and ceiling functions
RND(x,y): rounds up y to x decimal places

TRNC(x,y) :!truncate y to x decimal places
FLOOR(x) : closest integer that is less than or equal to x
CEIL(x): closest integer that is greater than or equal to x
As an exercise, verify that RND(1.4567,2) = 1.46, TRNC(1.4567,2) = 1.45,
FLOOR(2.3) = 2, CEIL(2,3) = 3
Radians-to-degrees and degrees-to-radians functions
DR (x): converts degrees to radiansRD (x): converts radians to degrees.
As an exercise, verify that DR(45) = 0.78539 (i.e., 45o = 0.78539rad),RD(1.5) = 85.943669.. (i.e., 1.5rad = 85.943669..o).

Special functions
Option 11. Special functions… in the MTH menu includes the following
functions:Page 3-14

GAMMA:The Gamma function Γ(α)

PSI:

N-th derivative of the digamma function

Psi:

Digamma function, derivative of the ln(Gamma)

The Gamma function is defined by Γ(α ) =

∞

∫ x
0

α −1 − xe dx . This function has

applications in applied mathematics for science and engineering, as well as inprobability and statistics.
Factorial of a number
The factorial of a positive integer number n is defined as n!=n⋅(n-1)×(n-2)…3×2×1, with 0! = 1. The factorial function is available in the calculator byusing ~‚2. In both ALG and RPN modes, enter the number first,
followed by the sequence ~‚2. Example: 5~‚2`.
The Gamma function, defined above, has the property that
Γ(α) = (α−1) Γ(α−1), for α > 1.
Therefore, it can be related to the factorial of a number, i.e., Γ(α) = (α−1)!,
when α is a positive integer. We can also use the factorial function to calculate
the Gamma function, and vice versa. For example, Γ(5) = 4! or,4~‚2`. The factorial function is available in the MTH menu,
through the 7. PROBABILITY.. menu.
The PSI function, Ψ(x,y), represents the y-th derivative of the digamma function,i.e., Ψ ( n, x ) =dnψ ( x) , where Ψ(x) is known as the digamma function, ordx n

Psi function. For this function, y must be a positive integer.

The Psi function, Ψ(x), or digamma function, is defined as ψ ( x ) = ln[Γ( x )] .

Page 3-15

Examples of these special functions are shown here using both the ALG and
RPN modes. As an exercise, verify that GAMMA(2.3) = 1.166711…,
PSI(1.5,3) = 1.40909.., and Psi(1.5) = 3.64899739..E-2.
These calculations are shown in the following screen shot:

Calculator constants
The following are the mathematical constants used by your calculator:
Θ e:the base of natural logarithms.
Θ i:
the imaginary unit, ii 2 = -1.
Θ π:
the ratio of the length of the circle to its diameter.
Θ MINR: the minimum real number available to the calculator.
Θ MAXR: the maximum real number available to the calculator.
To have access to these constants, select option 11. CONSTANTS.. in the MTH
menu,

The constants are listed as follows:

Page 3-16

Selecting any of these entries will place the value selected, whether a symbol(e.g., e, i, π, MINR, or MAXR) or a value (2.71.., (0,1), 3.14.., 1E-499,
9.99..E499) in the stack.
Please notice that e is available from the keyboard as exp(1), i.e.,„¸1`, in ALG mode, or 1` „¸, in RPN mode. Also, π
is available directly from the keyboard as „ì. Finally, i is available byusing „¥.

Operations with units
Numbers in the calculator can have units associated with them. Thus, it ispossible to calculate results involving a consistent system of units and produce
a result with the appropriate combination of units.

The UNITS menu
The units menu is launched by the keystroke combination ‚Û(associatedwith the 6 key). With system flag 117 set to CHOOSE boxes, the result isthe following menu:

Option 1. Tools.. contains functions used to operate on units (discussed later).
Options 3. Length.. through 17.Viscosity.. contain menus with a number of units
for each of the quantities described. For example, selecting option 8. Force..
shows the following units menu:

Page 3-17

The user will recognize most of these units (some, e.g., dyne, are not used very
often nowadays) from his or her physics classes: N = newtons, dyn = dynes, gf= grams – force (to distinguish from gram-mass, or plainly gram, a unit ofmass), kip = kilo-poundal (1000 pounds), lbf = pound-force (to distinguish frompound-mass), pdl = poundal.
To attach a unit object to a number, the number must be followed by anunderscore. Thus, a force of 5 N will be entered as 5_N.
For extensive operations with units SOFT menus provide a more convenient way
of attaching units. Change system flag 117 to SOFT menus (see Chapter 1),
and use the keystroke combination ‚Û to get the following menus. Press
L to move to the next menu page.

Pressing on the appropriate soft menu key will open the sub-menu of units forthat particular selection. For example, for the @)SPEED sub-menu, the following
units are available:

Pressing the soft menu key @)UNITS will take you back to the UNITS menu.
Recall that you can always list the full menu labels in the screen by using‚˜, e.g., for the @)ENRG set of units the following labels will be listed:

Page 3-18

Note: Use the L key or the „«keystroke sequence to navigate throughthe menus.

Available units
The following is a list of the units available in the UNITS menu. The unit symbol
is shown first followed by the unit name in parentheses:
LENGTHm (meter), cm (centimeter), mm (millimeter), yd (yard), ft (feet), in (inch), Mpc(Mega parsec), pc (parsec), lyr (light-year), au (astronomical unit), km(kilometer), mi (international mile), nmi (nautical mile), miUS (US statute mile),
chain (chain), rd (rod), fath (fathom), ftUS (survey foot), Mil (Mil), μ (micron), Å(Angstrom), fermi (fermi)
AREAm^2 (square meter), cm^2 (square centimeter), b (barn), yd^2 (square yard),
ft^2 (square feet), in^2 (square inch), km^2 (square kilometer), ha (hectare), a(are), mi^2 (square mile), miUS^2 (square statute mile), acre (acre)
VOLUMEm^3 (cubic meter), st (stere), cm^3 (cubic centimeter), yd^3 (cubic yard), ft^3
(cubic feet), in^3 (cubic inch), l (liter), galUK (UK gallon), galC (Canadiangallon), gal (US gallon), qt (quart), pt (pint), ml (mililiter), cu (US cup), ozfl (USfluid ounce), ozUK (UK fluid ounce), tbsp (tablespoon), tsp (teaspoon), bbl(barrel), bu (bushel), pk (peck), fbm (board foot)TIME
yr (year), d (day), h (hour), min (minute), s (second), Hz (hertz)

Page 3-19

SPEEDm/s (meter per second), cm/s (centimeter per second), ft/s (feet per second),kph (kilometer per hour), mph (mile per hour), knot (nautical miles per hour), c(speed of light), ga (acceleration of gravity )MASSkg (kilogram), g (gram), Lb (avoirdupois pound), oz (ounce), slug (slug), lbt(Troy pound), ton (short ton), tonUK (long ton), t (metric ton), ozt (Troy ounce), ct(carat), grain (grain), u (unified atomic mass), mol (mole)
FORCE
N (newton), dyn (dyne), gf (gram-force), kip (kilopound-force), lbf (poundforce), pdl (poundal)
ENERGYJ (joule), erg (erg), Kcal (kilocalorie), Cal (calorie), Btu (International table btu),
ft×lbf (foot-pound), therm (EEC therm), MeV (mega electron-volt), eV (electronvolt)
POWER
W (watt), hp (horse power),
PRESSURE
Pa (pascal), atm (atmosphere), bar (bar), psi (pounds per square inch), torr
(torr), mmHg (millimeters of mercury), inHg (inches of mercury), inH20 (inchesof water),
TEMPERATUREoC (degree Celsius), o F (degree Fahrenheit), K (Kelvin), o R (degree Rankine),

ELECTRIC CURRENT (Electric measurements)
V (volt), A (ampere), C (coulomb), Ω (ohm), F (farad), W (watt), Fdy (faraday),H (henry), mho (mho), S (siemens), T (tesla), Wb (weber )Page 3-20

ANGLE (planar and solid angle measurements)o (sexagesimal degree), r (radian), grad (grade), arcmin (minute of arc), arcs

(second of arc), sr (steradian)
LIGHT (Illumination measurements)
fc (footcandle), flam (footlambert), lx (lux), ph (phot), sb (stilb), lm (lumem), cd(candela), lam (lambert)
RADIATION
Gy (gray), rad (rad), rem (rem), Sv (sievert), Bq (becquerel), Ci (curie), R(roentgen)
VISCOSITY
P (poise), St (stokes)
Units not listed
Units not listed in the Units menu, but available in the calculator include: gmol
(gram-mole), lbmol (pound-mole), rpm (revolutions per minute), dB (decibels).
These units are accessible through menu 117.02, triggered by using
MENU(117.02) in ALG mode, or 117.02 ` MENU in RPN mode. The menu
will show in the screen as follows (use ‚˜to show labels in display):

These units are also accessible through the catalog, for example:
gmol:

‚N~„g

lbmol:

‚N~„l

rpm:

‚N~„r

dB:

‚N~„d

Page 3-21

Converting to base units
To convert any of these units to the default units in the SI system, use the functionUBASE. For example, to find out what is the value of 1 poise (unit of viscosity)in the SI units, use the following:
In ALG mode, system flag 117 set to CHOOSE boxes:‚ÛSelect the UNITS menu@@OK@@

Select the TOOLS menu

˜ @@OK@@

Select the UBASE function

1 ‚ÝEnter 1 and underline‚ÛSelect the UNITS menu

— @@OK@@

Select the VISCOSITY option@@OK@@

Select the UNITS menu`

Convert the units

This results in the following screen (i.e., 1 poise = 0.1 kg/(m⋅s)):

In RPN mode, system flag 117 set to CHOOSE boxes:
1Enter 1 (no underline)‚Û
Select the UNITS menu
— @@OK@@
Select the VISCOSITY option@@OK@@
Select the unit P (poise)‚ÛSelect the UNITS menu@@OK@@
Select the TOOLS menu
˜ @@OK@@
Select the UBASE function
In ALG mode, system flag 117 set to SOFT menus:‚Û
Select the UNITS menu)@TOOLS
Select the TOOLS menu
@UBASE
Select the UBASE function
1 ‚Ý Enter 1 and underline‚ÛSelect the UNITS menu„« @)VISC Select the VISCOSITY option@@@P@@
Select the unit P (poise)

Page 3-22

`Convert the units

In RPN mode, system flag 117 set to SOFT menus:
1
Enter 1 (no underline)‚Û
Select the UNITS menu„« @)VISC Select the VISCOSITY option@@@P@@
Select the unit P (poise)‚ÛSelect the UNITS menu)@TOOLS
Select the TOOLS menu
@UBASE
Select the UBASE function

Attaching units to numbers
To attach a unit object to a number, the number must be followed by anunderscore (‚Ý, key(8,5)). Thus, a force of 5 N will be entered as 5_N.
Here is the sequence of steps to enter this number in ALG mode, system flag
117 set to CHOOSE boxes:5‚ÝEnter number and underscore‚Û
Access the UNITS menu
8@@OK@@
Select units of force (8. Force..)@@OK@@
Select Newtons (N)`Enter quantity with units in the stack
The screen will look like the following:

Note: If you forget the underscore, the result is the expression 5*N, where N
here represents a possible variable name and not Newtons.
To enter this same quantity, with the calculator in RPN mode, use the following
keystrokes:
5Enter number (do not enter underscore)‚Û
Access the UNITS menu
8@@OK@@
Select units of force (8. Force..)@@OK@@
Select Newtons (N)Page 3-23

Notice that the underscore is entered automatically when the RPN mode isactive. The result is the following screen:

As indicated earlier, if system flag 117 is set to SOFT menus, then the UNITS
menu will show up as labels for the soft menu keys. This set up is very
convenient for extensive operations with units.
The keystroke sequences to enter units when the SOFT menu option is selected,
in both ALG and RPN modes, are illustrated next. For example, in ALG mode,
to enter the quantity 5_N use:5‚ÝEnter number and underscore‚Û

Access the UNITS menu

L @)@FORCE@ @@N@@

Select units of force
Select Newtons (N)`Enter quantity with units in the stack

The same quantity, entered in RPN mode uses the following keystrokes:
5Enter number (no underscore)‚Û
Access the UNITS menu
L @)@FORCE
Select units of force@ @@N@@
Select Newtons (N)Note: You can enter a quantity with units by typing the underline and units
with the ~keyboard, e.g., 5‚Ý~n will produce the entry:
5_N
Unit prefixes
You can enter prefixes for units according to the following table of prefixes fromthe SI system.
The prefix abbreviation is shown first, followed by its name, and by the
exponent x in the factor 10x corresponding to each prefix:___________________________________________________
Prefix Name x
Prefix Name x___________________________________________________

Page 3-24

Y
yotta
+24
d
deci
-1
Z
zetta
+21
c
centi
-2
E
exa
+18
m
milli
-3
μ
micro -6
P
peta
+15
T
tera
+12
n
nano -9
G
giga
+9
p
pico
-12
M
mega +6f
femto -15
k,K
kilo
+3
a
atto
-18
h,H
hecto +2z
zepto -21
D(*)
deka
+1
y
yocto -24___________________________________________________(*) In the SI system, this prefix is da rather than D. Use D for deka in thecalculator, however.
To enter these prefixes, simply type the prefix using the ~ keyboard. For
example, to enter 123 pm (1 picometer), use:
123‚Ý~„p~„m
Using UBASE to convert to the default unit (1 m) results in:Operations with units
Once a quantity accompanied with units is entered into the stack, it can beused in operations similar to plain numbers, except that quantities with units
cannot be used as arguments of functions (say, SQ or SIN). Thus, attempting tocalculate LN(10_m) will produce an error message: Error: Bad Argument Type.
Here are some calculation examples using the ALG operating mode. Be
warned that, when multiplying or dividing quantities with units, you must
enclosed each quantity with its units between parentheses. Thus, to enter, forexample, the product 12.5m × 5.2_yd, type it to read (12.5_m)*(5.2_yd) `:Page 3-25

which shows as 65_(m⋅yd). To convert to units of the SI system, use functionUBASE:

Note: Recall that the ANS(1) variable is available through the keystroke
combination „î(associated with the ` key).
To calculate a division, say, 3250 mi / 50 h, enter it as (3250_mi)/(50_h)`:

which transformed to SI units, with function UBASE, produces:

Addition and subtraction can be performed, in ALG mode, without using
parentheses, e.g., 5 m + 3200 mm, can be entered simply as 5_m + 3200_mm`:

More complicated expression require the use of parentheses, e.g.,(12_mm)*(1_cm^2)/(2_s) `:Page 3-26

Stack calculations in the RPN mode, do not require you to enclose the different
terms in parentheses, e.g.,12_m ` 1.5_yd ` *3250_mi ` 50_h ` /These operations produce the following output:

Also, try the following operations:5_m ` 3200_mm ` +12_mm ` 1_cm^2 `* 2_s ` /These last two operations produce the following output:

Note: Units are not allowed in expressions entered in the equation writer.

Units manipulation tools
The UNITS menu contains a TOOLS sub-menu, which provides the following
functions:
CONVERT(x,y): convert unit object x to units of object y
UBASE(x):convert unit object x to SI units
UVAL(x):extract the value from unit object x

Page 3-27

UFACT(x,y):UNIT(x,y):

factors a unit y from unit object x
combines value of x with units of y

The UBASE function was discussed in detail in an earlier section in this chapter.
To access any of these functions follow the examples provided earlier for
UBASE. Notice that, while function UVAL requires only one argument, functions
CONVERT, UFACT, and UNIT require two arguments.
Try the following exercises. The output shown below was developed in ALG
mode with system flat 117 set to SOFT menu:
Examples of!CONVERT
These examples produce the same result, i.e., to convert 33 watts to btus
CONVERT(33_W,1_hp) `CONVERT(33_W,11_hp) `These operations are shown in the screen as:

Examples of UVAL:UVAL(25_ft/s) `UVAL(0.021_cm^3) `Examples of UFACT
UFACT(1_ha,18_km^2) `UFACT(1_mm,15.1_cm) `Page 3-28

Examples of UNIT
UNIT(25,1_m) `UNIT(11.3,1_mph) `Physical constants in the calculator
Following along the treatment of units, we discuss the use of physical constants
that are available in the calculator’s memory. These physical constants arecontained in a constants library activated with the command CONLIB. To
launch this command you could simply type it in the stack:~~conlib~`or, you can select the command CONLIB from the command catalog, as
follows: First, launch the catalog by using: ‚N~c. Next, use the up
and down arrow keys —˜ to select CONLIB. Finally, press the F(@@OK@@)
soft menu key. Press `, if needed.
The constants library screen will look like the following (use the down arrow key
to navigate through the library):

Page 3-29

The soft menu keys corresponding to this CONSTANTS LIBRARY screen include
the following functions:SI
when selected, constants values are shown in SI units
ENGL when selected, constants values are shown in English units (*)
UNIT
when selected, constants are shown with units attached (*)
VALUE when selected, constants are shown without units
STK copies value (with or without units) to the stack
QUIT
exit constants library(*) Active only if the function VALUE is active.
This is the way the top of the CONSTANTS LIBRARY screen looks when theoption VALUE is selected (units in the SI system):

Page 3-30

To see the values of the constants in the English (or Imperial) system, press the@ENGL option:

If we de-select the UNITS option (press @UNITS ) only the values are shown(English units selected in this case):

To copy the value of Vm to the stack, select the variable name, and press !
,then, press @QUIT@. For the calculator set to the ALG, the screen will look like this:The display shows what is called a tagged value, Vm:359.0394. In here,
Vm, is the tag of this result. Any arithmetic operation with this number will
ignore the tag. Try, for example: ‚¹2*„î`, which
produces:

The same operation in RPN mode will require the following keystrokes (after thevalue of Vm was extracted from the constants library): 2`*‚ ¹

Page 3-31

Special physical functions
Menu 117, triggered by using MENU(117) in ALG mode, or 117 ` MENU
in RPN mode, produces the following menu (labels listed in the display by using‚˜):

The functions include:ZFACTOR: gas compressibility Z factor function
FANNING: Fanning friction factor for fluid flow
DARCY: Darcy-Weisbach friction factor for fluid flow
F0λ: Black body emissive power function
SIDENS: Silicon intrinsic density
TDELTA: Temperature delta function
In the second page of this menu (press L) we find the following items:

In this menu page, there is one function (TINC) and a number of units describedin an earlier section on units (see above). The function of interest is:
TINC:

temperature increment command

Out of all the functions available in this MENU (UTILITY menu), namely,ZFACTOR, FANNING, DARCY, F0λ, SIDENS, TDELTA, and TINC, functions
FANNING and DARCY are described in Chapter 6 in the context of solving
equations for pipeline flow. The remaining functions are described following.

Function ZFACTOR
Function ZFACTOR calculates the gas compressibility correction factor for
nonideal behavior of hydrocarbon gas. The function is called by using

Page 3-32

ZFACTOR(xT, yP), where xT is the reduced temperature, i.e., the ratio of actual
temperature to pseudo-critical temperature, and yP is the reduced pressure, i.e.,
the ratio of the actual pressure to the pseudo-critical pressure. The value of xTmust be between 1.05 and 3.0, while the value of yP must be between 0 and
30. Example, in ALG mode:

Function F0λFunction F0λ (T, λ) calculates the fraction (dimensionless) of total black-bodyemissive power at temperature T between wavelengths 0 and λ. If no units areattached to T and λ, it is implied that T is in K and λ in m. Example, in ALG
mode:

Function SIDENS
Function SIDENS(T) calculates the intrinsic density of silicon (in units of 1/cm3)
as a function of temperature T (T in K), for T between 0 and 1685 K. For
example,Function TDELTA
Function TDELTA(T0,Tf) yields the temperature increment Tf – T0. The result isreturned with the same units as T0, if any. Otherwise, it returns simply thedifference in numbers. For example,

The purpose of this function is to facilitate the calculation of temperature
differences given temperatures in different units. Otherwise, it’s simply
calculates a subtraction, e.g.,

Page 3-33

Function TINC
Function TINC(T0,ΔT) calculates T0+DT. The operation of this function is similar
to that of function TDELTA in the sense that it returns a result in the units of T0.
Otherwise, it returns a simple addition of values, e.g.,

Defining and using functions
Users can define their own functions by using the DEF command available
thought the keystroke sequence „à (associated with the 2 key). The
function must be entered in the following format:
Function_name(arguments) = expression_containing_arguments
For example, we could define a simple functionH(x) = ln(x+1) + exp(-x).
Suppose that you have a need to evaluate this function for a number of discretevalues and, therefore, you want to be able to press a single button and get theresult you want without having to type the expression in the right-hand side foreach separate value. In the following example, we assume you have set yourcalculator to ALG mode. Enter the following sequence of keystrokes:„à³~h„Ü~„x™‚Å‚¹~„x+1™+„¸~„x`
The screen will look like this:Page 3-34

Press the J key, and you will notice that there is a new variable in your soft
menu key (@@@H@@). To see the contents of this variable press ‚@@@H@@. The screen
will show now:

Thus, the variable H contains a program defined by:<<  x ‘LN(x+1) + EXP(x)’ >>This is a simple program in the default programming language of the calculator.
This programming language is called UserRPL. The program shown above isrelatively simple and consists of two parts, contained between the program
containers << >>:ΘΘInput:
Process:x
x‘LN(x+1) + EXP(x) ‘This is to be interpreted as saying: enter a value that is temporarily assigned to
the name x (referred to as a local variable), evaluate the expression between
quotes that contain that local variable, and show the evaluated expression.
To activate the function in ALG mode, type the name of the function followed by
the argument between parentheses, e.g., @@@H@@@ „Ü2`. Some
examples are shown below:

In the RPN mode, to activate the function enter the argument first, then press thesoft menu key corresponding to the variable name @@@H@@@ . For example, you
could try: 2@@@H@@@ . The other examples shown above can be entered byusing: 1.2@@@H@@@ , 2`3/@@@H@@@ .
Functions can have more than 2 arguments. For example, the screen below
shows the definition of the function K(α,β) = α+β, and its evaluation with thearguments K(√2,π), and K(1.2,2.3):

Page 3-35

The contents of the variable K are: <<  α β ‘α+β’ >>.

Functions defined by more than one expression
In this section we discuss the treatment of functions that are defined by two or
more expressions. An example of such functions would be⎧ 2 ⋅ x − 1,
f (x) = ⎨ 2⎩ x − 1,x < 0⎫⎬
x > 0 ⎭

The function IFTE (IF-Then-Else) describes such functions.

The IFTE function
The IFTE function is written as IFTE(condition, operation_if_true, operation_if_false)
If condition is true then operation_if_true is performed, else operation_if_false isperformed. For example, we can write ‘f(x) = IFTE(x>0, x^2-1, 2*x-1)’, todescribe the function listed above. Function IFTE is accessible from the function
catalog (‚N). The symbol ‘>’ (greater than) is available as (associatedwith the Y key). To define this function in ALG mode use the command:
DEF(f(x) = IFTE(x>0, x^2-1, 2*x-1)) then, press `. In RPN mode, type thefunction definition between apostrophes:‘f(x) = IFTE(x>0, x^2-1, 2*x-1)’
then press „à.
Press J to recover your variable menu. The function @@@f@@@ should be available
in your soft key menu. Press ‚@@@f@@@ to see the resulting program:<<  x ‘IFTE(x>0, x^2-1, 2*x-1)’ >>To evaluate the function in ALG mode, type the function name, f, followed by the
number at which you want to evaluate the function, e.g., f(2), then press `.
In RPN mode, enter a number and press @@@f@@@. Check, for example, that f(2) =3, while f(-2) = -5.

Page 3-36

Combined IFTE functions
To program a more complicated function such as⎧ − x, x < −2
⎪ x + 1, − 2 ≤ x < 0⎪g ( x) = ⎨⎪ x − 1, 0 ≤ x < 2⎪⎩
x2 , x ≥ 2
you can combine several levels of the IFTE function, i.e.,‘g(x) = IFTE(x<-2, -x, IFTE(x<0, x+1, IFTE(x<2, x-1, x^2)))’,

Define this function by any of the means presented above, and check thatg(-3) = 3, g(-1) = 0, g(1) = 0, g(3) = 9.

Page 3-37

Chapter 4
Calculations with complex numbers
This chapter shows examples of calculations and application of functions tocomplex numbers.

Definitions
A complex number z is a number written as z = x + iy, where x and y are real
numbers, and i is the imaginary unit defined by i2 = -1. The complex number
x+iy has a real part, x = Re(z), and an imaginary part, y = Im(z). We canthink of a complex number as a point P(x,y) in the x-y plane, with the x-axis
referred to as the real axis, and the y-axis referred to as the imaginary axis.
Thus, a complex number represented in the form x+iy is said to be in its
Cartesian representation. An alternative Cartesian representation is the orderedpair z = (x,y). A complex number can also be represented in polar coordinates(polar representation) as z = re iθ = r⋅cosθ + i r⋅sinθ, where r = |z|=

x 2 + y 2 is the magnitude of the complex number z, and θ = Arg(z) =arctan(y/x) is the argument of the complex number z. The relationship between
the Cartesian and polar representation of complex numbers is given by the
Euler formula: e iθ = cos θ + i sin θ.

The complex conjugate of a complexiθ

number z = x + iy = re , is⎯z = x – iy = re -iθ . The complex conjugate of i canbe thought of as the reflection of z about the real (x) axis. Similarly, thenegative of z, –z = -x-iy = - re iθ, can be thought of as the reflection of z about
the origin.

Setting the calculator to COMPLEX mode
When working with complex numbers it is a good idea to set the calculator tocomplex mode, using the following keystrokes:
H)@@CAS@ ˜˜™@@CHK@
The COMPLEX mode will be selected if the CAS MODES screen shows theoption _Complex checked, i.e.,

Page 4-1

Press @@OK@@ , twice, to return to the stack.

Entering complex numbers
Complex numbers in the calculator can be entered in either of the two
Cartesian representations, namely, x+iy, or (x,y). The results in the calculator
will be shown in the ordered-pair format, i.e., (x,y). For example, with thecalculator in ALG mode, the complex number (3.5,-1.2), is entered as:„Ü3.5‚í\1.2`
A complex number can also be entered in the form x+iy. For example, in ALG
mode, 3.5-1.2i is entered as:
3.5 -1.2*„¥`
The following screen results after entering these complex numbers:

In RPN mode, these numbers will be entered using the following keystrokes:„Ü3.5‚í1.2\`(Notice that the change-sign keystroke is entered after the number 1.2 has beenentered, in the opposite order as the ALG mode exercise).
The resulting RPN screen will be:

Page 4-2

Notice that the last entry shows a complex number in the form x+iy. This is so
because the number was entered between single quotes, which represents analgebraic expression. To evaluate this number use the EVAL key( μ).

Once the algebraic expression is evaluated, you recover the complex number(3.5,1.2).

Polar representation of a complex number
The result shown above represents a Cartesian (rectangular) representation of
the complex number 3.5-1.2i. A polar representation is possible if we change
the coordinate system to cylindrical or polar, by using function CYLIN. You canfind this function in the catalog (‚N). Changing to polar shows the result!
in RPN mode:

For this result, it is in standard notation and the angular measure is set toradians (you can always change to radians by using function RAD). The result
shown above represents a magnitude, 3.7, and an angle 0.33029…. The
angle symbol (∠) is shown in front of the angle measure.
Return to Cartesian or rectangular coordinates by using function RECT
(available in the catalog, ‚N). A complex number in polar
representation is written as z = r⋅eiθ. You can enter this complex number into
the calculator by using an ordered pair of the form (r, ∠θ). The angle symbol(∠) can be entered as ~‚6. For example, the complex number z =5.2e1.5i, can be entered as follows (the figures show the stack, before and after
entering the number):

Because the coordinate system is set to rectangular (or Cartesian), thecalculator automatically converts the number entered to Cartesian coordinates,i.e., x = r cos θ, y = r sin θ, resulting, for this case, in (0.3678…, 5.18…).

Page 4-3

On the other hand, if the coordinate system is set to cylindrical coordinates (useCYLIN), entering a complex number (x,y), where x and y are real numbers, willproduce a polar representation. For example, in cylindrical coordinates, enter
the number (3.,2.). The figure below shows the RPN stack, before and after
entering this number:

Simple operations with complex numbers
Complex numbers can be combined using the four fundamental operations(+-*/). The results follow the rules of algebra with the caveat thati2= -1. Operations with complex numbers are similar to those with real
numbers. For example, with the calculator in ALG mode and the CAS set toComplex, we’ll attempt the following sum: (3+5i) + (6-3i):

Notice that the real parts (3+6) and imaginary parts (5-3) are combined
together and the result given as an ordered pair with real part 9 and imaginary
part 2. Try the following operations on your own:
(5-2i) - (3+4i) = (2,-6)(3-i)·(2-4i) = (2,-14)(5-2i)/(3+4i) = (0.28,-1.04)
1/(3+4i) = (0.12, -0.16)
Notes:The product of two numbers is represented by: (x1+iy1)(x2+iy2) = (x1x2 - y1y2)+ i (x1y2 + x2y1).
The division of two complex numbers is accomplished by multiplying both
numerator and denominator by the complex conjugate of the denominator,
i.e.,Page 4-4

x1 + iy1
x + iy1 x 2 − iy 2 x1 x 2 + y1 y 2
x y − x1 y 2= 1⋅=+ i ⋅ 2 21
22
x 2 + iy 2 x 2 + iy 2 x 2 − iy 2x2 + y 2
x 2 + y 22
Thus, the inverse function INV (activated with the Y key) is defined as11
x − iy
x
y
=
⋅
= 2
+i⋅ 2
2
x + iy x + iy x − iy x + y
x + y2

Changing sign of a complex number
Changing the sign of a complex number can be accomplished by using the\ key, e.g., -(5-3i) = -5 + 3i

Entering the unit imaginary number
To enter the unit imaginary number type : „¥Notice that the number i is entered as the ordered pair (0,1) if the CAS is set to
APPROX mode. In EXACT mode, the unit imaginary number is entered as i.
Other operations
Operations such as magnitude, argument, real and imaginary parts, andcomplex conjugate are available through the CMPLX menus detailed later.

The CMPLX menus
There are two CMPLX (CoMPLeX numbers) menus available in the calculator.
One is available through the MTH menu (introduced in Chapter 3) and one
directly into the keyboard (‚ß). The two CMPLX menus are presented
next.

Page 4-5

CMPLX menu through the MTH menu
Assuming that system flag 117 is set to CHOOSE boxes (see Chapter 2), the
CMPLX sub-menu within the MTH menu is accessed by using: „´9@@OK@@ . The following sequence of screen shots illustrates these steps:

The first menu (options 1 through 6) shows the following functions:RE(z) : Real part of a complex number
IM(z) : Imaginary part of a complex number
C→R(z) : Takes a complex number (x,y) and separates it into its real andimaginary parts
R→C(x,y): Forms the complex number (x,y) out of real numbers x and y
ABS(z) : Calculates the magnitude of a complex number or the absolute valueof a real number.
ARG(z): Calculates the argument of a complex number.
The remaining options (options 7 through 10) are the following:

SIGN(z) : Calculates a complex number of unit magnitude as z/|z|.
NEG : Changes the sign of z
CONJ(z): Produces the complex conjugate of z
Examples of applications of these functions are shown next. Recall that, for ALG
mode, the function must precede the argument, while in RPN mode, you enter
the argument first, and then select the function. Also, recall that you can getthese functions as soft menus by changing the setting of system flag 117 (See
Chapter 3).

Page 4-6

This first screen shows functions RE, IM, and CR. Notice that the last function
returns a list {3. 5.} representing the real and imaginary components of thecomplex number:

The following screen shows functions RC, ABS, and ARG. Notice that the
ABS function gets translated to |3.+5.·i|, the notation of the absolute value.
Also, the result of function ARG, which represents an angle, will be given in theunits of angle measure currently selected. In this example, ARG(3.+5.·i) =1.0303… is given in radians.

In the next screen we present examples of functions SIGN, NEG (which shows
up as the negative sign - ), and CONJ.

CMPLX menu in keyboard
A second CMPLX menu is accessible by using the right-shift option associatedwith the 1 key, i.e., ‚ß. With system flag 117 set to CHOOSE boxes,
the keyboard CMPLX menu shows up as the following screens:

Page 4-7

The resulting menu include some of the functions already introduced in theprevious section, namely, ARG, ABS, CONJ, IM, NEG, RE, and SIGN. It also
includes function i which serves the same purpose as the keystroke combination„¥, i.e., to enter the unit imaginary number i in an expression.
The keyboard-base CMPLX menu is an alternative to the MTH-based CMPLX
menu containing the basic complex number functions. Try the examples shown
earlier using the keyboard-based CMPLX menu for practice.

Functions applied to complex numbers
Many of the keyboard-based functions defined in Chapter 3 for real numbers,e.g., SQ, ,LN, ex, LOG, 10X, SIN, COS, TAN, ASIN, ACOS, ATAN, can beapplied to complex numbers. The result is another complex number, as
illustrated in the following examples. To apply this functions use the sameprocedure as presented for real numbers (see Chapter 3).

Page 4-8

Note: When using trigonometric functions and their inverses with complex
numbers the arguments are no longer angles. Therefore, the angular measureselected for the calculator has no bearing in the calculation of these functions
with complex arguments. To understand the way that trigonometric functions,and other functions, are defined for complex numbers consult a book oncomplex variables.

Functions from the MTH menu
The hyperbolic functions and their inverses, as well as the Gamma, PSI, and Psi
functions (special functions) were introduced and applied to real numbers in
Chapter 3. These functions can also be applied to complex numbers byfollowing the procedures presented in Chapter 3. Some examples are shown
below:

The following screen shows that functions EXPM and LNP1 do not apply tocomplex numbers. However, functions GAMMA, PSI, and Psi accept complex
numbers:

Function DROITE: equation of a straight line
Function DROITE takes as argument two complex numbers, say, x1+iy1 andx2+iy2, and returns the equation of the straight line, say, y = a+bx, that
contains the points (x1,y1) and (x2,y2). For example, the line between points
A(5,-3) and B(6,2) can be found as follows (example in Algebraic mode):

Page 4-9

Function DROITE is found in the command catalog (‚N).
Using EVAL(ANS(1)) simplifies the result to:Page 4-10

Chapter 5
Algebraic and arithmetic operations
An algebraic object, or simply, algebraic, is any number, variable name or
algebraic expression that can be operated upon, manipulated, and combined
according to the rules of algebra. Examples of algebraic objects are thefollowing:•

A number: 12.3, 15.2_m, ‘π’, ‘e’, ‘i’•A variable name: ‘a’, ‘ux’, ‘width’, etc.

•

An expression: ‘p*D^2/4’,’f*(L/D)*(V^2/(2*g))’•

An equation: ‘Q=(Cu/n)*A(y)*R(y)^(2/3)*So^0.5’

Entering algebraic objects
Algebraic objects can be created by typing the object between single quotes
directly into stack level 1 or by using the equation writer ‚O. For
example, to enter the algebraic object ‘π*D^2/4’ directly into stack level 1
use:³„ì*~dQ2/4`. The resulting screen isshown next for both the ALG mode (left-hand side) and the RPN mode (righthand side):

An algebraic object can also be built in the Equation Writer and then sent tothe stack. The operation of the Equation Writer was described in Chapter 2.
As an exercise, build the following algebraic object in the Equation Writer:

After building the object, press to show it in the stack (ALG and RPN modes
shown below):

Simple operations with algebraic objects
Algebraic objects can be added, subtracted, multiplied, divided (except byzero), raised to a power, used as arguments for a variety of standard functions
Page 5-1

(exponential, logarithmic, trigonometry, hyperbolic, etc.), as you would any realor complex number. To demonstrate basic operations with algebraic objects,
let’s create a couple of objects, say ‘π*R^2’ and ‘g*t^2/4’, and store them invariables A1 and A2 (See Chapter 2 to learn how to create variables and store
values in them). Here are the keystrokes for storing variables A1 in ALG
mode:³„ì*~rQ2™ K ~a1 `, resulting in:

The keystrokes corresponding to RPN mode are: ³„ì*~rQ2`~a1 K
After storing the variable A2 and pressing the key, the screen will show thevariables as follows:

In ALG mode, the following keystrokes will show a number of operations withthe algebraics contained in variables @@A1@@ and @@A2@@ (press J to recovervariable menu):@@A1@@ + @@A2@@ `@@A1@@ - @@A2@@ `@@A1@@ * @@A2@@ `@@A1@@ / @@A2@@ `Page 5-2‚¹@@A1@@„¸@@A2@@The same results are obtained in RPN mode if using the following keystrokes:@@A1@@ @@A2@@ + μ@@A1@@ @@A2@@ - μ@@A1@@ @@A2@@ *μ@@A1@@ @@A2@@ /μ@@A1@@ ʳ ‚¹ μ@@A2@@ ʳ„¸ μFunctions in the ALG menu
The ALG (Algebraic) menu is available by using the keystroke sequence‚× (associated with the 4 key). With system flag 117 set to
CHOOSE boxes, the ALG menu shows the following functions:

Rather than listing the description of each function in this manual, the user isinvited to look up the description using the calculator’s help facility: I L@)HELP@ ` . To locate a particular function, type the first letter of the function.
For example, for function COLLECT, we type ~c, then use the up and downarrow keys, —˜, to locate COLLECT within the help window.
To complete the operation press @@OK@@. Here is the help screen for function
COLLECT:

Page 5-3

We notice that, at the bottom of the screen, the line See: EXPAND FACTOR
suggests links to other help facility entries, the functions EXPAND and FACTOR.
To move directly to those entries, press the soft menu key @SEE1! for EXPAND, and@SEE2! for FACTOR. Pressing @SEE1!, for example, shows the following
information for EXPAND:

Help facility
A help facility accessible via TOOL NEXT CASCMD allows you to browse
through all the CAS commands. It provides not only information on eachcommand, but also provides an example of its application. This example canbe copied onto your stack by pressing the @ECHO! soft menu key. For example, for
the EXPAND entry shown above, press the @ECHO! soft menu key to get thefollowing example copied to the stack (press ` to execute the command):We leave for the user to explore the list of CAS functions available. Here are acouple of examples:
The help facility will show the following information on the commands:
COLLECT:EXPAND:

Page 5-4

FACTOR:LNCOLLECT:

LIN:

PARTFRAC:SOLVE:SUBST:TEXPAND:

Note: Recall that, to use these, or any other functions in the RPN mode,
you must enter the argument first, and then the function. For example, theexample for TEXPAND, in RPN mode will be set up as:³„¸+~x+~y`At this point, select function TEXPAND from menu ALG (or directly from thecatalog ‚N), to complete the operation.

Page 5-5Other forms of substitution in algebraic expressions
Functions SUBST, shown above, is used to substitute a variable in an expression.
A second form of substitution can be accomplished by using the ‚¦(associated with the I key). For example, in ALG mode, the following entry will
substitute the value x = 2 in the expression x+x2. The figure to the left shows theway to enter the expression (the substituted value, x=2, must be enclosed inparentheses) before pressing `. After the ` key is pressed, the result isshown in the right-hand figure:

In RPN mode, this can be accomplished by entering first the expression where
the substitution will be performed (x+x2), followed by a list (see Chapter 8)
containing the substitution variable, an space, and the value to be substituted,i.e., {x 2}. The final step is to press the keystroke combination: ‚¦.

The required keystrokes are the following:³~„x+~„xQ2`„ä~„x#2` ‚¦`In ALG mode, substitution of more than one variable is possible as illustrated in
the following example (shown before and after pressing `)In RPN mode, it is also possible to substitute more than one variable at a time,
as illustrated in the example below. Recall that RPN mode uses a list of variablenames and values for substitution.

Page 5-6

A different approach to substitution consists in defining the substitution
expressions in calculator variables and placing the name of the variables in theoriginal expression. For example, in ALG mode, store the following variables:

Then, enter the expression A+B:

The last expression entered is automatically evaluated after pressing the `key, producing the result shown above.

Operations with transcendental functions
The calculator offers a number of functions that can be used to replace
expressions containing logarithmic, exponential, trigonometric, and hyperbolic
functions in terms of trigonometric identities or in terms of exponential functions.
The menus containing functions to replace trigonometric functions can beobtained directly from the keyboard by pressing the right-shift key followed by
the 8 key, i.e., ‚Ñ. The combination of this key with the left-shift key, i.e.,‚ Ð, produces a menu that lets you replace expressions in terms ofexponential or natural logarithm functions. In the next sections we cover thosemenus in more detail.

Expansion and factoring using log-exp functions
The „Ð produces the following menu:

Information and examples on these commands are available in the help facilityof the calculator. Some of the command listed in the EXP&LN menu, i.e., LIN,
Page 5-7

LNCOLLECT, and TEXPAND are also contained in the ALG menu presented
earlier. Functions LNP1 and EXPM were introduced in menu HYPERBOLIC,
under the MTH menu (See Chapter 2). The only remaining function is EXPLN.
Its description is shown in the left-hand side, the example from the help facility isshown to the right:

Expansion and factoring using trigonometric functions
The TRIG menu, triggered by using ‚Ñ, shows the following functions:

These functions allow to simplify expressions by replacing some category oftrigonometric functions for another one. For example, the function ACOS2S
allows to replace the function arccosine (acos(x)) with its expression in terms ofarcsine (asin(x)).
Description of these commands and examples of their applications areavailable in the calculator’s help facility (IL@HELP). The user is invited to
explore this facility to find information on the commands in the TRIG menu.
Notice that the first command in the TRIG menu is the HYPERBOLIC menu,
whose functions were introduced in Chapter 2.

Page 5-8

Functions in the ARITHMETIC menu
The ARITHMETIC menu contains a number of sub-menus for specificapplications in number theory (integers, polynomials, etc.), as well as a numberof functions that apply to general arithmetic operations. The ARITHMETIC
menu is triggered through the keystroke combination „Þ (associated withthe 1 key). With system flag 117 set to CHOOSE boxes, „Þ shows
the following menu:

Out of this menu list, options 5 through 9 (DIVIS, FACTORS, LGCD, PROPFRAC,SIMP2) correspond to common functions that apply to integer numbers or topolynomials. The remaining options (1. INTEGER, 2. POLYNOMIAL, 3.
MODULO, and 4. PERMUTATION) are actually sub-menus of functions that
apply to specific mathematical objects. This distinction between sub-menus(options 1 through 4) and plain functions (options 5 through 9) is made clear
when system flag 117 is set to SOFT menus. Activating the ARITHMETIC menu(„Þ ), under these circumstances, produces:

Following, we present the help facility entries for the functions of options 5
through 9 in the ARITHMETIC menu (IL@HELP):DIVIS:

FACTORS:

Page 5-9

LGCD (Greatest Common Denominator): PROPFRAC (proper fraction)

SIMP2:

The functions associated with the ARITHMETIC submenus: INTEGER,
POLYNOMIAL, MODULO, and PERMUTATION, are the following:

INTEGER menu
EULER
IABCUVIBERNOULLIICHINREM
IDIV2
IEGCD
IQUOT
IREMAINDERISPRIME?
NEXTPRIME
PA2B2
PREVPRIME

Number of integers < n, co -prime with n
Solves au + bv = c, with a,b,c = integers
n-th Bernoulli number
Chinese reminder for integers
Euclidean division of two integers
Returns u,v, such that au + bv = gcd(a,b)
Euclidean quotient of two integers
Euclidean remainder of two integers
Test if an integer number is prime
Next prime for a given integer number
Prime number as square norm of a complex number
Previous prime for a given integer number

POLYNOMIAL menu
ABCUV
CHINREMCYCLOTOMIC
DIV2
EGDC

Bézout polynomial equation (au+bv=c)
Chinese remainder for polynomials
n-th cyclotomic polynomial
Euclidean division of two polynomials
Returns u,v, from au+bv=gcd(a,b)

Page 5-10

FACTORFCOEF
FROOTSGCD
HERMITE
HORNERLAGRANGELCM
LEGENDRE
PARTFRAC
PCOEF
PTAYL
QUOT
RESULTANTREMAINDER
STURM
STURMAB

Factorizes an integer number or a polynomial
Generates fraction given roots and multiplicity
Returns roots and multiplicity given a fraction
Greatest common divisor of 2 numbers or polynomials
n-th degree Hermite polynomial
Horner evaluation of a polynomial
Lagrange polynomial interpolation
Lowest common multiple of 2 numbers or polynomials
n-th degree Legendre polynomial
Partial-fraction decomposition of a given fraction(help-facility entry missing)
Returns Q(x-a) in Q(x-a) = P(x), Taylor polynomial
Euclidean quotient of two polynomials
Determinant of the Sylvester matrix of 2 polynomials
Euclidean reminder of two polynomials
Sturm sequences for a polynomial
Sign at low bound and number of zeros between bounds

MODULO menu
ADDTMOD

Add two expressions modulo current modulus

DIVMOD

Divides 2 polynomials modulo current modulus

DIV2MOD

Euclidean division of 2 polynomials with modular
coefficients

EXPANDMOD

Expands/simplify polynomial modulo current modulus

FACTORMOD

Factorize a polynomial modulo current modulus

GCDMOD

GCD of 2 polynomials modulo current modulus

INVMOD

inverse of integer modulo current modulus

MOD(not entry available in the help facility)

MODSTO

Changes modulo setting to specified value

MULTMOD

Multiplication of two polynomials modulo current
modulusPOWMOD

Raises polynomial to a power modulo current modulus

SUBTMOD

Subtraction of 2 polynomials modulo current modulus

Page 5-11

Applications of the ARITHMETIC menu
This section is intended to present some of the background necessary for
application of the ARITHMETIC menu functions. Definitions are presented next
regarding the subjects of polynomials, polynomial fractions and modular
arithmetic. The examples presented below are presented independently of thecalculator setting (ALG or RPN)

Modular arithmetic
Consider a counting system of integer numbers that periodically cycles back on
itself and starts again, such as the hours in a clock. Such counting system iscalled a ring. Because the number of integers used in a ring is finite, thearithmetic in this ring is called finite arithmetic. Let our system of finite integer
numbers consists of the numbers 0, 1, 2, 3, …, n-1, n. We can also refer to thearithmetic of this counting system as modular arithmetic of modulus n. In thecase of the hours of a clock, the modulus is 12. (If working with modular
arithmetic using the hours in a clock, however, we would have to use the integer
numbers 0, 1, 2, 3, …, 10, 11, rather than 1, 2, 3,…,11, 12).
Operations in modular arithmetic
Addition in modular arithmetic of modulus n, which is a positive integer, follow
the rules that if j and k are any two nonnegative integer numbers, both smaller
than n, if j+k≥ n, then j+k is defined as j+k-n. For example, in the case of theclock, i.e., for n = 12, 6+9 “=” 3. To distinguish this ‘equality’ from infinite
arithmetic equalities, the symbol ≡ is used in place of the equal sign, and therelationship between the numbers is referred to as a congruence rather than an
equality. Thus, for the previous example we would write 6+9 ≡ 3 (mod 12),and read this expression as “six plus nine is congruent to three, modulus
twelve.” If the numbers represent the hours since midnight, for example, thecongruence 6+9 ≡ 3 (mod 12), can be interpreted as saying that “six hours
past the ninth hour after midnight will be three hours past noon.” Other sums
that can be defined in modulus 12 arithmetic are: 2+5 ≡ 7 (mod 12); 2+10 ≡0 (mod 12); 7+5 ≡ 0 (mod 12); etcetera.
The rule for subtraction will be such that if j – k < 0, then j-k is defined as j-k+n.
Therefore, 8-10 ≡ 2 (mod 12), is read “eight minus ten is congruent to two,modulus twelve.” Other examples of subtraction in modulus 12 arithmetic
would be 10-5 ≡ 5 (mod 12); 6-9 ≡ 9 (mod 12); 5 – 8 ≡ 9 (mod 12); 5 –10 ≡7 (mod 12); etcetera.
Multiplication follows the rule that if j⋅k > n, so that j⋅k = m⋅n + r, where m and r
are nonnegative integers, both less than n, then j⋅k ≡ r (mod n). The result ofPage 5-12

multiplying j times k in modulus n arithmetic is, in essence, the integer
remainder of j⋅k/n in infinite arithmetic, if j⋅k>n. For example, in modulus 12arithmetic we have 7⋅3 = 21 = 12 + 9, (or, 7⋅3/12 = 21/12 = 1 + 9/12, i.e.,
the integer reminder of 21/12 is 9). We can now write 7⋅3 ≡ 9 (mod 12), andread the latter result as “seven times three is congruent to nine, modulus twelve.”

The operation of division can be defined in terms of multiplication as follows, r/k ≡ j (mod n), if, j⋅k ≡ r (mod n). This means that r must be the remainder ofj⋅k/n. For example, 9/7 ≡ 3 (mod 12), because 7⋅3 ≡ 9 (mod 12). Some
divisions are not permitted in modular arithmetic. For example, in modulus 12arithmetic you cannot define 5/6 (mod 12) because the multiplication table of
6 does not show the result 5 in modulus 12 arithmetic. This multiplication tableis shown below:
6*0 (mod 12)
6*1 (mod 12)
6*2 (mod 12)
6*3 (mod 12)
6*4 (mod 12)
6*5 (mod 12)

0
6
0
6
0
6

6*6 (mod 12)
6*7 (mod 12)
6*8 (mod 12)
6*9 (mod 12)
6*10 (mod 12)
6*11 (mod 12)

0
6
0
6
0
6

Formal definition of a finite arithmetic ring
The expression a ≡ b (mod n) is interpreted as “a is congruent to b, modulo n,”
and holds if (b-a) is a multiple of n. With this definition the rules of arithmetic
simplify to the following:Ifa ≡ b (mod n) and c ≡ d (mod n),thena+c ≡ b+d (mod n),a-c ≡ b - d (mod n),
a×c ≡ b×d (mod n).
For division, follow the rules presented earlier. For example, 17 ≡ 5 (mod 6),
and 21 ≡ 3 (mod 6). Using these rules, we can write:
17 + 21 ≡ 5 + 3 (mod 6) => 38 ≡ 8 (mod 6) => 38 ≡ 2 (mod 6)
17 – 21 ≡ 5 - 3 (mod 6) =>-4 ≡ 2 (mod 6)

17 × 21 ≡ 5 × 3 (mod 6) => 357 ≡ 15 (mod 6) => 357 ≡ 3 (mod 6)
Page 5-13

Notice that, whenever a result in the right-hand side of the “congruence” symbol
produces a result that is larger than the modulo (in this case, n = 6), you canalways subtract a multiple of the modulo from that result and simplify it to anumber smaller than the modulo. Thus, the results in the first case 8 (mod 6)
simplifies to 2 (mod 6), and the result of the third case, 15 (mod 6) simplifies to
3 (mod 6). Confusing? Well, not if you let the calculator handle those
operations. Thus, read the following section to understand how finite arithmeticrings are operated upon in your calculator.

Finite arithmetic rings in the calculator
All along we have defined our finite arithmetic operation so that the results arealways positive. The modular arithmetic system in the calculator is set so thatthe ring of modulus n includes the numbers -n/2+1, …,-1, 0, 1,…,n/2-1, n/2,
if n is even, and –(n-1)/2, -(n-3)/2,…,-1,0,1,…,(n-3)/2, (n-1)/2, if n is odd.
For example, for n = 8 (even), the finite arithmetic ring in the calculator includes
the numbers: (-3,-2,-1,0,1,3,4), while for n = 7 (odd), the corresponding
calculator’s finite arithmetic ring is given by (-3,-2,-1,0,1,2,3).
Modular arithmetic in the calculator
To launch the modular arithmetic menu in the calculator select the MODULO
sub-menu within the ARITHMETIC menu („Þ). The available menu
includes functions: ADDTMOD, DIVMOD, DIV2MOD, EXPANDMOD,
FACTORMOD, GCDMOD, INVMOD, MOD, MODSTO, MULTMOD,
POWMOD, and SUBTMOD. Brief descriptions of these functions were provided
in an earlier section. Next we present some applications of these functions.
Setting the modulus (or MODULO)
The calculator contains a variable called MODULO that is placed in the{HOME CASDIR} directory and will store the magnitude of the modulus to be
used in modular arithmetic.
The default value of MODULO is 13. To change the value of MODULO, you
can either store the new value directly in the variable MODULO in the subdirectory {HOME CASDIR} Alternatively, you can store a new MODULO value
by using function MODSTO.
Modular arithmetic operations with numbers
To add, subtract, multiply, divide, and raise to a power using modular
arithmetic you will use the functions ADDTMOD, SUBTMOD, MULTMOD,
DIV2MOD and DIVMOD (for division), and POWMOD. In RPN mode youneed to enter the two numbers to operate upon, separated by an [ENTER] or an
Page 5-14

[SPC] entry, and then press the corresponding modular arithmetic function. For
example, using a modulus of 12, try the following operations:ADDTMOD examples
6+6 ≡ 0 (mod 12)
6+5 ≡ -1 (mod 12)
8+10 ≡ -6 (mod 12)
11+5 ≡ 4 (mod 12)

6+7 ≡ 1 (mod 12)

SUBTMOD examples
5 - 7 ≡ -2 (mod 12)
11 – 8 ≡ 3 (mod 12)

8 – 4 ≡ 4 (mod 12)
8 - 12 ≡ -4 (mod 12)

5 –10 ≡ -5 (mod 12)

MULTMOD examples
6⋅8 ≡ 0 (mod 12)5⋅6 ≡ 6 (mod 12)9⋅8 ≡ 0 (mod 12)11⋅3 ≡ -3 (mod 12)3⋅2 ≡ 6 (mod 12)

DIVMOD examples
12/3 ≡ 4 (mod 12)
25/5 ≡ 5 (mod 12)
66/6 ≡ -1 (mod 12)

12/8 (mod 12) does not exist
64/13 ≡ 4 (mod 12)

DIV2MOD examples
2/3 (mod 12) does not exist
26/12 (mod 12) does not exist
125/17 (mod 12) ½ 1 with remainder = 0
68/7 ½ -4 (mod 12) with remainder = 0
7/5 ½ -1 (mod 12) with remainder = 0
Note: DIVMOD provides the quotient of the modular division j/k (mod n),while DIMV2MOD provides no only the quotient but also the remainder of themodular division j/k (mod n).

POWMOD examples
23≡ -4 (mod 12)
118 ≡ 1 (mod 12)35≡ 3 (mod 12)
62 ≡ 0 (mod 12)510≡ 1 (mod 12)
99 ≡ -3 (mod 12)

In the examples of modular arithmetic operations shown above, we have used
numbers that not necessarily belong to the ring, i.e., numbers such as 66, 125,17, etc. The calculator will convert those numbers to ring numbers before
Page 5-15

operating on them. You can also convert any number into a ring number byusing the function EXPANDMOD. For example,
EXPANDMOD(125) ≡ 5 (mod 12)
EXPANDMOD(17) ≡ 5 (mod 12)
EXPANDMOD(6) ≡ 6 (mod 12)
The modular inverse of a number
Let a number k belong to a finite arithmetic ring of modulus n, then the modular
inverse of k, i.e., 1/k (mod n), is a number j, such that j⋅k ≡ 1 (mod n). The
modular inverse of a number can be obtained by using the function INVMOD
in the MODULO sub-menu of the ARITHMETIC menu. For example, in modulus
12 arithmetic:
1/6 (mod 12) does not exist.
1/7 ≡ -5 (mod 12)
1/11 ≡ -1 (mod 12)

1/5 ≡ 5 (mod 12)
1/3 (mod 12) does not exist.

The MOD operator
The MOD operator is used to obtain the ring number of a given modulus
corresponding to a given integer number. On paper this operation is written
as m mod n = p, and is read as “m modulo n is equal to p”. For example, tocalculate 15 mod 8, enter:ΘΘ

ALG mode:
RPN mode:

15 MOD 8`15`8` MODThe result is 7, i.e., 15 mod 8 = 7. Try the following exercises:
18 mod 11 = 7
23 mod 2 =1
40 mod 13 = 1
23 mod 17 = 6
34 mod 6 = 4
One practical application of the MOD function for programming purposes is todetermine when an integer number is odd or even, since n mod 2 = 0, if n iseven, and n mode 2 = 1, if n is odd. It can also be used to determine when an
integer m is a multiple of another integer n, for if that is the case m mod n = 0.

Page 5-16

Note: Refer to the help facility in the calculator for description and examples
on other modular arithmetic. Many of these functions are applicable topolynomials. For information on modular arithmetic with polynomials pleaserefer to a textbook on number theory.

Polynomials
Polynomials are algebraic expressions consisting of one or more terms
containing decreasing powers of a given variable. For example, ‘X^3+2*X^23*X+2’ is a third-order polynomial in X, while ‘SIN(X)^2-2’ is a second-orderpolynomial in SIN(X). A listing of polynomial-related functions in the
ARITHMETIC menu was presented earlier. Some general definitions onpolynomials are provided next. In these definitions A(X), B(X), C(X), P(X), Q(X),
U(X), V(X), etc., are polynomials.
Θ Polynomial fraction: a fraction whose numerator and denominator arepolynomials, say, C(X) = A(X)/B(X)Θ Roots, or zeros, of a polynomial: values of X for which P(X) = 0
Θ Poles of a fraction: roots of the denominatorΘ Multiplicity of roots or poles: the number of times a root shows up, e.g., P(X)
= (X+1)2(X-3) has roots {-1, 3} with multiplicities {2,1}Θ Cyclotomic polynomial (Pn(X)): a polynomial of order EULER(n) whose roots
are the primitive n-th roots of unity, e.g., P2(X) = X+1, P4(X) = X2+1
Θ Bézout’s polynomial equation: A(X) U(X) + B(X)V(X) = C(X)
Specific examples of polynomial applications are provided next.

Modular arithmetic with polynomials
The same way that we defined a finite-arithmetic ring for numbers in a previous
section, we can define a finite-arithmetic ring for polynomials with a given
polynomial as modulo. For example, we can write a certain polynomial P(X) as
P(X) = X (mod X2), or another polynomial Q(X) = X + 1 (mod X-2).
A polynomial, P(X) belongs to a finite arithmetic ring of polynomial modulus
M(X), if there exists a third polynomial Q(X), such that (P(X) – Q(X)) is a multipleof M(X). We then would write: P(X) ≡ Q(X) (mod M(X)). The later expression isinterpreted as “P(X) is congruent to Q(X), modulo M(X)”.

The CHINREM function
CHINREM stands for CHINese REMainder. The operation coded in thiscommand solves a system of two congruences using the Chinese Remainder
Theorem. This command can be used with polynomials, as well as with integer
Page 5-17

numbers (function ICHINREM). The input consists of two vectors [expression_1,
modulo_1] and [expression_2, modulo_2]. The output is a vector containing[expression_3, modulo_3], where modulo_3 is related to the product(modulo_1)⋅(modulo_2). Example: CHINREM([X+1, X^2-1],[X+1,X^2]) =[X+1,-(X^4-X^2)]
Statement of the Chinese Remainder Theorem for integers
If m1, m2,…,mr are natural numbers every pair of which are relatively prime,
and a1, a2, …, ar are any integers, then there is an integer x thatsimultaneously satisfies the congruences: x ≡ a1 (mod m1), x ≡ a2 (mod m2),…, x ≡ ar (mod mr). Additionally, if x = a is any solution then all other solutions
are congruent to a modulo equal to the product m1⋅m2⋅ … mr.

The EGCD function
EGCD stands for Extended Greatest Common Divisor. Given two polynomials,
A(X) and B(X), function EGCD produces the polynomials C(X), U(X), and V(X),
so that C(X) = U(X)*A(X) + V(X)*B(X). For example, for A(X) = X^2+1, B(X) =X^2-1, EGCD(A(X),B(X)) = {2, 1, -1}. i.e., 2 = 1*( X^2+1’)-1*( X^2-1). Also,
EGCD(‘X^3-2*X+5’,’X’) = { 5,1,-(X^2-2)}, i.e., 5 = – (X^2-2)*X + 1*(X^32*X+5).

The GCD function
The function GCD (Greatest Common Denominator) can be used to obtain thegreatest common denominator of two polynomials or of two lists of polynomialsof the same length. The two polynomials or lists of polynomials will be placedin stack levels 2 and 1 before using GCD. The results will be a polynomial or alist representing the greatest common denominator of the two polynomials or ofeach list of polynomials. Examples, in RPN mode, follow (calculator set to Exactmode):‘X^3-1’`’X^2-1’`GCD Results in: ‘X-1’{‘X^2+2*X+1’,’X^3+X^2’} `{'X^3+1','X^2+1'}ʳʳ`GCD results in {'X+1'
1}

The HERMITE function
The function HERMITE [HERMI] uses as argument an integer number, k, andreturns the Hermite polynomial of k-th degree. A Hermite polynomial, Hek(x) is
defined as
2

He0 = 1, Hen ( x) = (−1) n e x / 2

d n −x2 / 2(e), n = 1,2,...
dx nPage 5-18

An alternate definition of the Hermite polynomials is

H 0 * = 1, H n * ( x) = (−1) n e x2d n − x2(e ), n = 1,2,...
dx nwhere dn/dxn = n-th derivative with respect to x. This is the definition used in
the calculator.
Examples: The Hermite polynomials of orders 3 and 5 are given by:
HERMITE(3) = ‘8*X^3-12*X’,
And

HERMITE(5) = ‘32*x^5-160*X^3+120*X’.

The HORNER function
The function HORNER produces the Horner division, or synthetic division, of apolynomial P(X) by the factor (X-a). The input to the function are the polynomial
P(X) and the number a. The function returns the quotient polynomial Q(X) that
results from dividing P(X) by (X-a), the value of a, and the value of P(a), in thatorder. In other words, P(X) = Q(X)(X-a)+P(a). For example,
HORNER(‘X^3+2*X^2-3*X+1’,2) = {‘X^2+4*X+5’, 2, 11}. We could,
therefore, write X3+2X2-3X+1 = (X2+4X+5)(X-2)+11. A second example:
HORNER(‘X^6-1’,-5)= {’X^5-5*X^4+25*X^3-125*X^2+625*X-3125’,-5, 15624}
i.e.,
X6 -1 = (X5-5*X4+25X3-125X2+625X-3125)(X+5)+15624.

The variable VX
A variable called VX exists in the calculator’s {HOME CASDIR} directory thattakes, by default, the value of ‘X’. This is the name of the preferred
independent variable for algebraic and calculus applications. Avoid using thevariable VX in your programs or equations, so as to not get it confused with theCAS’ VX. If you need to refer to the x-component of velocity, for example, you
can use vx or Vx. For additional information on the CAS variable see
Appendix C.

The LAGRANGE function
The function LAGRANGE requires as input a matrix having two rows and ncolumns. The matrix stores data points of the form [[x1,x2, …, xn] [y1, y2, …,
yn]]. Application of the function LAGRANGE produces the polynomial
expanded fromPage 5-19n∏(x − x )npn −1 ( x) = ∑kk =1, k ≠ jn

j =1∏(x − x )k =1, k ≠ jj⋅ y j.

k

For example, for n = 2, we will write:

p1 ( x) =( y − y2 ) ⋅ x + ( y2 ⋅ x1 − y1 ⋅ x2 )x − x1x − x2⋅ y1 +⋅ y2 = 1
x1 − x2
x2 − x1
x1 − x2

Check this result with your calculator:
LAGRANGE([[ x1,x2],[y1,y2]]) = ‘((y1-y2)*X+(y2*x1-y1*x2))/(x1-x2)’.
Other examples: LAGRANGE([[1, 2, 3][2, 8, 15]]) = ‘(X^2+9*X-6)/2’
LAGRANGE([[0.5,1.5,2.5,3.5,4.5][12.2,13.5,19.2,27.3,32.5]]) =‘-(.1375*X^4+ -.7666666666667*X^3+ - .74375*X^2 +1.991666666667*X-12.92265625)’.
Note: Matrices are introduced in Chapter 10.

The LCM function
The function LCM (Least Common Multiple) obtains the least common multipleof two polynomials or of lists of polynomials of the same length. Examples:
LCM(‘2*X^2+4*X+2’ ,‘X^2-1’ ) = ‘(2*X^2+4*X+2)*(X-1)’.
LCM(‘X^3-1’,‘X^2+2*X’) = ‘(X^3-1)*( X^2+2*X)’

The LEGENDRE function
A Legendre polynomial of order n is a polynomial function that solves the2
differential equation (1 − x ) ⋅d2ydy− 2 ⋅ x ⋅ + n ⋅ (n + 1) ⋅ y = 02dxdx

To obtain the n-th order Legendre polynomial, use LEGENDRE(n), e.g.,
LEGENDRE(3) = ‘(5*X^3-3*X)/2’
LEGENDRE(5) = ‘(63*X ^5-70*X^3+15*X)/8’
Page 5-20

The PCOEF function
Given an array containing the roots of a polynomial, the function PCOEF
generates an array containing the coefficients of the corresponding polynomial.
The coefficients correspond to decreasing order of the independent variable.
For example: PCOEF([-2,–1,0,1,1,2]) = [1. –1. –5. 5. 4. –4. 0.], which
represents the polynomial X6 -X5-5X4+5X3+4X2-4X.

The PROOT function
Given an array containing the coefficients of a polynomial, in decreasing order,
the function PROOT provides the roots of the polynomial. Example, from
X2+5X-6 =0, PROOT([1, –5, 6]) = [2. 3.].

The PTAYL function
Given a polynomial P(X) and a number a, the function PTAYL is used to obtainan expression Q(X-a) = P(X), i.e., to develop a polynomial in powers of (X- a).
This is also known as a Taylor polynomial, from which the name of the function,
Polynomial & TAYLor, follow:
For example, PTAYL(‘X^3-2*X+2’,2) = ‘X^3+6*X^2+10*X+6’.
In actuality, you should interpret this result to mean‘(X-2) ^3+6*(X-2) ^2+10*(X-2) +6’.
Let’s check by using the substitution: ‘X = x – 2’. We recover the original
polynomial, but in terms of lower-case x rather than upper-case x.

The QUOT and REMAINDER functions
The functions QUOT and REMAINDER provide, respectively, the quotient Q(X)and the remainder R(X), resulting from dividing two polynomials, P1(X) andP2(X). In other words, they provide the values of Q(X) and R(X) from P1(X)/P2(X)= Q(X) + R(X)/P2(X). For example,
QUOT(X^3-2*X+2, X-1) = X^2+X-1
REMAINDER(X^3-2*X+2, X-1) = 1.
Thus, we can write: (X3-2X+2)/(X-1) = X2+X-1 + 1/(X-1).

Page 5-21

Note: you could get the latter result by using PROPFRAC:
PROPFRAC(‘(X^3-2*X+2)/(X-1)’) = ‘X^2+X-1 + 1/(X-1)’.

The EPSX0 function and the CAS variable EPS

The variable ε (epsilon) is typically used in mathematical textbooks to represent
a very small number. The calculator’s CAS creates a variable EPS, with default
value 0.0000000001 = 10 -10, when you use the EPSX0 function. You canchange this value, once created, if you prefer a different value for EPS. The
function EPSX0, when applied to a polynomial, will replace all coefficients
whose absolute value is less than EPS with a zero. Function EPSX0 is notavailable in the ARITHMETIC menu, it must be accessed from the function
catalog (N). Example:
EPSX0(‘X^3-1.2E-12*X^2+1.2E-6*X+6.2E-11)=‘X^3-0*X^2+.0000012*X+0’.
With μ:‘X^3+.0000012*X’.

The PEVAL function
The functions PEVAL (Polynomial EVALuation) can be used to evaluate apolynomial p(x) = an⋅xn+an-1⋅x n-1+ …+ a2⋅x2+a1⋅x+ a0, given an array ofcoefficients [an, an-1, … a2, a1, a0] and a value of x0. The result is theevaluation p(x0). Function PEVAL is not available in the ARITHMETIC menu, it
must be accessed from the function catalog (‚N). Example:
PEVAL([1,5,6,1],5) = 281.

The TCHEBYCHEFF function
The function TCHEBYCHEFF(n) generates the Tchebycheff (or Chebyshev)
polynomial of the first kind, order n, defined as Tn(X) = cos(n⋅arccos(X)). If theinteger n is negative (n < 0), the function TCHEBYCHEFF(n) generates theTchebycheff polynomial of the second kind, order n, defined as Tn(X) =sin(n⋅arccos(X))/sin(arccos(X)). Examples:
TCHEBYCHEFF(3) = 4*X^3-3*X
TCHEBYCHEFF(-3) = 4*X^2-1

Page 5-22

Fractions
Fractions can be expanded and factored by using functions EXPAND and
FACTOR, from the ALG menu (‚×). For example:
EXPAND(‘(1+X)^3/((X-1)*(X+3))’) = ‘(X^3+3*X^2+3*X+1)/(X^2+2*X-3)’
EXPAND(‘(X^2)*(X+Y)/(2*X-X^2)^2)’) = ‘(X+Y)/(X^2-4*X+4)’
EXPAND(‘X*(X+Y)/(X^2-1)’) = ‘(X^2+Y*X)/(X^2-1)’
EXPAND(‘4+2*(X-1)+3/((X-2)*(X+3))-5/X^2’) =ʳʳʳ‘(2*X^5+4*X^4-10*X^3-14*X^2-5*X+30)/(X^4+X^3-6*X^2)’
FACTOR(‘(3*X^3-2*X^2)/(X^2-5*X+6)’) = ‘X^2*(3*X-2)/((X-2)*(X-3))’
FACTOR(‘(X^3-9*X)/(X^2-5*X+6)’ ) = ‘X*(X+3)/(X-2)’
FACTOR(‘(X^2-1)/(X^3*Y-Y)’) = ‘(X+1)/((X^2+X+1)*Y)’The SIMP2 function
Functions SIMP2 and PROPFRAC are used to simplify a fraction and to produce
a proper fraction, respectively. Function SIMP2 takes as arguments two
numbers or polynomials, representing the numerator and denominator of arational fraction, and returns the simplified numerator and denominator. For
example: SIMP2(‘X^3-1’,’X^2-4*X+3’) = { ‘X^2+X+1’,‘X-3’}.

The PROPFRAC function
The function PROPFRAC converts a rational fraction into a “proper” fraction,i.e., an integer part added to a fractional part, if such decomposition ispossible. For example:
PROPFRAC(‘5/4’) = ‘1+1/4’
PROPFRAC(‘(x^2+1)/x^2’) = ‘1+1/x^2’

The PARTFRAC function
The function PARTFRAC decomposes a rational fraction into the partial fractions
that produce the original fraction. For example:
PARTFRAC(‘(2*X^6-14*X^5+29*X^4-37*X^3+41*X^2-16*X+5)/(X^57*X^4+11*X^3-7*X^2+10*X)’) =‘2*X+(1/2/(X-2)+5/(X-5)+1/2/X+X/(X^2+1))’
This technique is useful in calculating integrals (see chapter on calculus) ofrational fractions.
Page 5-23

If you have the Complex mode active, the result will be:‘2*X+(1/2/(X+i)+1/2/(X-2)+5/(X-5)+1/2/X+1/2/(X-i))’

The FCOEF function
The function FCOEF is used to obtain a rational fraction, given the roots andpoles of the fraction.
Note: If a rational fraction is given as F(X) = N(X)/D(X), the roots of thefraction result from solving the equation N(X) = 0, while the poles result fromsolving the equation D(X) = 0.
The input for the function is a vector listing the roots followed by their multiplicity(i.e., how many times a given root is repeated), and the poles followed by theirmultiplicity represented as a negative number. For example, if we want tocreate a fraction having roots 2 with multiplicity 1, 0 with multiplicity 3, and -5
with multiplicity 2, and poles 1 with multiplicity 2 and –3 with multiplicity 5,
use:
FCOEF([2, 1, 0, 3, –5, 2, 1, –2, –3, –5]) = ‘(X--5)^2*X^3*(X-2)/(X+3)^5*(X1)^2’
If you press μ„î` (or, simply μ, in RPN mode) you will get:‘(X^6+8*X^5+5*X^4-50*X^3)/(X^7+13*X^6+61*X^5+105*X^4-45*X^3297*X^2-81*X+243)’

The FROOTS function
The function FROOTS obtains the roots and poles of a fraction. As an
example, applying function FROOTS to the result produced above, will result in:[1 –2. –3 –5. 0 3. 2 1. –5 2.]. The result shows poles followed by theirmultiplicity as a negative number, and roots followed by their multiplicity as apositive number. In this case, the poles are (1, -3) with multiplicities (2,5)
respectively, and the roots are (0, 2, -5) with multiplicities (3, 1, 2), respectively.

Another example is: FROOTS(‘(X^2-5*X+6)/(X^5-X^2)’)= [0 –2. 1 –1. 3 1. 2
1.]. i.e., poles = 0 (2), 1(1), and roots = 3(1), 2(1). If you have had Complex
Page 5-24

mode selected, then the results would be:[0 –2. 1 –1. – ((1+i*√3)/2) –1. – ((1–i*√3)/2) –1. 3 1. 2 1.].

Step-by-step operations with polynomials and fractions
By setting the CAS modes to Step/step the calculator will show simplificationsof fractions or operations with polynomials in a step-by-step fashion. This isvery useful to see the steps of a synthetic division. The example of dividing

X 3 − 5X 2 + 3X − 2
X −2
is shown in detail in Appendix C. The following example shows a lengthier
synthetic division:

X 9 −1X 2 −1
Note that DIV2 is available from the ARITH/POLYNOMIAL menu.

Page 5-25

The CONVERT Menu and algebraic operations
The CONVERT menu is activated by using „Ú key (the 6 key). Thismenu summarizes all conversion menus in the calculator. The list of these menus
is shown next:

The functions available in each of the sub-menus are shown next.

UNITS convert menu (Option 1)
This menu is the same as the UNITS menu obtained by using ‚Û. The
applications of this menu are discussed in detail in Chapter 3.
Page 5-26

BASE convert menu (Option 2)
This menu is the same as the UNITS menu obtained by using ‚ã. The
applications of this menu are discussed in detail in Chapter 19.

TRIGONOMETRIC convert menu (Option 3)
This menu is the same as the TRIG menu obtained by using ‚Ñ. The
applications of this menu are discussed in detail in this Chapter.

MATRICES convert menu (Option 5)
This menu contains the following functions:

These functions are discussed in detail in Chapter 10.

REWRITE convert menu (Option 4)
This menu contains the following functions:

Functions IR and RI are used to convert a number from integer (I) to real (R),or vice versa. Integer numbers are shown without trailing decimal points, while
real numbers representing integers will have a trailing decimal point, e.g.,

Page 5-27

Function NUM has the same effect as the keystroke combination ‚ï(associated with the ` key). Function NUM converts a symbolic result into
its floating-point value. Function Q converts a floating-point value into a
fraction. Function Qπ converts a floating-point value into a fraction of π, if afraction of π can be found for the number; otherwise, it converts the number to a
fraction. Examples are of these three functions are shown next.

Out of the functions in the REWRITE menu, functions DISTRIB, EXPLN,
EXP2POW, FDISTRIB, LIN, LNCOLLECT, POWEREXPAND, and SIMPLIFY apply
to algebraic expressions. Many of these functions are presented in this
Chapter. However, for the sake of completeness we present here the help-facility
entries for these functions.
DISTRIBEXPLN

EXP2POWFDISTRIB

Page 5-28

LIN

LNCOLLECTPOWEREXPANDSIMPLIFY

Page 5-29

Chapter 6
Solution to single equations
In this chapter we feature those functions that the calculator provides for solving
single equations of the form f(X) = 0. Associated with the 7 key there are
two menus of equation-solving functions, the Symbolic SOLVer („Î), andthe NUMerical SoLVer (‚Ï). Following, we present some of the functions
contained in these menus. Change CAS mode to Complex for these exercises(see Chapter 2).

Symbolic solution of algebraic equations
Here we describe some of the functions from the Symbolic Solver menu.
Activate the menu by using the keystroke combination . With system flag 117
set to CHOOSE boxes, the following menu lists will be available:

Functions DESOLVE and LDEC are used for the solution of differential equations,the subject of a different chapter, and therefore will not be presented here.
Similarly, function LINSOLVE relates to the solution of multiple linear equations,and it will be presented in a different chapter. Functions ISOL and SOLVE canbe used to solve for any unknown in a polynomial equation. Function SOLVEVX
solves a polynomial equation where the unknown is the default CAS variable
VX (typically set to ‘X’). Finally, function ZEROS provides the zeros, or roots, ofa polynomial. Entries for all the functions in the S.SLV menu, except ISOL, areavailable through the CAS help facility(IL@HELP ).

Function ISOL
Function ISOL(Equation, variable) will produce the solution(s) to Equation byisolating variable. For example, with the calculator set to ALG mode, to solve
for t in the equation at3-bt = 0 we can use the following:

Page 6-1

Using the RPN mode, the solution is accomplished by entering the equation in
the stack, followed by the variable, before entering function ISOL. Right before
the execution of ISOL, the RPN stack should look as in the figure to the left.
After applying ISOL, the result is shown in the figure to the right:

The first argument in ISOL can be an expression, as shown above, or an
equation. For example, in ALG mode, try:

Note: To type the equal sign (=) in an equation, use ‚Å (associatedwith the \ key).
The same problem can be solved in RPN mode as illustrated below (figures
show the RPN stack before and after the application of function ISOL):

Function SOLVE
Function SOLVE has the same syntax as function ISOL, except that SOLVE canalso be used to solve a set of polynomial equations. The help-facility entry for
function SOLVE, with the solution to equation X^4 – 1 = 3 , is shown next:

The following examples show the use of function SOLVE in ALG and RPN
modes:

Page 6-2

The screen shot shown above displays two solutions. In the first one, β4 -5β=125, SOLVE produces no solutions { }. In the second one, β4 - 5β = 6, SOLVE
produces four solutions, shown in the last output line. The very last solution is
not visible because the result occupies more characters than the width of thecalculator’s screen. However, you can still see all the solutions by using thedown arrow key (˜), which triggers the line editor (this operation can beused to access any output line that is wider than the calculator’s screen):

The corresponding RPN screens for these two examples, before and after theapplication of function SOLVE, are shown next:

Use of the down-arrow key (˜) in this mode will launch the line editor:

Function SOLVEVX
The function SOLVEVX solves an equation for the default CAS variable
contained in the reserved variable name VX. By default, this variable is set to‘X’. Examples, using the ALG mode with VX = ‘X’, are shown below:

Page 6-3

In the first case SOLVEVX could not find a solution. In the second case,
SOLVEVX found a single solution, X = 2.
The following screens show the RPN stack for solving the two examples shown
above (before and after application of SOLVEVX):The equation used as argument for function SOLVEVX must be reducible to arational expression. For example, the following equation will not processed by
SOLVEVX:

Function ZEROS
The function ZEROS finds the solutions of a polynomial equation, without
showing their multiplicity. The function requires having as input the expression
for the equation and the name of the variable to solve for. Examples in ALG
mode are shown next:

To use function ZEROS in RPN mode, enter first the polynomial expression, thenthe variable to solve for, and then function ZEROS. The following screen shotsshow the RPN stack before and after the application of ZEROS to the two
examples above:

Page 6-4

The Symbolic Solver functions presented above produce solutions to rational
equations (mainly, polynomial equations). If the equation to be solved for has
all numerical coefficients, a numerical solution is possible through the use of the
Numerical Solver features of the calculator.

Numerical solver menu
The calculator provides a very powerful environment for the solution of single
algebraic or transcendental equations. To access this environment we start thenumerical solver (NUM.SLV) by using ‚Ï. This produces a drop-downmenu that includes the following options:

Item 2. Solve diff eq.. is to be discussed in a later chapter on differential
equations. Item 4. Solve lin sys.. will be discussed in a later Chapter onmatrices. Item 6. MSLV (Multiple equation SoLVer) will be presented in the next
chapter. Following, we present applications of items 3. Solve poly.., 5. Solvefinance, and 1. Solve equation.., in that order. Appendix 1-A, at the end ofChapter 1, contains instructions on how to use input forms with examples for thenumerical solver applications.
Notes:
1. Whenever you solve for a value in the NUM.SLV applications, the value
solved for will be placed in the stack. This is useful if you need to keep thatvalue available for other operations.
2. There will be one or more variables created whenever you activate some of
the applications in the NUM.SLV menu.

Page 6-5

Polynomial Equations
Using the Solve poly… option in the calculator’s SOLVE environment you can:(1) find the solutions to a polynomial equation;(2) obtain the coefficients of the polynomial having a number of given roots;(3) obtain an algebraic expression for the polynomial as a function of X.
Finding the solutions to a polynomial equation
A polynomial equation is an equation of the form: anxn + an-1xn-1 + …+ a1x +a0 = 0. The fundamental theorem of algebra indicates that there are n solutions
to any polynomial equation of order n. Some of the solutions could be complex
numbers, nevertheless. As an example, solve the equation: 3s4 + 2s3 - s + 1 =0.
We want to place the coefficients of the equation in a vector [an,an-1,a1 a0].
For this example, let's use the vector [3,2,0,-1,1]. To solve for this polynomial
equation using the calculator, try the following:‚Ï˜˜@@OK@@
Select solve poly...
„Ô3‚í2‚í 0‚í 1\‚í1@@OK@@
Enter vector of coefficients@SOLVE@
Solve equation
The screen will show the solution as follows:

Press ` to return to stack. The stack will show the following results in ALG
mode (the same result would be shown in RPN mode):

To see all the solutions, press the down-arrow key (˜) to trigger the line
editor:Page 6-6

All the solutions are complex numbers: (0.432,-0.389), (0.432,0.389), (-0.766,
0.632), (-0.766, -0.632).
Note: Recall that complex numbers in the calculator are represented asordered pairs, with the first number in the pair being the real part, and thesecond number, the imaginary part. For example, the number (0.432,-0.389),
a complex number, will be written normally as 0.432 - 0.389i, where i is theimaginary unit, i.e., i2 = -1.
Note: The fundamental theorem of algebra indicates that there are n solutions
for any polynomial equation of order n. There is another theorem of algebrathat indicates that if one of the solutions to a polynomial equation with realcoefficients is a complex number, then the conjugate of that number is also asolution. In other words, complex solutions to a polynomial equation with realcoefficients come in pairs. That means that polynomial equations with realcoefficients of odd order will have at least one real solution.
Generating polynomial coefficients given the polynomial's roots
Suppose you want to generate the polynomial whose roots are the numbers [1,5, -2, 4]. To use the calculator for this purpose, follow these steps:‚Ï˜˜@@OK@@

Select solve poly...

˜„Ô1‚í5‚í2\‚í 4@@OK@@

Enter vector of roots@SOLVE@

Solve for coefficients

Press ` to return to stack, the coefficients will be shown in the stack.

Page 6-7

Press ˜ to trigger the line editor to see all the coefficients.
Note: If you want to get a polynomial with real coefficients, but having complex roots, you must include the complex roots in pairs of conjugate numbers.
To illustrate the point, generate a polynomial having the roots [1 (1,2) (1,2)]. Verify that the resulting polynomial has only real coefficients. Also, try
generating a polynomial with roots [1 (1,2) (-1,2)], and verify that the resulting polynomial will have complex coefficients.
Generating an algebraic expression for the polynomial
You can use the calculator to generate an algebraic expression for apolynomial given the coefficients or the roots of the polynomial. The resulting
expression will be given in terms of the default CAS variable X. (The examples
below shows how you can replace X with any other variable by using thefunction |.)To generate the algebraic expression using the coefficients, try the following
example. Assume that the polynomial coefficients are [1,5,-2,4]. Use thefollowing keystrokes:‚Ï˜˜@@OK@@

Select Solve poly…

„Ô1‚í5‚í2\‚í 4@@OK@@—@SYMB@

Enter vector of coefficients`

Return to stack.

Generate symbolic expression

The expression thus generated is shown in the stack as:'X^3+5*X^2+-2*X+4'.
To generate the algebraic expression using the roots, try the following example.
Assume that the polynomial roots are [1,3,-2,1]. Use the following keystrokes:‚Ï˜˜@@OK@@

Select Solve poly…

˜„Ô1‚í3‚í2\‚í 1@@OK@@
˜@SYMB@

Enter vector of roots`

Return to stack.

Generate symbolic expression

The expression thus generated is shown in the stack as:'(X-1)*(X-3)*(X+2)*(X-1)'.
Page 6-8

To expand the products, you can use the EXPAND command. The resulting
expression is: 'X^4+-3*X^3+ -3*X^2+11*X-6'.
A different approach to obtaining an expression for the polynomial is togenerate the coefficients first, then generate the algebraic expression with thecoefficients highlighted. For example, for this case try:‚Ï˜˜@@OK@@

Select Solve poly…

˜„Ô1‚í3‚í2\‚í 1@@OK@@@SOLVE@Enter vector of roots

˜@SYMB@

Generate symbolic expression`

Return to stack.

Solve for coefficients

The expression thus generated is shown in the stack as: 'X^4+-3*X^3+ 3*X^2+11*X+-6*X^0'. The coefficients are listed in stack level 2.

Financial calculations
The calculations in item 5. Solve finance.. in the Numerical Solver (NUM.SLV)
are used for calculations of time value of money of interest in the discipline ofengineering economics and other financial applications. This application canalso be started by using the keystroke combination „sÒ (associated with
the 9 key). Before discussing in detail the operation of this solving
environment, we present some definitions needed to understand financial
operations in the calculator.
Definitions
Often, to develop projects, it is necessary to borrow money from a financial
institution or from public funds. The amount of money borrowed is referred toas the Present Value (PV). This money is to be repaid through n periods(typically multiples or sub-multiples of a month) subject to an annual interest rateof I%YR. The number of periods per year (P/YR) is an integer number of
periods in which the year will be divided for the purpose of repaying the loan
money. Typical values of P/YR are 12 (one payment per month), 24 (payment
twice a month), or 52 (weekly payments). The payment(PMT) is the amountthat the borrower must pay to the lender at the beginning or end of each of then periods of the loan. The future value of the money (FV) is the value that theborrowed amount of money will be worth at the end of n periods. Typically
payment occurs at the end of each period, so that the borrower starts paying at
the end of the first period, and pays the same fixed amount at the end of thesecond, third, etc., up to the end of the n-th period.
Page 6-9

Example 1 – Calculating payment on a loan
If $2 million are borrowed at an annual interest rate of 6.5% to be repaid in 60
monthly payments, what should be the monthly payment? For the debt to be
totally repaid in 60 months, the future values of the loan should be zero. So, forthe purpose of using the financial calculation feature of the calculator we will
use the following values: n = 60, I%YR = 6.5, PV = 2000000, FV = 0, P/YR =12. To enter the data and solve for the payment, PMT, use:„ÒStart the financial calculation input form

60 @@OK@@Enter n = 60

6.5 @@OK@@

Enter I%YR = 6.5 %2000000 @@OK@@

Enter PV = 2,000,000 US$

˜

Skip PMT, since we will be solving for it

0 @@OK@@Enter FV = 0, the option End is highlighted— š @@SOLVE!

Highlight PMT and solve for it

The solution screen will look like this:The screen now shows the value of PMT as –39,132.30, i.e., the borrower must
pay the lender US $ 39,132.30 at the end of each month for the next 60
months to repay the entire amount. The reason why the value of PMT turned
out to be negative is because the calculator is looking at the money amounts
from the point of view of the borrower. The borrower has + US $2,000,000.00 at time period t = 0, then he starts paying, i.e., adding -US $39132.30 at times t = 1, 2, …, 60. At t = 60, the net value in the hands of theborrower is zero. Now, if you take the value US $ 39,132.30 and multiply itby the 60 payments, the total paid back by the borrower is US $ 2,347,937.79.
Thus, the lender makes a net profit of $ 347,937.79 in the 5 years that hismoney is used to finance the borrower’s project.
Example 2 – Calculating amortization of a loan
The same solution to the problem in Example 1 can be found by pressing@)@AMOR!!, which is stands for AMORTIZATION. This option is used to calculate
how much of the loan has been amortized at the end of a certain number ofPage 6-10

payments. Suppose that we use 24 periods in the first line of the amortization
screen, i.e., 24 @@OK@@. Then, press @@AMOR@@. You will get the following
result:This screen is interpreted as indicating that after 24 months of paying back thedebt, the borrower has paid up US $ 723,211.43 into the principal amountborrowed, and US $ 215,963.68 of interest. The borrower still has to pay abalance of US $1,276,788.57 in the next 36 months.
Check what happens if you replace 60 in the Payments: entry in theamortization screen, then press @@OK@@ @@AMOR@@. The screen now looks like this:This means that at the end of 60 months the US $ 2,000,000.00 principal
amount has been paid, together with US $ 347,937.79 of interest, with thebalance being that the lender owes the borrower US $ 0.000316. Of course,
the balance should be zero. The value shown in the screen above is simply
round-off error resulting from the numerical solution.
Press $or `, twice, to return to normal calculator display.
Example 3 – Calculating payment with payments at beginning of period
Let’s solve the same problem as in Examples 1 and 2, but using the option thatpayment occurs at the beginning of the payment period. Use:„ÒStart the financial calculation input form

60 @@OK@@Enter n = 60

6.5 @@OK@@

Enter I%YR = 6.5 %2000000 @@OK@@

Enter PV = 2,000,000 US$
Page 6-11

˜Skip PMT, since we will be solving for it

0 @@OK@@Enter FV = 0, the option End is highlighted@@CHOOS !—@@OK@@

Change payment option to Begin— š @@SOLVE!

Highlight PMT and solve for it

The screen now shows the value of PMT as –38,921.47, i.e., the borrower must
pay the lender US $ 38,921.48 at the beginning of each month for the next 60
months to repay the entire amount. Notice that the amount the borrower pays
monthly, if paying at the beginning of each payment period, is slightly smaller
than that paid at the end of each payment period. The reason for thatdifference is that the lender gets interest earnings from the payments from the
beginning of the period, thus alleviating the burden on the lender.
Notes:
1. The financial calculator environment allows you to solve for any of the terms
involved, i.e., n, I%YR, PV, FV, P/Y, given the remaining terms in the loancalculation. Just highlight the value you want to solve for, and press @@SOLVE!.
The result will be shown in the highlighted field.
2. The values calculated in the financial calculator environment are copied tothe stack with their corresponding tag (identifying label).
Deleting the variables
When you use the financial calculator environment for the first time within the
HOME directory, or any sub-directory, it will generate the variables @@@N@@ @I©YR@@@PV@@ @@PMT@@ @@PYR@@ @@FV@@ to store the corresponding terms in the calculations.. You
can see the contents of these variables by using:‚@@ @n@@ ‚@I©YR@ ‚@@PV@@ ‚@@PMT@@ ‚@@PYR@@ ‚@@FV@@.
You can either keep these variables for future use, or use the PURGE function toerase them from your directory. To erase all of the variables at once, if using
ALG mode, try the following:
I@PURGE J „äEnter PURGE, prepare list of variables³‚@@@n@@Enter name of variable N™ ‚íEnter a comma³ ‚@I©YR@
Enter name of variable I%YR
™ ‚íEnter a comma³ ‚@@PV@@Enter name of variable PV™ ‚íEnter a comma³ ‚@@PMT@@Enter name of variable PMTPage 6-12

™ ‚í
³ ‚@@PYR@@™ ‚í
³ ‚@@FV@@.
`Enter a comma
Enter name of variable PYREnter a comma
Enter name of variable FV
Execute PURGE command

The following two screen shots show the PURGE command for purging all thevariables in the directory, and the result after executing the command.

In RPN mode, the command is executed by using:J „ä
@@@n@@@I©YR@@@PV@@@@PMT@@@@PYR@@@@FV@@`I@PURGE

Prepare a list of variables to be purgedEnter name of variable N
Enter name of variable I%YR
Enter name of variable PV
Enter name of variable PMTEnter name of variable PYREnter name of variable FVEnter list of variables in stack
Purge variables in list

Before the command PURGE is entered, the RPN stack will look like this:Solving equations with one unknown through NUM.SLVThe calculator's NUM.SLV menu provides item 1. Solve equation.. solve different
types of equations in a single variable, including non-linear algebraic andtranscendental equations. For example, let's solve the equation: ex-sin(πx/3) =0.
Simply enter the expression as an algebraic object and store it into variable
EQ. The required keystrokes in ALG mode are the following:

Page 6-13

³„¸~„x™-S„ì*~„x/3™‚Å 0™
K~e~q`

Function STEQ
Function STEQ, available through the command catalog, ‚N, will store its
argument into variable EQ, e.g., in ALG mode:

In RPN mode, enter the equation between apostrophes and activate command
STEQ. Thus, function STEQ can be used as a shortcut to store an expression
into variable EQ.
Press J to see the newly created EQ variable:

Then, enter the SOLVE environment and select Solve equation…, by using:‚Ï@@OK@@. The corresponding screen will be shown as:

The equation we stored in variable EQ is already loaded in the Eq field in the
SOLVE EQUATION input form. Also, a field labeled x is provided. To solve theequation all you need to do is highlight the field in front of X: by using ˜,and press @SOLVE@. The solution shown is X: 4.5006E-2:

Page 6-14

This, however, is not the only possible solution for this equation. To obtain anegative solution, for example, enter a negative number in the X: field before
solving the equation. Try 3\@@@OK@@˜@SOLVE@. The solution is now X: 3.045.
Solution procedure for Equation Solve...
The numerical solver for single-unknown equations works as follows:Θ It lets the user type in or @CHOOS an equation to solve.
Θ It creates an input form with input fields corresponding to all variables
involved in equation stored in variable EQ.
Θ The user needs to enter values for all variables involved, except one.
Θ The user then highlights the field corresponding to the unknown forwhich to solve the equation, and presses @SOLVE@
Θ The user may force a solution by providing an initial guess for thesolution in the appropriate input field before solving the equation.
The calculator uses a search algorithm to pinpoint an interval for which thefunction changes sign, which indicates the existence of a root or solution. It
then utilizes a numerical method to converge into the solution.
The solution the calculator seeks is determined by the initial value present in theunknown input field. If no value is present, the calculator uses a default value ofzero. Thus, you can search for more than one solution to an equation bychanging the initial value in the unknown input field. Examples of the equations
solutions are shown following.
Example 1 – Hooke’s law for stress and strain
The equation to use is Hooke’s law for the normal strain in the x-direction for asolid particle subjected to a state of stress given by

⎡σ xx
⎢
⎢σ yx
⎢σ zx
⎣

σ xy σ xz ⎤⎥σ yy σ yz ⎥σ zy σ zz ⎥⎦Page 6-15

The equation is exx =1[σ xx − n ⋅ (σ yy + σ zz )] + α ⋅ ΔT , here exx is the unitE

strain in the x-direction, σxx, σyy, and σzz, are the normal stresses on the particle
in the directions of the x-, y-, and z-axes, E is Young’s modulus or modulus ofelasticity of the material, n is the Poisson ratio of the material, α is the thermal
expansion coefficient of the material, and ΔT is a temperature increase.
Suppose that you are given the following data: σxx= 2500 psi, σyy =1200 psi,and σzz = 500 psi, E = 1200000 psi, n = 0.15, α = 0.00001/oF, ΔT = 60 oF.
To calculate the strain exx use the following:‚Ï@@OK@@‚O

Access numerical solver to solve equations
Access the equation writer to enter equation

At this point follow the instructions from Chapter 2 on how to use the Equation
Writer to build an equation. The equation to enter in the Eq field should look
like this (notice that we use only one sub-index to refer to the variables, i.e., exx
is translated as ex, etc. -- this is done to save typing time):

Use the following shortcuts for special characters:

σ:

~‚s

α:

~‚a

Δ:

~‚c

and recall that lower-case letters are entered by using ~„ before the letter
key, thus, x is typed as ~„x.
Press `to return to the solver screen. Enter the values proposed above into
the corresponding fields, so that the solver screen looks like this:Page 6-16

With the ex: field highlighted, press @SOLVE@ to solve for ex:

The solution can be seen from within the SOLVE EQUATION input form bypressing @EDIT while the ex: field is highlighted. The resulting value is
2.470833333333E-3. Press @@@OK@@ to exit the EDIT feature.
Suppose that you now, want to determine the Young’s modulus that will produce
a strain of exx = 0.005 under the same state of stress, neglecting thermal
expansion. In this case, you should enter a value of 0.005 in the ex: field, anda zero in the ΔT: field (with ΔT = 0, no thermal effects are included). To solve
for E, highlight the E: field and press @SOLVE@. The result, seeing with the @EDIT
feature is, E = 449000 psi. Press @SOLVE@ ` to return to normal display.
Notice that the results of the calculations performed within the numerical solver
environment have been copied to the stack:Also, you will see in your soft-menu key labels variables corresponding to thosevariables in the equation stored in EQ (press L to see all variables in yourdirectory), i.e., variables ex, ΔT, α, σz, σy, n, σx, and E.
Example 2 – Specific energy in open channel flow

Page 6-17

Specific energy in an open channel is defined as the energy per unit weightmeasured with respect to the channel bottom. Let E = specific energy, y =channel depth, V = flow velocity, g = acceleration of gravity, then we write

E = y+V2.
2g

The flow velocity, in turn, is given by V = Q/A, where Q = water discharge, A= cross-sectional area. The area depends on the cross-section used, forexample, for a trapezoidal cross-section, as shown in the figure below, A =(b+m⋅y) ⋅y, where b = bottom width, and m = side slope of cross section.

z

2

n

c
We can type in the equation for E as shown above and use auxiliary variables
for A and V, so that the resulting input form will have fields for the fundamental
variables y, Q, g, m, and b, as follows:Θ First, create a sub-directory called SPEN (SPecific ENergy) and workwithin that sub-directory.
Θ Next, define the following variables:Θ

Launch the numerical solver for solving equations: ‚Ï@@OK@@.
Notice that the input form contains entries for the variables y, Q, b, m,and g:

Θ

Try the following input data: E = 10 ft, Q = 10 cfs (cubic feet per
second), b = 2.5 ft, m = 1.0, g = 32.2 ft/s2:
Page 6-18

ΘΘ

Solve for y.

The result is 0.149836.., i.e., y = 0.149836.
It is known, however, that there are actually two solutions available fory in the specific energy equation. The solution we just foundcorresponds to a numerical solution with an initial value of 0 (thedefault value for y, i.e., whenever the solution field is empty, the initialvalue is zero). To find the other solution, we need to enter a larger
value of y, say 15, highlight the y input field and solve for y once
more:

The result is now 9.99990, i.e., y = 9.99990 ft.
This example illustrates the use of auxiliary variables to write complicatedequations. When NUM.SLV is activated, the substitutions implied by theauxiliary variables are implemented, and the input screen for the equation
provides input field for the primitive or fundamental variables resulting from thesubstitutions. The example also illustrates an equation that has more than one
solution, and how choosing the initial guess for the solution may produce thosedifferent solutions.

Page 6-19

In the next example we will use the DARCY function for finding friction factors inpipelines. Thus, we define the function in the following frame.
Special function for pipe flow: DARCY (ε/D,Re)The Darcy-Weisbach equation is used to calculate the energy loss (per unit
weight), hf, in a pipe flow through a pipe of diameter D, absolute roughness ε,and length L, when the flow velocity in the pipe is V. The equation is written as

hf = f ⋅L V2⋅. The quantity f is known as the friction factor of the flow andD 2g

it has been found to be a function of the relative roughness of the pipe, ε/D,and a (dimensionless) Reynolds number, Re. The Reynolds number is defined as
Re = ρVD/μ = VD/ν, where ρ and μ are the density and dynamic viscosity of
the fluid, respectively, and ν = μ/ρ is the kinematic viscosity of the fluid.
The calculator provides a function called DARCY that uses as input the relativeroughness ε/D and the Reynolds number, in that order, to calculate the friction
factor f. The function DARCY can be found through the command catalog:

For example, for ε/D = 0.0001, Re = 1000000, you can find the friction factor
by using: DARCY(0.0001,1000000). In the following screen, the function
NUM () was used to obtain a numerical value of the function:

The result is f = DARCY(0.0001,1000000) = 0.01341…
The function FANNING(ε/D,Re)In aerodynamics applications a different friction factor, the Fanning friction
factor, is used. The Fanning friction factor, fF, is defined as 4 times the DarcyWeisbach friction factor, f. The calculator also provides a function called
FANNING that uses the same input as DARCY, i.e., ε/D and Re, and provides
the FANNING friction factor. Check that FANNING(0.0001,1000000) =0.0033603589181s.
Page 6-20

Example 3 – Flow in a pipe
You may want to create a separate sub-directory (PIPES) to try this example.
The main equation governing flow in a pipe is, of course, the Darcy-Weisbachequation. Thus, type in the following equation into EQ:

Also, enter the following variables (f, A, V, Re):In this case we stored the main equation (Darcy-Weisbach equation) into EQ,
and then replaced several of its variables by other expressions through thedefinition of variables f, A, V, and Re. To see the combined equation, use
EVAL(EQ). In this example we changed the display setting so that we can see
the entire equation in the screen:Thus, the equation we are solving, after combining the different variables in the
directory, is:Page 6-21

QD ⎞
⎛
⎜
8Q L
ε πD 2 / 4 ⎟⎟⎜h f = 2 5 ⋅ DARCY
,
⎜D
Nu ⎟
π gD
⎜
⎟
⎝
⎠
2

The combined equation has primitive variables: hf, Q, L, g, D, ε, and Nu.
Launch the numerical solver (‚Ï@@OK@@) to see the primitive variables listed
in the SOLVE EQUATION input form:

Suppose that we use the values hf = 2 m, ε = 0.00001 m, Q = 0.05 m3/s, Nu= 0.000001 m2/s, L = 20 m, and g = 9.806 m/s2, find the diameter D. Enterthe input values, and solve for D, The solution is: 0.12, i.e., D = 0.12 m.

If the equation is dimensionally consistent, you can add units to the input
values, as shown in the figure below. However, you must add those units to theinitial guess in the solution. Thus, in the example below we place 0_m in the D:
field before solving the problem. The solution is shown in the screen to the right:

Press ` to return to normal calculator display. The solution for D will be listed
in the stack.

Page 6-22

Example 4 – Universal gravitation
Newton’s law of universal gravitation indicates that the magnitude of theattractive force between two bodies of masses m1 and m2 separated by adistance r is given by the equation F = G ⋅M1 ⋅ M 2.
r2

Here, G is the universal gravitational constant, whose value can be obtained
through the use of the function CONST in the calculator by using:

We can solve for any term in the equation (except G) by entering the equationas:This equation is then stored in EQ:

Launching the numerical solver for this equation results in an input form
containing input fields for F, G, m1, m2, and r.

Let’s solve this problem using units with the following values for the known
variables m1 = 1.0×106 kg, m2 = 1.0×1012 kg, r = 1.0×1011 m. Also, entera value of 0_N in field F to ensure the proper solution using units in thecalculator:

Page 6-23

Solve for F, and press to return to normal calculator display. The solution is F :6.67259E-15_N, or F = 6.67259×10 -15 N.

Note: When using units in the numerical solver make sure that all the variables
have the proper units, that the units are compatible, and that the equation isdimensionally homogeneous.

Different ways to enter equations into EQ
In all the examples shown above we have entered the equation to be solved
directly into variable EQ before activating the numerical solver. You canactually type the equation to be solved directly into the solver after activating itby editing the contents of the EQ field in the numerical solver input form. If
variable EQ has not been defined previously, when you launch the numericalsolver (‚Ï@@OK@@), the EQ field will be highlighted:

At this point you can either type a new equation by pressing @EDIT. You will be
provided with a set of apostrophes so that you can type the expression between
them:

Page 6-24

Type an equation, say X^2 - 125 = 0, directly on the stack, and press @@@OK@@@ .

At this point the equation is ready for solution.
Alternatively, you can activate the equation writer after pressing @EDIT to enter
your equation. Press ` to return to the numerical solver screen.
Another way to enter an equation into the EQ variable is to select a variablealready existing in your directory to be entered into EQ. This means that yourequation would have to have been stored in a variable name previously toactivating the numerical solver. For example, suppose that we have entered thefollowing equations into variables EQ1 and EQ2:

Now, launch the numerical solver (‚Ï@@OK@@, and highlight the EQ field. At
this point press the @CHOOS soft menu key. Use the up and down arrow keys (—˜) to select, say, variable EQ1:

Press @@@OK@@@ after selecting EQ1 to load into variable EQ in the solver. The new
equation is ready to be solved.

Page 6-25

The SOLVE soft menu
The SOLVE soft menu allows access to some of the numerical solver functions
through the soft menu keys. To access this menu use in RPN mode: 74 MENU,
or in ALG mode: MENU(74). Alternatively, you can use ‚(hold) 7 toactivate the SOLVE soft menu. The sub-menus provided by the SOLVE soft menu
are the following:

The ROOT sub-menu
The ROOT sub-menu include the following functions and sub-menus:

Function ROOT
Function ROOT is used to solve an equation for a given variable with a starting
guess value. In RPN mode the equation will be in stack level 3, while thevariable name will be located in level 2, and the initial guess in level 1. The
following figure shows the RPN stack before and after activating function @ROOT:In ALG mode, you would use ROOT(‘TAN(θ)=θ’,’θ’,5) to activate function ROOT:

Variable EQ
The soft menu key @@EQ@@ in this sub-menu is used as a reference to the variable
EQ. Pressing this soft menu key is equivalent to using function RCEQ (ReCall
EQ).

The SOLVR sub-menu
The SOLVR sub-menu activates the soft-menu solver for the equation currently
stored in EQ. Some examples are shown next:

Page 6-26

Example 1 - Solving the equation t2-5t = -4
For example, if you store the equation ‘t^2-5*t=-4’ into EQ, and press @)SOLVR, it
will activate the following menu:

This result indicates that you can solve for a value of t for the equation listed at
the top of the display. If you try, for example, „[ t ], it will give you theresult t: 1., after briefly flashing the message “Solving for t.” There is a secondroot to this equation, which can be found by changing the value of t, before
solving for it again. Do the following: 10 [ t ], then press „[ t ]. The
result is now, t: 4.0000000003. To verify this result, press the soft menu key
labeled @EXPR=, which evaluates the expression in EQ for the current value of t.
The results in this case are:

To exit the SOLVR environment, press J. The access to the SOLVE menu islost at this point, so you have to activate it once more as indicated earlier, tocontinue with the exercises below.
Example 2 - Solving the equation Q = at2+bt
It is possible to store in EQ, an equation involving more than one variable, say,
‘Q = at^2 + bt’. In this case, after activating the SOLVE soft menu, andpressing @)ROOT @)SOLVR, you will get the following screen:

Within this SOLVR environment you can provide values for any of the variables
listed by entering the value in the stack and pressing the corresponding softmenu keys. For example, say you enter the values Q = 14, a = 2, and b = 3.
You would use: 14 [ Q ], 2 [ a ], 3 [ b ].
As variables Q, a, and b, get assigned numerical values, the assignments arelisted in the upper left corner of the display. At this point we can solve for t, byusing „[ t ]. The result is t: 2. Pressing @EXPR= shows the results:

Example 3 - Solving two simultaneous equations, one at a time

Page 6-27

You can also solve more than one equation by solving one equation at a time,and repeating the process until a solution is found. For example, if you enter
the following list of equations into variable EQ: { ‘a*X+b*Y = c’, ‘k*X*Y=s’},the keystroke sequence @)ROOT @)SOLVR, within the SOLVE soft menu, will produce
the following screen:

The first equation, namely, a*X + b*Y = c, will be listed in the top part of thedisplay. You can enter values for the variables a, b, and c, say:
2 [ a ] 5 [ b ] 19 [ c ]. Also, since we can only solve one equation ata time, let’s enter a guess value for Y, say, 0 [ Y ], and solve for X, by using„[ X ]. This gives the value, X: 9.4999…. To check the value of theequation at this point, press @EXPR=. The results are: Left: 19, Right: 19. To
solve the next equation, press L @NEXQ. The screen shows the soft menu keysas:

Say we enter the values k = 2, s = 12. Then solve for Y, and press@EXPR=. The results are now, Y:

We then continue moving from the first to the second equation, back and forth,solving the first equation for X and the second for Y, until the values of X and Y
converge to a solution. To move from equation to equation use @NEXQ.
To solve for X and Y use „[ X ], and „[ Y ], respectively. The following
sequence of solutions is produced:

After solving the two equations, one at a time, we notice that, up to the third
decimal, X is converging to a value of 7.500, while Y is converging to a value o
0.799.

Page 6-28

Using units with the SOLVR sub-menu
These are some rules on the use of units with the SOLVR sub-menu:
Θ Entering a guess with units for a given variable, will introduce the useof those units in the solution.
Θ If a new guess is given without units, the units previously saved for thatparticular variable are used.
Θ To remove units enter a number without units in a list as the new guess,i.e., use the format { number }.
Θ A list of numbers can be given as a guess for a variable. In this case,the units takes the units used belong to the last number in the list. For
example, entering { 1.41_ft 1_cm 1_m } indicates that meters (m) will
be used for that variable.
Θ The expression used in the solution must have consistent units, or anerror will result when trying to solve for a value.

The DIFFE sub-menu
The DIFFE sub-menu provides a number of functions for the numerical solution ofdifferential equations. The functions provided are the following:

These functions are presented in detail in Chapter 16.

The POLY sub-menu
The POLY sub-menu performs operations on polynomials. The functions
included are the following:

Function PROOTThis function is used to find the roots of a polynomial given a vector containing
the polynomial coefficients in decreasing order of the powers of the
independent variable. In other words, if the polynomial is anxn + an-1xn-1 + …
+ a2x2 + a1x + a0, the vector of coefficients should be entered as [an, an-1, …
, a2, a1 , a0]. For example, the roots of the polynomial whose coefficients are[1, -5, 6] are [2, 3].
Function PCOEF

Page 6-29

This function produces the coefficients [an, an-1, … , a2, a1 , a0] of apolynomial anxn + an-1xn-1 + … + a2x2 + a1x + a0, given a vector of its roots[r1, r2, …, rn]. For example, a vector whose roots are given by[-1, 2, 2, 1, 0], will produce the following coefficients: [1, -4, 3, 4, -4, 0]. The
polynomial is x5 - 4x4 + 3x3 + 4x2 - 4x.
Function PEVALThis function evaluates a polynomial, given a vector of its coefficients, [an, an-1,… , a2, a1 , a0], and a value x0, i.e., PEVAL calculates anx0n + an-1x0n-1 + …
+ a2x02 + a1x0 + a0. For example, for coefficients [2, 3, -1, 2] and a value of
2, PEVAL returns the value 28.

The SYS sub-menu
The SYS sub-menu contains a listing of functions used to solve linear systems.
The functions listed in this sub-menu are:

These functions are presented in detail in Chapter 11.

The TVM sub-menu
The TVM sub-menu contains functions for calculating Time Value of Money. Thisis an alternative way to solve FINANCE problems (see Chapter 6). The
functions available are shown next:

The SOLVR sub-menu
The SOLVR sub-menu in the TVM sub-menu will launch the solver for solving
TVM problems. For example, pressing @)SOLVR, at this point, will trigger thefollowing screen:

As an exercise, try using the values n = 10, I%YR = 5.6, PV = 10000, and FV= 0, and enter „[ PMT ] to find PMT = -1021.08…. Pressing L, produces
the following screen:

Page 6-30

Press J to exit the SOLVR environment. Find your way back to the TVM submenu within the SOLVE sub-menu to try the other functions available.
Function TVMROOTThis function requires as argument the name of one of the variables in the TVM
problem. The function returns the solution for that variable, given that the othervariables exist and have values stored previously. For example, having solved a
TVM problem above, we can solve for, say, ‘N’, as follows: [ ‘ ] ~n`@TVMRO. The result is 10.
Function AMORTThis function takes a value representing a period of payment (between 0 and n)
and returns the principal, interest, and balance for the values currently stored in
the TVM variables. For example, with the data used earlier, if we activate
function AMORT for a value of 10, we get:

Function BEG
If selected, the TMV calculations use payments at the beginning of each period.
If deselected, the TMV calculations use payments at the end of each period.

Page 6-31

Chapter 7
Solving multiple equations
Many problems of science and engineering require the simultaneous solutionsof more than one equation. The calculator provides several procedures forsolving multiple equations as presented below. Please notice that no discussionof solving systems of linear equations is presented in this chapter. Linear
systems solutions will be discussed in detail in subsequent chapters on matrices
and linear algebra.

Rational equation systems
Equations that can be re-written as polynomials or rational algebraic
expressions can be solved directly by the calculator by using the function
SOLVE. You need to provide the list of equations as elements of a vector. The
list of variables to solve for must also be provided as a vector. Make sure that
the CAS is set to mode Exact before attempting a solution using this procedure.
Also, the more complicated the expressions, the longer the CAS takes in solving
a particular system of equations. Examples of this application follow:

Example 1 – Projectile motion
Use function SOLVE with the following vector arguments, the first being the list ofequations: [‘x = x0 + v0*COS(θ0)*t’ ‘y =y0+v0*SIN(θ0)*t – g*t^2/2’]`,and the second being the variables to solve for, say t and y0, i.e., [‘t’ ‘y0’].
The solution in this case will be provided using the RPN mode. The only reason
being that we can build the solution step by step. The solution in the ALG
mode is very similar. First, we store the first vector (equations) into variable A2,
and the vector of variables into variable A1. The following screen shows the
RPN stack before saving the variables.

At this point, we need only press K twice to store these variables.
To solve, first change CAS mode to Exact, then, list the contents of A2 and A1,
in that order: @@@A2@@@ @@@A1@@@ .

Page 7-1

Use command SOLVE at this point (from the S.SLV menu: „Î) After about
40 seconds, maybe more, you get as result a list:{ ‘t = (x-x0)/(COS(θ0)*v0)’‘y0 = (2*COS(θ0)^2*v0^2*y+(g*x^2(2*x0*g+2*SIN(θ0))*COS(θ0)*v0^2)*x+(x0^2*g+2*SIN(θ0)*COS(θ0)*v0^2*x0)))/(2*COS(θ0)^2*v0^2)’]}Press μ to remove the vector from the list, then use command OBJ, to get
the equations listed separately in the stack.

Note: This method worked fine in this example because the unknowns t andy0 were algebraic terms in the equations. This method would not work forsolving for θ0, since θ0 belongs to a transcendental term.

Example 2 – Stresses in a thick wall cylinder
Consider a thick-wall cylinder for inner and outer radius a and b, respectively,
subject to an inner pressure Pi and outer pressure Po. At any radial distance r
from the cylinder’s axis the normal stresses in the radial and transverse
directions, σrr and σθθ, respectively, are given byσ θθ =

a 2 ⋅ Pi − b 2 ⋅ Po a 2 ⋅ b 2 ⋅ ( Pi − Po )+,b2 − a 2r 2 ⋅ (b 2 −a 2 )σ rr =

a 2 ⋅ Pi − b 2 ⋅ Po a 2 ⋅ b 2 ⋅ ( Pi − Po )−.
b2 − a 2r 2 ⋅ (b 2 −a 2 )Notice that the right-hand sides of the two equations differ only in the sign
between the two terms. Therefore, to write these equations in the calculator, Isuggest you type the first term and store in a variable T1, then the second term,and store it in T2. Writing the equations afterwards will be matter of recalling
Page 7-2

the contents of T1 and T2 to the stack and adding and subtracting them. Hereis how to do it with the equation writer:Enter and store term T1:

Enter and store term T2:

Notice that we are using the RPN mode in this example, however, theprocedure in the ALG mode should be very similar. Create the equation forσθθ: J@@@T1@@@ @@T2#@@ + ~‚s ~‚t ` ™ ‚ÅCreate the equation for σrr: J@@@T1@@@ @@T2#@@ - ~‚s ~„r `™ ‚Å
Put together a vector with the two equations, using function ARRY (find it
using the command catalog ‚N) after typing a 2:

Now, suppose that we want to solve for Pi and Po, given a, b, r, σrr, and σθθ.
We enter a vector with the unknowns:

To solve for Pi and Po, use the command SOLVE from the S.SLV menu („Î),
it may take the calculator a minute to produce the result:{[‘Pi=-(((σθ-σr)*r^2-(σθ+σr)*a^2)/(2*a^2))’‘Po=-(((σθ-σr)*r^2-(σθ+σr)*b^2)/(2*b^2))’ ] }, i.e.,

Page 7-3

Notice that the result includes a vector [ ] contained within a list { }. To remove
the list symbol, use μ. Finally, to decompose the vector, use function OBJ.
The result is:

These two examples constitute systems of linear equations that can be handledequally well with function LINSOLVE (see Chapter 11). The following example
shows function SOLVE applied to a system of polynomial equations.

Example 3 - System of polynomial equations
The following screen shot shows the solution of the system X2+XY=10, X2-Y2=-5,
using function SOLVE:

Solution to simultaneous equations with MSLV
Function MSLV is available as the last option in the ‚Ï menu:

The help-facility entry for function MSLV is shown next:

Page 7-4

Example 1 - Example from the help facility
As with all function entries in the help facility, there is an example attached to
the MSLV entry as shown above. Notice that function MSLV requires threearguments:
1. A vector containing the equations, i.e., ‘[SIN(X)+Y,X+SIN(Y)=1]’
2. A vector containing the variables to solve for, i.e., ‘[X,Y]’
3. A vector containing initial values for the solution, i.e., the initial valuesof both X and Y are zero for this example.
In ALG mode, press @ECHO to copy the example to the stack, press ` to run theexample. To see all the elements in the solution you need to activate the line
editor by pressing the down arrow key (˜):

In RPN mode, the solution for this example is produced by using:

Activating function MSLV results in the following screen.

You may have noticed that, while producing the solution, the screen showsintermediate information on the upper left corner. Since the solution provided
by MSLV is numerical, the information in the upper left corner shows the resultsof the iterative process used to obtain a solution. The final solution is X =1.8238, Y = -0.9681.

Example 2 - Entrance from a lake into an open channel
This particular problem in open channel flow requires the simultaneous solutionof two equations, the equation of energy: H o = y +equation: Q =V2, and Manning’s
2g

Cu A 5 / 3⋅⋅ S o . In these equations, Ho represents the energy
n P2/3head (m, or ft) available for a flow at the entrance to a channel, y is the flow
depth (m or ft), V = Q/A is the flow velocity (m/s or ft/s), Q is the volumetric

Page 7-5

discharge (m3/s or ft3/s), A is the cross-sectional area (m2 or ft2), Cu is acoefficient that depends on the system of units (Cu = 1.0 for the SI, Cu = 1.486
for the English system of units), n is the Manning’s coefficient, a measure of thechannel surface roughness (e.g., for concrete, n = 0.012), P is the wetted
perimeter of the cross section (m or ft), So is the slope of the channel bed
expressed as a decimal fraction. For a trapezoidal channel, as shown below,
the area is given by A = (b + my ) y , while the wetted perimeter is given by

P = b + 2 y 1 + m 2 , where b is the bottom width (m or ft), and m is the sideslope (1V:mH) of the cross section.
Typically, one has to solve the equations of energy and Manning’s
simultaneously for y and Q. Once these equations are written in terms of theprimitive variables b, m, y, g, So, n, Cu, Q, and Ho, we are left with a system of
equations of the form f1(y,Q) = 0, f2(y,Q) = 0. We can build these two
equations as follows.
We assume that we will be using the ALG and Exact modes in the calculator,
although defining the equations and solving them with MSLV is very similar in
the RPN mode. Create a sub-directory, say CHANL (for open CHANneL), andwithin that sub-directory define the following variables:

To see the original equations, EQ1 and EQ2, in terms of the primitive variables
listed above, we can use function EVAL applied to each of the equations, i.e.,
Page 7-6

μ@@@EQ1@@ μ @@@EQ2@@. The equations are listed in the stack as follows (small
font option selected):

We can see that these equations are indeed given in terms of the primitive
variables b, m, y, g, So, n, Cu, Q, and Ho.
In order to solve for y and Q we need to give values to the other variables.
Suppose we use H0 = 5 ft, b = 1.5 ft, m = 1, n = 0.012, S0 = 0.00001, g =32.2, and Cu = 1.486. Before being able to use MSLV for the solution, we
need to enter these values into the corresponding variable names. This can beaccomplished as follows:

Now, we are ready to solve the equation. First, we need to put the two
equations together into a vector. We can do this by actually storing the vector
into a variable that we will call EQS (EQuationS):

As initial values for the variables y and Q we will use y = 5 (equal to the valueof Ho, which is the maximum value that y can take) and Q = 10 (this is aguess). To obtain the solution we select function MSLV from the NUM.SLV
menu, e.g., ‚Ï6@@@OK@@@, to place the command in the screen:

Page 7-7

Next, we’ll enter variable EQS: LL@@EQS@ , followed by vector [y,Q]:‚í„Ô~„y‚í~q™
and by the initial guesses ‚í„Ô5‚í 10.
Before pressing `, the screen will look like this:Press ` to solve the system of equations. You may, if your angular measure
is not set to radians, get the following request:

Press @@OK@@ and allow the solution to proceed. An intermediate solution step may
look like this:

The vector at the top representing the current value of [y,Q] as the solution
progresses, and the value .358822986286 representing the criteria for
convergence of the numerical method used in the solution. If the system is well
posed, this value will diminish until reaching a value close to zero. At that point
a numerical solution would have been found. The screen, after MSLV finds asolution will look like this:Page 7-8

The result is a list of three vectors. The first vector in the list will be the equations
solved. The second vector is the list of unknowns. The third vector represents thesolution. To be able to see these vectors, press the down-arrow key ˜ toactivate the line editor. The solution will be shown as follows:

The solution suggested is [4.9936.., 20.661…]. This means, y = 4.99 ft, andQ = 20.661… ft3/s. You can use the arrow keys (š™—˜) to see thesolution in detail.

Using the Multiple Equation Solver (MES)The multiple equation solver is an environment where you can solve a system ofmultiple equations by solving for one unknown from one equation at a time. It
is not really a solver to simultaneous solutions, rather, it is a one-by-one solver ofa number of related equations. To illustrate the use of the MES for solving
multiple equations we present an application related to trigonometry in the next
section. The examples shown here are developed in the RPN mode.

Application 1 - Solution of triangles
In this section we use one important application of trigonometric functions:calculating the dimensions of a triangle. The solution is implemented in thecalculator using the Multiple Equation Solver, or MES.
Consider the triangle ABC shown in the figure below.

The sum of the interior angles of any triangle is always 180o, i.e., α + β + γ =180o. The sine law indicates that:sin α sin β sin γ
=
=
.
a
b
c
Page 7-9

The cosine law indicates that:a2 = b2 + c2 – 2⋅b⋅c⋅cos α,b2 = a2 + c2 – 2⋅a⋅c⋅cos β,
c2 = a2 + b2 – 2⋅a⋅b⋅cos γ.
In order to solve any triangle, you need to know at least three of the following
six variables: a, b, c, α, β, γ. Then, you can use the equations of the sine law,cosine law, and sum of interior angles of a triangle, to solve for the other threevariables.
If the three sides are known, the area of the triangle can be calculated with
Heron’s formulaA = s ⋅ ( s − a ) ⋅ ( s − b) ⋅ ( s − c) ,where s is known as thesemi-perimeter of the triangle, i.e., s =

a+b+c
.
2

Triangle solution using the Multiple Equation Solver (MES)The Multiple Equation Solver (MES) is a feature that can be used to solve two or
more coupled equations. It must be pointed out, however, that the MES does
not solve the equations simultaneously. Rather, it takes the known variables,
and then searches in a list of equations until it finds one that can be solved forone of the unknown variables. Then, it searches for another equation that canbe solved for the next unknowns, and so on, until all unknowns have beensolved for.
Creating a working directory
We will use the MES to solve for triangles by creating a list of equations
corresponding to the sine and cosine laws, the law of the sum of interior angles,
and Heron’s formula for the area. First, create a sub-directory within HOME
that we will call TRIANG, and move into that directory. See Chapter 2 for
instructions on how to create a new sub-directory.
Entering the list of equations
Within TRIANG, enter the following list of equations either by typing them
directly on the stack or by using the equation writer. (Recall that ~‚aproduces the character α, and ~‚b produces the character β. The
character γ needs to be @ECHOed from ‚±):
Page 7-10

‘SIN(α)/a = SIN(β)/b’‘SIN(α)/a = SIN(γ)/c’‘SIN(β)/b = SIN(γ)/c’‘c^2 = a^2+b^2-2*a*b*COS(γ)’‘b^2 = a^2+c^2-2*a*c*COS(β)’‘a^2 = b^2+c^2-2*b*c*COS(α)’‘α+β+γ = 180’‘s = (a+b+c)/2’‘A = √ (s*(s-a)*(s-b)*(s-c))’Then, enter the number 9, and create a list of equations by using: function
LIST (use the command catalog ‚N). Store this list in the variable EQ.
The variable EQ contains the list of equations that will be scanned by the MES
when trying to solve for the unknowns.
Entering a window title
Next, we will create a string variable to be called TITLE to contain the string“Triangle Solution”, as follows:‚ÕOpen double quotes in stack~~„~Locks keyboard into lower-case alpha.

„triangle#

Enter text: Triangle_„solution

Enter text: Solution`

Enter string “Triangle Solution” in stack³

Open single quotes in stack~~title`Enter variable name ‘TITLE’KStore string into ‘TITLE’

Creating a list of variables
Next, create a list of variable names in the stack that will look like this:{ a b c α β γ A s }and store it in variable LVARI (List of VARIables). The list of variables represents
the order in which the variables will be listed when the MES gets started. It must
include all the variables in the equations, or it will not work with function MITM
(see below). Here is the sequence of keystrokes to use to prepare and store thislist:
Page 7-11

Press J, if needed, to get your variables menu. Your menu should show thevariables @LVARI! !@TITLE @@EQ@@ .
Preparing to run the MES
The next step is to activate the MES and try one sample solution. Before we dothat, however, we want to set the angular units to DEGrees, if they are notalready set to that, by typing ~~deg`.
Next, we want to keep in the stack the contents of TITLE and LVARI, by using:!@TITLE @LVARI!
We will use the following MES functions
Θ MINIT: MES INITialization: initializes the variables in the equations
stored in EQ.
Θ MITM: MES’ Menu Item: Takes a title from stack level 2 and the list ofvariables from stack level 1 and places the title atop of the MES
window, and the list of variables as soft menu keys in the orderindicated by the list. In the present exercise, we already have a title(“Triangle Solution”) and a list of variables ({ a b c α β γ A s }) instack levels 2 and 1, respectively, ready to activate MITM.
Θ MSOLVR: MES SOLVER; activates the Multiple Equation Solver (MES)
and waits for input by the user.
Running the MES interactively
To get the MES started, with the variables TITLE and LVARI listed in the stack,activate command MINIT, then MITM, and finally, MSOLVR (find these functionsin the catalog ‚N).
The MES is launched with the following list of variables available (Press L to
see the next list of variables):Press L to see the third list of variables. You should see:Press L once more to recover the first variable menu.

Page 7-12

Let’s try a simple solution of Case I, using a = 5, b = 3, c = 5. Use thefollowing entries:
5[ a ]

a:5 is listed in the top left corner of the display.

3[ b ]

b:3 is listed in the top left corner of the display.

5[ c ]

c:5 is listed in the top left corner of the display.

To solve for the angles use:„[ α ]

Calculator reports Solving for α, and shows the result α:
72.5423968763.

Note: If you get a value that is larger than 180, try the following:
10[„[ α ]

α]Re-initialize a to a smaller value.
Calculator reports Solving for α

Next, we calculate the other two values:„[ β ]The result is β: 34.9152062474.

„[ γ ]The result is γ: 72.5423968763.
You should have the values of the three angles listed in stack levels 3 through
1. Press + twice to check that they add indeed to 180o.

Press L to move to the next variables menu. To calculate the area use: „[A ]. The calculator first solves for all the other variables, and then finds thearea as A: 7.15454401063.

Note: When a solution is found, the calculator reports the conditions for thesolution as either Zero, or Sign Reversal. Other messages may occur if thecalculator has difficulties finding a solution.

Page 7-13

Pressing „@@ALL@@

will solve for all the variables, temporarily showing theintermediate results. Press ‚@@ALL@@ to see the solutions:

When done, press $ to return to the MES environment. Press J to exit the
MES environment and return to the normal calculator display.
Organizing the variables in the sub directoryYour variable menu will now contain the variables (press L to see the second
set of variables):Variables corresponding to all the variables in the equations in EQ have beencreated. There is also a new variable called Mpar (MES parameters), whichcontains information regarding the setting up of the MES for this particular setof equations. If you use ‚@Mpar to see the contents of the variable Mpar. You
will get the cryptic message: Library Data. The meaning of this is that the MES
parameters are coded in a binary file, which cannot be accessed by the editor.

Next, we want to place them in the menu labels in a different order than the
one listed above, by following these steps:
1. Create a list containing { EQ Mpar LVARI TITLE }, by using:„ä @@@EQ@@@ @Mpar! !@LVARI @@TITLE `2. Place contents of LVARI in the stack, by using: @LVARI.
3. Join the two lists by pressing +.
Use function ORDER (use the command catalog ‚N) to order the variables
as shown in the list in stack level 1.
4. Press J to recover your variables list. It should now look like this:

5. Press L to recover the first variable menu.

Page 7-14

Programming the MES triangle solution using User RPL
To facilitate activating the MES for future solutions, we will create a programthat will load the MES with a single keystroke. The program should look like
this: << DEG MINIT TITLE LVARI MITM MSOLVR >>, and can be typed in byusing:‚å
Opens the program symbol~~
Locks alphanumeric keyboard
deg#Type in DEG (angular units set to DEGrees)
minit#
Type in MINIT_~
Unlocks alphanumeric keyboard@TITLE
List the name TITLE in the program@LVARI
List the name LVARI in the program~~
Locks alphanumeric keyboard
mitm#
Type in MITM_
msolvrType in MSOLVR`Enter program in stack
Store the program in a variable called TRISOL, for TRIangle SOLution, by using:³~~trisol` K
Press J, if needed, to recover your list of variables. A soft key label @TRISO
should be available in your menu.
Running the program – solution examples
To run the program, press the @TRISO soft menu key. You will now have the MES
menu corresponding to the triangle solution. Let’s try examples of the threecases listed earlier for triangle solution.
Example 1 – Right triangle
Use a = 3, b = 4, c = 5. Here is the solution sequence:
3[ a ] 4 [ b ] 5[ c ] To enter data„[ α ]The result is α: 36.8698976458„[ β ]The result is β: 53.1301023541.

„[ γ

The result is γ: 90.

]

L

To move to the next variables menu.

[][ A ]The result is A: 6.

LL

To move to the next variables menu.

Example 2 - Any type of triangle

Page 7-15

Use a = 3, b = 4, c = 6. The solution procedure used here consists of solving
for all variables at once, and then recalling the solutions to the stack:J @TRISOTo clear up data and re-start MES

3[ a ] 4 [ b ] 6[ c ] To enter dataL

To move to the next variables menu.

„ @ALL!

Solve for all the unknowns.

‚ @ALL!

Show the solution:

The solution is:

At the bottom of the screen, you will have the soft menu keys:@VALU @EQNS! @PRINT %%%% %%%% @EXIT
The square dot in @VALU indicates that the values of the variables, rather thanthe equations from which they were solved, are shown in the display. To see theequations used in the solution of each variable, press the @EQNS! soft menu key.
The display will now look like this:The soft menu key @PRINT is used to print the screen in a printer, if available.
And @EXIT returns you to the MES environment for a new solution, if needed. To
return to normal calculator display, press J.
The following table of triangle solutions shows the data input in bold face andthe solution in italics. Try running the program with these inputs to verify thesolutions. Please remember to press J @TRISO at the end of each solution toclear up variables and start the MES solution again. Otherwise, you may carryover information from the previous solution that may wreck havoc with yourcurrent calculations.
Page 7-16

a

b

c

α( ο)

β( ο)

γ( ο)

2.5

6.98377.2

20.22975

84.771 8.6933

A

7.2

8.5

14.26 22.616

27

130.38 23.309

21.92

17.5

13.2

90

52.98

37.03

115.5

41.92

23

29.6

75

32

73

328.81

10.27

3.26

10.5

77

18

85

16.66

17

25

32

31.79

50.78

97.44 210.71

Adding an INFO button to your directory
An information button can be useful for your directory to help you remember theoperation of the functions in the directory. In this directory, all we need toremember is to press @TRISO to get a triangle solution started. You may want totype in the following program: <<“Press [TRISO] to start.“ MSGBOX >>, and store it
in a variable called INFO. As a result, the first variable in your directory will be
the @INFO button.

Application 2 - Velocity and acceleration in polar coordinates
Two-dimensional particle motion in polar coordinates often involves determining
the radial and transverse components of the velocity and acceleration of theparticle given r, r’ = dr/dt, r” = d2r/dt2, θ, θ’ = d θ /dt, and, θ” = d2θ/dt2.
The following equations are used:v r = r&vθ = rθ&a r = &r& − rθ& 2
a = rθ&& + 2r&θ&θ

Create a subdirectory called POLC (POLar Coordinates), which we will use to
calculate velocities and accelerations in polar coordinates. Within that
subdirectory, enter the following variables:
Program or valueStore into variable:<< PEQ STEQ MINIT NAME LIST MITM MSOLVR >>"vel. & acc. polar coord."{ r rD rDD θD θDD vr vθ v ar aθ a }{ 'vr = rD' 'vθ = r*θD' 'v = √(vr^2 + vθ^2)''ar = rDD − r*θD^2' 'aθ = r*θDD + 2*rD*θD''a = √(ar^2 + aθ^2)' }SOLVEP
NAME
LIST

PEQ

Page 7-17

An explanation of the variables follows:
SOLVEP = a program that triggers the multiple equation solver for theparticular set of equations stored in variable PEQ;
NAME = a variable storing the name of the multiple equation solver, namely,"vel. & acc. polar coord.";
LIST =

a list of the variable used in the calculations, placed in the order wewant them to show up in the multiple equation solver environment;

PEQ =list of equations to be solved, corresponding to the radial andtransverse components of velocity (vr, vθ) and acceleration (ar, aθ)in polar coordinates, as well as equations to calculate themagnitude of the velocity (v) and the acceleration (a) when thepolar components are known.

r, rD, rDD = r (radial coordinate), r-dot (first derivative of r), r-double dot(second derivative of r).
θD, θDD = θ-dot (first derivative of θ), θ-double dot (second derivative of θ).
________________________________________________________________
Suppose you are given the following information: r = 2.5, rD = 0.5, rDD = 1.5, θD = 2.3, θDD = -6.5, and you are asked to find vr, vθ, ar, aθ, v, and a.
Start the multiple equation solver by pressing J@SOLVE. The calculator
produces a screen labeled , "vel. & acc. polar coord.", that looks as follows:

To enter the values of the known variables, just type the value and press the
button corresponding to the variable to be entered. Use the following
keystrokes: 2.5 [ r ] 0.5 [ rD ] 1.5 \ [ rDD ] 2.3 [ θD ] 6.5 \ [ θDD ].

Page 7-18

Notice that after you enter a particular value, the calculator displays thevariable and its value in the upper left corner of the display. We have now
entered the known variables. To calculate the unknowns we can proceed in two
ways:a). Solve for individual variables, for example, „[ vr ] gives vr: 0.500.
Press L„[ vθ ] to get vθ : 5.750 , and so on. The remaining results
are v: 5.77169819031; ar: -14.725; aθ: -13.95; and a:
20.2836911089.; or,b). Solve for all variables at once, by pressing „@ALL!. The calculator will
flash the solutions as it finds them. When the calculator stops, you canpress ‚@ALL! to list all results. For this case we have:Pressing the soft-menu key @EQNS will let you know the equations used tosolve for each of the values in the screen:

To use a new set of values press, either @EXIT @@ALL@ LL, or J @SOLVE.

Let's try another example using r = 2.5, vr = rD = -0.5, rDD = 1.5, v = 3.0, a =25.0. Find, θD, θDD, vθ, ar, and aθ. You should get the following results:

Page 7-19

Page 7-20

Chapter 8
Operations with lists
Lists are a type of calculator’s object that can be useful for data processing andin programming. This Chapter presents examples of operations with lists.

Definitions
A list, within the context of the calculator, is a series of objects enclosed
between braces and separated by spaces (#), in the RPN mode, or commas(‚í), in both modes. Objects that can be included in a list are numbers,letters, character strings, variable names, and/or operators. Lists are useful for
manipulating data sets and in some programming applications. Some
examples of lists are:{ t 1 }, {"BET " h2 4}, {1 1.5 2.0},{a a a a}, { {1 2 3} {3 2 1} {1 2 3}}
In the examples shown below we will limit ourselves to numerical lists.

Creating and storing lists
To create a list in ALG mode, first enter the braces key „ä (associatedwith the + key), then type or enter the elements of the list, separating themwith commas (‚í). The following keystrokes will enter the list {1 2 3 4}
and store it into variable L1.
„ä 1 ‚í 2 ‚í 3 ‚í 4
™K~l1`The screen will show the following:

The figure to the left shows the screen before pressing `, while the one to theright shows the screen after storing the list into L1. Notice that before pressing` the list shows the commas separating its elements. However, after pressing`, the commas are replaced with spaces.
Entering the same list in RPN mode requires the following keystrokes:„ä 1 # 2 # 3 # 4 `~l1`KPage 8-1

The figure below shows the RPN stack before pressing the K key:

Composing and decomposing lists
Composing and decomposing lists makes sense in RPN mode only. Under suchoperating mode, decomposing a list is achieved by using function OBJ. With
this function, a list in the RPN stack is decomposed into its elements, with stacklevel 1: showing the number of elements in the list. The next two screen shotsshow the stack with a small list before and after application of function OBJ:Notice that, after applying OBJ, the elements of the list occupy levels 4:
through 2:, while level 1: shows the number of elements in the list.
To compose a list in RPN mode, place the elements of the list in the stack, enter
the list size, and apply function LIST (select it from the function catalog, as
follows: ‚N‚é, then use the up and down arrow keys (—˜) tolocate function LIST). The following screen shots show the elements of a list of
size 4 before and after application of function LIST:

Note: Function OBJ applied to a list in ALG mode simply reproduces the list,
adding to it the list size:

Operations with lists of numbers
To demonstrate operations with lists of numbers, we will create a couple ofother lists, besides list L1 created above: L2={-3,2,1,5}, L3={-6,5,3,1,0,3,-4},
L4={3,-2,1,5,3,2,1}. In ALG mode, the screen will look like this after enteringlists L2, L3, L4:

Page 8-2

In RPN mode, the following screen shows the three lists and their names readyto be stored. To store the lists in this case you need to press K three times.

Changing sign
The sign-change key (\) , when applied to a list of numbers, will change thesign of all elements in the list. For example:

Addition, subtraction, multiplication, division
Multiplication and division of a list by a single number is distributed across thelist, for example:

Subtraction of a single number from a list will subtract the same number fromeach element in the list, for example:

Addition of a single number to a list produces a list augmented by the number,and not an addition of the single number to each element in the list. For
example:Page 8-3

Subtraction, multiplication, and division of lists of numbers of the same length
produce a list of the same length with term-by-term operations. Examples:

The division L4/L3 will produce an infinity entry because one of the elements in
L3 is zero:If the lists involved in the operation have different lengths, an error message is
produced (Error: Invalid Dimension).
The plus sign (+), when applied to lists, acts a concatenation operator,
putting together the two lists, rather than adding them term-by-term. For
example:In order to produce term-by-term addition of two lists of the same length, weneed to use operator ADD. This operator can be loaded by using the function
catalog (‚N). The screen below shows an application of ADD to add lists
L1 and L2, term-by-term:

Real number functions from the keyboard
Real number functions from the keyboard (ABS, ex, LN, 10x, LOG, SIN, x2, √,COS, TAN, ASIN, ACOS, ATAN, yx) can be used on lists. Here are someexamples:Page 8-4

ABS

EXP and LN

LOG and ANTILOGSQ and square root

SIN, ASIN

COS, ACOS

TAN, ATAN

INVERSE (1/x)

Real number functions from the MTH menu
Functions of interest from the MTH menu include, from the HYPERBOLIC menu:
SINH, ASINH, COSH, ACOSH, TANH, ATANH, and from the REAL menu: %,%CH, %T, MIN, MAX, MOD, SIGN, MANT, XPON, IP, FP, RND, TRNC,FLOOR, CEIL, DR, RD. Some of the functions that take a single argument
are illustrated below applied to lists of real numbers:
SINH, ASINH

COSH, ACOSH

Page 8-5

TANH, ATANH

SIGN, MANT, XPON

IP, FPFLOOR, CEIL

DR, RD

Examples of functions that use two arguments
The screen shots below show applications of the function % to list arguments.
Function % requires two arguments. The first two examples show cases in which
only one of the two arguments is a list.

The results are lists with the function % distributed according to the list
argument. For example,%({10, 20, 30},1) = {%(10,1),%(20,1),%(30,1)},
while%(5,{10,20,30}) = {%(5,10),%(5,20),%(5,30)}
In the following example, both arguments of function % are lists of the same
size. In this case, a term-by-term distribution of the arguments is performed, i.e.,
Page 8-6

%({10,20,30},{1,2,3}) = {%(10,1),%(20,2),%(30,3)}This description of function % for list arguments shows the general pattern ofevaluation of any function with two arguments when one or both arguments arelists. Examples of applications of function RND are shown next:

Lists of complex numbers
The following exercise shows how to create a list of complex numbers given twolists of the same length, one representing the real parts and one the imaginaryparts of the complex numbers. Use L1 ADD i*L2.

Functions such as LN, EXP, SQ, etc., can also be applied to a list of complex
numbers, e.g.,

Page 8-7

The following example shows applications of the functions RE(Real part),IM(imaginary part), ABS(magnitude), and ARG(argument) of complex
numbers. The results are lists of real numbers:

Lists of algebraic objects
The following are examples of lists of algebraic objects with the function SIN
applied to them:

The MTH/LIST menu
The MTH menu provides a number of functions that exclusively to lists. Withflag 117 set to CHOOSE boxes:

Next, with system flag 117 set to SOFT menus:

Page 8-8

This menu contains the following functions:
ΔLIST: Calculate increment among consecutive elements in list
ΣLIST
: Calculate summation of elements in the list
ΠLIST
: Calculate product of elements in the list
SORT
: Sorts elements in increasing order
REVLIST : Reverses order of list
ADD
: Operator for term-by-term addition of two lists of the same length(examples of this operator were shown above)
Examples of application of these functions in ALG mode are shown next:

SORT and REVLIST can be combined to sort a list in decreasing order:

If you are working in RPN mode, enter the list onto the stack and then select theoperation you want. For example, to calculate the increment between
consecutive elements in list L3, press:l3`!´˜˜ #OK# #OK#
This places L3 onto the stack and then selects the ΔLIST operation from the MTH
menu.

Page 8-9

Manipulating elements of a list
The PRG (programming) menu includes a LIST sub-menu with a number offunctions to manipulate elements of a list. With system flag 117 set to
CHOOSE boxes:

Item 1. ELEMENTS.. contains the following functions that can be used for the
manipulation of elements in lists:

List size
Function SIZE, from the PRG/LIST/ELEMENTS sub-menu, can be used to obtainthe size (also known as length) of the list, e.g.,

Extracting and inserting elements in a list
To extract elements of a list we use function GET, available in the PRG/LIST/ELEMENTS sub-menu. The arguments of function GET are the list and thenumber of the element you want to extract. To insert an element into a list use
function PUT (also available in the PRG/LST/ELEMENTS sub-menu). The
arguments of function PUT are the list, the position that one wants to replace,and the value that will be replaced. Examples of applications of functions GET
and PUT are shown in the following screen:

Page 8-10

Functions GETI and PUTI, also available in sub-menu PRG/ ELEMENTS/, canalso be used to extract and place elements in a list. These two functions,however, are useful mainly in programming. Function GETI uses the same
arguments as GET and returns the list, the element location plus one, and theelement at the location requested. Function PUTI uses the same arguments as
GET and returns the list and the list size.

Element position in the list
To determine the position of an element in a list use function POS having the list
and the element of interest as arguments. For example,

HEAD and TAIL functions
The HEAD function extracts the first element in the list. The TAIL function
removes the first element of a list, returning the remaining list. Some examples
are shown next:

The SEQ function
Item 2. PROCEDURES.. in the PRG/LIST menu contains the following functions
that can be used to operate on lists.

Functions REVLIST and SORT were introduced earlier as part of the MTH/LIST
menu. Functions DOLIST, DOSUBS, NSUB, ENDSUB, and STREAM, aredesigned as programming functions for operating lists in RPN mode. Function

Page 8-11

SEQ is useful to produce a list of values given a particular expression and is
described in more detail here.
The SEQ function takes as arguments an expression in terms of an index, thename of the index, and starting, ending, and increment values for the index,
and returns a list consisting of the evaluation of the expression for all possible
values of the index. The general form of the function is SEQ(expression, index,
start, end, increment).
In the following example, in ALG mode, we identify expression = n2, index =n, start = 1, end = 4, and increment = 1:

The list produced corresponds to the values {12, 22, 32, 42}. In RPN mode, you
can list the different arguments of the function as follows:

before applying function SEQ.

The MAP function
The MAP function, available through the command catalog (‚N), takes asarguments a list of numbers and a function f(X) or a program of the form << 
a … >>, and produces a list consisting of the application of that function or
program to the list of numbers. For example, the following call to function MAP
applies the function SIN(X) to the list {1,2,3}:

In ALG mode, the syntax is:~~map~!Ü!ä1@í2@í3™@
í S~X`In RPN mode, the syntax is:!ä1@í2@í3`³S~X`~~map`
Page 8-12

In both cases, you can either type out the MAP command (as in the examples
above) or select the command from the CAT menu.
The following call to function MAP uses a program instead of a function as
second argument:

Defining functions that use lists
In Chapter 3 we introduced the use of the DEFINE function ( „à) tocreate functions of real numbers with one or more arguments. A function
defined with DEF can also be used with list arguments, except that, any function
incorporating an addition must use the ADD operator rather than the plus sign(+). For example, if we define the function F(X,Y) = (X-5)*(Y-2), shown here
in ALG mode:

we can use lists (e.g., variables L1 and L2, defined earlier in this Chapter) toevaluate the function, resulting in:Since the function statement includes no additions, the application of thefunction to list arguments is straightforward. However, if we define the function
G(X,Y) = (X+3)*Y, an attempt to evaluate this function with list arguments (L1,
L2) will fail:To fix this problem we can edit the contents of variable @@@G@@@ , which we can listin the stack by using …@@@G@@@,

Page 8-13

to replace the plus sign (+) with ADD:

Next, we store the edited expression into variable @@@G@@@:

Evaluating G(L1,L2) now produces the following result:

As an alternative, you can define the function with ADD rather than the plus
sign (+), from the start, i.e., use DEFINE('G(X,Y)=(X DD 3)*Y') :You can also define the function as G(X,Y) = (X--3)*Y.

Page 8-14

Applications of lists
This section shows a couple of applications of lists to the calculation of statistics
of a sample. By a sample we understand a list of values, say, {s1, s2, …, sn}.
Suppose that the sample of interest is the list
{1, 5, 3, 1, 2, 1, 3, 4, 2, 1}
and that we store it into a variable called S (The screen shot below shows thisaction in ALG mode, however, the procedure in RPN mode is very similar. Just
keep in mind that in RPN mode you place the arguments of functions in thestack before activating the function):

Harmonic mean of a list
This is a small enough sample that we can count on the screen the number of
elements (n=10). For a larger list, we can use function SIZE to obtain that
number, e.g.,

Suppose that we want to calculate the harmonic mean of the sample, defined
as

sh =

1
1
1
∑
n k =1 s nn=

1
1⎛ 1 1
1⎞⎜⎜ + + L + ⎟⎟n ⎝ s1 s 2
sn ⎠.

To calculate this value we can follow this procedure:
1. Apply function INV () to list S:

2. Apply function ΣLIST() to the resulting list in1.

Page 8-15

3. Divide the result above by n = 10:

4. Apply the INV() function to the latest result:Thus, the harmonic mean of list S is sh = 1.6348…

Geometric mean of a list
The geometric mean of a sample is defined asn

x g = n ∏ x k = n x1 ⋅ x 2 L x n
k =1

To find the geometric mean of the list stored in S, we can use the following
procedure:
1. Apply function ΠLIST() to list S:

2. Apply function XROOT(x,y), i.e., keystrokes ‚», to the result in 1:

Page 8-16

Thus, the geometric mean of list S is sg = 1.003203…

Weighted average
Suppose that the data in list S, defined above, namely:
S = {1,5,3,1,2,1,3,4,2,1}
is affected by the weights,
W = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}If we define the weight list as W = {w1,w2,…,wn}, we notice that the k -thelement in list W, above, can be defined by wk = k. Thus we can use function
SEQ to generate this list, and then store it into variable @@@W@@@ as follows:

Given the data list {s1, s2, …, sn }, and the weight list {w1, w2, …, wn }, theweighted average of the data in S is defined as
n

∑w ⋅s

s w = k =1 n

k

∑w
k =1

k

k

.
To calculate the weighted average of the data in list S with the weights in list W,
we can use th e following steps:
1. Multiply lists S and W:

2. Use function ΣLIST in this result to calculate the numerator of sw:

Page 8-17

3. Use function ΣLIST, once more, to calculate the denominator of sw:

4. Use the expression ANS(2)/ANS(1) to calculate the weighted average:

Thus, the weighted average of list S with weights in list W is sw= 2.2.
Note: ANS(1) refers to the most recent result (55), while ANS(2) refers to
the previous to last result (121).

Statistics of grouped data
Grouped data is typically given by a table showing the frequency (w) of data indata classes or bins. Each class or bin is represented by a class mark (s),typically the midpoint of the class. An example of grouped data is shown next:Classboundaries
0-2
2-4
4-6
6-8
8 -10

Class
mark
sk

Frequency
count
wk

1
3
5
7
9

5
12
18
1
3

Page 8-18

The class mark data can be stored in variable S, while the frequency count canbe stored in variable W, as follows:

Given the list of class marks S = {s1, s2, …, sn }, and the list of frequency counts
W = {w1, w2, …, wn }, the weighted average of the data in S with weights W
represents the mean value of the grouped data, that we call ⎯s, in this context:
n

s=

∑w ⋅s
k

k =1

n

∑w
k =1

where N =

n

k

=

∑w ⋅s
k =1

k

k

k

N
,

n

∑ w represents the total frequency count.
k =1k

The mean value for the data in lists S and W, therefore, can be calculated using
the procedure outlined above for the weighted average, i.e.,We’ll store this value into a variable called XBAR:

The variance of this grouped data is defined asPage 8-19

n∑ wk ⋅ ( s k − s ) 2

V = k =1

n

∑w
k =1

k

n

∑ w ⋅ (s − s )= k =1kk

2

N

To calculate this last result, we can use the following:

The standard deviation of the grouped data is the square root of the variance:

Page 8-20

Chapter 9
Vectors
This Chapter provides examples of entering and operating with vectors, bothmathematical vectors of many elements, as well as physical vectors of 2 and 3components.

Definitions
From a mathematical point of view, a vector is an array of 2 or more elements
arranged into a row or a column. These will be referred to as row and column
vectors. Examples are shown below:⎡− 1⎤
v = ⎢⎢ 3 ⎥⎥, u = [1,− 3, 5, 2]⎢⎣ 6 ⎥⎦
Physical vectors have two or three components and can be used to represent
physical quantities such as position, velocity, acceleration, forces, moments,
linear and angular momentum, angular velocity and acceleration, etc.
Referring to a Cartesian coordinate system (x,y,z), there exists unit vectors i, j, kassociated with each coordinate direction, such that a physical vector A can be
written in terms of its components Ax, Ay, Az, as A = Axi + Ayj + Azk.
Alternative notation for this vector are: A = [Ax, Ay, Az], A = (Ax, Ay, Az), or A
= < Ax, Ay, Az >. A two dimensional version of this vector will be written as A
= Axi + Ayj, A = [Ax, Ay], A = (Ax, Ay), or A = < Ax, Ay >. Since in thecalculator vectors are written between brackets [ ], we will choose the notation
A = [Ax, Ay, Az] or A = [Ax, Ay, Az], to refer to two- and three-dimensional
vectors from now on. The magnitude of a vector A is defined as |A| =Ax2 + Ay2 + Az2 . A unit vector in the direction of vector A, is defined as eA =A/|A|. Vectors can be multiplied by a scalar, e.g., kA = [kAx, kAy, kAz].
Physically, the vector kA is parallel to vector A, if k>0, or anti-parallel to vectorA, if k<0. The negative of a vector is defined as –A = (–1)A = [–Ax, –Ay, –Az].
Division by as scalar can be interpreted as a multiplication, i.e., A/k = (1/k)⋅A.
Addition and subtraction of vectors are defined as A±B = [Ax ± Bx, Ay ± By, Az± By], where B is the vector B = [Bx, By, Bz].
There are two definitions of products of physical vectors, a scalar or internal
product (the dot product) and a vector or external product (the cross product).
The dot product produces a scalar value defined as A•B = |A||B|cos(θ),

Page 9-1

where θ is the angle between the two vectors. The cross product produces avector A×B whose magnitude is |A×B| = |A||B|sin(θ), and its direction is
given by the so-called right-hand rule (consult a textbook on Math, Physics, orMechanics to see this operation illustrated graphically). In terms of Cartesiancomponents, A•B = AxBx+AyBy+AzBz, and A×B = [AyBz-AzBy,AzBx-AxBz,AxByAyBx]. The angle between two vectors can be found from the definition of thedot product as cos(θ) = A•B/|A||B|= eA•eB. Thus, if two vectors A and B
are perpendicular (θ = 900 = π/2rad), A•B = 0.

Entering vectors
In the calculator, vectors are represented by a sequence of numbers enclosed
between brackets, and typically entered as row vectors. The brackets are
generated in the calculator by the keystroke combination „Ô , associatedwith the * key. The following are examples of vectors in the calculator:[3.5, 2.2, -1.3, 5.6, 2.3]

A general row vector[1.5,-2.2]

A 2-D vector[3,-1,2]

A 3-D vector['t','t^2','SIN(t)']A vector of algebraics

Typing vectors in the stack
With the calculator in ALG mode, a vector is typed into the stack by opening a
set of brackets („Ô) and typing the components or elements of the vector
separated by commas (‚í). The screen shots below show the entering of
a numerical vector followed by an algebraic vector. The figure to the left shows
the algebraic vector before pressing „. The figure to the right shows thecalculator’s screen after entering the algebraic vector:

In RPN mode, you can enter a vector in the stack by opening a set of brackets
and typing the vector components or elements separated by either commas(‚í) or spaces (#). Notice that after pressing ` , in either mode,the calculator shows the vector elements separated by spaces.

Page 9-2

Storing vectors into variables
Vectors can be stored into variables. The screen shots below show the vectors
u2 = [1, 2], u3 = [-3, 2, -2], v2 = [3,-1], v3 = [1, -5, 2]
stored into variables @@@u2@@, @@@u3@@, @@@v2@@, and @@@v3@@, respectively. First, in ALG
mode:

Then, in RPN mode (before pressing K, repeatedly):

Using the Matrix Writer (MTRW) to enter vectors
Vectors can also be entered by using the Matrix Writer „²(third key in the
fourth row of keys from the top of the keyboard). This command generates a
species of spreadsheet corresponding to rows and columns of a matrix (Details
on using the Matrix Writer to enter matrices will be presented in a subsequent
chapter). For a vector we are interested in filling only elements in the top row.
By default, the cell in the top row and first column is selected. At the bottom of
the spreadsheet you will find the following soft menu keys:@EDIT! @VEC ←WID @WID→ @GO→ @GO↓
The @EDIT key is used to edit the contents of a selected cell in the Matrix
Writer.
The @VEC@@ key, when selected, will produce a vector, as opposite to amatrix of one row and many columns.

Page 9-3

Vectors vs. matrices
To see the @VEC@ key in action, try the following exercises:(1) Launch the Matrix Writer („²). With @VEC and @GO→ selected, enter3`5`2``. This produces [3. 5. 2.]. (In RPN mode,
you can use the following keystroke sequence to produce the same result:
3#5#2``).
(2) With @VEC@@ deselected and @GO→ selected,, enter
3#5#2``. This produces [[3. 5. 2.]].
Although these two results differ only in the number of brackets used, for the
calculator they represent different mathematical objects. The first one is a vector
with three elements, and the second one a matrix with one row and threecolumns. There are differences in the way that mathematical operations takeplace on a vector as opposite to a matrix. Therefore, for the time being, keep
the soft menu key @VEC selected while using the Matrix Writer.
The ←WID key is used to decrease the width of the columns in the
spreadsheet. Press this key a couple of times to see the column width
decrease in your Matrix Writer.
The @WID→ key is used to increase the width of the columns in the
spreadsheet. Press this key a couple of times to see the column width
increase in your Matrix Writer.
The @GO→ key, when selected, automatically selects the next cell to theright of the current cell when you press `. This option is selected bydefault.
The @GO↓ key, when selected, automatically selects the next cell below
the current cell when you press `.
Moving to the right vs. moving down in the Matrix Writer
Activate the Matrix Writer and enter 3`5`2`` with the@GO→ key selected (default). Next, enter the same sequence of numbers withthe @GO↓ key selected to see the difference. In the first case you entered avector of three elements. In the second case you entered a matrix of three rows
and one column.
Activate the Matrix Writer again by using „², and press L to check out
the second soft key menu at the bottom of the display. It will show the keys:@+ROW@ @-ROW @+COL@ @-COL@ @→STK@@ @GOTO@
Page 9-4

The @+ROW@ key will add a row full of zeros at the location of the selected
cell of the spreadsheet.
The @-ROW key will delete the row corresponding to the selected cell of
the spreadsheet.
The @+COL@ key will add a column full of zeros at the location of theselected cell of the spreadsheet.
The @-COL@ key will delete the column corresponding to the selected cellof the spreadsheet.
The @→STK@@ key will place the contents of the selected cell on the stack.
The @GOTO@ key, when pressed, will request that the user indicate thenumber of the row and column where he or she wants to position the
cursor.
Pressing L once more produces the last menu, which contains only one
function @@DEL@ (delete).
The function @@DEL@ will delete the contents of the selected cell andreplace it with a zero.
To see these keys in action try the following exercise:(1) Activate the Matrix Writer by using „². Make sure the @VEC and@GO→ keys are selected.
(2) Enter the following:
1`2`3`
L @GOTO@ 2@@OK@@ 1 @@OK@@ @@OK@@2`1`5`
4`5`6`
7`8`9`(3) Move the cursor up two positions by using ———. Then press @-ROW.
The second row will disappear.
(4) Press @+ROW@. A row of three zeroes appears in the second row.
(5) Press @-COL@. The first column will disappear.
(6) Press @+COL@. A row of two zeroes appears in the first row.
(7) Press @GOTO@ 3@@OK@@ 3@@OK@@ @@OK@@ to move to position (3,3).
(8) Press @→STK@@. This will place the contents of cell (3,3) on the stack, although
you will not be able to see it yet.
(9) Press ` to return to normal display. Element (3,3) and the full matrix will
be available in the screen.

Page 9-5

Summary of Matrix Writer use for entering vectors
In summary, to enter a vector using the Matrix Writer, simply activate the writer(„²), and place the elements of the vector, pressing ` after each ofthem. Then, press ``. Make sure that the @VEC and @GO→@ keys are
selected.
Example: „²³~„xQ2`2`5\``
produces:[‘x^2‘ 2 –5 ]Building a vector with ARRY
The function →ARRY, available in the function catalog (‚N‚é, use—˜ to locate the function), can also be used to build a vector or array inthe following way. In ALG mode, enter ARRY(vector elements, number of
elements), e.g.,

In RPN mode:(1) Enter the n elements of the array in the order you want them to appear in
the array (when read from left to right) into the RPN stack.
(2) Enter n as the last entry.
(3) Use function ARRY.

The following screen shots show the RPN stack before and after applying
function ARRY:

Page 9-6

In RPN mode, the function [→ARRY] takes the objects from stack levels n+1, n,n-1, …, down to stack levels 3 and 2, and converts them into a vector of nelements. The object originally at stack level n+1 becomes the first element, theobject originally at level n becomes the second element, and so on.
Note: Function ARRY is also available in the PRG/TYPE menu („°)

Identifying, extracting, and inserting vector elements
If you store a vector into a variable name, say A, you can identify elements ofthe vector by using A(i), where i is an integer number less than or equal to thevector size. For example, create the following array and store it in variable A:[-1, -2, -3, -4, -5]:To recall the third element of A, for example, you could type in A(3) into thecalculator. In ALG mode, simply type A(3). In RPN mode, type ‘A(3)’ `μ.
You can operate with elements of the array by writing and evaluating algebraic
expressions such as:

More complicated expressions involving elements of A can also be written. For
example, using the Equation Writer (‚O), we can write the following
summation of the elements of A:

Page 9-7

Highlighting the entire expression and using the @EVAL@ soft menu key, we get theresult: -15.
Note: The vector A can also be referred to as an indexed variable because
the name A represents not one, but many values identified by a sub-index.
To replace an element in an array use function PUT (you can find it in thefunction catalog ‚N, or in the PRG/LIST/ELEMENTS sub-menu – the later
was introduced in Chapter 8). In ALG mode, you need to use function PUT withthe following arguments: PUT(array, location to be replaced, new value). For
example, to change the contents of A(3) to 4.5, use:

In RPN mode, you can change the value of an element of A, by storing a newvalue in that particular element. For example, if we want to change thecontents of A(3) to read 4.5 instead of its current value of –3., use:
4.5`³~a„Ü3`K
To verify that the change took place use: ‚@@@@A@@ . The result now shown is: [1 -2 4.5 -4 -5 ].
Note: This approach for changing the value of an array element is notallowed in ALG mode, if you try to store 4.5 into A(3) in this mode you get thefollowing error message: Invalid Syntax.
To find the length of a vector you can use the function SIZE, available throughthe command catalog (N) or through the PRG/LIST/ELEMENTS sub-menu.
Some examples, based on the arrays or vectors stored previously, are shown
below:

Page 9-8

Simple operations with vectors
To illustrate operations with vectors we will use the vectors A, u2, u3, v2, andv3, stored in an earlier exercise.

Changing sign
To change the sign of a vector use the key \, e.g.,

Addition, subtraction
Addition and subtraction of vectors require that the two vector operands havethe same length:

Attempting to add or subtract vectors of different length produces an error
message (Invalid Dimension), e.g., v2+v3, u2+u3, A+v3, etc.

Multiplication by a scalar, and division by a scalar
Multiplication by a scalar or division by a scalar is straightforward:

Page 9-9

Absolute value function
The absolute value function (ABS), when applied to a vector, produces themagnitude of the vector. For a vector A = [A1,A2,…,An], the magnitude isdefined as | A |=Ax2 + Ay2 + L + Az2 . In the ALG mode, enter the function

name followed by the vector argument. For example: BS([1,-2,6]),
BS( ), BS(u3), will show in the screen as follows:

The MTH/VECTOR menu
The MTH menu („´) contains a menu of functions that specifically tovector objects:

The VECTOR menu contains the following functions (system flag 117 set to
CHOOSE boxes):

Magnitude
The magnitude of a vector, as discussed earlier, can be found with function
ABS. This function is also available from the keyboard („Ê). Examples ofapplication of function ABS were shown above.

Page 9-10

Dot product
Function DOT is used to calculate the dot product of two vectors of the samelength. Some examples of application of function DOT, using the vectors A, u2,
u3, v2, and v3, stored earlier, are shown next in ALG mode. Attempts tocalculate the dot product of two vectors of different length produce an error
message:

Cross product
Function CROSS is used to calculate the cross product of two 2-D vectors, of two
3-D vectors, or of one 2-D and one 3-D vector. For the purpose of calculating across product, a 2-D vector of the form [Ax, Ay], is treated as the 3-D vector [Ax,Ay,0]. Examples in ALG mode are shown next for two 2-D and two 3-D vectors.
Notice that the cross product of two 2-D vectors will produce a vector in the zdirection only, i.e., a vector of the form [0, 0, Cz]:

Examples of cross products of one 3-D vector with one 2-D vector, or vice versa,
are presented next:

Attempts to calculate a cross product of vectors of length other than 2 or 3,
produce an error message (Invalid Dimension), e.g., CROSS(v3,A), etc.

Decomposing a vector
Function V is used to decompose a vector into its elements or components. If
used in the ALG mode, V will provide the elements of the vector in a list, e.g.,

Page 9-11

In the RPN mode, application of function V will list the components of avector in the stack, e.g., V(A) will produce the following output in the RPN
stack (vector A is listed in stack level 6:).

Building a two-dimensional vector
Function V2 is used in the RPN mode to build a vector with the values in stacklevels 1: and 2:. The following screen shots show the stack before and after
applying function V2:

Building a three-dimensional vector
Function V3 is used in the RPN mode to build a vector with the values in stacklevels 1: , 2:, and 3:. The following screen shots show the stack before andafter applying function V2:

Changing coordinate system
Functions RECT, CYLIN, and SPHERE are used to change the current coordinate
system to rectangular (Cartesian), cylindrical (polar), or spherical coordinates.
The current system is shown highlighted in the corresponding CHOOSE box(system flag 117 unset), or selected in the corresponding SOFT menu label(system flag 117 set). In the following figure the RECTangular coordinate
system is shown as selected in these two formats:

Page 9-12

When the rectangular, or Cartesian, coordinate system is selected, the top lineof the display will show an XYZ field, and any 2-D or 3-D vector entered in thecalculator is reproduced as the (x,y,z) components of the vector. Thus, to enterthe vector A = 3i+2j-5k, we use [3,2,-5], and the vector is shown as:

If instead of entering Cartesian components of a vector we enter cylindrical(polar) components, we need to provide the magnitude, r, of the projection of
the vector on the x-y plane, an angle θ (in the current angular measure)
representing the inclination of r with respect to the positive x-axis , and a zcomponent of the vector. The angle θ must be entered preceded by the angle
character (∠), generated by using ~‚6. For example, suppose that wehave a vector with r = 5, θ = 25o (DEG should be selected as the angularmeasure), and z = 2.3, we can enter this vector in the following way:„Ô5 ‚í ~‚6 25 ‚í 2.3
Before pressing `, the screen will look as in the left-hand side of thefollowing figure. After pressing `, the screen will look as in the right-handside of the figure (For this example, the numerical format was changed to Fix,
with three decimals).

Notice that the vector is displayed in Cartesian coordinates , with components
x = r cos(θ), y = r sin(θ), z = z, even though we entered it in polar coordinates.
This is because the vector display will default to the current coordinate system.
For this case, we have x = 4.532, y = 2.112, and z = 2.300.
Suppose that we now enter a vector in spherical coordinates (i.e., in the form
(ρ,θ,φ), where ρ is the length of the vector, θ is the angle that the xy projectionof the vector forms with the positive side of the x-axis, and φ is the angle that ρ
forms with the positive side of the z axis), with ρ = 5, θ = 25o, and φ = 45o.
We will use:„Ô5 ‚í ~‚6 25 í~‚6 45
Page 9-13

The figure below shows the transformation of the vector from spherical toCartesian coordinates, with x = ρ sin(φ) cos(θ), y = ρ sin (φ) cos (θ), z = ρcos(φ). For this case, x = 3.204, y = 1.494, and z = 3.536.

If the CYLINdrical system is selected, the top line of the display will show an R∠
Z field, and a vector entered in cylindrical coordinates will be shown in its
cylindrical (or polar) coordinate form (r,θ,z). To see this in action, change thecoordinate system to CYLINdrical and watch how the vector displayed in thelast screen changes to its cylindrical (polar) coordinate form. The second
component is shown with the angle character in front to emphasize its angularnature.

The conversion from Cartesian to cylindrical coordinates is such that r =(x2+y2)1/2, θ = tan-1(y/x), and z = z. For the case shown above thetransformation was such that (x,y,z) = (3.204, 2.112, 2.300), produced (r,θ,z)= (3.536,25o,3.536).
At this point, change the angular measure to Radians. If we now enter a vectorof integers in Cartesian form, even if the CYLINdrical coordinate system is
active, it will be shown in Cartesian coordinates, e.g.,

This is because the integer numbers are intended for use with the CAS and,
therefore, the components of this vector are kept in Cartesian form. To force theconversion to polar coordinates enter the vector components as real numbers(i.e., add a decimal point), e.g., [2., 3., 5.].

With the cylindrical coordinate system selected, if we enter a vector in sphericalcoordinates it will be automatically transformed to its cylindrical (polar)
Page 9-14

equivalent (r,θ,z) with r = ρ sin φ, θ = θ, z = ρ cos φ. For example, the following
figure shows the vector entered in spherical coordinates, and transformed topolar coordinates. For this case, ρ = 5, θ = 25o, and φ = 45o, while thetransformation shows that r = 3.563, and z = 3.536. (Change to DEG):

Next, let’s change the coordinate system to spherical coordinates by using
function SPHERE from the VECTOR sub-menu in the MTH menu. When thiscoordinate system is selected, the display will show the R∠∠ format in the top
line. The last screen will change to show the following:

Notice that the vectors that were written in cylindrical polar coordinates havenow been changed to the spherical coordinate system. The transformation issuch that ρ = (r2+z2)1/2, θ = θ, and φ = tan-1(r/z). However, the vector thatoriginally was set to Cartesian coordinates remains in that form.

Application of vector operations
This section contains some examples of vector operations that you may
encounter in Physics or Mechanics applications.

Resultant of forces
Suppose that a particle is subject to the following forces (in N): F1 = 3i+5j+2k,
F2 = -2i+3j-5k, and F3 = 2i-3k. To determine the resultant, i.e., the sum, of allthese forces, you can use the following approach in ALG mode:Thus, the resultant is R = F1+ F2 + F3 = (3i+8j-6k)N. RPN mode use:
[3,5,2] ` [-2,3,-5] ` [2,0,3] ` + +Angle between vectors
The angle between two vectors A, B, can be found as θ =cos-1(A•B/|A||B|)

Page 9-15

Suppose that you want to find the angle between vectors A = 3i-5j+6k, B =2i+j-3k, you could try the following operation (angular measure set to degrees)in ALG mode:
1 - Enter vectors [3,-5,6], press `, [2,1,-3], press `.
2 - DOT(ANS(1),ANS(2)) calculates the dot product3 - ABS(ANS(3))*ABS((ANS(2)) calculates product of magnitudes
4 - ANS(2)/ANS(1) calculates cos(θ)
5 - ACOS(ANS(1)), followed by ,NUM(ANS(1)), calculates θ
The steps are shown in the following screens (ALG mode, of course):!!!
Thus, the result is θ = 122.891o.

In RPN mode use the following:[3,-5,6] ` [2,1,-3] ` DOT[3,-5,6] ` BS [2,1,-3] ` BS *
/

COS

NUM

Moment of a force
The moment exerted by a force F about a point O is defined as the crossproduct M = r×F, where r, also known as the arm of the force, is the position
vector based at O and pointing towards the point of application of the force.
Suppose that a force F = (2i+5j-6k) N has an arm r = (3i-5j+4k)m. To
determine the moment exerted by the force with that arm, we use function
CROSS as shown next:

Page 9-16

Thus, M = (10i+26j+25k) m⋅N. We know that the magnitude of M is such that
|M| = |r||F|sin(θ), where θ is the angle between r and F. We can find thisangle as, θ = sin-1(|M| /|r||F|) by the following operations:
1 – ABS(ANS(1))/(ABS(ANS(2))*ABS(ANS(3)) calculates sin(θ)
2 – ASIN(ANS(1)), followed by NUM(ANS(1)) calculates θ
These operations are shown, in ALG mode, in the following screens:Thus the angle between vectors r and F is θ = 41.038o. RPN mode, we canuse: [3,-5,4] ` [2,5,-6] ` CROSSBS [3,-5,4] `BS [2,5,-6] ` BS * / SIN NUM

Equation of a plane in space
Given a point in space P0(x0,y0,z0) and a vector N = Nxi+Nyj+Nzk normal toa plane containing point P0, the problem is to find the equation of the plane.
We can form a vector starting at point P0 and ending at point P(x,y,z), a
generic point in the plane. Thus, this vector r = P0P = (x-x0)i+ (y-y0)j + (z-z0)k,is perpendicular to the normal vector N, since r is contained entirely in theplane. We learned that for two normal vectors N and r, N•r =0. Thus, we canuse this result to determine the equation of the plane.
To illustrate the use of this approach, consider the point P0(2,3,-1) and thenormal vector N = 4i+6j+2k, we can enter vector N and point P0 as two
vectors, as shown below. We also enter the vector [x,y,z] last:Page 9-17

Next, we calculate vector P0P = r as ANS(1) – ANS(2), i.e.,

Finally, we take the dot product of ANS(1) and ANS(4) and make it equal tozero to complete the operation N•r =0:

We can now use function EXPAND (in the ALG menu) to expand thisexpression:

Thus, the equation of the plane through point P0(2,3,-1) and having normal
vector N = 4i+6j+2k, is 4x + 6y + 2z – 24 = 0. In RPN mode, use:
[2,3,-1] ` ['x','y','z'] ` - [4,6,2] DOT EXP ND

Row vectors, column vectors, and lists
The vectors presented in this chapter are all row vectors. In some instances, it isnecessary to create a column vector (e.g., to use the pre-defined statistical
functions in the calculator). The simplest way to enter a column vector is byenclosing each vector element within brackets, all contained within an external
set of brackets. For example, enter:[[1.2],[2.5],[3.2],[4.5],[6.2]] `This is represented as the following column vector:

Page 9-18

In this section we will showing you ways to transform: a column vector into a
row vector, a row vector into a column vector, a list into a vector, and a vector(or matrix) into a list.
We first demonstrate these transformations using the RPN mode. In this mode,
we will use functions OBJ, LIST, ARRY and DROP to perform thetransformation. To facilitate accessing these functions we will set system flag
117 to SOFT menus (see Chapter 1). With this flag set, functions OBJ,ARRY, and LIST will be accessible by using „° @)TYPE!. Functions
OBJ, ARRY, and LIST will be available in soft menu keys A, B, andC. Function DROP is available by using „°@)STACK @DROP.
Following we introduce the operation of functions OBJ, LIST, ARRY, andDROP with some examples.

Function OBJThis function decomposes an object into its components. If the argument is alist, function OBJ will list the list elements in the stack, with the number of
elements in stack level 1, for example: {1,2,3} ` „°@)TYPE! @OBJ@
results in:

When function OBJ is applied to a vector, it will list the elements of the vector
in the stack, with the number of elements in level 1: enclosed in braces (a list).
The following example illustrates this application: [1,2,3] `„°@)TYPE! @OBJ@ results in:Page 9-19

If we now apply function OBJ once more, the list in stack level 1:, {3.}, will be
decomposed as follows:

Function LIST
This function is used to create a list given the elements of the list and the list
length or size. In RPN mode, the list size, say, n, should be placed in stack level
1:. The elements of the list should be located in stack levels 2:, 3:, …, n+1:.
For example, to create the list {1, 2, 3}, type: 1` 2` 3`
3` „°@)TYPE! !LIST@.

Function ARRY

This function is used to create a vector or a matrix. In this section, we will use it
to build a vector or a column vector (i.e., a matrix of n rows and 1 column). To
build a regular vector we enter the elements of the vector in the stack, and in
stack level 1: we enter the vector size as a list, e.g., 1` 2`
3` „ä 3` „°@)TYPE! !ARRY@.
To build a column vector of n elements, enter the elements of the vector in thestack, and in stack level 1 enter the list {n 1}. For example,1` 2`
3` „ä 1‚í3` „°@)TYPE! !ARRY@.

Function DROP
This function has the same effect as the delete key (ƒ).

Transforming a row vector into a column vector
We illustrate the transformation with vector [1,2,3]. Enter this vector into
the RPN stack to follow the exercise. To transform a row vector into a column
vector, we need to carry on the following operations in the RPN stack:1 - Decompose the vector with function OBJ

2 - Press 1+ to transform the list in stack level 1: from {3} to {3,1}Page 9-20

3 - Use function ARRY to build the column vector

These three steps can be put together into a UserRPL program, entered asfollows (in RPN mode, still): ‚å„°@)TYPE! @OBJ@ 1 + !ARRY@`³~~rxc` K
A new variable, @@RXC@@, will be available in the soft menu labels after pressing
J:

Press ‚@@RXC@@ to see the program contained in the variable RXC:<< OBJ 1 +  RRY >>This variable, @@RXC@@, can now be used to directly transform a row vector to acolumn vector. In RPN mode, enter the row vector, and then press @@RXC@@. Try,for example: [1,2,3] ` @@RXC@@.
After having defined this variable , we can use it in ALG mode to transform arow vector into a column vector. Thus, change your calculator’s mode to ALG
and try the following procedure: [1,2,3] ` J @@RXC@@ „ Ü „î, resulting in:Transforming a column vector into a row vector
To illustrate this transformation, we’ll enter the column vector[[1],[2],[3]] in RPN mode. Then, follow the next exercise to transforma row vector into a column vector:
1 - Use function OBJ to decompose the column vector

Page 9-21

2 - Use function OBJ to decompose the list in stack level 1:

3 - Press the delete key ƒ (also known as function DROP) to eliminate thenumber in stack level 1:

4 - Use function LIST to create a list

5 - Use function ARRY to create the row vector

These five steps can be put together into a UserRPL program, entered as follows(in RPN mode, still):‚å„°@)TYPE! @OBJ@ @OBJ@„°@)STACK @DROP „°@)TYPE! !LIST@ !ARRY@ `³~~cxr ` K
A new variable, @@CXR@@, will be available in the soft menu labels after pressing
J:

Press ‚@@CXR@@ to see the program contained in the variable CXR:<< OBJ OBJ DROP  RRY >>Page 9-22

This variable, @@CXR@@, can now be used to directly transform a column vector to arow vector. In RPN mode, enter the column vector, and then press @@CXR@@. Try,for example:[[1],[2],[3]] ` @@CXR@@.
After having defined variable @@CXR@@, we can use it in ALG mode to transform arow vector into a column vector. Thus, change your calculator’s mode to ALG
and try the following procedure:[[1],[2],[3]] ` J @@CXR@@ „Ü „î
resulting in:Transforming a list into a vector
To illustrate this transformation, we’ll enter the list {1,2,3} in RPN mode.
Then, follow the next exercise to transform a list into a vector:
1 - Use function OBJ to decompose the column vector

2 - Type a 1 and use function LIST to create a list in stack level 1:

3 - Use function ARRY to create the vector

These three steps can be put together into a UserRPL program, entered asfollows (in RPN mode):‚å„°@)TYPE! @OBJ@ 1 !LIST@ !ARRY@ `³~~lxv ` K

Page 9-23

A new variable, @@LXV@@, will be available in the soft menu labels after pressing
J:

Press ‚@@LXV@@ to see the program contained in the variable LXV:<< OBJ 1 LIST  RRY >>This variable, @@LXV@@, can now be used to directly transform a list into a vector.
In RPN mode, enter the list, and then press @@LXV@@. Try, for example: {1,2,3}` @@LXV@@.
After having defined variable @@LXV@@, we can use it in ALG mode to transform alist into a vector. Thus, change your calculator’s mode to ALG and try thefollowing procedure: {1,2,3} ` J @@LXV@@ „Ü „î, resultingin:Transforming a vector (or matrix) into a list
To transform a vector into a list, the calculator provides function AXL. You canfind this function through the command catalog, as follows:‚N~~axl~@@OK@@
As an example, apply function AXL to the vector [1,2,3] in RPN mode byusing:[1,2,3] ` XL. The following screen shot shows the application offunction AXL to the same vector in ALG mode.

Page 9-24

Chapter 10!
Creating and manipulating matrices
This chapter shows a number of examples aimed at creating matrices in thecalculator and demonstrating manipulation of matrix elements.

Definitions
A matrix is simply a rectangular array of objects (e.g., numbers, algebraics)
having a number of rows and columns. A matrix A having n rows and mcolumns will have, therefore, n×m elements. A generic element of the matrix isrepresented by the indexed variable aij, corresponding to row i and column j.
With this notation we can write matrix A as A = [aij]n×m . The full matrix isshown next:

⎡ a11
⎢a
A = [aij ] n×m = ⎢ 21
⎢ M
⎢
⎣a n1

a12
a 22
M
an2

L a1m ⎤
L a 2 m ⎥⎥.
⎥O⎥
L a nm ⎦A matrix is square if m = n. The transpose of a matrix is constructed byswapping rows for columns and vice versa. Thus, the transpose of matrix A, is
AT = [(aT)ij] m×n = [aji]m×n. The main diagonal of a square matrix is thecollection of elements aii. An identity matrix, In×n, is a square matrix whose
main diagonal elements are all equal to 1, and all off-diagonal elements are
zero. For example, a 3×3 identity matrix is written as⎡1 0 0 ⎤I = ⎢⎢0 1 0⎥⎥⎣⎢0 0 1⎥⎦
An identity matrix can be written as In×n = [δij], where δij is a function known as
Kronecker’s delta, and defined as⎧1, if i = j⎩0, if i ≠ j .

δ ij = ⎨Page 10-1

Entering matrices in the stack
In this section we present two different methods to enter matrices in thecalculator stack: (1) using the Matrix Writer, and (2) typing the matrix directly
into the stack.

Using the Matrix Writer
As with the case of vectors, discussed in Chapter 9, matrices can be enteredinto the stack by using the Matrix Writer. For example, to enter the matrix:⎡− 2.5 4.2 2.0⎤
⎢ 0.3
1.9 2.8⎥⎥,⎢⎢⎣ 2− 0.1 0.5⎥⎦
first, start the matrix writer by using „². Make sure that the option @GO→
is selected. Then use the following keystrokes:
2.5\` 4.2` 2`˜ššš
.3` 1.9` 2.8 `2` .1\` .5`
At this point, the Matrix Writer screen may look like this:Press ` once more to place the matrix on the stack. The ALG mode stack isshown next, before and after pressing `, once more:

Page 10-2

If you have selected the textbook display option (using H@)DISP! and checking
off Textbook), the matrix will look like the one shown above. Otherwise, thedisplay will show:

The display in RPN mode will look very similar to these.
Note: Details on the use of the matrix writer were presented in Chapter 9.

Typing in the matrix directly into the stack
The same result as above can be achieved by entering the following directly
into the stack:„Ô„Ô 2.5\ ‚í 4.2 ‚í 2 ™
‚í„Ô .3 ‚í 1.9 ‚í 2.8 ™
‚í„Ô 2 ‚í .1\ ‚í .5
Thus, to enter a matrix directly into the stack open a set of brackets („Ô)
and enclose each row of the matrix with an additional set of brackets(„Ô). Commas (‚í .) should separate the elements of eachrow, as well as the brackets between rows. (Note: In RPN mode, you can omit
the inner brackets after the first set has been entered, thus, instead of typing, forexample, [[1 2 3] [4 5 6] [7 8 9]], type [[1 2 3] 4 5 6 7 8 9].)For future exercises, let’s save this matrix under the name A. In ALG mode use
K~a. In RPN mode, use ³~a K.

Creating matrices with calculator functions
Some matrices can be created by using the calculator functions available ineither the MTH/MATRIX/MAKE sub-menu within the MTH menu („´),

Page 10-3

or in the MATRICES/CREATE menu available through „Ø:The MTH/MATRIX/MAKE sub menu (let’s call it the MAKE menu) contains thefollowing functions:while the MATRICES/CREATE sub-menu (let’s call it the CREATE menu) has thefollowing functions:Page 10-4

As you can see from exploring these menus (MAKE and CREATE), they bothhave the same functions GET, GETI, PUT, PUTI, SUB, REPL, RDM, RANM,HILBERT, VANDERMONDE, IDN, CON, →DIAG, and DIAG→. The CREATE
menu includes the COLUMN and ROW sub-menus, that are also available
under the MTH/MATRIX menu. The MAKE menu includes the functions SIZE,
that the CREATE menu does not include. Basically, however, both menus,
MAKE and CREATE, provide the user with the same set of functions. In theexamples that follow, we will show how to access functions through use of thematrix MAKE menu. At the end of this section we present a table with the
keystrokes required to obtain the same functions with the CREATE menu whensystem flag 117 is set to SOFT menus.
If you have set that system flag (flag 117) to SOFT menu, the MAKE menu will
be available through the keystroke sequence: „´!)MATRX !)MAKE!
The functions available will be shown as soft-menu key labels as follows (press
L to move to the next set of functions):

With system flag 117 set to SOFT menus, the functions of the CREATE menu,
triggered by „Ø)@CREAT ,will show as follows:

In the next sections we present applications of the matrix functions in the MAKE
and CREATE menu.

Page 10-5

Functions GET and PUTFunctions GET, GETI, PUT, and PUTI, operate with matrices in a similar manner
as with lists or vectors, i.e., you need to provide the location of the element thatyou want to GET or PUT. However, while in lists and vectors only one index isrequired to identify an element, in matrices we need a list of two indices {row,column} to identify matrix elements. Examples of the use of GET and PUT
follow.
Let’s use the matrix we stored above into variable A to demonstrate the use of
the GET and PUT functions. For example, to extract element a23 from matrix A,
in ALG mode, can be performed as follows:

Notice that we achieve the same result by simply typing (2,3) and pressing`. In RPN mode, this exercise is performed by entering @@@A@@@ ` 3 `GET, or by using (2,3) `.
Suppose that we want to place the value ‘π’ into element a31 of the matrix.
We can use function PUT for that purpose, e.g.,

In RPN mode you can use: J @@@A@@@ {3,1} ` „ì PUT.
Alternatively, in RPN mode you can use: „ì³ (2,3) ` K . To
see the contents of variable A after this operation, use @@@A@@@.

Functions GETI and PUTI
Functions PUTI and GETI are used in UserRPL programs since they keep track of
an index for repeated application of the PUT and GET functions. The index list
in matrices varies by columns first. To illustrate its use, we propose thefollowing exercise in RPN mode: @@@A@@@ {2,2}` GETI. Screen shots showing
the RPN stack before and after the application of function GETI are shown
below:

Page 10-6

Notice that the screen is prepared for a subsequent application of GETI or GET,by increasing the column index of the original reference by 1, (i.e., from {2,2}to {2,3}), while showing the extracted value, namely A(2,2) = 1.9, in stack level1.
Now, suppose that you want to insert the value 2 in element {3 1} using PUTI.
Still in RPN mode, try the following keystrokes: ƒ ƒ{3 1} ` 2 `PUTI. The screen shots below show the RPN stack before and after theapplication of function PUTI:

In this case, the 2 was replaced in position {3 1}, i.e., now A(3,1) = 2, and theindex list was increased by 1 (by column first), i.e., from {3,1} to {3,2}. The
matrix is in level 2, and the incremented index list is in level 1.

Function SIZE
Function SIZE provides a list showing the number of rows and columns of thematrix in stack level 1. The following screen shows a couple of applications offunction SIZE in ALG mode:

In RPN mode, these exercises are performed by using @@@A@@@ SIZE, and[[1,2],[3,4]] ` SIZE .

Function TRN
Function TRN is used to produce the transconjugate of a matrix, i.e., thetranspose (TRAN) followed by its complex conjugate (CONJ). For example, thefollowing screen shot shows the original matrix in variable A and its transpose,shown in small font display (see Chapter 1):

Page 10-7

If the argument is a real matrix, TRN simply produces the transpose of the realmatrix. Try, for example, TRN(A), and compare it with TRAN(A).
In RPN mode, the transconjugate of matrix A is calculated by using @@@A@@@ TRN.
Note: The calculator also includes Function TRAN in the MATRICES/OPERATIONS sub-menu:

For example, in ALG mode:

Function CON
The function takes as argument a list of two elements, corresponding to thenumber of row and columns of the matrix to be generated, and a constantvalue. Function CON generates a matrix with constant elements. For example,
in ALG mode, the following command creates a 4×3 matrix whose elements are
all equal to –1.5:

Page 10-8

In RPN mode this is accomplished by using {4,3} ` 1.5 \` CON.

Function IDN
Function IDN (IDeNtity matrix) creates an identity matrix given its size. Recall
that an identity matrix has to be a square matrix, therefore, only one value isrequired to describe it completely. For example, to create a 4×4 identity matrix
in ALG mode use:

You can also use an existing square matrix as the argument of function IDN,
e.g.,

The resulting identity matrix will have the same dimensions as the argument
matrix. Be aware that an attempt to use a rectangular (i.e., non-square) matrix
as the argument of IDN will produce an error.

In RPN mode, the two exercises shown above are created by using: 4`
IDN and @@@A@@@ IDN.

Function RDM
Function RDM (Re-DiMensioning) is used to re-write vectors and matrices as
matrices and vectors. The input to the function consists of the original vector or
matrix followed by a list of a single number, if converting to a vector, or two
numbers, if converting to a matrix. In the former case the number represents the

Page 10-9

vector’s dimension, in the latter the number of rows and columns of the matrix.
The following examples illustrate the use of function RDM:
Re-dimensioning a vector into a matrix
The following example shows how to re-dimension a vector of 6 elements into amatrix of 2 rows and 3 columns in ALG mode:

In RPN mode, we can use [1,2,3,4,5,6] ` {2,3} ` RDM toproduce the matrix shown above.
Re-dimensioning a matrix into another matrix
In ALG mode, we now use the matrix created above and re-dimension it into amatrix of 3 rows and 2 columns:

In RPN mode, we simply use {3,2}` RDM.
Re-dimensioning a matrix into a vector
To re-dimension a matrix into a vector, we use as arguments the matrix followed
by a list containing the number of elements in the matrix. For example, toconvert the matrix from the previous example into a vector of length 6, in ALG
mode, use:

Page 10-10

If using RPN mode, we assume that the matrix is in the stack and use {6} `RDM.
Note: Function RDM provides a more direct and efficient way to transform lists
to arrays and vice versa, than that provided at the end of Chapter 9.

Function RANM
Function RANM (RANdom Matrix) will generate a matrix with random integerelements given a list with the number of rows and columns (i.e., the dimensionsof the matrix). For example, in ALG mode, two different 2×3 matrices withrandom elements are produced by using the same command, namely,
R NM({2,3}) :In RPN mode, use {2,3} ` R NM.
Obviously, the results you will get in your calculator will most certainly be
different than those shown above. The random numbers generated are integer
numbers uniformly distributed in the range [-10,10], i.e., each one of those 21
numbers has the same probability of being selected. Function RANM is usefulfor generating matrices of any size to illustrate matrix operations, or theapplication of matrix functions.

Function SUB
Function SUB extracts a sub-matrix from an existing matrix, provided you
indicate the initial and final position of the sub-matrix. For example, if we want
to extract elements a12, a13, a22, and a23 from the last result, as a 2×2 submatrix, in ALG mode, use:

Page 10-11

In RPN mode, assuming that the original 2×3 matrix is already in the stack, use{1,2} ` {2,3} ` SUB.

Function REPL
Function REPL replaces or inserts a sub-matrix into a larger one. The input forthis function is the matrix where the replacement will take place, the location
where the replacement begins, and the matrix to be inserted. For example,
keeping the matrix that we inherited from the previous example, enter thematrix: [[1,2,3],[4,5,6],[7,8,9]] . In ALG mode, the following
screen shot to the left shows the new matrix before pressing `. The screen
shot to the right shows the application of function RPL to replace the matrix in
NS(2), the 2×2 matrix, into the 3×3 matrix currently located in NS(1),starting at position {2,2}:

If working in the RPN mode, assuming that the 2×2 matrix was originally in thestack, we proceed as follows:[[1,2,3],[4,5,6],[7,8,9]]`™ (this last key swaps thecontents of stack levels 1 and 2) {1,2} ` ™ (another swapping of levels
1 and 2) REPL.

Function →DIAG
Function →DIAG takes the main diagonal of a square matrix of dimensions n×n,
and creates a vector of dimension n containing the elements of the main
diagonal. For example, for the matrix remaining from the previous exercise, we
can extract its main diagonal by using:Page 10-12

In RPN mode, with the 3×3 matrix in the stack, we simply have to activate
function DI G to obtain the same result as above.

Function DIAG→
Function DIAG→ takes a vector and a list of matrix dimensions {rows, columns},
and creates a diagonal matrix with the main diagonal replaced with the proper
vector elements. For example, the command
DI G([1,-1,2,3],{3,3})
produces a diagonal matrix with the first 3 elements of the vector argument:

In RPN mode, we can use [1,-1,2,3] ` {3,3}` DI G toobtain the same result as above.
Another example of application of the DIAG→ function follows, in ALG mode:

In RPN mode, use [1,2,3,4,5] ` {3,2}` DI G .
In this case a 3×2 matrix was to be created using as main diagonal elements as
many elements as possible form the vector [1,2,3,4,5]. The main diagonal, fora rectangular matrix, starts at position (1,1) and moves on to position (2,2),(3,3), etc. until either the number of rows or columns is exhausted. In this case,the number of columns (2) was exhausted before the number of rows (3), so themain diagonal included only the elements in positions (1,1) and (2,2). Thus,
only the first two elements of the vector were required to form the main
diagonal.

Function VANDERMONDE
Function VANDERMONDE generates the Vandermonde matrix of dimension nbased on a given list of input data. The dimension n is, of course, the length ofthe list. If the input list consists of objects {x1, x2,… xn}, then, a Vandermondematrix in the calculator is a matrix made of the following elements:

Page 10-13

⎡1
⎢
⎢1
⎢1
⎢
⎢M
⎢1
⎣

x1
x2
x3
M
xn

x12 L x1n −1 ⎤⎥x 22 L x 2n −1 ⎥x32 L x3n −1 ⎥⎥M O M ⎥
x n2 L x nn −1 ⎥⎦For example, the following command in ALG mode for the list {1,2,3,4}:

In RPN mode, enter {1,2,3,4} ` V NDERMONDE.

Function HILBERT
Function HILBERT creates the Hilbert matrix corresponding to a dimension n. By
definition, the n×n Hilbert matrix is Hn = [hjk]n×n, so thath jk =

1
j + k −1

The Hilbert matrix has application in numerical curve fitting by the method of
linear squares.

A program to build a matrix out of a number of lists
In this section we provide a couple of UserRPL programs to build a matrix out ofa number of lists of objects. The lists may represent columns of the matrix(program @CRMC) or rows of the matrix (program @CRMR). The programs areentered with the calculator set to RPN mode, and the instructions for the
keystrokes are given for system flag 117 set to SOFT menus. This section isintended for you to practice accessing programming functions in the calculator.
The programs are listed below showing, in the left-hand side, the keystrokes
necessary to enter the program steps, and, in the right-hand side, the characters

Page 10-14

entered in the display as you perform those keystrokes. First, we present thesteps necessary to produce program CRMC.

Lists represent columns of the matrix
The program @CRMC allows you to put together a p×n matrix (i.e., p rows, ncolumns) out of n lists of p elements each. To create the program enter thefollowing keystrokes:
Keystroke sequence:‚å„°@)STACK! @@DUP@‚ é # ~ „n‚å1„°@)STACK! @SWAP„°@)BRCH! @)FOR@! @FOR@~„j„°@)TYPE OBJ

Produces:
«
DUP
n

<<
1 SWAPFORj
OBJARRY@

ARRY„°@)BRCH! @)@IF@@ @@IF@@
~ „j#
~ „n
„°@)TEST! @@@<@@@„°@)BRCH! @)@IF@ @THEN~ „j #1+„°@)STACK! L@ROLL„°@)BRCH! @)@IF@ @END„°@)BRCH! @)FOR@! @NEXT„°@)BRCH! @)@IF@ @@IF@@~ „n #1„°@)TEST! @@@>@@@„°@)BRCH! @@IF@ @THEN1#~ „n #1„°@)BRCH! @)FOR@! @FOR@~ „j #~ „j #1+„°@)STACK! L@ROLL!
„°@)BRCH! @)FOR@! @NEXT!
„°@)BRCH! )@@IF@! @END@

IF
j
n
<
THEN
j1 +
ROLL
END
NEXT
IF
n1
>
THEN
1
n1FOR
j
j1+
ROLL
NEXT
END

Page 10-15~„n #„´@)MATRX! @)COL! @COL!

n
COL

`

Program is displayed in level 1

To save the program:!³~~crmc~ K

Note: if you save this program in your HOME directory it will be available
from any other sub-directory you use.
To see the contents of the program use J ‚@CRMC. The program listing is
the following:« DUP → n « 1 SWAP FOR j OBJ→ → RRY IF j n < THEN j 1 +ROLL END NEXT IF n 1 > THEN 1 n 1 - FOR j j 1 + ROLL
NEXT END n COL→ » »To use this program, in RPN mode, enter the n lists in the order that you wantthem as columns of the matrix, enter the value of n, and press @CRMC. As an
example, try the following exercise:{1,2,3,4} ` {1,4,9,16} ` {1,8,27,64} ` 3 ` @CRMC
The following screen shots show the RPN stack before and after running
program @CRMC:

To use the program in ALG mode, press @CRMC followed by a set of parentheses(„Ü). Within the parentheses type the lists of data representing thecolumns of the matrix, separated by commas, and finally, a comma, and thenumber of columns. The command should look like this:
CRMC({1,2,3,4}, {1,4,9,16}, {1,8,27,64}, 3)
The ALG screen showing the execution of program CRMC is shown below:

Page 10-16

Lists represent rows of the matrix
The previous program can be easily modified to create a matrix when the input
lists will become the rows of the resulting matrix. The only change to be
performed is to change COL→ for ROW→ in the program listing. To perform
this change use:‚@CRMC˜‚˜—ššš
ƒƒƒ~~row~`

List program CRMC in stackMove to end of program
Delete COL
Type in ROW, enter program

To store the program use: ³~~crmr~ K{1,2,3,4} ` {1,4,9,16} ` {1,8,27,64} ` 3 ` @CRMR
The following screen shots show the RPN stack before and after running
program @CRMR:

These programs can be useful for statistical applications, specifically to create
the statistical matrix ΣDAT. Examples of the use of these program are shown ina latter chapters.

Manipulating matrices by columns
The calculator provides a menu with functions for manipulating matrices by
operating in their columns. This menu is available through the MTH/MATRIX/
COL.. sequence: („´) shown in the figure below with system flag 117 set
to CHOOSE boxes:

or through the MATRICES/CREATE/COLUMN sub-menu:

Page 10-17

Both approaches will show the same functions:

When system flag 117 is set to SOFT menus, the COL menu is accessible
through „´!)MATRX ) !)@@COL@ , or through „Ø!)@CREAT@ !)@@COL@ . Bothapproaches will show the same set of functions:

The operation of these functions is presented below.

Function →COL
Function →COL takes as argument a matrix and decomposes it into vectors
corresponding to its columns. An application of function COL in ALG modeis shown below. The matrix used has been stored earlier in variable A. The
matrix is shown in the figure to the left. The figure to the right shows the matrix
decomposed in columns. To see the full result, use the line editor (triggered bypressing ˜).

In RPN mode, you need to list the matrix in the stack, and the activate function
COL, i.e., @@@A@@@ COL. The figure below shows the RPN stack before andafter the application of function COL.

Page 10-18

In this result, the first column occupies the highest stack level after
decomposition, and stack level 1 is occupied by the number of columns of theoriginal matrix. The matrix does not survive decomposition, i.e., it is no longer
available in the stack.

Function COL→
Function COL→ has the opposite effect of Function →COL, i.e., given n vectorsof the same length, and the number n, function COL builds a matrix byplacing the input vectors as columns of the resulting matrix. Here is an example
in ALG mode. The command used was:
COL([1,2,3],[4,5,6],[7,8,9],3)In RPN mode, place the n vectors in stack levels n+1, n, n-1,…,2, and thenumber n in stack level 1. With this set up, function COL places the vectors
as columns in the resulting matrix. The following figure shows the RPN stack
before and after using function COL.

Function COL+
Function COL+ takes as argument a matrix, a vector with the same length as
the number of rows in the matrix, and an integer number n representing thelocation of a column. Function COL+ inserts the vector in column n of thematrix. For example, in ALG mode, we’ll insert the second column in matrix A
with the vector [-1,-2,-3], i.e.,

Page 10-19

In RPN mode, enter the matrix first, then the vector, and the column number,before applying function COL+. The figure below shows the RPN stack before
and after applying function COL+.

Function COLFunction COL- takes as argument a matrix and an integer number representing
the position of a column in the matrix. Function returns the original matrix minus
a column, as well as the extracted column shown as a vector. Here is an
example in the ALG mode using the matrix stored in A:

In RPN mode, place the matrix in the stack first, then enter the number
representing a column location before applying function COL-. The following
figure shows the RPN stack before and after applying function COL-.

Function CSWP
Function CSWP (Column SWaP) takes as arguments two indices, say, i and j,(representing two distinct columns in a matrix), and a matrix, and produces a
new matrix with columns i and j swapped. The following example, in ALG
mode, shows an application of this function. We use the matrix stored invariable A for the example. This matrix is listed first.

Page 10-20

In RPN mode, function CSWP lets you swap the columns of a matrix listed instack level 3, whose indices are listed in stack levels 1 and 2. For example, thefollowing figure shows the RPN stack before and after applying function CSWP
to matrix A in order to swap columns 2 and 3:

As you can see, the columns that originally occupied positions 2 and 3 havebeen swapped. Swapping of columns, and of rows (see below), is commonlyused when solving systems of linear equations with matrices. Details of these
operations will be given in a subsequent Chapter.

Manipulating matrices by rows
The calculator provides a menu with functions for manipulating matrices by
operating in their rows. This menu is available through the MTH/MATRIX/
ROW.. sequence: („´) shown in the figure below with system flag 117 set
to CHOOSE boxes:

or through the MATRICES/CREATE/ROW sub-menu:

Both approaches will show the same functions:Page 10-21

When system flag 117 is set to SOFT menus, the ROW menu is accessible
through „´!)MATRX !)@@ROW@ , or through „Ø!)@CREAT@ !)@@ROW@ . Bothapproaches will show the same set of functions:

The operation of these functions is presented below.

Function →ROW
Function →ROW takes as argument a matrix and decomposes it into vectors
corresponding to its rows. An application of function ROW in ALG mode isshown below. The matrix used has been stored earlier in variable A. The
matrix is shown in the figure to the left. The figure to the right shows the matrix
decomposed in rows. To see the full result, use the line editor (triggered bypressing ˜).

In RPN mode, you need to list the matrix in the stack, and the activate function
ROW, i.e., @@@A@@@ ROW. The figure below shows the RPN stack before andafter the application of function ROW.

In this result, the first row occupies the highest stack level after decomposition,and stack level 1 is occupied by the number of rows of the original matrix. The
Page 10-22

matrix does not survive decomposition, i.e., it is no longer available in thestack.

Function ROW→
Function ROW→ has the opposite effect of the function →ROW, i.e., given n
vectors of the same length, and the number n, function ROW builds a matrix
by placing the input vectors as rows of the resulting matrix. Here is an example
in ALG mode. The command used was:
ROW([1,2,3],[4,5,6],[7,8,9],3)In RPN mode, place the n vectors in stack levels n+1, n, n-1,…,2, and thenumber n in stack level 1. With this set up, function ROW places the vectors
as rows in the resulting matrix. The following figure shows the RPN stack before
and after using function ROW.

Function ROW+
Function ROW+ takes as argument a matrix, a vector with the same length as
the number of rows in the matrix, and an integer number n representing thelocation of a row. Function ROW+ inserts the vector in row n of the matrix. For
example, in ALG mode, we’ll insert the second row in matrix A with the vector [1,-2,-3], i.e.,

In RPN mode, enter the matrix first, then the vector, and the row number, before
applying function ROW+. The figure below shows the RPN stack before andafter applying function ROW+.

Page 10-23

Function ROWFunction ROW- takes as argument a matrix and an integer number representing
the position of a row in the matrix. The function returns the original matrix,
minus a row, as well as the extracted row shown as a vector. Here is an
example in the ALG mode using the matrix stored in A:

In RPN mode, place the matrix in the stack first, then enter the number
representing a row location before applying function ROW-. The following
figure shows the RPN stack before and after applying function ROW-.

Function RSWP
Function RSWP (Row SWaP) takes as arguments two indices, say, i and j,(representing two distinct rows in a matrix), and a matrix, and produces a new
matrix with rows i and j swapped. The following example, in ALG mode,shows an application of this function. We use the matrix stored in variable A
for the example. This matrix is listed first.

In RPN mode, function RSWP lets you swap the rows of a matrix listed in stacklevel 3, whose indices are listed in stack levels 1 and 2. For example, thefollowing figure shows the RPN stack before and after applying function RSWP
to matrix A in order to swap rows 2 and 3:

Page 10-24

As you can see, the rows that originally occupied positions 2 and 3 have beenswapped.

Function RCIFunction RCI stands for multiplying Row I by a Constant value and replace theresulting row at the same location. The following example, written in ALG
mode, takes the matrix stored in A, and multiplies the constant value 5 into row
number 3, replacing the row with this product.

This same exercise done in RPN mode is shown in the next figure. The left-handside figure shows the setting up of the matrix, the factor and the row number, in
stack levels 3, 2, and 1. The right-hand side figure shows the resulting matrix
after function RCI is activated.

Function RCIJ
Function RCIJ stands for “take Row I and multiplying it by a constant C and then
add that multiplied row to row J, replacing row J with the resulting sum.” This
type of row operation is very common in the process of Gaussian or GaussJordan elimination (more details on this procedure are presented in a
subsequent Chapter). The arguments of the function are: (1) the matrix, (2) the
constant value, (3) the row to be multiplied by the constant in(2), and (4) the
row to be replaced by the resulting sum as described above. For example,
taking the matrix stored in variable A, we are going to multiply column 3 times
1.5, and add it to column 2. The following example is performed in ALG
mode:

Page 10-25

In RPN mode, enter the matrix first, followed by the constant value, then by therow to be multiplied by the constant value, and finally enter the row that will be
replaced. The following figure shows the RPN stack before and after applying
function RCIJ under the same conditions as in the ALG example shown above:

Page 10-26

Chapter 11
Matrix Operations and Linear Algebra
In Chapter 10 we introduced the concept of a matrix and presented a numberof functions for entering, creating, or manipulating matrices. In this Chapter we
present examples of matrix operations and applications to problems of linear
algebra.

Operations with matrices
Matrices, like other mathematical objects, can be added and subtracted. They
can be multiplied by a scalar, or among themselves. They can also be raised toa real power. An important operation for linear algebra applications is theinverse of a matrix. Details of these operations are presented next.
To illustrate the operations we will create a number of matrices that we will store
in variables. The generic name of the matrices will be Aij and Bij, where irepresents the number of rows and j the number of columns of the matrices. The
matrices to be used are generated by using function RANM (random matrices).
If you try this exercise in your calculator you will get different matrices than theones listed herein, unless you store them into your calculator exactly as shown
below. Here are the matrices A22, B22, A23, B23, A32, B32, A33 and B33
created in ALG mode:

In RPN mode, the steps to follow are:{2,2}` R NM ' 22'K

{2,2}` R NM 'B22'K{2,3}` R NM ' 23'K

{2,3}` R NM 'B23'K{3,2}` R NM ' 32'K

{3,2}` R NM 'B32'K{3,3}` R NM ' 33'K

{3,3}` R NM 'B33'K

Page 11-1

Addition and subtraction
Consider a pair of matrices A = [aij]m×n and B = [bij]m×n. Addition andsubtraction of these two matrices is only possible if they have the same numberof rows and columns. The resulting matrix, C = A ± B = [cij]m×n has elements cij= aij ± bij. Some examples in ALG mode are shown below using the matrices
stored above (e.g., @A22@ + @B22@)

In RPN mode, the steps to follow are:22 ` B22`+

22 ` B22`-

23 ` B23`+

23 ` B23`-

32 ` B32`+

32 ` B32`-

Translating the ALG examples to RPN is straightforward, as illustrated here. The
remaining examples of matrix operations will be performed in ALG mode only.

Multiplication
There are numerous multiplication operations that involve matrices. These aredescribed next.
Multiplication by a scalar
Multiplication of the matrix A = [aij]m×n by a scalar k results in the matrix C =kA = [cij]m×n = [kaij]m×n. In particular, the negative of a matrix is defined by
the operation -A =(-1)A = [-aij] m×n. Some examples of multiplication of amatrix by a scalar are shown below.

Page 11-2

By combining addition and subtraction with multiplication by a scalar we canform linear combinations of matrices of the same dimensions, e.g.,

In a linear combination of matrices, we can multiply a matrix by an imaginary
number to obtain a matrix of complex numbers, e.g.,

Matrix-vector multiplication
Matrix-vector multiplication is possible only if the number of columns of thematrix is equal to the length of the vector. This operation follows the rules ofmatrix multiplication as shown in the next section. A couple of examples ofmatrix-vector multiplication follow:

Vector-matrix multiplication, on the other hand, is not defined. This
multiplication can be performed, however, as a special case of matrix
multiplication as defined next.
Page 11-3

Matrix multiplication
Matrix multiplication is defined by Cm×n = Am×p⋅Bp×n, where A = [aij]m×p, B =[bij]p×n, and C = [cij]m×n. Notice that matrix multiplication is only possible if thenumber of columns in the first operand is equal to the number of rows of thesecond operand. The general term in the product, cij, is defined asp

cij = ∑ aik ⋅ bkj , for i = 1,2,K, m; j = 1,2,K, n.
k =1This is the same as saying that the element in the i-th row and j-th column of the
product, C, results from multiplying term-by-term the i-th row of A with the j-thcolumn of B, and adding the products together. Matrix multiplication is notcommutative, i.e., in general, A⋅B ≠ B⋅A. Furthermore, one of themultiplications may not even exist.
The following screen shots show the results of multiplications of the matrices that
we stored earlier:!!!
The matrix-vector multiplication introduced in the previous section can bethought of as the product of a matrix m×n with a matrix n×1 (i.e., a column
vector) resulting in an m×1 matrix (i.e., another vector). To verify this assertion
check the examples presented in the previous section. Thus, the vectors definedin Chapter 9 are basically column vectors for the purpose of matrix
multiplication.
The product of a vector with a matrix is possible if the vector is a row vector,
i.e., a 1×m matrix, which multiplied with a matrix m×n produces a 1xn matrix

Page 11-4

(another row vector). For the calculator to identify a row vector, you must use
double brackets to enter it:

Term-by-term multiplication
Term-by-term multiplication of two matrices of the same dimensions is possible
through the use of function HADAMARD. The result is, of course, another matrixof the same dimensions. This function is available through Function catalog(‚N), or through the MATRICES/OPERATIONS sub-menu („Ø).
Applications of function HADAMARD are presented next:

Raising a matrix to a real power
You can raise a matrix to any power as long as the power is either an
integer or a real number with no fractional part. The following example shows
the result of raising matrix B22, created earlier, to the power of 5:

You can also raise a matrix to a power without first storing it as a variable:

Page 11-5

In algebraic mode, the keystrokes are: [enter or select the matrix] Q [enter the
power] `. In RPN mode, the keystrokes are: [enter or select the matrix] †[enter the power] Q`.
Matrices can be raised to negative powers. In this case, the result is equivalent
to 1/[matrix]^ABS(power).

The identity matrix
In Chapter 9 we introduce the identity matrix as the matrix I = [δij]n×n, where δij
is the Kronecker’s delta function. Identity matrices can be obtained by using
function IDN described in Chapter 9. The identity matrix has the property thatA⋅I = I⋅A = A. To verify this property we present the following examples using
the matrices stored earlier on:

The inverse matrix
The inverse of a square matrix A is the matrix A-1 such that A⋅A-1 = A-1⋅A = I,
where I is the identity matrix of the same dimensions as A. The inverse of amatrix is obtained in the calculator by using the inverse function, INV (i.e., theY key). An example of the inverse of one of the matrices stored earlier ispresented next:

Page 11-6

To verify the properties of the inverse matrix, consider the following
multiplications:Characterizing a matrix (The matrix NORM menu)
The matrix NORM (NORMALIZE) menu is accessed through the keystroke
sequence „´ (system flag 117 set to CHOOSE boxes):

This menu contains the following functions:

These functions are described next. Because many of these functions use
concepts of matrix theory, such as singular values, rank, etc., we will include
short descriptions of these concepts intermingled with the description offunctions.

Page 11-7

Function ABS
Function ABS calculates what is known as the Frobenius norm of a matrix. For amatrix A = [aij] m×n, the Frobenius norm of the matrix is defined as

AF =

n

m

∑∑ a
i =1 j =1

2
ij

If the matrix under consideration in a row vector or a column vector, then the
Frobenius norm , ||A||F , is simply the vector’s magnitude. Function ABS isaccessible directly in the keyboard as „Ê.
Try the following exercises in ALG mode (using the matrices stored earlier for
matrix operations):

Function SNRM
Function SNRM calculates the Spectral NoRM of a matrix, which is defined as
the matrix’s largest singular value, also known as the Euclidean norm of thematrix. For example,

Page 11-8

Singular value decomposition
To understand the operation of Function SNRM, we need to introduce theconcept of matrix decomposition. Basically, matrix decomposition involves thedetermination of two or more matrices that, when multiplied in a certain order(and, perhaps, with some matrix inversion or transposition thrown in), produce
the original matrix. The Singular Value Decomposition (SVD) is such that arectangular matrix Am×n is written as Am×n = Um×m ⋅Sm×n ⋅V Tn×n,
where U and V are orthogonal matrices, and S is a diagonal matrix. The
diagonal elements of S are called the singular values of A and are usuallyordered so that si ≥ si+1, for i = 1, 2, …, n-1. The columns [uj] of U and [vj] of
V are the corresponding singular vectors. (Orthogonal matrices are such thatU⋅ UT = I. A diagonal matrix has non-zero elements only along its main
diagonal).
The rank of a matrix can be determined from its SVD by counting the number of
non-singular values. Examples of SVD will be presented in a subsequent
section.

Functions RNRM and CNRM
Function RNRM returns the Row NoRM of a matrix, while function CNRM
returns the Column NoRM of a matrix. Examples,

Row norm and column norm of a matrix
The row norm of a matrix is calculated by taking the sums of the absolute valuesof all elements in each row, and then, selecting the maximum of these sums.
The column norm of a matrix is calculated by taking the sums of the absolutevalues of all elements in each column, and then, selecting the maximum of thesesums.

Page 11-9

Function SRAD
Function SRAD determines the Spectral RADius of a matrix, defined as thelargest of the absolute values of its eigenvalues. For example,

Definition of eigenvalues and eigenvectors of a matrix
The eigenvalues of a square matrix result from the matrix equation A⋅x = λ⋅x.
The values of λ that satisfy the equation are known as the eigenvalues of thematrix A. The values of x that result from the equation for each value of l are
known as the eigenvectors of the matrix. Further details on calculating
eigenvalues and eigenvectors are presented later in the chapter.

Function COND
Function COND determines the condition number of a matrix:

Condition number of a matrix
The condition number of a square non-singular matrix is defined as the productof the matrix norm times the norm of its inverse, i.e.,cond(A) = ||A||×||A-1||. We will choose as the matrix norm, ||A||, themaximum of its row norm (RNRM) and column norm (CNRM), while the normof the inverse, ||A-1||, will be selected as the minimum of its row norm andcolumn norm. Thus, ||A|| = max(RNRM(A),CNRM(A)), and ||A-1|| =min(RNRM(A-1), CNRM(A-1)).
The condition number of a singular matrix is infinity. The condition number ofa non-singular matrix is a measure of how close the matrix is to being singular.
The larger the value of the condition number, the closer it is to singularity. (Asingular matrix is one for which the inverse does not exist).
Page 11-10

Try the following exercise for matrix condition number on matrix A33. The
condition number is COND(A33) , row norm, and column norm for A33 areshown to the left. The corresponding numbers for the inverse matrix, INV(A33),
are shown to the right:

Since RNRM(A33) > CNRM(A33), then we take ||A33|| = RNRM(A33) =21. Also, since CNRM(INV(A33)) < RNRM(INV(A33)), then we take||INV(A33)|| = CNRM(INV(A33)) = 0.261044... Thus, the condition
number is also calculated as CNRM(A33)*CNRM(INV(A33)) = COND(A33) =6.7871485…

Function RANKFunction RANK determines the rank of a square matrix. Try the following
examples:The rank of a matrix
The rank of a square matrix is the maximum number of linearly independentrows or columns that the matrix contains. Suppose that you write a squarematrix An×n as A = [c1 c2 … cn], where ci (i = 1, 2, …, n) are vectors
representing the columns of the matrix A, then, if any of those columns, say ck,
can be written as c k =∑d ⋅c ,jj ≠ k , j∈{1, 2 ,..., n}jPage 11-11

where the values dj are constant, we say that ck is linearly dependent on thecolumns included in the summation. (Notice that the values of j include any
value in the set {1, 2, …, n}, in any combination, as long as j≠k.) If theexpression shown above cannot be written for any of the column vectors thenwe say that all the columns are linearly independent. A similar definition forthe linear independence of rows can be developed by writing the matrix as acolumn of row vectors. Thus, if we find that rank(A) = n, then the matrix has
an inverse and it is a non-singular matrix. If, on the other hand, rank(A) < n,then the matrix is singular and no inverse exist.
For example, try finding the rank for the matrix:

You will find that the rank is 2. That is because the second row [2,4,6] is equal
to the first row [1,2,3] multiplied by 2, thus, row two is linearly dependent ofrow 1 and the maximum number of linearly independent rows is 2. You cancheck that the maximum number of linearly independent columns is 3. The rank
being the maximum number of linearly independent rows or columns becomes
2 for this case.

Function DETFunction DET calculates the determinant of a square matrix. For example,

Page 11-12

The determinant of a matrix
The determinant of a 2x2 and or a 3x3 matrix are represented by the samearrangement of elements of the matrices, but enclosed between vertical lines,
i.e.,

a11
a 21

a11
a 21
a31

a12
,
a 22

a12
a 22
a32

a13
a 23
a33

A 2×2 determinant is calculated by multiplying the elements in its diagonal
and adding those products accompanied by the positive or negative sign as
indicated in the diagram shown below.

The 2×2 determinant is, therefore,

a11

a12

a 21

a 22

= a11 ⋅ a 22 − a12 ⋅ a 21

A 3×3 determinant is calculated by augmenting the determinant, an
operation that consists on copying the first two columns of the determinant,and placing them to the right of column 3, as shown in the diagram below.
The diagram also shows the elements to be multiplied with the corresponding
sign to attach to their product, in a similar fashion as done earlier for a 2×2
determinant. After multiplication the results are added together to obtain thedeterminant.

Page 11-13

For square matrices of higher order determinants can be calculated by using
smaller order determinant called cofactors. The general idea is to "expand"a determinant of a n×n matrix (also referred to as a n×n determinant) into asum of the cofactors, which are (n-1)×(n-1) determinants, multiplied by theelements of a single row or column, with alternating positive and negative
signs. This "expansion" is then carried to the next (lower) level, withcofactors of order (n-2)×(n-2), and so on, until we are left only with a longsum of 2×2 determinants. The 2×2 determinants are then calculated throughthe method shown above.
The method of calculating a determinant by cofactor expansion is very
inefficient in the sense that it involves a number of operations that grows very
fast as the size of the determinant increases. A more efficient method, andthe one preferred in numerical applications, is to use a result from Gaussianelimination. The method of Gaussian elimination is used to solve systems oflinear equations. Details of this method are presented in a later part of thischapter.
To refer to the determinant of a matrix A, we write det(A). A singular matrix
has a determinant equal to zero.

Function TRACE
Function TRACE calculates the trace of square matrix, defined as the sum of theelements in its main diagonal, orntr (A) = ∑ aii
i =1.

Examples:Page 11-14

Function TRAN
Function TRAN returns the transpose of a real or the conjugate transpose of acomplex matrix. TRAN is equivalent to TRN. The operation of function TRN
was presented in Chapter 10.

Additional matrix operations (The matrix OPER menu)
The matrix OPER (OPERATIONS) is available through the keystroke sequence„Ø (system flag 117 set to CHOOSE boxes):

The OPERATIONS menu includes the following functions:

Functions ABS, CNRM, COND, DET, RANK, RNRM, SNRM, TRACE, and TRAN
are also found in the MTH/MATRIX/NORM menu (the subject of the previous
section). Function SIZE was presented in Chapter 10. Function HADAMARD
was presented earlier in the context of matrix multiplication. Functions LSQ ,Page 11-15

MAD and RSD are related to the solution of systems of linear equations and will
be presented in a subsequent section in this Chapter. In this section we’ll
discuss only functions AXL and AXM.

Function AXL
Function AXL converts an array (matrix) into a list, and vice versa:

Note: the latter operation is similar to that of the program CRMR presented in
Chapter 10.

Function AXM
Function AXM converts an array containing integer or fraction elements into its
corresponding decimal, or approximate, form:

Function LCXM
Function LCXM can be used to generate matrices such that the element aij is afunction of i and j. The input to this function consists of two integers, n and m,
representing the number of rows and columns of the matrix to be generated,
and a program that takes i and j as input. The numbers n, m, and the program
occupy stack levels 3, 2, and 1, respectively. Function LCXM is accessible
through the command catalog ‚N.
For example, to generate a 2´ 3 matrix whose elements are given by aij = (i+j)2,
first, store the following program into variable P1 in RPN mode. This is the waythat the RPN stack looks before pressing K.

Page 11-16

The implementation of function LCXM for this case requires you to enter:2`3`‚@@P1@@ LCXM `The following figure shows the RPN stack before and after applying function
LCXM:

In ALG mode, this example can be obtained by using:

The program P1 must still have been created and stored in RPN mode.

Solution of linear systems
A system of n linear equations in m variables can be written asa11⋅x1 + a12⋅x2 + a13⋅x3 + …+ a1,m-1⋅x m-1 + a1,m⋅x m = b1,a21⋅x1 + a22⋅x2 + a23⋅x3 + …+ a2,m-1⋅x m-1 + a2,m⋅x m = b2,a31⋅x1 + a32⋅x2 + a33⋅x3 + …+ a3,m-1⋅x m-1 + a3,m⋅x m = b3,
.
.
.
…
.
.
!! .
.
.
.
…
.
.
!!
.
an-1,1⋅x1 + an-1,2⋅x2 + an-1,3⋅x3 + …+ an-1,m-1⋅x m-1 + an-1,m⋅x m = bn-1,
an1⋅x1 + an2⋅x2 + an3⋅x3 + …+ an,m-1⋅x m-1 + an,m⋅x m = bn.
This system of linear equations can be written as a matrix equation, An×m⋅xm×1= bn×1, if we define the following matrix and vectors:

Page 11-17

⎡ a11⎢a
A = ⎢ 21
⎢ M
⎢
⎣an1

a12 L a1m ⎤⎡ x1 ⎤⎡ b1 ⎤⎥⎥⎢⎢b ⎥a22 L a2 m ⎥
x2 ⎥
⎢
x=
b = ⎢ 2⎥⎢M⎥⎢M⎥
M O M ⎥⎥
⎢ ⎥⎢ ⎥an 2 L anm ⎦ n×m⎣ xm ⎦ m×1 ,⎣bn ⎦ n×1,

Using the numerical solver for linear systems
There are many ways to solve a system of linear equations with the calculator.
One possibility is through the numerical solver ‚Ï. From the numericalsolver screen, shown below (left), select the option 4. Solve lin sys.., and press@@@OK@@@. The following input form will be provided (right):

To solve the linear system A⋅x = b, enter the matrix A, in the format [[ a11, a12,… ], … [….]] in the A: field. Also, enter the vector b in the B: field. When the
X: field is highlighted, press [SOLVE]. If a solution is available, the solution
vector x will be shown in the X: field. The solution is also copied to stack level
1. Some examples follow.
A square system
The system of linear equations
2x1 + 3x2 –5x3 = 13,
x1 – 3x2 + 8x3 = -13,
2x1 – 2x2 + 4x3 = -6,
can be written as the matrix equation A⋅x = b, if⎡ x1 ⎤⎡2 3 − 5⎤⎥⎢
A = ⎢1 − 3 8 ⎥, x = ⎢⎢ x 2 ⎥⎥, and⎢⎣ x3 ⎥⎦⎢⎣2 − 2 4 ⎥⎦⎡ 13 ⎤b = ⎢⎢− 13⎥⎥.
⎢⎣ − 6 ⎥⎦Page 11-18

This system has the same number of equations as of unknowns, and will bereferred to as a square system. In general, there should be a unique solution to
the system. The solution will be the point of intersection of the three planes in
the coordinate system (x1, x2, x3) represented by the three equations.
To enter matrix A you can activate the Matrix Writer while the A: field isselected. The following screen shows the Matrix Writer used for entering matrix
A, as well as the input form for the numerical solver after entering matrix A(press ` in the Matrix Writer):Press ˜ to select the B: field. The vector b can be entered as a row vector
with a single set of brackets, i.e., [13,-13,-6] @@@OK@@@ .
After entering matrix A and vector b, and with the X: field highlighted, we canpress @SOLVE! to attempt a solution to this system of equations:

A solution was found as shown next.

To see the solution in the stack press `. The solution is x = [1,2,-1].

Page 11-19

To check that the solution is correct, enter the matrix A and multiply times thissolution vector (example in algebraic mode):

Under-determined system
The system of linear equations
2x1 + 3x2 –5x3 = -10,
x1 – 3x2 + 8x3 = 85,
can be written as the matrix equation A⋅x = b, if⎡ x1 ⎤⎡2 3 − 5⎤A=⎢, x = ⎢⎢ x2 ⎥⎥, and⎥⎣1 − 3 8 ⎦⎢⎣ x3 ⎥⎦⎡− 10⎤b=⎢⎥.
⎣ 85 ⎦

This system has more unknowns than equations, therefore, it is not uniquelydetermined. We can visualize the meaning of this statement by realizing thateach of the linear equations represents a plane in the three-dimensional
Cartesian coordinate system (x1, x2, x3). The solution to the system of
equations shown above will be the intersection of two planes in space. We
know, however, that the intersection of two (non-parallel) planes is a straight
line, and not a single point. Therefore, there is more than one point that satisfy
the system. In that sense, the system is not uniquely determined.
Let’s use the numerical solver to attempt a solution to this system of equations:‚Ï ˜˜˜ @@OK@@ . Enter matrix A and vector b as illustrated in theprevious example, and press @SOLVE when the X: field is highlighted:

Page 11-20

To see the details of the solution vector, if needed, press the @EDIT! button. This
will activate the Matrix Writer. Within this environment, use the right- and leftarrow keys to move about the vector:

Thus, the solution is x = [15.373, 2.4626, 9.6268].
To return to the numerical solver environment, press `.
The procedure that we describe next can be used to copy the matrix A and thesolution vector X into the stack. To check that the solution is correct, try thefollowing:•

Press ——, to highlight the A: field.

•

Press L @CALC@ `, to copy matrix A onto the stack.

•Press @@@OK@@@ to return to the numerical solver environment.

•

Press ˜ ˜@CALC@ `, to copy solution vector X onto the stack.

•Press @@@OK@@@ to return to the numerical solver environment.

•

Press ` to return to the stack.

In ALG mode, the stack will now look like this:Page 11-21

Let’s store the latest result in a variable X, and the matrix into variable A, as
follows:
Press K~x` to store the solution vector into variable X
Press ƒ ƒ ƒ to clear three levels of the stack
Press K~a` to store the matrix into variable A
Now, let’s verify the solution by using: @@@A@@@ * @@@X@@@ `, which results in(press ˜ to see the vector elements): [-9.99999999992 85. ], close enoughto the original vector b = [-10 85].
Try also this, @@A@@@ * [15,10/3,10] ` ‚ï`, i.e.,

This result indicates that x = [15,10/3,10] is also a solution to the system,
confirming our observation that a system with more unknowns than equations is
not uniquely determined (under-determined).
How does the calculator came up with the solution x = [15.37… 2.46…
9.62…] shown earlier? Actually, the calculator minimizes the distance from apoint, which will constitute the solution, to each of the planes represented by theequations in the linear system. The calculator uses a least-square method, i.e.,
minimizes the sum of the squares of those distances or errors.
Over-determined system
The system of linear equations
x1 + 3x2 = 15,
2x1 – 5x2 = 5,
-x1 + x2 = 22,
Page 11-22

can be written as the matrix equation A⋅x = b, if

3⎤
⎡1
⎡x ⎤
⎢
A = ⎢ 2 − 5⎥⎥, x = ⎢ 1 ⎥, and⎣ x2 ⎦⎢⎣− 1 1 ⎥⎦⎡15 ⎤b = ⎢⎢ 5 ⎥⎥.
⎢⎣22⎥⎦

This system has more equations than unknowns (an over-determined system).
The system does not have a single solution.
Each of the linear equations inthe system presented above represents a straight line in a two-dimensional
Cartesian coordinate system (x1, x2). Unless two of the three equations in thesystem represent the same equation, the three lines will have more than one
intersection points. For that reason, the solution is not unique. Some numericalalgorithms can be used to force a solution to the system by minimizing the
distance from the presumptive solution point to each of the lines in the system.
Such is the approach followed by the calculator numerical solver.
Let’s use the numerical solver to attempt a solution to this system of equations:‚Ï ˜˜˜ @@OK@@ . Enter matrix A and vector b as illustrated in theprevious example, and press @SOLVE when the X: field is highlighted:

To see the details of the solution vector, if needed, press the @EDIT! button. This
will activate the Matrix Writer. Within this environment, use the right- and leftarrow keys to move about the vector:

Page 11-23

Press ` to return to the numerical solver environment. To check that thesolution is correct, try the following:•

Press ——, to highlight the A: field.

•

Press L @CALC@ `, to copy matrix A onto the stack.

•Press @@@OK@@@ to return to the numerical solver environment.

•

Press ˜ ˜@CALC@ `, to copy solution vector X onto the stack.

•Press @@@OK@@@ to return to the numerical solver environment.

•

Press ` to return to the stack.

In ALG mode, the stack will now look like this:Let’s store the latest result in a variable X, and the matrix into variable A, as
follows:
Press K~x` to store the solution vector into variable X
Press ƒ ƒ ƒ to clear three levels of the stack
Press K~a` to store the matrix into variable A
Now, let’s verify the solution by using: @@@A@@@ * @@@X@@@ `, which results in thevector [8.6917… -3.4109… -1.1301…], which is not equal to [15 5 22], theoriginal vector b. The “solution” is simply the point that is closest to the threelines represented by the three equations in the system, and not an exact
solution.

Least-square solution (function LSQ)
The LSQ function returns the minimum-norm least-square solution of a linear
system Ax = b, according to the following criteria:

Page 11-24

•

If A is a square matrix and A is non-singular (i.e., it’s inverse matrix
exist, or its determinant is non-zero), LSQ returns the exact solution to
the linear system.

•

If A has less than full row rank (underdetermined system of equations),
LSQ returns the solution with the minimum Euclidean length out of an
infinity number of solutions.

•

If A has less than full column rank (over-determined system of
equations), LSQ returns the "solution" with the minimum residual valuee = A⋅x – b. The system of equations may not have a solution,
therefore, the value returned is not a real solution to the system, just theone with the smallest residual.

Function LSQ takes as input vector b and matrix A, in that order. Function LSQ
can be found in Function catalog (‚N). Next, we use function LSQ torepeat the solutions found earlier with the numerical solver:
Square system
Consider the system
2x1 + 3x2 –5x3 = 13,
x1 – 3x2 + 8x3 = -13,
2x1 – 2x2 + 4x3 = -6,
with⎡ x1 ⎤⎡2 3 − 5⎤⎥⎢
A = ⎢1 − 3 8 ⎥, x = ⎢⎢ x2 ⎥⎥, and⎢⎣ x3 ⎥⎦⎢⎣2 − 2 4 ⎥⎦⎡ 13 ⎤b = ⎢⎢− 13⎥⎥.
⎢⎣ − 6 ⎥⎦The solution using LSQ is shown next:

Page 11-25

Under-determined system
Consider the system
2x1 + 3x2 –5x3 = -10,
x1 – 3x2 + 8x3 = 85,
with⎡ x1 ⎤⎡2 3 − 5⎤A=⎢, x = ⎢⎢ x 2 ⎥⎥, and⎥⎣1 − 3 8 ⎦⎢⎣ x3 ⎥⎦⎡− 10⎤b=⎢⎥.
⎣ 85 ⎦The solution using LSQ is shown next:Over-determined system
Consider the system
x1 + 3x2 = 15,
2x1 – 5x2 = 5,
-x1 + x2 = 22,
with

3⎤
⎡1
⎡x ⎤
⎢
A = ⎢ 2 − 5⎥⎥, x = ⎢ 1 ⎥, and⎣ x2 ⎦⎢⎣− 1 1 ⎥⎦⎡15 ⎤b = ⎢⎢ 5 ⎥⎥.
⎢⎣22⎥⎦The solution using LSQ is shown next:

Page 11-26

Compare these three solutions with the ones calculated with the numericalsolver.

Solution with the inverse matrix
The solution to the system A⋅x = b, where A is a square matrix is x = A-1⋅ b.
This results from multiplying the first equation by A-1, i.e., A-1⋅A⋅x = A-1⋅b. By
definition, A-1⋅A = I, thus we write I⋅x = A-1⋅b. Also, I⋅x = x, thus, we have, x= A-1⋅ b.
For the example used earlier, namely,
2x1 + 3x2 –5x3 = 13,
x1 – 3x2 + 8x3 = -13,
2x1 – 2x2 + 4x3 = -6,
we can find the solution in the calculator as follows:which is the same result found earlier.

Solution by “division” of matrices
While the operation of division is not defined for matrices, we can use thecalculator’s / key to “divide” vector b by matrix A to solve for x in the matrix
equation A⋅x = b. This is an arbitrary extension of the algebraic division
operation to matrices, i.e., from A⋅x = b, we dare to write x = b/A(Mathematicians would cringe if they see this!) This, of course is interpreted as(1/A)⋅b = A-1⋅b, which is the same as using the inverse of A as in the previous
section.

Page 11-27

The procedure for the case of “dividing” b by A is illustrated below for the case
2x1 + 3x2 –5x3 = 13,
x1 – 3x2 + 8x3 = -13,
2x1 – 2x2 + 4x3 = -6,
The procedure is shown in the following screen shots:

The same solution as found above with the inverse matrix.

Solving multiple set of equations with the same coefficient matrix
Suppose that you want to solve the following three sets of equations:
X +2Y+3Z = 14, 2X +4Y+6Z = 9,

2X +4Y+6Z = -2,

3X -2Y+ Z = 2, 3X -2Y+ Z = -5,

3X -2Y+ Z = 2,

4X +2Y -Z = 5, 4X +2Y -Z = 19,

4X +2Y -Z = 12.

We can write the three systems of equations as a single matrix equation: A⋅X= B, where⎡ X (1)3⎤⎡1 2⎢
A = ⎢⎢3 − 2 1 ⎥⎥, X = ⎢ Y(1)⎢ Z (1)⎢⎣4 2 − 1⎥⎦⎣

X ( 2)
Y( 2 )
Z ( 2)X ( 3) ⎤⎥Y( 3) ⎥,
Z ( 3) ⎥⎦⎡14 9 − 2⎤
B = ⎢⎢ 2 − 5 2 ⎥⎥.
⎢⎣ 5 19 12 ⎥⎦The sub-indices in the variable names X, Y, and Z, determine to which equation
system they refer to. To solve this expanded system we use the following
procedure, in RPN mode,

Page 11-28

[[14,9,-2],[2,-5,2],[5,19,12]] `[[1,2,3],[3,-2,1],[4,2,-1]] `/The result of this operation is:

2⎤
⎡1 2
⎢
X = ⎢2 5
1 ⎥⎥.
⎢⎣3 − 1 − 2⎥⎦

Gaussian and Gauss-Jordan elimination
Gaussian elimination is a procedure by which the square matrix of coefficients
belonging to a system of n linear equations in n unknowns is reduced to an
upper-triangular matrix (echelon form) through a series of row operations. This
procedure is known as forward elimination. The reduction of the coefficientmatrix to an upper-triangular form allows for the solution of all n unknowns,
utilizing only one equation at a time, in a procedure known as backward
substitution.
Example of Gaussian elimination using equations
To illustrate the Gaussian elimination procedure we will use the following systemof 3 equations in 3 unknowns:
2X +4Y+6Z = 14,
3X -2Y+ Z = -3,
4X +2Y -Z = -4.
We can store these equations in the calculator in variables E1, E2, and E3,
respectively, as shown below. For backup purposes, a list containing the threeequations was also created and stored into variable EQS. This way, if a
mistake is made, the equations will still be available to the user.

Page 11-29

To start the process of forward elimination, we divide the first equation (E1) by
2, and store it in E1, and show the three equations again to produce:

Next, we replace the second equation E2 by (equation 2 – 3×equation 1, i.e.,
E1-3×E2), and the third by (equation 3 – 4×equation 1), to get:

Next, divide the second equation by –8, to get:

Next, replace the third equation, E3, with (equation 3 + 6×equation 2, i.e.,
E2+6×E3), to get:Notice that when we perform a linear combination of equations the calculator
modifies the result to an expression on the left-hand side of the equal sign, i.e.,
Page 11-30

an expression = 0. Thus, the last set of equations is interpreted to be thefollowing equivalent set of equations:
X +2Y+3Z = 7,
Y+ Z = 3,-7Z = -14.
The process of backward substitution in Gaussian elimination consists in finding
the values of the unknowns, starting from the last equation and working
upwards. Thus, we solve for Z first:

Next, we substitute Z=2 into equation 2 (E2), and solve E2 for Y:

Next, we substitute Z=2 and Y = 1 into E1, and solve E1 for X:

The solution is, therefore, X = -1, Y = 1, Z = 2.
Example of Gaussian elimination using matrices
The system of equations used in the example above can be written as a matrix
equation A⋅x = b, if we use:

Page 11-31

6⎞
⎛2 4
⎡X ⎤
⎡ 14 ⎤⎜⎟⎢⎥A = ⎜ 3 − 2 1 ⎟, x = ⎢ Y ⎥, b = ⎢⎢ − 3⎥⎥.
⎜ 4 2 − 1⎟⎢⎣ Z ⎥⎦⎢⎣− 4⎥⎦⎝⎠
To obtain a solution to the system matrix equation using Gaussian elimination,
we first create what is known as the augmented matrix corresponding to A, i.e.,⎛2 4
6 14 ⎞⎜⎟
A aug = ⎜ 3 − 2 1 − 3 ⎟⎜ 4 2 −1 − 4⎟⎝⎠
The matrix Aaug is the same as the original matrix A with a new row,corresponding to the elements of the vector b, added (i.e., augmented) to theright of the rightmost column of A.
Once the augmented matrix is put together, we can proceed to perform row
operations on it that will reduce the original A matrix into an upper-triangularmatrix. For this exercise, we will use the RPN mode (H\@@OK@@), with system
flag 117 set to SOFT menu. In your calculator, use the following keystrokes.
First, enter the augmented matrix, and make an extra copy of the same in thestack (This step is not necessary, except as an insurance that you have an extra
copy of the augmented matrix saved in case you make a mistake in the forwardelimination procedure that we are about to undertake.):[[2,4,6,14],[3,-2,1,-3],[4,2,-1,-4]] ``Save augmented matrix in variable AAUG: ³~~aaug~ K
With a copy of the augmented matrix in the stack, press „´ @MATRX! @ROW! toactivate the ROW operation menu. Next, perform the following row operations
on your augmented matrix.
Multiply row 1 by ½: 2Y 1 @RCI!
Multiply row 1 by –3 add it to row 2, replacing it: 3\ # 1 #2
@RCIJ!
Multiply row 1 by –4 add it to row 3, replacing it: 4\#1#3@RCIJ!

Page 11-32

Multiply row 2 by –1/8: 8\Y2 @RCI!
Multiply row 2 by 6 add it to row 3, replacing it: 6#2#3 @RCIJ!
If you were performing these operations by hand, you would write thefollowing:⎛2 4
6 14 ⎞ ⎛ 1 2
3 7 ⎞
⎜
⎟ ⎜
⎟
A aug = ⎜ 3 − 2 1 − 3 ⎟ ≅ ⎜ 3 − 2 1 − 3 ⎟⎜ 4 2 −1 − 4⎟ ⎜ 4 2 −1 − 4⎟
⎝
⎠ ⎝
⎠
⎛1 2
3
7 ⎞ ⎛1 2
3
7 ⎞
⎜
⎟ ⎜
⎟
1
3 ⎟
A aug ≅ ⎜ 0 − 8 − 8 − 24 ⎟ ≅ ⎜ 0 1⎜ 0 − 6 − 13 − 32 ⎟ ⎜ 0 − 6 − 13 − 32 ⎟⎝⎠ ⎝⎠⎛1 2 3 7 ⎞⎜⎟A aug ≅ ⎜ 0 1 1 3 ⎟⎜ 0 0 − 7 − 14 ⎟⎝⎠The symbol ≅ (“ is equivalent to”) indicates that what follows is equivalent to theprevious matrix with some row (or column) operations involved.
The resulting matrix is upper-triangular, and equivalent to the set of equations
X +2Y+3Z = 7,
Y+ Z = 3,-7Z = -14,
which can now be solved, one equation at a time, by backward substitution, as
in the previous example.
Gauss-Jordan elimination using matrices
Gauss-Jordan elimination consists in continuing the row operations in the uppertriangular matrix resulting from the forward elimination process until an identity
matrix results in place of the original A matrix. For example, for the case wejust presented, we can continue the row operations as follows:

Page 11-33

Multiply row 3 by –1/7: 7\Y 3 @RCI!
Multiply row 3 by –1, add it to row 2, replacing it:

1\ # 3#2 @RCIJ!
Multiply row 3 by –3, add it to row 1, replacing it:
3\#3#1@RCIJ!
Multiply row 2 by –2, add it to row 1, replacing it: 2\#2#1@RCIJ!
Writing this process by hand will result in the following steps:⎛ 1 2 0 1 ⎞ ⎛ 1 0 0 − 1⎞⎜
⎟ ⎜⎟Aaug ≅ ⎜ 0 1 0 1 ⎟ ≅ ⎜ 0 1 0 1 ⎟.
⎜ 0 0 1 2⎟ ⎜ 0 0 1 2 ⎟⎝⎠ ⎝⎠Pivoting
If you look carefully at the row operations in the examples shown above, youwill notice that many of those operations divide a row by its corresponding
element in the main diagonal. This element is called a pivot element, or simply,
a pivot. In many situations it is possible that the pivot element become zero, in
which case we cannot divide the row by its pivot. Also, to improve thenumerical solution of a system of equations using Gaussian or Gauss-Jordan
elimination, it is recommended that the pivot be the element with the largest
absolute value in a given column. In such cases, we exchange rows before
performing row operations. This exchange of rows is called partial pivoting. To
follow this recommendation is it often necessary to exchange rows in theaugmented matrix while performing a Gaussian or Gauss-Jordan elimination.

Page 11-34

While performing pivoting in a matrix elimination procedure, you can improve
the numerical solution even more by selecting as the pivot the element with thelargest absolute value in the column and row of interest. This operation may
require exchanging not only rows, but also columns, in some pivoting
operations. When row and column exchanges are allowed in pivoting, theprocedure is known as full pivoting.
When exchanging rows and columns in partial or full pivoting, it is necessary tokeep track of the exchanges because the order of the unknowns in the solutionis altered by those exchanges. One way to keep track of column exchanges inpartial or full pivoting mode, is to create a permutation matrix P = In×n, at the
beginning of the procedure. Any row or column exchange required in theaugmented matrix Aaug is also registered as a row or column exchange,
respectively, in the permutation matrix. When the solution is achieved, then,we multiply the permutation matrix by the unknown vector x to obtain the orderof the unknowns in the solution. In other words, the final solution is given byP⋅x = b’, where b’ is the last column of the augmented matrix after the solution
has been found.
Example of Gauss-Jordan elimination with full pivoting
Let’s illustrate full pivoting with an example.

Solve the following system of

equations using full pivoting and the Gauss-Jordan elimination procedure:X + 2Y + 3Z = 2,
2X +3Z = -1,

8X +16Y- Z = 41.
The augmented matrix and the permutation matrix are as follows:2⎤⎡1 0 0 ⎤⎡1 2 3⎥⎢A aug = ⎢2 0 3 − 1⎥, P = ⎢⎢0 1 0⎥⎥.
⎢⎣0 0 1⎥⎦⎢⎣8 16 − 1 41⎥⎦
Store the augmented matrix in variable AAUG, then press ‚ @AAUG to get a
copy in the stack. We want to keep the CSWP (Column Swap) command
readily available, for which we use: ‚N~~cs~ (find CSWP),@@OK@@. You’ll get an error message, press $, and ignore the message.
Next, get the ROW menu available by pressing: „Ø @)CREAT @)@ROW@.

Page 11-35

Now we are ready to start the Gauss-Jordan elimination with full pivoting. We
will need to keep track of the permutation matrix by hand, so take yournotebook and write the P matrix shown above.
First, we check the pivot a11. We notice that the element with the largest
absolute value in the first row and first column is the value of a31 = 8. Since wewant this number to be the pivot, then we exchange rows 1 and 3, by using:
1#3L @RSWP. The augmented matrix and the permutation matrix
now are:
8
2
1

16
0
2

-1
3
3

41
-1
2

0 0 1
0 1 0
1 0 0

Checking the pivot at position (1,1) we now find that 16 is a better pivot than
8, thus, we perform a column swap as follows: 1#2‚N @@OK@@@RSWP. The augmented matrix and the permutation matrix now are:
16
0
2

8
2
1

-1
3
3

41
-1
2

0 0 1
1 0 0
0 1 0

Now we have the largest possible value in position (1,1), i.e., we performed
full pivoting at (1,1). Next, we proceed to divide by the pivot:
16Y1L @RCI@ . The permutation matrix does not change, but theaugmented matrix is now:1
0
2

1/2 -1/16 41/16
2
3
-1
1
3
2

0 0 1
1 0 0
0 1 0

The next step is to eliminate the 2 from position (3,2) by using:2\#1#3@RCIJ
100

1/2 -1/16 41/16
2
3-1
0
25/8 -25/8

0
1
0

0
0
1

1
0
0

Page 11-36

Having filled up with zeros the elements of column 1 below the pivot, now weproceed to check the pivot at position (2,2). We find that the number 3 inposition (2,3) will be a better pivot, thus, we exchange columns 2 and 3 byusing: 2#3 ‚N@@@OK@@
1
0
0

-1/16
3
25/8

1/2 41/16
2
-1
0
-25/8

0
1
0

1 0
0 0
0 1

Checking the pivot at position (2,2), we now find that the value of 25/8, atposition (3,2), is larger than 3. Thus, we exchange rows 2 and 3 by using:2#3 L@RSWP
1
0
0

-1/16
25/8
3

1/2 41/16
0
-25/8
2
-1

0
0
1

1
0
0

0
1
0

Now, we are ready to divide row 2 by the pivot 25/8, by using³ 8/25™#2 L @RCI
100

-1/16 1/2
1
0
3
2

41/16
-1
-1

0 1 0
0 0 1
1 0 0

Next, we eliminate the 3 from position (3,2) by using:3\#2#3@RCIJ
1
00-1/16 1/2
1
0
0
2

41/16
-1
2

0 1
0 0
1 0

0
1
0

Having filled with zeroes the position below the pivot, we proceed to check thepivot at position (3,3). The current value of 2 is larger than ½ or 0, thus, we
keep it unchanged. We do divide the whole third row by 2 to convert the pivot
to 1, by using: 2Y3@RCI
1
00-1/16 1/2
1
0
0
1

41/16
-1
1

0 1 0
0 0 1
1 0 0

Next, we proceed to eliminate the ½ in position (1,3) by using:Page 11-37

2 Y \#3#1@RCIJ
1
0
0

-1/16
1
0

0
0
1

33/16
-1
1

0
0
1

1
0
0

0
1
0

Finally, we eliminate the –1/16 from position (1,2) by using:
16 Y # 2#1@RCIJ
1
0
0

0
1
0

0
0
1

2
-1
1

0 1 0
0 0 1
1 0 0

We now have an identity matrix in the portion of the augmented matrix
corresponding to the original coefficient matrix A, thus we can proceed toobtain the solution while accounting for the row and column exchanges codedin the permutation matrix P. We identify the unknown vector x, the modified
independent vector b’ and the permutation matrix P as:⎡0 1 0 ⎤
⎡X ⎤
⎡2⎤
⎥
⎥
⎢
⎢
x = ⎢ Y ⎥, b' = ⎢− 1⎥, P = ⎢⎢0 0 1⎥⎥.
⎢⎣1 0 0⎥⎦⎢⎣ Z ⎥⎦⎢⎣ 1 ⎥⎦The solution is given by P⋅x=b’, or⎡0 1 0 ⎤ ⎡ X ⎤ ⎡ 3 ⎤⎢0 0 1⎥ ⋅ ⎢ Y ⎥ = ⎢− 1⎥.
⎥ ⎢ ⎥ ⎢ ⎥⎢⎢⎣1 0 0⎥⎦ ⎢⎣ Z ⎥⎦ ⎢⎣ 1 ⎥⎦Which results in⎡Y ⎤ ⎡ 3 ⎤⎢ Z ⎥ = ⎢− 1⎥.
⎢ ⎥ ⎢ ⎥⎢⎣ X ⎥⎦ ⎢⎣ 1 ⎥⎦Step-by-step calculator procedure for solving linear systems
The example we just worked is, of course, the step-by-step, user-driven
procedure to use full pivoting for Gauss-Jordan elimination solution of linear
equation systems. You can see the step-by-step procedure used by thecalculator to solve a system of equations, without user intervention, by setting
the step-by-step option in the calculator’s CAS, as follows:

Page 11-38

Then, for this particular example, in RPN mode, use:
[2,-1,41] ` [[1,2,3],[2,0,3],[8,16,-1]] `/The calculator shows an augmented matrix consisting of the coefficients matrix
A and the identity matrix I, while, at the same time, showing the next procedure
to calculate:

L2 = L2-2⋅L1 stands for “replace row 2 (L2) with the operation L2 – 2⋅L1. If we
had done this operation by hand, it would have corresponded to:
2\#1#1@RCIJ. Press @@@OK@@@, and follow the operations in yourcalculator’s screen. You will see the following operations performed:
L3=L3-8⋅L1, L1 = 2⋅L1--1⋅L2, L1=25⋅L1--3⋅L3, L2 = 25⋅L2-3⋅L3,
and finally a message indicating “Reduction result” showing:

When you press @@@OK@@@ , the calculator returns the final result [1 2 –1].
Calculating the inverse matrix step-by-step
The calculation of an inverse matrix can be considered as calculating thesolution to the augmented system [A | I ]. For example, for the matrix A usedin the previous example, we would write this augmented matrix as

Page 11-39

⎡1 2
3 1 0 0⎤⎢⎥A aug ( I ) = ⎢3 − 2 1 0 1 0⎥.
⎢⎣4 2 − 1 0 0 1⎥⎦
To see the intermediate steps in calculating and inverse, just enter the matrix A
from above, and press Y, while keeping the step-by-step option active in thecalculator’s CAS. Use the following:[[ 1,2,3],[3,-2,1],[4,2,-1]] `Y
After going through the different steps, the solution returned is:What the calculator showed was not exactly a Gauss-Jordan elimination withfull pivoting, but a way to calculate the inverse of a matrix by performing a
Gauss-Jordan elimination, without pivoting. This procedure for calculating theinverse is based on the augmented matrix (Aaug)n×n = [A n×n |In×n].
The calculator showed you the steps up to the point in which the left-hand halfof the augmented matrix has been converted to a diagonal matrix. From there,
the final step is to divide each row by the corresponding main diagonal pivot.
In other words, the calculator has transformed (Aaug)n×n = [A n×n |In×n], into [I|A-1].
Inverse matrices and determinants
Notice that all the elements in the inverse matrix calculated above are divided
by the value 56 or one of its factors (28, 7, 8, 4 or 1). If you calculate thedeterminant of the matrix A, you get det(A) = 56.
We could write, A-1 = C/det(A), where C is the matrix

8
8⎤
⎡0
⎢
C = ⎢ 7 − 13 8 ⎥⎥.
⎢⎣14 6 − 8⎥⎦Page 11-40

The result (A-1)n×n = C n×n /det(A n×n), is a general result that applies to any
non-singular matrix A. A general form for the elements of C can be written
based on the Gauss-Jordan algorithm.
Based on the equation A-1 = C/det(A), sketched above, the inverse matrix,
A-1, is not defined if det(A) = 0. Thus, the condition det(A) = 0 defines also a
singular matrix.

Solution to linear systems using calculator functions
The simplest way to solve a system of linear equations, A⋅x = b, in thecalculator is to enter b, enter A, and then use the division function /. If thesystem of linear equations is over-determined or under-determined, a “solution”
can be produced by using Function LSQ (Least-SQuares), as shown earlier. The
calculator, however, offers other possibilities for solving linear systems ofequations by using Functions included in the MATRICES’ LINEAR SYSTEMS..
menu accessible through „Ø(Set system flag 117 to CHOOSE boxes):

The functions included are LINSOLVE, REF, rref, RREF, and SYST2MAT.
Function LINSOLVE
Function LINSOLVE takes as arguments an array of equations and a vector
containing the names of the unknowns, and produces the solution to the linear
system. The following screens show the help-facility entry (see Chapter 1) for
function LINSOLVE, and the corresponding example listed in the entry. The
right-hand side screen shows the result using the line editor (press ˜ toactivate):

Here is another example in ALG mode. Enter the following:
Page 11-41

LINSOLVE([X-2*Y+Z=-8,2*X+Y-2*Z=6,5*X-2*Y+Z=-12],[X,Y,Z])
to produce the solution: [X=-1,Y=2,Z = -3].
Function LINSOLVE works with symbolic expressions. Functions REF, rref, andRREF, work with the augmented matrix in a Gaussian elimination approach.
Functions REF, rref, RREF
The upper triangular form to which the augmented matrix is reduced during theforward elimination part of a Gaussian elimination procedure is known as an"echelon" form. Function REF (Reduce to Echelon Form) produces such a matrix
given the augmented matrix in stack level 1.
Consider the augmented matrix,⎡1 − 2 1 0 ⎤⎢⎥A aug = ⎢2 1 − 2 − 3⎥.
⎢⎣5 − 2 1 12 ⎥⎦Representing a linear system of equations, A⋅x = b, whereA = [[1,-2,1],[2,1,-2],[5,-2,1]],andb = [[0],[-3],[12]].
Enter the augmented matrix, and save it into variable AAUG, in ALG mode:[[1,-2,1,0],[2,1,-2,-3][5,-2,1,12]] 

UGApplication of function REF produces:

The result is the upper triangular (echelon form) matrix of coefficients resulting
from the forward elimination step in a Gaussian elimination procedure.

Page 11-42

The diagonal matrix that results from a Gauss-Jordan elimination is called arow-reduced echelon form. Function RREF ( Row-Reduced Echelon Form) The
result of this function call is to produce the row-reduced echelon form so that thematrix of coefficients is reduced to an identity matrix. The extra column in theaugmented matrix will contain the solution to the system of equations.
As an example, we show the result of applying function RREF to matrix AAUG
in ALG mode:

The result is final augmented matrix resulting from a Gauss-Jordan elimination
without pivoting.
A row-reduced echelon form for an augmented matrix can be obtained byusing function rref. This function produces a list of the pivots and an equivalentmatrix in row-reduced echelon form so that the matrix of coefficients is reduced
to a diagonal matrix.
For example, for matrix AAUG, function rref produces the following result:

The second screen above is obtained by activating the line editor (press ˜).
The result shows pivots of 3, 1, 4, 1, 5, and 2, and a reduced diagonal matrix.
Function SYST2MATThis function converts a system of linear equations into its augmented matrix
equivalent. The following example is available in the help facility of thecalculator:

Page 11-43

The result is the augmented matrix corresponding to the system of equations:
X+Y = 0
X-Y =2

Residual errors in linear system solutions (Function RSD)
Function RSD calculates the ReSiDuals or errors in the solution of the matrix
equation A⋅x=b, representing a system of n linear equations in n unknowns.
We can think of solving this system as solving the matrix equation: f(x) = b -A⋅x
= 0. Suppose that, through a numerical method, we produce as a first
approximation the solution x(0). Evaluating f(x(0)) = b - A⋅x(0) = e ≠ 0. Thus,
e is a vector of residuals of Function for the vector x = x (0).
To use Function RSD you need the terms b, A, and x(0), as arguments. The
vector returned is e = b - A⋅x(0). For example, using A = [[2,1][0,2]], x(0) = [1.8,2.7], and b = [1,6], we can find the vectorof residuals as follows:

The result is e = b - A⋅x(0) = [ 0.1 0.6 ].
Note: If we let the vector Δx = x – x (0), represent the correction in thevalues of x (0), we can write a new matrix equation for Δx, namely A⋅Δx = e.
Solving for Δx we can find the actual solution of the original system as x =x(0) + Δx.

Page 11-44

Eigenvalues and eigenvectors
Given a square matrix A, we can write the eigenvalue equation A⋅x = λ⋅x,where the values of λ that satisfy the equation are known as the eigenvalues ofmatrix A. For each value of λ, we can find, from the same equation, values ofx that satisfy the eigenvalue equation. These values of x are known as the
eigenvectors of matrix A. The eigenvalues equation can be written also as (A– λ⋅I)x = 0.
This equation will have a non-trivial solution only if the matrix (A – λ⋅I) is
singular, i.e., if det(A – λ⋅I) = 0.
The last equation generates an algebraic equation involving a polynomial oforder n for a square matrix An×n. The resulting equation is known as thecharacteristic polynomial of matrix A. Solving the characteristic polynomial
produces the eigenvalues of the matrix.
The calculator provides a number of functions that provide information
regarding the eigenvalues and eigenvectors of a square matrix. Some of thesefunctions are located under the menu MATRICES/EIGEN activated through„Ø.

Function PCAR
Function PCAR generates the characteristic polynomial of a square matrix using
the contents of variable VX (a CAS reserved variable, typically equal to ‘X’) as
the unknown in the polynomial. For example, enter the following matrix in ALG
mode and find the characteristic equation using PCAR:[[1,5,-3],[2,-1,4],[3,5,2]]

Page 11-45

Using the variable λ to represent eigenvalues, this characteristic polynomial is to
be interpreted as
λ 3-2λ 2-22λ +21=0.

Function EGVL
Function EGVL (EiGenVaLues) produces the eigenvalues of a square matrix. For
example, the eigenvalues of the matrix shown below are calculated in ALG
mode using function EGVL:The eigenvalues λ = [ -√10, √10 ].
Note: In some cases, you may not be able to find an ‘exact’ solution to thecharacteristic polynomial, and you will get an empty list as a result when using
Function EGVL. If that were to happen to you, change the calculation mode to
Approx in the CAS, and repeat the calculation.
For example, in exact mode, the following exercise produces an empty list as
the solution:

Change mode to Approx and repeat the entry, to get the following eigenvalues:[(1.38,2.22), (1.38,-2.22), (-1.76,0)].

Function EGV
Function EGV (EiGenValues and eigenvectors) produces the eigenvalues andeigenvectors of a square matrix. The eigenvectors are returned as the columns

Page 11-46

of a matrix, while the corresponding eigenvalues are the components of avector.
For example, in ALG mode, the eigenvectors and eigenvalues of the matrix
listed below are found by applying function EGV:The result shows the eigenvalues as the columns of the matrix in the result list.
To see the eigenvalues we can use: GET(ANS(1),2), i.e., get the second
element in the list in the previous result. The eigenvalues are:In summary,
λ1 = 0.29, x1 = [ 1.00,0.79,–0.91]T,
λ2 = 3.16, x2 = [1.00,-0.51, 0.65] T,
λ3 = 7.54, x1 = [-0.03, 1.00, 0.84] T.
Note: A symmetric matrix produces all real eigenvalues, and its eigenvectors
are mutually perpendicular. For the example just worked out, you can checkthat x1 •x2 = 0, x1 •x3 = 0, and x2 •x3 = 0.

Function JORDAN
Function JORDAN is intended to produce the diagonalization or Jordan-cycle
decomposition of a matrix. In RPN mode, given a square matrix A, function
JORDAN produces four outputs, namely:•

The minimum polynomial of matrix A (stack level 4)•

The characteristic polynomial of matrix A (stack level 3)

Page 11-47

•

A list with the eigenvectors corresponding to each eigenvalue of matrix
A (stack level 2)•

A vector with the eigenvectors of matrix A (stack level 4)

For example, try this exercise in RPN mode:[[4,1,-2],[1,2,-1],[-2,-1,0]]

JORD NThe output is the following:
4: ‘X^3+-6*x^2+2*X+8’
3: ‘X^3+-6*x^2+2*X+8’
2: { }
1: { }The same exercise, in ALG mode, looks as in the following screen shots:

Function MAD
This function, although not available in the EIGEN menu, also provides
information related to the eigenvalues of a matrix. Function MAD is available
through the MATRICES OPERATIONS sub-menu („Ø) and is intended to
produce the adjoint matrix of a matrix.
In RPN mode, function MAD generates a number of properties of a squarematrix, namely:•

the determinant (stack level 4)•

the formal inverse (stack level 3),•

in stack level 2, the matrix coefficients of the polynomial p(x) definedby (x⋅I-A) ⋅p(x)=m(x)⋅I,•

the characteristic polynomial of the matrix (stack level 1)

Page 11-48

Notice that the equation (x⋅I-A)⋅p(x)=m(x)⋅I is similar, in form, to theeigenvalue equation A⋅x = λ⋅x.
As an example, in RPN mode, try:[[4,1,-2] [1,2,-1][-2,-1,0]] M D
The result is:
4: -8.
3: [[ 0.13 –0.25 –0.38][-0.25 0.50 –0.25][-0.38 –0.25 –0.88]]
2: {[[1 0 0][0 1 0][0 0 1]] [[ -2 1 –2][1 –4 –1][-2 –1 –6] [[-1 2 3][2 –4 2][3 2 7]]}
1: ‘X^3+-6*x^2+2*X+8’

The same exercise, in ALG mode, will look as follows:

Matrix factorization
Matrix factorization or decomposition consists of obtaining matrices that when
multiplied result in a given matrix. We present matrix decomposition throughthe use of Functions contained in the matrix FACT menu. This menu is accessed
through „Ø.

Function contained in this menu are: LQ, LU, QR,SCHUR, SVD, SVL.

Page 11-49

Function LU
Function LU takes as input a square matrix A, and returns a lower-triangularmatrix L, an upper triangular matrix U, and a permutation matrix P, in stacklevels 3, 2, and 1, respectively. The results L, U, and P, satisfy the equationP⋅A = L⋅U. When you call the LU function, the calculator performs a Crout LU
decomposition of A using partial pivoting.
For example, in RPN mode: [[-1,2,5][3,1,-2][7,6,5]] LU
produces:
3:[[7 0 0][-1 2.86 0][3 –1.57 –1]
2: [[1 0.86 0.71][0 1 2][0 0 1]]
1: [[0 0 1][1 0 0][0 1 0]]
In ALG mode, the same exercise will be shown as follows:

Orthogonal matrices and singular value decomposition
A square matrix is said to be orthogonal if its columns represent unit vectors thatare mutually orthogonal. Thus, if we let matrix U = [v1 v2 … vn] where the vi,
i = 1, 2, …, n, are column vectors, and if vi•vj = δij, where δij is the Kronecker’s
delta function, then U will be an orthogonal matrix. This conditions also imply
that U⋅ UT = I.
The Singular Value Decomposition (SVD) of a rectangular matrix Am×n consists indetermining the matrices U, S, and V, such that Am×n = U m×m ⋅S m×n ⋅V T n×n,
where U and V are orthogonal matrices, and S is a diagonal matrix. The
diagonal elements of S are called the singular values of A and are usuallyordered so that si ≥ si+1, for i = 1, 2, …, n-1. The columns [uj] of U and [vj] of
V are the corresponding singular vectors.

Function SVD
In RPN, function SVD (Singular Value Decomposition) takes as input a matrix
An×m, and returns the matrices Un×n, Vm×m, and a vector s in stack levels 3, 2,
and 1, respectively. The dimension of vector s is equal to the minimum of thevalues n and m. The matrices U and V are as defined earlier for singular value
Page 11-50

decomposition, while the vector s represents the main diagonal of the matrix S
used earlier.
For example, in RPN mode: [[5,4,-1],[2,-3,5],[7,2,8]] SVD
3: [[-0.27 0.81 –0.53][-0.37 –0.59 –0.72][-0.89 3.09E-3 0.46]]
2: [[ -0.68 –0.14 –0.72][ 0.42 0.73 –0.54][-0.60 0.67 0.44]]
1: [ 12.15 6.88 1.42]

Function SVL
Function SVL (Singular VaLues) returns the singular values of a matrix An×m as avector s whose dimension is equal to the minimum of the values n and m. For
example, in RPN mode, [[5,4,-1],[2,-3,5],[7,2,8]] SVL
produces [ 12.15 6.88 1.42].

Function SCHUR
In RPN mode, function SCHUR produces the Schur decomposition of a squarematrix A returning matrices Q and T, in stack levels 2 and 1, respectively, suchthat A = Q⋅T⋅QT, where Q is an orthogonal matrix, and T is a triangularmatrix. For example, in RPN mode,[[2,3,-1][5,4,-2][7,5,4]] SCHUR
results in:
2: [[0.66 –0.29 –0.70][-0.73 –0.01 –0.68][ -0.19 –0.96 0.21]]
1: [[-1.03 1.02 3.86 ][ 0 5.52 8.23 ][ 0 –1.82 5.52]]

Function LQ
The LQ function produces the LQ factorization of a matrix An×m returning alower Ln×m trapezoidal matrix, a Qm×m orthogonal matrix, and a Pn×n
permutation matrix, in stack levels 3, 2, and 1. The matrices A, L, Q and P
are related by P⋅A = L⋅Q. (A trapezoidal matrix out of an n×m matrix is theequivalent of a triangular matrix out of an n×n matrix). For example,[[ 1, -2, 1][ 2, 1, -2][ 5, -2, 1]] LQ
produces
3: [[-5.48 0 0][-1.10 –2.79 0][-1.83 1.43 0.78]]
2: [[-0.91 0.37 -0.18] [-0.36 -0.50 0.79] [-0.20 -0.78 -0.59]]
1: [[0 0 1][0 1 0][1 0 0]]

Page 11-51

Function QR
In RPN, function QR produces the QR factorization of a matrix An×m returning a
Qn×n orthogonal matrix, a Rn×m upper trapezoidal matrix, and a Pm×m
permutation matrix, in stack levels 3, 2, and 1. The matrices A, P, Q and R are
related by A⋅P = Q⋅R. For example, [[ 1,-2,1][ 2,1,-2][ 5,2,1]] QR
produces
3: [[-0.18 0.39 0.90][-0.37 –0.88 0.30][-0.91 0.28 –0.30]]
2: [[ -5.48 –0.37 1.83][ 0 2.42 –2.20][0 0 –0.90]]
1: [[1 0 0][0 0 1][0 1 0]]

Note: Examples and definitions for all functions in this menu are available
through the help facility in the calculator. Try these exercises in ALG mode to
see the results in that mode.

Matrix Quadratic Forms
A quadratic form from a square matrix A is a polynomial expression originatedfrom x⋅A⋅xT. For example, if we use A = [[2,1,–1][5,4,2][3,5,–1]], and x =[X Y Z]T, the corresponding quadratic form is calculated asx ⋅ A ⋅ x = [XT

= [XFinally,YY⎡2 1 − 1⎤ ⎡ X ⎤Z ] ⋅ ⎢⎢5 4 2 ⎥⎥ ⋅ ⎢⎢ Y ⎥⎥⎢⎣3 5 − 1⎥⎦ ⎢⎣ Z ⎥⎦⎡ 2X + Y − Z ⎤Z ] ⋅ ⎢⎢5 X + 4Y + 2 Z ⎥⎥⎢⎣ 3 X + 5Y − Z ⎥⎦x⋅A⋅xT = 2X2+4Y2-Z2+6XY+2XZ+7ZY

The QUADF menu
The calculator provides the QUADF menu for operations related to QUADratic
Forms. The QUADF menu is accessed through „Ø.

Page 11-52

This menu includes functions AXQ, CHOLESKY, GAUSS, QXA, and SYLVESTER.

Function AXQ
In RPN mode, function AXQ produces the quadratic form corresponding to amatrix An×n in stack level 2 using the n variables in a vector placed in stacklevel 1. Function returns the quadratic form in stack level 1 and the vector ofvariables in stack level 1. For example,[[2,1,-1],[5,4,2],[3,5,-1]] `['X','Y','Z'] ` XQ
returns
2: ‘2*X^2+(6*Y+2*Z)*X+4*Y^2+7*Z*y-Z^2’
1: [‘X’ ‘Y’ ‘Z’]

Function QXAFunction QXA takes as arguments a quadratic form in stack level 2 and a vectorof variables in stack level 1, returning the square matrix A from which thequadratic form is derived in stack level 2, and the list of variables in stack level
1. For example,'X^2+Y^2-Z^2+4*X*Y-16*X*Z' `['X','Y','Z'] ` QX
returns
2: [[1 2 –8][2 1 0][-8 0 –1]]
1: [‘X’ ‘Y’ ‘Z’]

Diagonal representation of a quadratic form
Given a symmetric square matrix A, it is possible to “diagonalize” the matrix A
by finding an orthogonal matrix P such that PT⋅A⋅P = D, where D is a diagonal
matrix. If Q = x⋅A⋅xT is a quadratic form based on A, it is possible to write
the quadratic form Q so that it only contains square terms from a variable y,Page 11-53

such that x = P⋅y, by using Q = x⋅A⋅xT = (P⋅y)⋅A⋅ (P⋅y)T = y⋅(PT⋅A⋅P)⋅yT =y⋅D⋅yT.

Function SYLVESTER
Function SYLVESTER takes as argument a symmetric square matrix A and returns
a vector containing the diagonal terms of a diagonal matrix D, and a matrix P,
so that PT⋅A⋅P = D. For example:[[2,1,-1],[1,4,2],[-1,2,-1]] SYLVESTER
produces
2: [ 1/2 2/7 -23/7]
1: [[2 1 –1][0 7/2 5/2][0 0 1]]

Function GAUSSFunction GAUSS returns the diagonal representation of a quadratic form Q =x⋅A⋅xT taking as arguments the quadratic form in stack level 2 and the vectorof variables in stack level 1. The result of this function call is the following:•

An array of coefficients representing the diagonal terms of D (stacklevel 4)•A matrix P such that A = PT⋅D⋅P (stack level 3)•

The diagonalized quadratic form (stack level 2)• The list of variables (stack level 1)
For example:'X^2+Y^2-Z^2+4*X*Y-16*X*Z' `['X','Y','Z'] ` G USS
returns
4: [1 –0.333 20.333]
3: [[1 2 –8][0 –3 16][0 0 1]]
2: ’61/3*Z^2+ -1/3*(16*Z+-3*Y)^2+(-8*z+2*Y+X)^2‘
1: [‘X’ ‘Y’ ‘Z’]

Linear Applications
The LINEAR APPLICATIONS menu is available through the „Ø.

Page 11-54

Information on the functions listed in this menu is presented below by using the
calculator’s own help facility. The figures show the help facility entry and theattached examples.

Function IMAGE

Function ISOM

Page 11-55

Function KER

Function MKISOM

Page 11-56

Chapter 12
Graphics
In this chapter we introduce some of the graphics capabilities of the calculator.
We will present graphics of functions in Cartesian coordinates and polar
coordinates, parametric plots, graphics of conics, bar plots, scatterplots, and avariety of three-dimensional graphs.

Graphs options in the calculator
To access the list of graphic formats available in the calculator, use the keystroke
sequence „ô(D) Please notice that if you are using the RPN modethese two keys must be pressed simultaneously to activate any of the graphfunctions. After activating the 2D/3D function, the calculator will produce the
PLOT SETUP window, which includes the TYPE field as illustrated below.

Right in front of the TYPE field you will, most likely, see the option Function
highlighted. This is the default type of graph for the calculator. To see the listof available graph types, press the soft menu key labeled @CHOOS. This willproduce a drop down menu with the following options (use the up- and downarrow keys to see all the options):

Page 12-1

These graph options are described briefly next.
Function: for equations of the form y = f(x) in plane Cartesian coordinates
Polar: for equations of the from r = f(θ) in polar coordinates in the plane
Parametric: for plotting equations of the form x = x(t), y = y(t) in the plane
Diff Eq: for plotting the numerical solution of a linear differential equation
Conic: for plotting conic equations (circles, ellipses, hyperbolas, parabolas)
Truth: for plotting inequalities in the plane
Histogram: for plotting frequency histograms (statistical applications)
Bar: for plotting simple bar charts
Scatter: for plotting scatter plots of discrete data sets (statistical applications)
Slopefield: for plotting traces of the slopes of a function f(x,y) = 0.
Fast3D: for plotting curved surfaces in space
Wireframe: for plotting curved surfaces in space showing wireframe grids
Ps-Contour: for plotting contour plots of surfaces
Y- Slice: for plotting a slicing view of a function f(x,y).
Gridmap: for plotting real and imaginary part traces of a complex function
Pr-Surface: for parametric surfaces given by x = x(u,v), y = y(u,v), z = z(u,v).

Plotting an expression of the form y = f(x)In this section we present an example of a plot of a function of the form y = f(x).
In order to proceed with the plot, first, purge the variable x, if it is defined in thecurrent directory (x will be the independent variable in the calculator's PLOT
feature, therefore, you don't want to have it pre-defined). Create a subdirectory called 'TPLOT' (for test plot), or other meaningful name, to perform thefollowing exercise.
As an example, let's plot the function,f ( x) =
Θ

1
2π

exp(−

x2
)
2

First, enter the PLOT SETUP environment by pressing, „ô. Make
sure that the option Function is selected as the TYPE, and that ‘X’ isselected as the independent variable (INDEP). Press L@@@OK@@@ toreturn to normal calculator display. The PLOT SET UP window shouldlook similar to this:Page 12-2

ΘNote: You will notice that a new variable, called PPAR, shows up in yoursoft menu key labels. This stands for Plot PARameters. To see its contents,press ‚@PPAR. A detailed explanation of the contents of PPAR isprovided later in this Chapter. Press ƒ to drop this line from the stack.
ΘEnter the PLOT environment by pressing „ñ(press themsimultaneously if in RPN mode). Press @ADD to get you into the equation
writer. You will be prompted to fill the right-hand side of an equation
Y1(x) = . Type the function to be plotted so that the Equation Writer
shows the following:ΘPress ` to return to the PLOT - FUNCTION window. The expression‘Y1(X) = EXP(-X^2/2)/√(2*π)’ will be highlighted. Press L@@@OK@@@ toreturn to normal calculator display.

Note: Two new variables show up in your soft menu key labels, namely EQ
and Y1. To see the contents of EQ, use ‚@@@EQ@@. The content of EQ issimply the function name ‘Y1(X)’. The variable EQ is used by the calculator
to store the equation, or equations, to plot.
To see the contents of Y1 press ‚@@@Y1@@. You will get the function Y1(X)
defined as the program:

Page 12-3

<< →X ‘EXP(-X^2/2)/ √(2*π)‘ >>.
Press ƒ, twice, to drop the contents of the stack.
Θ Enter the PLOT WINDOW environment by entering „ò (press
them simultaneously if in RPN mode). Use a range of –4 to 4 for HVIEW, then press @AUTO to generate the V-VIEW automatically. The
PLOT WINDOW screen looks as follows:

Θ
Θ
Θ
Θ

Plot the graph: @ERASE @DRAW (wait till the calculator finishes the graphs)
To see labels:@EDIT L @LABEL @MENU
To recover the first graphics menu: LL@)PICT
To trace the curve: @TRACE @@X,Y@@ . Then use the right- and left-arrow keys
(š™) to move about the curve. The coordinates of the points you
trace will be shown at the bottom of the screen. Check that for x =1.05 , y = 0.231. Also, check that for x = -1.48 , y = 0.134. Here is
picture of the graph in tracing mode:ΘTo recover the menu, and return to the PLOT WINDOW environment,press L@CANCL@.

Page 12-4

Some useful PLOT operations for FUNCTION plots
In order to discuss these PLOT options, we'll modify the function to force it tohave some real roots (Since the current curve is totally contained above the xaxis, it has no real roots.) Press ‚@@@Y1@@ to list the contents of the function Y1
on the stack: << →X ‘EXP(-X^2/2)/ √(2*π) ‘ >>. To edit this expression use:
˜

Launches the line editor‚˜

Moves cursor to the end of the lineššš-0.1

Modifies the expression`

Returns to calculator display

Next, store the modified expression into variable y by using „@@@Y1@@ if in RPNmode, or „îK @@@Y1@@ in ALG mode.

The function to be plotted is now, f ( x ) =

1
2π

exp(−

x2
) − 0.1
2Enter the PLOT WINDOW environment by entering „ò(press themsimultaneously if in RPN mode.) Keep the range of –4 to 4 for H-VIEW, press
˜@AUTO to generate the V-VIEW. To plot the graph, press @ERASE @DRAWΘΘΘ

Once the graph is plotted, press @)@FCN! to access the function menu.
With this menu you can obtain additional information about the plot
such as intersects with the x-axis, roots, slopes of the tangent line, area
under the curve, etc.
For example, to find the root on the left side of the curve, move thecursor near that point, and press @ROOT. You will get the result: ROOT: 1.6635…. Press L to recover the menu. Here is the result of
ROOT in the current plot:

If you move the cursor towards the right-hand side of the curve, bypressing the right-arrow key (™), and press @ROOT, the result now isPage 12-5

Θ

Θ
Θ
Θ

Θ

Θ

Θ

Θ
Θ

ROOT: 1.6635... The calculator indicated, before showing the root,that it was found through SIGN REVERSAL. Press L to recover themenu.
Pressing @ISECT will give you the intersection of the curve with the x-axis,
which is essentially the root. Place the cursor exactly at the root andpress @ISECT. You will get the same message as before, namely SIGNREVERSAL, before getting the result I-SECT: 1.6635…. The @ISECT
function is intended to determine the intersection of any two curves
closest to the location of the cursor. In this case, where only one curve,
namely, Y1(X), is involved, the intersection sought is that of f(x) with thex-axis, however, you must place the cursor right at the root to produce
the same result. Press L to recover the menu.
Place the cursor on the curve at any point and press @SLOPE to get thevalue of the slope at that point. For example, at the negative root,
SLOPE: 0.16670…. Press L to recover the menu.
To determine the highest point in the curve, place the cursor near thevertex and press @EXTR The result is EXTRM: 0.. Press L to recover
the menu.
Other buttons available in the first menu are @AREA to calculate the area
under the curve, and @SHADE to shade an area under the curve. Press
L to see more options. The second menu includes one button called@VIEW that flashes for a few seconds the equation plotted. Press @VIEW.
Alternatively, you can press the button @NEXQ (NEXt eQuation) to see thename of the function Y1(x). Press L to recover the menu.
The button
gives the value of f(x) corresponding to the cursor
position. Place the cursor anywhere in the curve and press. The
value will be shown in the lower left corner of the display. Press L
to recover the menu.
Place the cursor in any given point of the trajectory and press TANL toobtain the equation of the tangent line to the curve at that point. The
equation will be displayed on the lower left corner of the display. Press
L to recover the menu.
If you press
the calculator will plot the derivative function, f'(x) =df/dx, as well as the original function, f(x). Notice that the two curvesintercept at two points. Move the cursor near the left intercept point
and press @)@FCN! @ISECT, to get I-SECT: (-0.6834…,0.21585). Press L
to recover the menu.
To leave the FCN environment, press @)PICT (or L)PICT).
Press @CANCL to return to the PLOT WINDOW environment. Then, press
L @@@OK@@@ to return to normal calculator display.

Page 12-6

Note: the stack will show all the graph operations performed, properly
identified.
ΘΘEnter the PLOT environment by pressing, simultaneously if in RPN mode,„ñ. Notice that the highlighted field in the PLOT environment
now contains the derivative of Y1(X). Press L@@@OK@@@ to return to return
to normal calculator display.
Press ‚@@EQ@@ to check the contents of EQ. You will notice that it
contains a list instead of a single expression. The list has as elements
an expression for the derivative of Y1(X) and Y1(X) itself. Originally,
EQ contained only Y1(x). After we pressedin the @)FCN@
environment, the calculator automatically added the derivative of Y1(x)to the list of equations in EQ.

Saving a graph for future use
If you want to save your graph to a variable, get into the PICTURE environment
by pressing š. Then, press @EDIT LL@PICT. This captures the current
picture into a graphics object. To return to the stack, press @)PICT @CANCL.
In level 1 of the stack you will see a graphics object described as Graphic
131 × 64. This can be stored into a variable name, say, PIC1.
To display your figure again, recall the contents of variable PIC1 to the stack.
The stack will show the line: Graphic 131 × 64. To see the graph, enter the
PICTURE environment, by pressing š.
Clear the current picture, @EDIT L@ERASE.
Move the cursor to the upper left corner of the display, by using theš and— keys.
To display the figure currently in level 1 of the stack press L REPL .

Page 12-7

To return to normal calculator function, press @)PICT @CANCL.
Note: To save printing space, we will not include more graphs produced byfollowing the instructions in this Chapter. The user is invited to produce thosegraphics on his or her own.

Graphics of transcendental functions
In this section we use some of the graphics features of the calculator to show thetypical behavior of the natural log, exponential, trigonometric and hyperbolic
functions. You will not see more graphs in this chapter, instead the user should
see them in the calculator.

Graph of ln(X)Press, simultaneously if in RPN mode, the left-shift key „ and the ô (D)key to produce the PLOT SETUP window. The field labeled Type will behighlighted. If the option Function is not already selected press the soft key
labeled @CHOOS, use the up and down keys to select Function, and press @@@OK@@@
to complete the selection. Check that the field labeled Indep: contains thevariable ‘X’. If that is not so, press the down arrow key twice until the Indep
field is highlighted, press the soft key labeled @EDIT and modify the value of the
independent variable to read ‘X’. Press @@@OK@@@ when done. Press L@@@OK@@@ toreturn to normal calculator display.
Next, we’ll resize the plot window. First, press, simultaneously if in RPN mode,
the left-shift key „ and the ñ (A) key to produce the PLOT-FUNCTION
window. If there is any equation highlighted in this window, press @@DEL@@ asneeded to clear the window completely. When the PLOT-FUNCTION window
is empty you will get a prompt message that reads: No Equ., Press ADD.
Press the soft key labeled @@ADD@! . This will trigger the equation writer with theexpression Y1(X)= . Type LN(X). Press ` to return to the PLOT-FUNCTION
window. Press L@@@OK@@@ to return to normal calculator display.
The next step is to press, simultaneously if in RPN mode, the left-shift key „and the ò(B) key to produce the PLOT WINDOW - FUNCTION window.
Most likely, the display will show the horizontal (H-View) and vertical (V-View)
6.5, V-View: -3.9
4.0
ranges as: H-View: -6.5
These are the default values for the x- and y-range, respectively, of the current
graphics display window. Next, change the H-View values to read: H-View: -1
Page 12-8

10 by using 1\@@@OK@@ 10@@@OK@@@. Next, press the soft key labeled @AUTO
to let the calculator determine the corresponding vertical range. After a coupleof seconds this range will be shown in the PLOT WINDOW-FUNCTION
window. At this point we are ready to produce the graph of ln(X). Press @ERASE@DRAW to plot the natural logarithm function.

To add labels to the graph press @EDIT L@)LABEL. Press @MENU to remove themenu labels, and get a full view of the graph. Press L to recover the current
graphic menu. Press L@)PICT to recover the original graphical menu.
To determine the coordinates of points on the curve press @TRACE (the cursor
moves on top of the curve at a point located near the center of the horizontal
range). Next, press (X,Y) to see the coordinates of the current cursor location.
These coordinates will be shown at the bottom of the screen. Use the right- andleft-arrow keys to move the cursor along the curve. As you move the cursor
along the curve the coordinates of the curve are displayed at the bottom of thescreen. Check that when Y:1.00E0, X:2.72E0. This is the point (e,1), sinceln(e) = 1. Press L to recover the graphics menu.
Next, we will find the intersection of the curve with the x-axis by pressing @)FCN@ROOT. The calculator returns the value Root: 1, confirming that ln(1) = 0. Press
LL@)PICT @CANCL to return to the PLOT WINDOW – FUNCTION. Press `to return to normal calculator display. You will notice that the root found in thegraphics environment was copied to the calculator stack.
Note: When you press J , your variables list will show new variables
called @@@X@@ and @@Y1@@ .Press ‚@@Y1@@ to see the contents of this variable. You
will get the program << → X ‘LN(X)’ >> , which you will recognize as the
program that may result from defining the function ‘Y1(X) = LN(X)’ by using„à. This is basically what happens when you @@ADD@! a function in the
PLOT – FUNCTION window (the window that results from pressing  ñ,
simultaneously if in RPN mode), i.e., the function gets defined and added toyour variable list.

Page 12-9

Next, press ‚@@@X@@@ to see the contents of this variable. A value of 10.275 isplaced in the stack. This value is determined by our selection for the horizontal
display range. We selected a range between -1 and 10 for X. To produce
the graph, the calculator generates values between the range limits using a
constant increment, and storing the values generated, one at a time, in thevariable @@@X@@@ as the graph is drawn. For the horizontal range ( –1,10), theincrement used seems to be 0.275. When the value of X becomes larger thanthe maximum value in the range (in this case, when X = 10.275), the drawingof the graph stops. The last value of X for the graphic under consideration is
kept in variable X. Delete X and Y1 before continuing.

Graph of the exponential function
First, load the function exp(X), by pressing, simultaneously if in RPN mode, theleft-shift key „ and the ñ (V) key to access the PLOT-FUNCTION
window.

Press @@DEL@@ to remove the function LN(X), if you didn’t delete Y1 assuggested in the previous note. Press @@ADD@! and type „¸~x` toenter EXP(X) and return to the PLOT-FUNCTION window. Press L@@@OK@@@ toreturn to normal calculator display.
Next, press, simultaneously if in RPN mode, the left-shift key „ and theò (B) key to produce the PLOT WINDOW - FUNCTION window. Change
the H-View values to read:

H-View: -8

2

by using 8\@@@OK@@ @2@@@OK@@@. Next, press @AUTO. After the vertical range iscalculated, press @ERASE @DRAW to plot the exponential function.
To add labels to the graph press @EDIT L@)LABEL. Press @MENU to remove themenu labels, and get a full view of the graph. Press LL@)PICT! @CANCL toreturn to the PLOT WINDOW – FUNCTION.

Press ` to return to normal

calculator display.

Page 12-10

The PPAR variable
Press J to recover your variables menu, if needed. In your variables menu
you should have a variable labeled PPAR . Press ‚@PPAR to get the contentsof this variable in the stack. Press the down-arrow key, , to launch the stackeditor, and use the up- and down-arrow keys to view the full contents of PPAR.
The screen will show the following values:

PPAR stands for Plot PARameters, and its contents include two ordered pairs ofreal numbers, (-8.,-1.10797263281) and (2.,7.38905609893),
which represent the coordinates of the lower left corner and the upper rightcorner of the plot, respectively. Next, PPAR lists the name of the independent
variable, X, followed by a number that specifies the increment of the
independent variable in the generation of the plot. The value shown here is thedefault value, zero (0.), which specifies increments in X corresponding to 1 pixelin the graphics display. The next element in PPAR is a list containing first thecoordinates of the point of intersection of the plot axes, i.e., (0.,0.), followed bya list that specifies the tick mark annotation on the x- and y-axes, respectively {#10d # 10d}. Next, PPAR lists the type of plot that is to be generated, i.e.,
FUNCTION, and, finally, the y-axis label, i.e., Y.
The variable PPAR, if non-existent, is generated every time you create a plot.
The contents of the function will change depending on the type of plot and on
the options that you select in the PLOT window (the window generated by thesimultaneous activation of the „ and ò(B) keys.

Inverse functions and their graphs
Let y = f(x), if we can find a function y = g(x), such that, g(f(x)) = x, then we saythat g(x) is the inverse function of f(x). Typically, the notation g(x) = f -1(x) is
used to denote an inverse function. Using this notation we can write: if y = f(x),then x = f -1(y). Also, f(f -1(x)) = x, and f -1(f(x)) = x.

Page 12-11

As indicated earlier, the ln(x) and exp(x) functions are inverse of each other,i.e., ln(exp(x)) = x, and exp(ln(x)) = x. This can be verified in the calculator bytyping and evaluating the following expressions in the Equation Writer:
LN(EXP(X)) and EXP(LN(X)). They should both evaluate to X.
When a function f(x) and its inverse f -1(x) are plotted simultaneously in thesame set of axes, their graphs are reflections of each other about the line y = x.
Let’s check this fact with the calculator for the functions LN(X) and EXP(X) by
following this procedure:
Press, simultaneously if in RPN mode, „ñ. The function Y1(X) = EXP(X)should be available in the PLOT - FUNCTION window from the previous
exercise. Press @@ADD@! , and type the function Y2(X) = LN(X). Also, load
the function Y3(X) = X. Press L@@@OK@@@ to return to normal calculator display.
Press, simultaneously if in RPN mode, „ò, and change the H-View range
to read:H-View: -8

8Press @AUTO to generate the vertical range. Press @ERASE @DRAW to produce thegraph of y = ln(x), y = exp(x), and y =x, simultaneously if in RPN mode.
You will notice that only the graph of y = exp(x) is clearly visible. Something
went wrong with the @AUTO selection of the vertical range. What happens is that,when you press @AUTO in the PLOT FUNCTION – WINDOW screen, thecalculator produces the vertical range corresponding to the first function in thelist of functions to be plotted. Which, in this case, happens to be Y1(X) =EXP(X). We will have to enter the vertical range ourselves in order to display
the other two functions in the same plot.
Press @CANCL to return to the PLOT FUNCTION – WINDOW screen. Modify thevertical and horizontal ranges to read: H-View: -8
8, V-View: -4
4
By selecting these ranges we ensure that the scale of the graph is kept 1 verticalto 1 horizontal. Press @ERASE @DRAW and you will get the plots of the natural
logarithm, exponential, and y = x functions. It will be evident from the graphthat LN(X) and EXP(X) are reflections of each other about the line y = X. Press@CANCL to return to the PLOT WINDOW – FUNCTION. Press ` to return tonormal calculator display.

Page 12-12

Summary of FUNCTION plot operation
In this section we present information regarding the PLOT SETUP, PLOTFUNCTION, and PLOT WINDOW screens accessible through the left-shift key
combined with the soft-menu keys A through D. Based on the graphing
examples presented above, the procedure to follow to produce a FUNCTION
plot (i.e., one that plots one or more functions of the form Y = F(X)), is thefollowing:„ô, simultaneously if in RPN mode: Access to the PLOT SETUP window.
If needed, change TYPE to FUNCTION, and enter the name of the independent
variable.
Settings:
Θ A check on _Simult means that if you have two or more plots in the samegraph, they will be plotted simultaneously when producing the graph.
Θ A check on _Connect means that the curve will be a continuous curve
rather than a set of individual points.
Θ A check on _Pixels means that the marks indicated by H-Tick and VTick will be separated by that many pixels.
Θ The default value for both by H-Tick and V-Tick is 10.
Soft key menu options:Θ Use @EDIT to edit functions of values in the selected field.
Θ Use @CHOOS to select the type of plot to use when the Type: field ishighlighted. For the current exercises, we want this field set to FUNCTION.

Note: the soft menu keys @EDIT and @CHOOS are not available at the sametime. One or the other will be selected depending on which input field ishighlighted.
Θ

Θ
Θ
Θ
Θ

Press the AXES soft menu key to select or deselect the plotting of axes in
the graph. If the option ‘plot axes’ is selected, a square dot will appear in
the key label: @AXES . Absence of the square dot indicates that axes will
not be plotted in the graph.
Use @ERASE to erase any graph currently existing in the graphics display
window.
Use @DRAW to produce the graph according to the current contents of PPAR
for the equations listed in the PLOT-FUNCTION window.
Press L to access the second set of soft menu keys in this screen.
Use @RESET to reset any selected field to its default value.
Page 12-13

ΘΘ

Use @CANCL to cancel any changes to the PLOT SETUP window and return tonormal calculator display.
Press @@@OK@@@ to save changes to the options in the PLOT SETUP window andreturn to normal calculator display.

„ñ, simultaneously if in RPN mode: Access to the PLOT window (in thiscase it will be called PLOT –FUNCTION window).
Soft menu key options:Θ Use @EDIT to edit the highlighted equation.
Θ Use @@ADD@! to add new equations to the plot.
Note: @@ADD@! or @EDIT will trigger the equation writer EQW that you can
use to write new equations or edit old equations.
Θ
Θ
Θ
Θ
Θ
Θ
Θ

Θ

Use @@DEL@@ to remove the highlighted equation.
Use @CHOOS to add an equation that is already defined in your variables
menu, but not listed in the PLOT – FUNCTION window.
Use @ERASE to erase any graph currently existing in the graphics display
window.
Use @DRAW to produce the graph according to the current contents of PPAR
for the equations listed in the PLOT-FUNCTION window.
Press L to activate the second menu list.
Useand
to move the selected equation one location up or
down, respectively.
Use @CLEAR if you want to clear all the equations currently active in the PLOT
– FUNCTION window. The calculator will verify whether or not you want
to clear all the functions before erasing all of them. Select YES, and press@@@OK@@@ to proceed with clearing all functions. Select NO, and press @@@OK@@@ tode-activate the option CLEAR.
Press @@@OK@@@ when done to return to normal calculator display.

„ò, simultaneously if in RPN mode: Access to the PLOT WINDOW
screen.
Settings:
Θ Enter lower and upper limits for horizontal view (H-View) and vertical view
(V-View) ranges in the plot window. Or,

Page 12-14

Θ
Θ
Θ

Θ

Enter lower and upper limits for horizontal view (H-View), and press @AUTO,
while the cursor is in one of the V-View fields, to generate the vertical view
(V-View) range automatically. Or,
Enter lower and upper limits for vertical view (V-View), and press @AUTO,
while the cursor is in one of the H-View fields, to generate the horizontal
view (H-View) range automatically.
The calculator will use the horizontal view (H-View) range to generate data
values for the graph, unless you change the options Indep Low, (Indep) High,and (Indep) Step. These values determine, respectively, the minimum,
maximum, and increment values of the independent variable to be used in
the plot. If the option Default is listed in the fields Indep Low, (Indep) High,and (Indep) Step, the calculator will use the minimum and maximum values
determined by H-View.
A check on _Pixels means that the values of the independent variable
increments (Step:) are given in pixels rather than in plot coordinates.

Soft menu key options:Θ Use @EDIT to edit any entry in the window.
Θ Use @AUTO as explained in Settings, above.
Θ Use @ERASE to erase any graph currently existing in the graphics display
window.
Θ Use @DRAW to produce the graph according to the current contents of PPAR
for the equations listed in the PLOT-FUNCTION window.
Θ Press L to activate the second menu list.
Θ Use @RESET to reset the field selected (i.e., where the cursor is positioned) toits default value.
Θ Use @CALC to access calculator stack to perform calculations that may benecessary to obtain a value for one of the options in this window. Whenthe calculator stack is made available to you, you will also have the soft
menu key options @CANCL and @@@OK@@@ .
Θ Use @CANCL in case you want to cancel the current calculation and return to
the PLOT WINDOW screen. Or,
Θ Use @@@OK@@@ to accept the results of your calculation and return to the PLOT
WINDOW screen.
Θ Use @TYPES to get information on the type of objects that can be used in theselected option field.
Θ Use @CANCL to cancel any changes to the PLOT WINDOW screen and return
to normal calculator display.
Θ Press @@@OK@@@ to accept changes to the PLOT WINDOW screen and return tonormal calculator display.
Page 12-15„ó, simultaneously if in RPN mode: Plots the graph based on the settings
stored in variable PPAR and the current functions defined in the PLOT –FUNCTION screen. If a graph, different from the one you are plotting, alreadyexists in the graphic display screen, the new plot will be superimposed on theexisting plot. This may not be the result you desire, therefore, I recommend touse the @ERASE @DRAW soft menu keys available in the PLOT SETUP, PLOTFUNCTION or PLOT WINDOW screens.

Plots of trigonometric and hyperbolic functions
The procedures used above to plot LN(X) and EXP(X), separately or
simultaneously, can be used to plot any function of the form y = f(x). It is left as
an exercise to the reader to produce the plots of trigonometric and hyperbolic
functions and their inverses. The table below suggests the values to use for thevertical and horizontal ranges in each case. You can include the function Y=X
when plotting simultaneously a function and its inverse to verify their ‘reflection’
about the line Y = X.

Function

H-View range
Minimum Maximum

V-View range
Minimum Maximum

SIN(X)

-3.15

3.15

AUTO

ASIN(X)

-1.2

1.2

AUTO

SIN & ASIN

-3.2

3.2

-1.6

COS(X)

-3.15

3.15

AUTO

ACOS(X)

-1.2

1.2

AUTO

1.6

COS & ACOS

-3.2

3.2

-1.6

1.6

TAN(X)

-3.15

3.15

-10

10

ATAN(X)

-10

10

-1.8

1.8

TAN & ATAN

-2

-2

-2

-2

SINH(X)

-2

2

AUTO

ASINH(X)

-5

5

AUTO

SINH & ASINH

-5

5

-5

COSH(X)

-2

2

AUTO

ACOSH(X)

-1

5

AUTO

COS & ACOS

-5

5

-1

5

5

Page 12-16

TANH(X)

-5

5

AUTO

ATANH(X)

-1.2

1.2

AUTO

TAN & ATAN

-5

5

-2.5

2.5

Generating a table of values for a function
The combinations „õ(E) and „ö(F), pressed simultaneously if
in RPN mode, let’s the user produce a table of values of functions. For example,
we will produce a table of the function Y(X) = X/(X+10), in the range -5 < X <5 following these instructions:
Θ

Θ
Θ
Θ

We will generate values of the function f(x), defined above, for values of x
from –5 to 5, in increments of 0.5. First, we need to ensure that the graphtype is set to FUNCTION in the PLOT SETUP screen („ô, press themsimultaneously, if in RPN mode). The field in front of the Type option will behighlighted. If this field is not already set to FUNCTION, press the soft key@CHOOS and select the FUNCTION option, then press @@@OK@@@.
Next, press ˜ to highlight the field in front of the option EQ, type thefunction expression ‘X/(X+10)’ and press @@@OK@@@.
To accept the changes made to the PLOT SETUP screen press L @@@OK@@@.
You will be returned to normal calculator display.
The next step is to access the Table Set-up screen by using the keystroke
combination „õ (i.e., soft key E) – simultaneously if in RPN mode.
This will produce a screen where you can select the starting value (Start)
and the increment (Step). Enter the following: 5\ @@@OK@@@ 0.5@@@OK@@@ 0.5 @@@OK@@@ (i.e., Zoom factor = 0.5). Toggle the @@CHK soft
menu key until a check mark appears in front of the option Small Font if you
so desire. Then press @@@OK@@@. This will return you to normal calculator
display.

The TPAR variable
After finishing the table set up, your calculator will create a variable called
TPAR (Table PARameters) that store information relevant to the table that is to begenerated. To see the contents of this variable, press ‚@TPAR.
Θ

To see the table, press „ö(i.e., soft menu key F) – simultaneously if
in RPN mode. This will produce a table of values of x = -5, -4.5, …, andPage 12-17

the corresponding values of f(x), listed as Y1 by default. You can use theup and down arrow keys to move about in the table. You will notice that
we did not have to indicate an ending value for the independent variable
x. Thus, the table continues beyond the maximum value for x suggested
early, namely x = 5.
Some options available while the table is visible are @ZOOM, @@BIG@, and @DEFN:ΘΘΘ

The @DEFN, when selected, shows the definition of the independent variable.
The @@BIG@ key simply changes the font in the table from small to big, andvice versa. Try it.
The @ZOOM key, when pressed, produces a menu with the options: In, Out,
Decimal, Integer, and Trig. Try the following exercises:
Θ

Θ
Θ
Θ
Θ
Θ
Θ
Θ

With the option In highlighted, press @@@OK@@@. The table is expanded sothat the x-increment is now 0.25 rather than 0.5. Simply, what thecalculator does is to multiply the original increment, 0.5, by the zoom
factor, 0.5, to produce the new increment of 0.25. Thus, the zoom in
option is useful when you want more resolution for the values of x inyour table.
To increase the resolution by an additional factor of 0.5 press @ZOOM,
select In once more, and press @@@OK@@@. The x-increment is now 0.0125.
To recover the previous x-increment, press @ZOOM —@@@OK@@@ to select theoption Un-zoom. The x-increment is increased to 0.25.
To recover the original x-increment of 0.5 you can do an un-zoom
again, or use the option zoom out by pressing @ZOOM @@@OK@@@.
The option Decimal in @ZOOM produces x-increments of 0.10.
The option Integer in @ZOOM produces x-increments of 1.
The option Trig in produces increments related to fractions of π, thus
being useful when plotting trigonometric functions.
To return to normal calculator display press `.

Plots in polar coordinates
First of all, you may want to delete the variables used in previous examples(e.g., X, EQ, Y1, PPAR) using function PURGE (I @PURGE). By doing this, allparameters related to graphics will be cleared. Press J to check that thevariables were indeed purged.

Page 12-18

We will try to plot the function f(θ) = 2(1-sin(θ)), as follows:Θ First, make sure that your calculator’s angle measure is set to radians.
Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT
SETUP window.
Θ Change TYPE to Polar, by pressing @CHOOS ˜ @@@OK@@@.
Θ Press ˜ and type:³2* „ Ü1-S~‚t @@@OK@@@.
ΘΘΘΘThe cursor is now in the Indep field. Press ³~‚t @@@OK@@@ tochange the independent variable to θ.
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT
window (in this case it will be called PLOT –POLAR window).
Change the H-VIEW range to –8 to 8, by using
8\@@@OK@@@8@@@OK@@@, and the V-VIEW range to -6 to 2 by using
6\@@@OK@@@2@@@OK@@@.
Note: the H-VIEW and V-VIEW determine the scales of the display
window only, and their ranges are not related to the range of values of
the independent variable in this case.

Θ
Θ

Θ
Θ

Change the Indep Low value to 0, and the High value to 6.28 (≈ 2π), by
using: 0@@@OK@@@ 6.28@@@OK@@@.
Press @ERASE @DRAW to plot the function in polar coordinates. The result is a
curve shaped like a hearth. This curve is known as a cardiod (cardios,
Greek for heart).

Press @EDIT L @LABEL @MENU to see the graph with labels. Press L torecover the menu. Press L @)PICT to recover the original graphics menu.
Press @TRACE @x,y@ to trace the curve. The data shown at the bottom of thedisplay is the angle θ and the radius r, although the latter is labeled Y(default name of dependent variable).

Page 12-19

ΘPress L@CANCL to return to the PLOT WINDOW screen. Press L@@@OK@@@ toreturn to normal calculator display.

In this exercise we entered the equation to be plotted directly in the PLOT SETUP
window. We can also enter equations for plotting using the PLOT window, i.e.,
simultaneously if in RPN mode, pressing „ñ. For example, when youpress „ñ after finishing the previous exercise, you will get the equation‘2*(1-SIN(θ))’ highlighted. Let’s say, we want to plot also the function ‘2*(1COS(θ))’ along with the previous equation.
ΘΘPress @@ADD@! , and type 2*„Ü1- T~‚t`, toenter the new equation.
Press @ERASE @DRAW to see the two equations plotted in the same figure. The
result is two intersecting cardioids. Press @CANCL $ to return to normal
calculator display.

Plotting conic curves
The most general form of a conic curve in the x-y plane is:
Ax2+By2+Cxy+Dx+Ey+F = 0. We also recognize as conic equations thosegiven in the canonical form for the following figures:Θcircle:(x-xo)2+(y-yo)2 = r2

Θellipse:(x-xo) 2/a2 + (y-yo) 2/b2 = 1ΘΘparabola:hyperbola:(y-b)2 = K(x-a) or (x-a)2 = K(y-b)(x-xo) 2/a2 + (y-yo) 2/b2 = 1 or xy = K,

where xo, yo, a, b, and K are constant.
The name conic curves follows because these figures (circles, ellipses, parabolas
or hyperbolas) result from the intersection of a plane with a cone. For example,
a circle is the intersection of a cone with a plane perpendicular to the cone's
main axis.
Page 12-20

The calculator has the ability of plotting one or more conic curves by selecting
Conic as the function TYPE in the PLOT environment. Make sure to delete thevariables PPAR and EQ before continuing. For example, let's store the list ofequations{ ‘(X-1)^2+(Y-2)^2=3’ , ‘X^2/4+Y^2/3=1’ }into the variable EQ.
These equations we recognize as those of a circle centered at (1,2) with radius√3, and of an ellipse centered at (0,0) with semi-axis lengths a = 2 and b = √3.

Θ
Θ
Θ
Θ
Θ
Θ

Θ

Enter the PLOT environment, by pressing „ô, simultaneously if in RPNmode, and select Conic as the TYPE. The list of equations will be listed in
the EQ field.
Make sure that the independent variable (Indep) is set to ‘X’ and thedependent variable (Depnd) to ‘Y’.
Press L@@@OK@@@ to return to normal calculator display.
Enter the PLOT WINDOW environment, by pressing „ò,simultaneously if in RPN mode.
Change the range for H-VIEW to -3 to 3, by using 3\@@@OK@@@3@@@OK@@@.
Also, change the V-VIEW range to -1.5 to 2 by using
1.5\@@@OK@@@ 2@@@OK@@@.
Change the Indep Low: and High: fields to Default by using L @RESET
while each of those fields is highlighted.
Select the option Reset value
after pressing @RESET. Press @@@OK@@@ to complete the resetting of values. Press
L to return to the main menu.
Plot the graph: @ERASE @DRAW.

Page 12-21

Note: The H-View and V-View ranges were selected to show the intersectionof the two curves. There is no general rule to select those ranges, except basedon what we know about the curves. For example, for the equations shown
above, we know that the circle will extend from -3+1 = -2 to 3+1 = 4 in x, andfrom -3+2=-1 to 3+2=5 in y. In addition, the ellipse, which is centered at theorigin (0,0), will extend from -2 to 2 in x, and from -√3 to √3 in y.
Notice that for the circle and the ellipse the region corresponding to the left andright extremes of the curves are not plotted. This is the case with all circles or
ellipses plotted using Conic as the TYPE.
ΘΘΘ

To see labels: @EDIT L@)LABEL @MENU
To recover the menu: LL@)PICT
To estimate the coordinates of the point of intersection, press the @(X,Y)@
menu key and move the cursor as close as possible to those points using thearrow keys. The coordinates of the cursor are shown in the display. For
example, the left point of intersection is close to (-0.692, 1.67), while theright intersection is near (1.89,0.5).

ΘΘTo recover the menu and return to the PLOT environment, press L@CANCL.
To return to normal calculator display, press L@@@OK@@@.

Parametric plots
Parametric plots in the plane are those plots whose coordinates are generated
through the system of equations x = x(t) and y = y(t), where t is known as theparameter. An example of such graph is the trajectory of a projectile, x(t) = x0
+ v0⋅COS θ0⋅t, y(t) = y0 + v0⋅sin θ0⋅t – ½⋅g⋅t2. To plot equations like these,

Page 12-22

which involve constant values x0, y0, v0, and θ0, we need to store the values of
those parameters in variables. To develop this example, create a sub-directory
called ‘PROJM’ for PROJectile Motion, and within that sub-directory store thefollowing variables: X0 = 0, Y0 = 10, V0 = 10 , θ0 = 30, and g = 9.806.
Make sure that the calculator’s angle measure is set to DEG. Next, define thefunctions (use „à):X(t) = X0 + V0*COS(θ0)*t
Y(t) = Y0 + V0*SIN(θ0)*t – 0.5*g*t^2which will add the variables @@@Y@@@ and @@@X@@@ to the soft menu key labels.

To produce the graph itself, follow these steps:
Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Θ Change TYPE to Parametric, by pressing @CHOOS ˜˜@@@OK@@@.
Θ Press ˜ and type ‘X(t) + i*Y(t)’ @@@OK@@@ to define the parametric plot as thatof a complex variable. (The real and imaginary parts of the complex
variable correspond to the x- and y-coordinates of the curve.)Θ The cursor is now in the Indep field. Press ³~„t @@@OK@@@ tochange the independent variable to t.
Θ Press L@@@OK@@@ to return to normal calculator display.
Θ Press „ò, simultaneously if in RPN mode, to access the PLOT window(in this case it will be called PLOT –PARAMETRIC window). Instead ofmodifying the horizontal and vertical views first, as done for other types ofplot, we will set the lower and upper values of the independent variable
first as follows:Θ Select the Indep Low field by pressing ˜˜. Change this value to
0@@@OK@@@. Then, change the value of High to 2@@@OK@@@. Enter 0.
1@@@OK@@@ for the Step value (i.e., step = 0.1).

Page 12-23

Note: Through these settings we are indicating that the parameter t willtake values of t = 0, 0.1, 0.2, …, etc., until reaching the value of 2.0.
ΘPress @AUTO. This will generate automatic values of the H-View and V-View
ranges based on the values of the independent variable t and thedefinitions of X(t) and Y(t) used. The result will be:ΘΘPress @ERASE @DRAW to draw the parametric plot.
Press @EDIT L @LABEL @MENU to see the graph with labels. The window
parameters are such that you only see half of the labels in the x-axis.

ΘPress L to recover the menu. Press L@)PICT to recover the originalgraphics menu.
Press TRACE @(X,Y)@ to determine coordinates of any point on the graph.
Use ™ and š to move the cursor about the curve. At the bottom of thescreen you will see the value of the parameter t and coordinates of the
cursor as (X,Y).
Press L@CANCL to return to the PLOT WINDOW environment. Then, press$ , or L@@@OK@@@, to return to normal calculator display.

ΘΘ

A review of your soft menu key labels shows that you now have the following
variables: t, EQ, PPAR, Y, X, g, θ0, V0, Y0, X0. Variables t, EQ, and PPAR are
generated by the calculator to store the current values of the parameter, t, of theequation to be plotted EQ (which contains ‘X(t) + I∗Y(t)’), and the plot

Page 12-24

parameters. The other variables contain the values of constants used in thedefinitions of X(t) and Y(t).
You can store different values in the variables and produce new parametricplots of the projectile equations used in this example. If you want to erase thecurrent picture contents before producing a new plot, you need to access either
the PLOT, PLOT WINDOW, or PLOT SETUP screens, by pressing, „ñ ,„ò, or „ô (the two keys must be pressed simultaneously if in RPNmode). Then, press @ERASE @DRAW. Press @CANCL to return to the PLOT, PLOT
WINDOW, or PLOT SETUP screen. Press $, or L@@@OK@@@, to return tonormal calculator display.

Generating a table for parametric equations
In an earlier example we generated a table of values (X,Y) for an expression of
the form Y=f(X), i.e., a Function type of graph. In this section, we present theprocedure for generating a table corresponding to a parametric plot. For thispurpose, we’ll take advantage of the parametric equations defined in theexample above.
ΘΘFirst, let’s access the TABLE SETUP window by pressing „õ,simultaneously if in RPN mode. For the independent variable change
the Starting value to 0.0, and the Step value to 0.1. Press @@@OK@@@.
Generate the table by pressing, simultaneously if in RPN mode,„ö. The resulting table has three columns representing theparameter t, and the coordinates of the corresponding points. For thistable the coordinates are labeled X1 and Y1.

Θ Use the arrow keys, š™—˜, to move about the table.
Θ Press $ to return to normal calculator display.
This procedure for creating a table corresponding to the current type of plot canbe applied to other plot types.

Page 12-25

Plotting the solution to simple differential equations
The plot of a simple differential equation can be obtained by selecting Diff
Eq in the TYPE field of the PLOT SETUP environment as follows: suppose that wewant to plot x(t) from the differential equation dx/dt = exp(-t2), with initialconditions: x = 0 at t = 0. The calculator allows for the plotting of the solutionof differential equations of the form Y'(T) = F(T,Y). For our case, we let Yx
and Tt, therefore, F(T,Y)f(t,x) = exp(-t2).
Before plotting the solution, x(t), for t = 0 to 5, delete the variables EQ and
PPAR.
Θ
Θ
Θ
Θ

Θ
Θ
Θ
Θ

Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Change TYPE to Diff Eq.
Press ˜ and type ³„ ¸-~ „tQ2@@@OK@@@.
The cursor is now in the H-Var field. It should show H-Var:0 and also VVar:1. This is the code used by the calculator to identify the variables to beplotted. H-Var:0 means the independent variable (to be selected later) will
be plotted in the horizontal axis. Also, V-Var:1 means the dependent
variable (default name ‘Y’) will be plotted in the vertical axis.
Press ˜ . The cursor is now in the Indep field. Press ³~„t@@@OK@@@ to change the independent variable to t.
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT window(in this case it will be called PLOT WINDOW – DIFF EQ).
Change the H-VIEW and V-VIEW parameters to read: H-VIEW: -15,V-VIEW:
-11.5

Θ
Θ

Θ
Θ
Θ

Change the Init value to 0, and the Final value to 5 by using: 0@@@OK@@@
5@@@OK@@@.
The values Step and Tol represent the step in the independent variable andthe tolerance for convergence to be used by the numerical solution. Let’sleave those values with their default settings (if the word default is notshown in the Step: field, use L @RESET to reset that value to its default
value. Press L to return to the main menu.) Press ˜ .
The Init-Soln value represents the initial value of the solution to start thenumerical result. For the present case, we have for initial conditions x(0) =0, thus, we need to change this value to 0.0, by using 0@@@OK@@@.
Press @ERASE @DRAW to plot the solution to the differential equation.
Press @EDIT L @LABEL @MENU to see the graph with labels.

Page 12-26

Θ
Θ

Θ

Θ
Θ

Θ

Press L to recover the menu. Press L@)PICT to recover the originalgraphics menu.
When we observed the graph being plotted, you'll notice that the graph is
not very smooth. That is because the plotter is using a time step that is toolarge. To refine the graph and make it smoother, use a step of 0.1. Try thefollowing keystrokes: @CANCL ˜˜˜.1@@@OK@@@ @ERASE @DRAW. The plot
will take longer to be completed, but the shape is definitely smoother than
before.
Press @EDIT L @LABEL @MENU, to see axes labels and range. Notice that thelabels for the axes are shown as 0 (horizontal) and 1 (vertical). These are
the definitions for the axes as given in the PLOT WINDOW screen (seeabove), i.e., H-VAR (t): 0, and V-VAR(x): 1.

Press LL@)PICT to recover menu and return to PICT environment.
Press (X,Y) to determine coordinates of any point on the graph. Use ™
and š to move the cursor in the plot area. At the bottom of the screen
you will see the coordinates of the cursor as (X,Y). The calculator uses X
and Y as the default names for the horizontal and vertical axes,
respectively.
Press L@)CANCL to return to the PLOT WINDOW environment. Then, press$ to return to normal calculator display.

More details on using graphical solutions of differential equations are presented
in Chapter 16.

Page 12-27

Truth plots
Truth plots are used to produce two-dimensional plots of regions that satisfy acertain mathematical condition that can be either true or false. For example,
suppose that you want to plot the region for X^2/36 + Y^2/9 < 1,proceed as follows:Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Θ Change TYPE to Truth.
Θ Press ˜ and type {‘(X^2/36+Y^2/9 < 1)','(X^2/16+Y^2/9 > 1)’}@@@OK@@@ to define the conditions to be plotted.
Θ The cursor is now in the Indep field. Leave that as ‘X’ if already set to thatvariable, or change it to ‘X’ if needed.
Θ Press L@@@OK@@@ to return to normal calculator display.
Θ Press „ò, simultaneously if in RPN mode, to access the PLOT window(in this case it will be called PLOT WINDOW – TRUTH window). Let’s keep
the default value for the window’s ranges: H-View: -6.5 6.5, V-View:-3.9 4.0 (To reset them use L @RESET (select Reset all) @@OK@@ L).
Note: if the window’s ranges are not set to default values, the quickest way toreset them is by using L@RESET@ (select Reset all) @@@OK@@@ L.
Θ

Θ

Θ
Θ

Press @ERASE @DRAW to draw the truth plot. Because the calculator samples theentire plotting domain, point by point, it takes a few minutes to produce atruth plot. The present plot should produce a shaded ellipse of semi-axes 6
and 3 (in x and y, respectively), centered at the origin.
Press @EDIT L @LABEL @MENU to see the graph with labels. The window
parameters are such that you only see half of the labels in the x-axis. Press
L to recover the menu. Press L@)PICT to recover the original graphics
menu.
Press (X,Y) to determine coordinates of any point on the graph. Use thearrow keys to move the cursor about the region plotted. At the bottom of
the screen you will see the value of the coordinates of the cursor as (X,Y).
Press L@)CANCL to return to the PLOT WINDOW environment. Then, press$ , or L@@@OK@@@, to return to normal calculator display.

You can have more than one condition plotted at the same time if you multiply
the conditions. For example, to plot the graph of the points for which X2/36 +Y2/9 < 1, and X2/16 + Y2/9 > 1, use the following:

Page 12-28ΘΘΘ

Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Press ˜ and type ‘(X^2/36+Y^2/9 < 1)⋅ (X^2/16+Y^2/9 > 1)’@@@OK@@@ todefine the conditions to be plotted.
Press @ERASE @DRAW to draw the truth plot. Again, you have to be patient
while the calculator produces the graph. If you want to interrupt the plot,press $ , once. Then press @CANCEL .

Plotting histograms, bar plots, and scatter plots
Histograms, bar plots and scatter plots are used to plot discrete data stored in
the reserved variable ΣDAT. This variable is used not only for these types ofplots, but also for all kind of statistical applications as will be shown in Chapter
18. As a matter of fact, the use of histogram plots is postponed until we get tothat chapter, for the plotting of a histogram requires to perform a grouping ofdata and a frequency analysis before the actual plot.

In this section we willshow how to load data in the variable ΣDAT and how to plot bar plots andscatter plots.
We will use the following data for plotting bar plots and scatter plots:

x
3.1
3.6
4.2
4.5
4.9
5.2

y
2.1
3.2
4.5
5.6
3.8
2.2

z
1.1
2.2
3.3
4.4
5.5
6.6

Bar plots
First, make sure your calculator’s CAS is in Exact mode. Next, enter the data
shown above as a matrix, i.e.,[[3.1,2.1,1.1],[3.6,3.2,2.2],[4.2,4.5,3.3],
Page 12-29

[4.5,5.6,4.4],[4.9,3.8,5.5],[5.2,2.2,6.6]] `to store it in ΣDAT, use the function STOΣ (available in the function catalog,‚N). Press VAR to recover your variables menu. A soft menu key
labeled ΣDAT should be available in the stack. The figure below shows thestorage of this matrix in ALG mode:

To produce the graph:
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ

Θ

Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Change TYPE to Bar.
A matrix will be shown at the ΣDAT field. This is the matrix we stored
earlier into ΣDAT.
Highlight the Col: field. This field lets you choose the column of ΣDAT thatis to be plotted. The default value is 1. Keep it to plot column 1 in ΣDAT.
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Change the V-View to read, V-View: 0 5.
Press @ERASE @DRAW to draw the bar plot.

Press @CANCL to return to the PLOT WINDOW environment.
$ , or L@@@OK@@@, to return to normal calculator display.

Then, press

The number of bars to be plotted determines the width of the bar. The H- and VVIEW are set to 10, by default. We changed the V-VIEW to better
Page 12-30

accommodate the maximum value in column 1 of ΣDAT. Bar plots are usefulwhen plotting categorical (i.e., non-numerical) data.
Suppose that you want to plot the data in column 2 of the ΣDAT matrix:
Θ
Θ
Θ
Θ
Θ

Θ

Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Press ˜˜ to highlight the Col: field and type 2 @@@OK@@@, followed by
L@@@OK@@@.
Press „ò, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Change V-View to read V-View: 0 6
Press @ERASE @DRAW.

Press @CANCL to return to the PLOT WINDOW screen, then $ to return tonormal calculator display.

Scatter plots
We will use the same ΣDAT matrix to produce scatter plots. First, we will plot
the values of y vs. x, then those of y vs. z, as follows:
Θ
Θ
Θ
Θ
Θ
Θ

Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Change TYPE to Scatter.
Press ˜˜ to highlight the Cols: field. Enter 1@@@OK@@@ 2@@@OK@@@ toselect column 1 as X and column 2 as Y in the Y-vs.-X scatter plot.
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Change the plot window ranges to read: H-View: 0 6, V-View: 0 6.

Page 12-31

ΘPress @ERASE @DRAW to draw the bar plot. Press @EDIT L @LABEL @MENU to see
the plot unencumbered by the menu and with identifying labels (the cursor
will be in the middle of the plot, however):ΘΘPress LL@)PICT to leave the EDIT environment.
Press @CANCL to return to the PLOT WINDOW environment.
$ , or L@@@OK@@@, to return to normal calculator display.

Then, press

To plot y vs. z, use:
Θ
Θ
Θ
Θ
Θ
Θ

Θ
Θ

Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Press ˜˜ to highlight the Cols: field. Enter 3@@@OK@@@ 2@@@OK@@@ toselect column 3 as X and column 2 as Y in the Y-vs.-X scatter plot.
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Change the plot window ranges to read: H-View: 0 7, V-View: 0 7.
Press @ERASE @DRAW to draw the bar plot. Press @EDIT L @LABEL @MENU to see
the plot unencumbered by the menu and with identifying labels.

Press LL@)PICT to leave the EDIT environment.
Press @CANCL to return to the PLOT WINDOW environment. Then, press$ , or L@@@OK@@@, to return to normal calculator display.

Page 12-32

Slope fields
Slope fields are used to visualize the solutions to a differential equation of theform y’ = f(x,y). Basically, what is presented in the plot are segments tangential
to the solution curves, since y’ = dy/dx, evaluated at any point (x,y), represents
the slope of the tangent line at point (x,y).
For example, to visualize the solution to the differential equation y’ = f(x,y) =x+y, use the following:
Θ
Θ
Θ
Θ
Θ
Θ
Θ

Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Change TYPE to Slopefield.
Press ˜ and type ‘X+Y’ @@@OK@@@.
Make sure that ‘X’ is selected as the Indep: and ‘Y’ as the Depnd:
variables.
Press L@@@OK@@@ to return to normal calculator display.
Press „ ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Change the plot window ranges to read: X-Left:-5, X-Right:5, Y-Near:-5, Y-Far:5

Θ

Press @ERASE @DRAW to draw the slope field plot. Press @EDIT L @LABEL@MENU to see the plot unencumbered by the menu and with identifying labels.

ΘPress LL@)PICT to leave the EDIT environment.

Θ

Press @CANCL to return to the PLOT WINDOW environment.
$ , or L@@@OK@@@, to return to normal calculator display.

Then, press

If you could reproduce the slope field plot in paper, you can trace by hand linesthat are tangent to the line segments shown in the plot. This lines constitute lines

Page 12-33

of y(x,y) = constant, for the solution of y’ = f(x,y). Thus, slope fields are usefultools for visualizing particularly difficult equations to solve.
Try also a slope field plot for the function y’ = f(x,y) = - (y/x)2, by using:
Θ
Θ
Θ
Θ

Θ
Θ

Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Change TYPE to Slopefield.
Press ˜ and type ‘− (Y/X)^2’ @@@OK@@@.
Press @ERASE @DRAW to draw the slope field plot. Press @EDIT L @LABEL@MENU to see the plot unencumbered by the menu and with identifying labels.

Press LL@)PICT to leave the EDIT environment.
Press @CANCL to return to the PLOT WINDOW environment.
$ , or L@@@OK@@@, to return to normal calculator display.

Then, press

Fast 3D plots
Fast 3D plots are used to visualize three-dimensional surfaces represented byequations of the form z = f(x,y). For example, if you want to visualize z = f(x,y)= x2+y2, we can use the following:Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.
Θ Change TYPE to Fast3D.
Θ Press ˜ and type ‘X^2+Y^2’ @@@OK@@@.
Θ Make sure that ‘X’ is selected as the Indep: and ‘Y’ as the Depnd: variables.
Θ Press L@@@OK@@@ to return to normal calculator display.
Θ Press „ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Θ Keep the default plot window ranges to read: X-Left:-1, X-Right:1, Y-Near:-1, YFar: 1, Z-Low: -1, Z-High: 1, Step Indep: 10, Depnd: 8

Page 12-34

Note: The Step Indep: and Depnd: values represent the number ofgridlines to be used in the plot. The larger these number, the slower it isto produce the graph, although, the times utilized for graphic generation
are relatively fast. For the time being we’ll keep the default values of 10
and 8 for the Step data.
ΘPress @ERASE @DRAW to draw the three-dimensional surface. The result is a
wireframe picture of the surface with the reference coordinate system shownat the lower left corner of the screen. By using the arrow keys (š™—˜) you can change the orientation of the surface. The orientation of thereference coordinate system will change accordingly. Try changing thesurface orientation on your own. The following figures show a couple ofviews of the graph:

Θ
Θ
Θ
Θ

When done, press @EXIT.
Press @CANCL to return to the PLOT WINDOW environment.
Change the Step data to read: Step Indep: 20 Depnd: 16
Press @ERASE @DRAW to see the surface plot. Sample views:ΘΘΘWhen done, press @EXIT.
Press @CANCL to return to PLOT WINDOW.
Press $ , or L@@@OK@@@, to return to normal calculator display.

Try also a Fast 3D plot for the surface z = f(x,y) = sin (x2+y2)

Page 12-35

Θ
Θ
Θ
Θ
Θ
Θ

Press „ô, simultaneously if in RPN mode, to access the PLOT SETUP
window.
Press ˜ and type ‘SIN(X^2+Y^2)’ @@@OK@@@.
Press @ERASE @DRAW to draw the plot.
When done, press @EXIT.
Press @CANCL to return to PLOT WINDOW.
Press $ , or L@@@OK@@@, to return to normal calculator display.

Wireframe plots
Wireframe plots are plots of three-dimensional surfaces described by z = f(x,y).
Unlike Fast 3D plots, wireframe plots are static plots. The user can choose theviewpoint for the plot, i.e., the point from which the surface is seen. For
example, to produce a wireframe plot for the surface z = x + 2y –3, use thefollowing:
Θ
Θ
Θ
Θ
Θ
Θ
Θ

Press „ô, simultaneously if in RPN mode, to access to the PLOT
SETUP window.
Change TYPE to Wireframe.
Press ˜ and type ‘X+2*Y-3’ @@@OK@@@.
Make sure that ‘X’ is selected as the Indep: and ‘Y’ as the Depnd:
variables.
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Keep the default plot window ranges to read: X-Left:-1, X-Right:1, Y-Near:-1, YFar: 1, Z-Low: -1, Z-High: 1, XE:0,YE:-3, ZE:0, Step Indep: 10 Depnd: 8

The coordinates XE, YE, ZE, stand for “eye coordinates,” i.e., the coordinatesfrom which an observer sees the plot. The values shown are the default values.
The Step Indep: and Depnd: values represent the number of gridlines to be usedin the plot. The larger these number, the slower it is to produce the graph. For
the time being we’ll keep the default values of 10 and 8 for the StepΘ

Press @ERASE @DRAW to draw the three-dimensional surface.
wireframe picture of the surface.

The result is a

Page 12-36

ΘPress @EDIT L @LABEL @MENU to see the graph with labels and ranges. Thisparticular version of the graph is limited to the lower part of the display.
We can change the viewpoint to see a different version of the graph.

Θ
Θ
Θ
Θ

Press LL@)PICT @CANCL to return to the PLOT WINDOW environment.
Change the eye coordinate data to read : XE:0
YE:-3
ZE:3
Press @ERASE @DRAW to see the surface plot.
Press @EDIT L @LABEL @MENU to see the graph with labels and ranges.

This version of the graph occupies more area in the display than theprevious one. We can change the viewpoint, once more, to see anotherversion of the graph.
ΘΘΘ

Press LL@)PICT @CANCL to return to the PLOT WINDOW environment.
Change the eye coordinate data to read : XE:3
YE:3
ZE:3
Press @ERASE @DRAW to see the surface plot. This time the bulk of the plot islocated towards the right –hand side of the display.

ΘΘ

Press @CANCL to return to the PLOT WINDOW environment.
Press $ , or L@@@OK@@@, to return to normal calculator display.
Page 12-37

Try also a Wireframe plot for the surface z = f(x,y) = x2+y2
Θ
Θ
Θ

Θ
Θ

Press „ô, simultaneously if in RPN mode, to access the PLOT SETUP
window.
Press ˜ and type ‘X^2+Y^2’ @@@OK@@@.
Press @ERASE @DRAW to draw the slope field plot. Press @EDIT L@)MENU @LABEL
to see the plot unencumbered by the menu and with identifying labels.

Press LL@)PICT to leave the EDIT environment.
Press @CANCL to return to the PLOT WINDOW environment.
$ , or L@@@OK@@@, to return to normal calculator display.

Then, press

Ps-Contour plots
Ps-Contour plots are contour plots of three-dimensional surfaces described by z
= f(x,y). The contours produced are projections of level surfaces z = constanton the x-y plane. For example, to produce a Ps-Contour plot for the surface z =x2+y2, use the following:Θ Press „ô, simultaneously if in RPN mode, to access to the PLOT
SETUP window.
Θ Change TYPE to Ps-Contour.
Θ Press ˜ and type ‘X^2+Y^2’ @@@OK@@@.
Θ Make sure that ‘X’ is selected as the Indep: and ‘Y’ as the Depnd:
variables.
Θ Press L@@@OK@@@ to return to normal calculator display.
Θ Press „ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Θ Change the default plot window ranges to read: X-Left:-2, X-Right:2, Y-Near:-1
Y-Far: 1, Step Indep: 10, Depnd: 8

ΘPress @ERASE @DRAW to draw the contour plot. This operation will take sometime, so, be patient. The result is a contour plot of the surface. Notice thatthe contour are not necessarily continuous, however, they do provide agood picture of the level surfaces of the function.

Page 12-38

ΘPress @EDIT!L @LABEL @MENU to see the graph with labels and ranges.

ΘΘPress LL@)PICT@CANCL to return to the PLOT WINDOW environment.
Press $ , or L@@@OK@@@, to return to normal calculator display.

Try also a Ps-Contour plot for the surface z = f(x,y) = sin x cos y.
Θ
Θ
Θ

Θ
Θ

Press „ô, simultaneously if in RPN mode, to access the PLOT SETUP
window.
Press ˜ and type ‘SIN(X)*COS(Y)’ @@@OK@@@.
Press @ERASE @DRAW to draw the slope field plot. Press @EDIT L@)LABEL @MENU to
see the plot unencumbered by the menu and with identifying labels.

Press LL@)PICT to leave the EDIT environment.
Press @CANCL to return to the PLOT WINDOW environment.
$ , or L@@@OK@@@, to return to normal calculator display.

Then, press

Y-Slice plots
Y-Slice plots are animated plots of z-vs.-y for different values of x from thefunction z = f(x,y).

For example, to produce a Y-Slice plot for the surface z =x3-xy3, use the following:ΘΘΘ

Press „ô, simultaneously if in RPN mode, to access to the PLOT
SETUP window.
Change TYPE to Y-Slice.
Press ˜ and type ‘X^3+X*Y^3’ @@@OK@@@.

Page 12-39

Θ
Θ
Θ
Θ
Θ

Θ
Θ

Make sure that ‘X’ is selected as the Indep: and ‘Y’ as the Depnd: variables.
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Change the default plot window ranges to read: X-Left:-1, X-Right:1, Y-Near:1, Y-Far: 1, Z-Low:-1, Z-High:1, Step Indep: 10 Depnd: 8
Press @ERASE @DRAW to draw the three-dimensional surface. You will see thecalculator produce a series of curves on the screen, that will immediately
disappear. When the calculator finishes producing all the y-slice curves,then it will automatically go into animating the different curves. One of thecurves is shown below.

Press $ to stop the animation. Press @CANCL to return to the PLOT
WINDOW environment.
Press $ , or L@@@OK@@@, to return to normal calculator display.

Try also a Ps-Contour plot for the surface z = f(x,y) = (x+y) sin y.
Θ Press „ô, simultaneously if in RPN mode, to access the PLOT SETUP
window.
Θ Press ˜ and type ‘(X+Y)*SIN(Y)’ @@@OK@@@.
Θ Press @ERASE @DRAW to produce the Y-Slice animation.
Θ Press $ to stop the animation.
Θ Press @CANCL to return to the PLOT WINDOW environment. Then, press$ , or L@@@OK@@@, to return to normal calculator display.

Gridmap plots
Gridmap plots produce a grid of orthogonal curves describing a function of acomplex variable of the form w =f(z) = f(x+iy), where z = x+iy is a complex
variable. The functions plotted correspond to the real and imaginary part of w
= Φ(x,y) + iΨ(x,y), i.e., they represent curves Φ(x,y) =constant, and Ψ(x,y) =constant. For example, to produce a Gridmap plot for the function w = sin(z),use the following:

Page 12-40

ΘΘ

Press „ô, simultaneously if in RPN mode, to access to the PLOT
SETUP window.
Change TYPE to Gridmap.
Press ˜ and type ‘SIN(X+i*Y)’ @@@OK@@@.
Make sure that ‘X’ is selected as the Indep: and ‘Y’ as the Depnd: variables.
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Keep the default plot window ranges to read: X-Left:-1, X-Right:1, Y-Near:-1 YFar: 1, XXLeft:-1 XXRight:1, YYNear:-1, yyFar: 1, Step Indep: 10 Depnd: 8
Press @ERASE @DRAW to draw the gridmap plot. The result is a grid of functions
corresponding to the real and imaginary parts of the complex function.
Press @EDIT L@LABEL @MENU to see the graph with labels and ranges.

ΘΘPress LL@)PICT @CANCL to return to the PLOT WINDOW environment.
Press $ , or L@@@OK@@@, to return to normal calculator display.

Θ
Θ
Θ
Θ
Θ
Θ
Θ

Other functions of a complex variable worth trying for Gridmap plots are:(1) SIN((X,Y))

i.e., F(z) = sin(z)(2)(X,Y)^2

i.e., F(z) = z2

(3) EXP((X,Y))

i.e., F(z) = ez

(4) SINH((X,Y))

i.e., F(z) = sinh(z)(5) TAN((X,Y))

i.e., F(z) = tan(z)(6) ATAN((X,Y))

i.e., F(z) = tan-1(z)(7) (X,Y)^3

i.e., F(z) = z3

(8) 1/(X,Y)

i.e., F(z) = 1/z(9) √ (X,Y)

i.e., F(z) = z

1/2

Pr-Surface plots
Pr-Surface (parametric surface) plots are used to plot a three-dimensionalsurface whose coordinates (x,y,z) are described by x = x(X,Y), y = y(X,Y),
z=z(X,Y), where X and Y are independent parameters.

Page 12-41

Note: The equations x = x(X,Y), y = y(X,Y), z=z(X,Y) represent a parametricdescription of a surface. X and Y are the independent parameters. Most
textbooks will use (u,v) as the parameters, rather than (X,Y). Thus, theparametric description of a surface is given as x = x(u,v), y = y(u,v), z=z(u,v).
For example, to produce a Pr-Surface plot for the surface x = x(X,Y) = X sin Y, y
= y(X,Y) = x cos Y, z=z(X,Y)=X, use the following:ΘΘΘ

Press „ô, simultaneously if in RPN mode, to access to the PLOT
SETUP window.
Change TYPE to Pr-Surface.
Press ˜ and type ‘{X*SIN(Y), X*COS(Y), X}’ @@@OK@@@.
Make sure that ‘X’ is selected as the Indep: and ‘Y’ as the Depnd: variables.
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT
WINDOW screen.
Keep the default plot window ranges to read: X-Left:-1, X-Right:1, Y-Near:-1, YFar: 1, Z-Low: -1, Z-High:1, XE: 0, YE:-3, zE:0, Step Indep: 10, Depnd: 8
Press @ERASE @DRAW to draw the three-dimensional surface.
Press @EDIT!L @LABEL @MENU to see the graph with labels and ranges.

ΘΘPress LL@)PICT @CANCL to return to the PLOT WINDOW environment.
Press $ , or L@@@OK@@@, to return to normal calculator display.

Θ
Θ
Θ
Θ
Θ
Θ

The VPAR variable
The VPAR (Volume Parameter) variable contains information regarding the“volume” used to produce a three dimensional graph. Therefore, you will see it
produced whenever you create a three dimensional plot such as Fast3D,
Wireframe, or Pr-Surface.

Page 12-42

Interactive drawing
Whenever we produce a two-dimensional graph, we find in the graphics screena soft menu key labeled @)EDIT. Pressing @)EDIT produces a menu that include thefollowing options (press L to see additional functions):

Through the examples above, you have the opportunity to try out functions
LABEL, MENU, PICT, and REPL. Many of the remaining functions, such as
DOT+, DOT-, LINE, BOX, CIRCL, MARK, DEL, etc., can be used to draw points,
lines, circles, etc. on the graphics screen, as described below. To see how to
use these functions we will try the following exercise:First, we get the graphics screen corresponding to the following instructions:
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ

Press „ô, simultaneously if in RPN mode, to access to the PLOT
SETUP window.
Change TYPE to Function, if needed
Change EQ to ‘X’
Make sure that Indep: is set to ‘X’ also
Press L@@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously if in RPN mode, to access the PLOT
window (in this case it will be called PLOT –POLAR window).
Change the H-VIEW range to –10 to 10, by using 10\@@@OK@@@
10@@@OK@@@, and the V-VIEW range to -5 to 5 by using
5\@@@OK@@@ 5@@@OK@@@.
Press @ERASE @DRAW to plot the function.
Press @EDIT L @LABEL to add labels to the graph. Press LL (or„«) to recover the original EDIT menu.
Page 12-43

Next, we illustrate the use of the different drawing functions on the resulting
graphics screen. They require use of the cursor and the arrow keys (š™—˜) to move the cursor about the graphics screen.

DOT+ and DOTWhen DOT+ is selected, pixels will be activated wherever the cursor moves
leaving behind a trace of the cursor position. When DOT- is selected, theopposite effect occurs, i.e., as you move the cursor, pixels will be deleted.
For example, use the ™— keys to move the cursor somewhere in the middleof the first quadrant of the x-y plane, then press @DOT+@@. The label will beselected (DOT+@). Press and hold the ™ key to see a horizontal line being
traced. Now, press @DOT-@, to select this option ( @DOT-@ ). Press and hold theš key to see the line you just traced being erased. Press @DOT-, when done,
to deselect this option.

MARK
This command allows the user to set a mark point which can be used for anumber of purposes, such as:ΘΘΘStart of line with the LINE or TLINE command
Corner for a BOX commandCenter for a CIRCLE command

Using the MARK command by itself simply leaves an x in the location of themark (Press L@MARK to see it in action).

LINE
This command is used to draw a line between two points in the graph. To see
it in action, position the cursor somewhere in the first quadrant, and press„«@LINE. A MARK is placed over the cursor indicating the origin of theline. Use the ™ key to move the cursor to the right of the current position, sayabout 1 cm to the right, and press @LINE. A line is draw between the first andthe last points.
Notice that the cursor at the end of this line is still active indicating that thecalculator is ready to plot a line starting at that point. Press ˜ to move thecursor downwards, say about another cm, and press @LINE again. Now you

Page 12-44

should have a straight angle traced by a horizontal and a vertical segments.
The cursor is still active. To deactivate it, without moving it at all, press @LINE.
The cursor returns to its normal shape (a cross) and the LINE function is nolonger active.

TLINE(Toggle LINE) Move the cursor to the second quadrant to see this function inaction. Press @TLINE. A MARK is placed at the start of the toggle line. Movethe cursor with the arrow keys away from this point, and press @TLINE. A line isdrawn from the current cursor position to the reference point selected earlier.
Pixels that are on in the line path will be turned off, and vice versa. To remove
the most recent line traced, press @TLINE again. To deactivate TLINE, move thecursor to the original point where TLINE was activated, and press @LINE @LINE.

BOX
This command is used to draw a box in the graph. Move the cursor to a clear
area of the graph, and press @BOX@. This highlights the cursor. Move the cursor
with the arrow keys to a point away, and in a diagonal direction, from thecurrent cursor position. Press @BOX@ again. A rectangle is drawn whose
diagonal joins the initial and ending cursor positions. The initial position of thebox is still marked with and x. Moving the cursor to another position andpressing @BOX@ will generate a new box containing the initial point. To deselectBOX, move the cursor to the original point where BOX was activated, then press@LINE @LINE.

CIRCL
This command produces a circle. Mark the center of the circle with a MARK
command, then move the cursor to a point that will be part of the periphery of
the circle, and press @CIRCL. To deactivate CIRCL, return the cursor to the
MARK position and press @LINE.
Try this command by moving the cursor to a clear part of the graph, press @MARK.
Move the cursor to another point, then press @CIRCL. A circle centered at the
MARK, and passing through the last point will be drawn.

LABEL
Pressing @LABEL places the labels in the x- and y-axes of the current plot. Thisfeature has been used extensively through this chapter.

Page 12-45

DEL
This command is used to remove parts of the graph between two MARK
positions. Move the cursor to a point in the graph, and press @MARK. Move thecursor to a different point, press @MARK again. Then, press @@DEL@. The section of
the graph boxed between the two marks will be deleted.

ERASE
The function ERASE clears the entire graphics window. This command isavailable in the PLOT menu, as well as in the plotting windows accessible
through the soft menu keys.

MENU
Pressing @MENU will remove the soft key menu labels to show the graphic
unencumbered by those labels. To recover the labels, press L.

SUB
Use this command to extract a subset of a graphics object. The extracted object
is automatically placed in the stack. Select the subset you want to extract byplacing a MARK at a point in the graph, moving the cursor to the diagonalcorner of the rectangle enclosing the graphics subset, and press @@SUB@. Thisfeature can be used to move parts of a graphics object around the graph.

REPL
This command places the contents of a graphic object currently in stack level 1
at the cursor location in the graphics window. The upper left corner of thegraphic object being inserted in the graph will be placed at the cursor position.
Thus, if you want a graph from the stack to completely fill the graphic window,
make sure that the cursor is placed at the upper left corner of the display.

PICT
This command places a copy of the graph currently in the graphics window onto the stack as a graphic object. The graphic object placed in the stack can besaved into a variable name for storage or other type of manipulation.

Page 12-46

X,YThis command copies the coordinates of the current cursor position, in user
coordinates, in the stack.

Zooming in and out in the graphics display
Whenever you produce a two-dimensional FUNCTION graphic interactively,
the first soft-menu key, labeled @)ZOOM, lets you access functions that can be used
to zoom in and out in the current graphics display. The ZOOM menu includes
the following functions (press Lto move to the next menu):

We present each of these functions following. You just need to produce agraph as indicated in Chapter 12, or with one of the programs listed earlier inthis Chapter.

ZFACT, ZIN, ZOUT, and ZLAST
Pressing @)ZFACT produces an input screen that allows you to change the current
X- and Y-Factors. The X- and Y-Factors relate the horizontal and vertical userdefined unit ranges to their corresponding pixel ranges. Change the H-Factor
to read 8., and press @@@OK@@@, then change the V-Factor to read 2., and press@@@OK@@. Check off the option Recenter on cursor, and press @@@OK@@.
Back in the graphics display, press @@ZIN@ . The graphic is re-drawn with the newvertical and horizontal scale factors, centered at the position where the cursor
was located, while maintaining the original PICT size (i.e., the original numberof pixels in both directions). Using the arrow keys, scroll horizontally or
vertically as far as you can of the zoomed-in graph.
To zoom out, subjected to the H- and V-Factors set with ZFACT, press @)ZOOM@ZOUT. The resulting graph will provide more detail than the zoomed-in graph.
Page 12-47

You can always return to the very last zoom window by using @ZLAST.

BOXZ
Zooming in and out of a given graph can be performed by using the soft-menu
key BOXZ. With BOXZ you select the rectangular sector (the “box”) that you
want to zoom in into. Move the cursor to one of the corners of the box (using
the arrow keys), and press @)ZOOM @BOXZ. Using the arrow keys once more, movethe cursor to the opposite corner of the desired zoom box. The cursor will trace
the zoom box in the screen. When desired zoom box is selected, press @ZOOM.
The calculator will zoom in the contents of the zoom box that you selected to fill
the entire screen.
If you now press @ZOUT, the calculator will zoom out of the current box using theH- and V-Factors, which may not recover the graph view from which you started
the zoom box operation.

ZDFLT, ZAUTO
Pressing @ZDFLT re-draws the current plot using the default x- and y-ranges, i.e., 6.5 to 6.5 in x, and –3.1 to 3.1 in y. The command @ZAUTO, on the other hand,creates a zoom window using the current independent variable (x) range, but
adjusting the dependent variable (y) range to fit the curve (as when you use thefunction @AUTO in the PLOT WINDOW input form („ò, simultaneously in
RPN mode).

HZIN, HZOUT, VZIN and VZOUT
These functions zoom in and out the graphics screen in the horizontal or verticaldirection according to the current H- and V-Factors.

CNTR
Zooms in with the center of the zoom window in the current cursor location. The
zooming factors used are the current H- and V-Factors.

ZDECI
Zooms the graph so as to round off the limits of the x-interval to a decimalvalue.

ZINTG
Zooms the graph so that the pixel units become user-define units. For example,
the minimum PICT window has 131 pixels. When you use ZINTG, with thePage 12-48

cursor at the center of the screen, the window gets zoomed so that the x-axis
extends from –64.5 to 65.5.

ZSQR
Zooms the graph so that the plotting scale is maintained at 1:1 by adjusting thex scale, keeping the y scale fixed, if the window is wider than taller. This forcesa proportional zooming.

ZTRIG
Zooms the graph so that the x scale incorporates a range from about –3π to+3π, the preferred range for trigonometric functions.

Note: None of these functions are programmable. They are only useful in aninteractive way. Do not confuse the command @ZFACT in the ZOOM menu withthe function ZFACTOR, which is used for gas dynamic and chemistry
applications (see Chapter 3).

The SYMBOLIC menu and graphs
The SYMBOLIC menu is activated by pressing the P key (fourth key from theleft in fourth row from the top of the keyboard). This menu provides a list ofmenus related to the Computer Algebraic System or CAS, these are:All but one of these menus are available directly in the keyboard by pressing
the appropriate keystroke combination as follows. The Chapter of the user
manual where the menus are described is also listed:
ALGEBRA..

‚× (the 4 key)

Ch. 5

ARITHMETIC..

„Þ (the 1 key)

Ch. 5

CALCULUS..

„Ö (the 4 key)

Ch. 13
Page 12-49

SOLVER..

„Î (the 7 key)

Ch. 6

TRIGONOMETRIC..

‚Ñ (the 8 key)

Ch. 5

EXP&LN..

„Ð (the 8 key)

Ch. 5

The SYMB/GRAPH menu
The GRAPH sub-menu within the SYMB menu includes the following functions:

DEFINE: same as the keystroke sequence „à (the 2 key)
GROBADD: pastes two GROBs first over the second (See Chapter 22)
PLOT(function): plots a function, similar to „ô
PLOTADD(function): adds this function to the list of functions to plot, similar to„ôPlot setup..: same as „ô
SIGNTAB(function): sign table of given function showing intervals of positive
and negative variation, zero points and infinite asymptotes
TABVAL: table of values for a function
TABVAR: variation table of a function
Examples of some of these functions are provided next.
PLOT(X^2-1) is similar to „ô with EQ: X^2 -1. Using @ERASE @DRAW
produces the plot:

PLOTADD(X^2-X) is similar to „ô but adding this function to EQ: X^2 -1.
Using @ERASE @DRAW produces the plot:

Page 12-50

TABVAL(X^2-1,{1, 3}) produces a list of {min max} values of the function in theinterval {1,3}, while SIGNTAB(X^2-1) shows the sign of the function in theinterval (-∞,+), with f(x) > 0 in (-∞,-1), f(x) <0, in (-1,1), and f(x) > 0 in (1,+ ∞).

TABVAR(LN(X)/X) produces the following table of variation:

A detailed interpretation of the table of variation is easier to follow in RPN
mode:

The output is in a graphical format, showing the original function, F(X), thederivative F’(X) right after derivation and after simplification, and finally a tableof variation. The table consists of two rows, labeled in the right-hand side.
Thus, the top row represents values of X and the second row represents values

Page 12-51

of F. The question marks indicates uncertainty or non-definition. For example,
for X<0, LN(X) is not defined, thus the X lines shows a question mark in thatinterval. Right at zero (0+0) F is infinite, for X = e, F = 1/e. F increases before
reaching this value, as indicated by the upward arrow, and decreases after thisvalue (X=e) becoming slightly larger than zero (+:0) as X goes to infinity. A
plot of the graph is shown below to illustrate these observations:

Function DRAW3DMATRIXThis function takes as argument a n×m matrix, Z, = [ zij ], and minimum andmaximum values for the plot. You want to select the values of vmin and vmax sothat they contain the values listed in Z. The general call to the function is,therefore, DRAW3DMATRIX(Z,vmin,vmax). To illustrate the use of this function
we first generate a 6×5 matrix using RANM({6,5}), and then call function
DRAW3DMATRIX, as shown below:

The plot is in the style of a FAST3DPLOT. Different views of the plot are shown
below:

Page 12-52

Chapter 13
Calculus Applications
In this Chapter we discuss applications of the calculator’s functions tooperations related to Calculus, e.g., limits, derivatives, integrals, power series,
etc.

The CALC (Calculus) menu
Many of the functions presented in this Chapter are contained in thecalculator’s CALC menu, available through the keystroke sequence „Ö(associated with the 4 key). The CALC menu shows the following entries:

The first four options in this menu are actually sub-menus that apply to (1)derivatives and integrals, (2) limits and power series, (3) differential equations,and (4) graphics. The functions in entries (1) and (2) will be presented in this
Chapter. Differential equations, the subject of item (3), are presented in
Chapter 16. Graphic functions, the subject of item (4), were presented at theend of Chapter 12. Finally, entries 5. DERVX and 6.INTVX are the functions to
obtain a derivative and a indefinite integral for a function of the default CAS
variable (typically, ‘X’). Functions DERVX and INTVX are discussed in detaillater.

Limits and derivatives
Differential calculus deals with derivatives, or rates of change, of functions andtheir applications in mathematical analysis. The derivative of a function isdefined as a limit of the difference of a function as the increment in the
independent variable tends to zero. Limits are used also to check the continuityof functions.

Page 13-1

Function lim
The calculator provides function lim to calculate limits of functions. This functionuses as input an expression representing a function and the value where thelimit is to be calculated. Function lim is available through the command
catalog (‚N~„l) or through option 2. LIMITS & SERIES… of the
CALC menu (see above).
Note: The functions available in the LIMITS & SERIES menu are shown next:

Function DIVPC is used to divide two polynomials producing a series
expansion. Functions DIVPC, SERIES, TAYLOR0, and TAYLOR are used in series
expansions of functions and discussed in more detail in this Chapter.
Function lim is entered in ALG mode as lim(f(x),x=a) to calculate thelimit

lim f ( x) . In RPN mode, enter the function first, then the expressionx→ a‘x=a’, and finally function lim. Examples in ALG mode are shown next,
including some limits to infinity. The keystrokes for the first example are as
follows (using Algebraic mode, and system flag 117 set to CHOOSE boxes):„Ö2 @@OK@@ 2 @@OK@@ x+1‚í x‚Å 1`

The infinity symbol is associated with the 0 key, i.e.., „è.

Page 13-2

To calculate one-sided limits, add +0 or -0 to the value to the variable. A “+0”means limit from the right, while a “-0” means limit from the left. For example,
the limit of x − 1 as x approaches 1 from the left can be determined with thefollowing keystrokes (ALG mode):‚N~„l˜$OK$ R!ÜX1™@íX@Å1+0`
The result is as follows:

Derivatives
The derivative of a function f(x) at x = a is defined as the limitdff ( x + h) − f ( x )= f ' ( x) = lim
h
−
>
0
dx
h
Some examples of derivatives using this limit are shown in the following screen
shots:

Functions DERIV and DERVX
The function DERIV is used to take derivatives in terms of any independent
variable, while the function DERVX takes derivatives with respect to the CAS
default variable VX (typically ‘X’). While function DERVX is available directly in
the CALC menu, both functions are available in the DERIV.&INTEG sub-menu
within the CALCL menu ( „Ö).
Function DERIV requires a function, say f(t), and an independent variable, say, t,
while function DERVX requires only a function of VX. Examples are shown next
Page 13-3

in ALG mode. Recall that in RPN mode the arguments must be entered before
the function is applied.

The DERIV&INTEG menu
The functions available in this sub-menu are listed below:

Out of these functions DERIV and DERVX are used for derivatives. The otherfunctions include functions related to anti-derivatives and integrals (IBP, INTVX,PREVAL, RISCH, SIGMA, and SIGMAVX), to Fourier series (FOURIER),and tovector analysis (CURL, DIV, HESS, LAPL). Next we discuss functions DERIV andDERVX, the remaining functions are presented either later in this Chapter or insubsequent Chapters.

Calculating derivatives with ∂The symbol is available as ‚¿ (the T key). This symbol can be used toenter a derivative in the stack or in the Equation Writer (see Chapter 2). If you
use the symbol to write a derivative into the stack, follow it immediately with theindependent variable, then by a pair of parentheses enclosing the function to

Page 13-4

be differentiated. Thus, to calculate the derivative d(sin(r),r), use, in ALG mode:‚¿~„r„ÜS~„r`
In RPN mode, this expression must be enclosed in quotes before entering it into
the stack. The result in ALG mode is:In the Equation Writer, when you press ‚¿, the calculator provides thefollowing expression:

The insert cursor () will be located right at the denominator awaiting for theuser to enter an independent variable, say, s: ~„s. Then, press the rightarrow key (™) to move to the placeholder between parentheses:

Next, enter the function to be differentiated, say, s*ln(s):Page 13-5

To evaluate the derivative in the Equation Writer, press the up-arrow key —,four times, to select the entire expression, then, press @EVAL. The derivative will
be evaluated in the Equation Writer as:

Note: The symbol ∂ is used formally in mathematics to indicate a partial
derivative, i.e., the derivative of a function with more than one variable.
However, the calculator does not distinguish between ordinary and partial
derivatives, utilizing the same symbol for both. The user must keep this
distinction in mind when translating results from the calculator to paper.

The chain rule
The chain rule for derivatives applies to derivatives of composite functions. A
general expression for the chain-rule is d{f[g(x)]}/dx = (df/dg)⋅ (dg/dx). Using
the calculator, this formula results in:

The terms d1 in front of g(x) and f(g(x)) in the expression above areabbreviations the calculator uses to indicate a first derivative when the
independent variable, in this case x, is clearly defined. Thus, the latter result isinterpreted as in the formula for the chain rule shown above. Here is anotherexample of a chain rule application:

Page 13-6

Derivatives of equations
You can use the calculator to calculate derivatives of equations, i.e., expressions
in which derivatives will exist in both sides of the equal sign. Some examples
are shown below:

Notice that in the expressions where the derivative sign (∂) or function DERIV
was used, the equal sign is preserved in the equation, but not in the cases
where function DERVX was used. In these cases, the equation was re-writtenwith all its terms moved to the left-hand side of the equal sign. Also, the equal
sign was removed, but it is understood that the resulting expression is equal tozero.

Implicit derivatives
Implicit derivatives are possible in expressions such as:

Application of derivatives
Derivatives can be used for analyzing the graphs of functions and for
optimizing functions of one variable (i.e., finding maxima and minima). Someapplications of derivatives are shown next.

Page 13-7

Analyzing graphics of functions
In Chapter 11 we presented some functions that are available in the graphics
screen for analyzing graphics of functions of the form y = f(x). These functions
include (X,Y) and TRACE for determining points on the graph, as well asfunctions in the ZOOM and FCN menu. The functions in the ZOOM menu
allow the user to zoom in into a graph to analyze it in more detail. These
functions are described in detail in Chapter 12. Within the functions of the
FCN menu, we can use the functions SLOPE, EXTR, F’, and TANL to determine
the slope of a tangent to the graph, the extrema (minima and maxima) of thefunction, to plot the derivative, and to find the equation of the tangent line.
Try the following example for the function y = tan(x).
Θ Press „ô, simultaneously in RPN mode, to access to the PLOT
SETUP window.
Θ Change TYPE to FUNCTION, if needed, by using [@CHOOS].
Θ Press ˜ and type in the equation ‘TAN(X)’.
Θ Make sure the independent variable is set to ‘X’.
Θ Press L @@@OK@@@ to return to normal calculator display.
Θ Press „ò, simultaneously, to access the PLOT windowΘ Change H-VIEW range to –2 to 2, and V-VIEW range to –5 to 5.
Θ Press @ERASE @DRAW to plot the function in polar coordinates.
The resulting plot looks as follows:ΘΘΘ

Notice that there are vertical lines that represent asymptotes. These are
not part of the graph, but show points where TAN(X) goes to ± ∞ atcertain values of X.
Press @TRACE @(X,Y)@, and move the cursor to the point X: 1.08E0, Y:
1.86E0. Next, press L@)@FCN@ @SLOPE. The result is Slope:4.45010547846.
Press LL@TANL. This operation produces the equation of thetangent line, and plots its graph in the same figure. The result is shownin the figure below:

Page 13-8

Θ

Press L @PICT @CANCL $ to return to normal calculator display.
Notice that the slope and tangent line that you requested are listed in
the stack.

Function DOMAIN
Function DOMAIN, available through the command catalog (‚N),
provides the domain of definition of a function as a list of numbers andspecifications. For example,

indicates that between –∞ and 0, the function LN(X) is not defined (?), whilefrom 0 to +∞, the function is defined (+). On the other hand,indicates that the function is not defined between –∞ and -1, nor between 1
and +∞. The domain of this function is, therefore, -1<X<1.

Function TABVALThis function is accessed through the command catalog or through the GRAPH
sub-menu in the CALC menu. Function TABVAL takes as arguments a function of
the CAS variable, f(X), and a list of two numbers representing a domain ofinterest for the function f(X). Function TABVAL returns the input values plus therange of the function corresponding to the domain used as input. For example,

Page 13-9

This result indicates that the range of the functionf (X ) =1
X 2 +1⎧ 2 26 ⎫
,
⎬.
26
2
⎩
⎭

corresponding to the domain D = { -1,5 } is R = ⎨Function SIGNTAB
Function SIGNTAB, available through the command catalog (‚N),
provides information on the sign of a function through its domain. For example,
for the TAN(X) function,

SIGNTAB indicates that TAN(X) is negative between –π/2 and 0, and positive
between 0 and π /2. For this case, SIGNTAB does not provide information (?)
in the intervals between –∞ and -π /2, nor between +π /2 and ∞. Thus,
SIGNTAB, for this case, provides information only on the main domain of
TAN(X), namely -π /2 < X < +π /2.
A second example of function SIGNTAB is shown below:

For this case, the function is negative for X<-1 and positive for X> -1.

Function TABVAR
This function is accessed through the command catalog or through the GRAPH
sub-menu in the CALC menu. It uses as input the function f(VX), where VX is thedefault CAS variable. The function returns the following, in RPN mode:

Page 13-10

ΘLevel 3: the function f(VX)Θ

Two lists, the first one indicates the variation of the function (i.e., where
it increases or decreases) in terms of the independent variable VX, thesecond one indicates the variation of the function in terms of thedependent variable.

Θ

A graphic object showing how the variation table was computed.

Example: Analyze the function Y = X3-4X2-11X+30, using the function TABVAR.
Use the following keystrokes, in RPN mode:'X^3-4*X^2-11*X+30' `‚N ~t(select TABVAR) @@OK@@
This is what the calculator shows in stack level 1:

This is a graphic object. To be able to the result in its entirety, press ˜. The
variation table of the function is shown as follows:

Press $ to recover normal calculator display. Press ƒ to drop this lastresult from the stack.
Two lists, corresponding to the top and bottom rows of the graphics matrix
shown earlier, now occupy level 1. These lists may be useful for programming
purposes. Press ƒ to drop this last result from the stack.

Page 13-11

The interpretation of the variation table shown above is as follows: the function
F(X) increases for X in the interval (-∞, -1), reaching a maximum equal to 36 at
X = -1. Then, F(X) decreases until X = 11/3, reaching a minimum of –400/27.
After that F(X) increases until reaching +∞. Also, at X = ±∞, F(X) = ±∞.

Using derivatives to calculate extreme points“Extreme points,” or extrema, is the general designation for maximum andminimum values of a function in a given interval. Since the derivative of afunction at a given point represents the slope of a line tangent to the curve atthat point, then values of x for which f’(x) =0 represent points where the graphof the function reaches a maximum or minimum. Furthermore, the value of thesecond derivative of the function, f”(x), at those points determines whether the
point is a relative or local maximum [f”(x)<0] or minimum [f”(x)>0]. These
ideas are illustrated in the figure below.

In this figure we limit ourselves to determining extreme points of the function y =f(x) in the x-interval [a,b]. Within this interval we find two points, x = xm and x= xM, where f’(x)=0. The point x = xm, where f”(x)>0, represents a local
minimum, while the point x = xM, where f”(x)<0, represents a local maximum.
From the graph of y = f(x) it follows that the absolute maximum in the interval[a,b] occurs at x = a, while the absolute minimum occurs at x = b.
For example, to determine where the critical points of function 'X^3-4*X^211*X+30' occur, we can use the following entries in ALG mode:

Page 13-12

We find two critical points, one at x = 11/3 and one at x = -1. To evaluate thesecond derivative at each point use:

The last screen shows that f”(11/3) = 14, thus, x = 11/3 is a relative minimum.
For x = -1, we have the following:This result indicates that f”(-1) = -14, thus, x = -1 is a relative maximum.
Evaluate the function at those points to verify that indeed f(-1) > f(11/3).

Higher order derivatives
Higher order derivatives can be calculated by applying a derivative function
several times, e.g.,

Page 13-13

Anti-derivatives and integrals
An anti-derivative of a function f(x) is a function F(x) such that f(x) = dF/dx. For
example, since d(x3) /dx = 3x2, an anti-derivative of f(x) = 3x2 is F(x) = x3 + C,
where C is a constant. One way to represent an anti-derivative is as aindefinite integral, i.e.,
C = constant.

∫ f ( x)dx = F ( x) + C , if and only if, f(x) = dF/dx, andFunctions INT, INTVX, RISCH, SIGMA and SIGMAVXThe calculator provides functions INT, INTVX, RISCH, SIGMA and SIGMAVX tocalculate anti-derivatives of functions. Functions INT, RISCH, and SIGMA workwith functions of any variable, while functions INTVX, and SIGMAVX utilize
functions of the CAS variable VX (typically, ‘x’). Functions INT and RISCH
require, therefore, not only the expression for the function being integrated, butalso the independent variable name. Function INT, requires also a value of x
where the anti-derivative will be evaluated. Functions INTVX and SIGMAVX
require only the expression of the function to integrate in terms of VX. Some
examples are shown next in ALG mode:

Please notice that functions SIGMAVX and SIGMA are designed for integrands
that involve some sort of integer function like the factorial (!) function shown

Page 13-14

above. Their result is the so-called discrete derivative, i.e., one defined for
integer numbers only.

Definite integrals
In a definite integral of a function, the resulting anti-derivative is evaluated at theupper and lower limit of an interval (a,b) and the evaluated values subtracted.
Symbolically,b∫ f ( x)dx = F (b) − F (a), where f(x) = dF/dx.
a

The PREVAL(f(x),a,b) function of the CAS can simplify such calculation by
returning f(b)-f(a) with x being the CAS variable VX.

To calculate definite integrals the calculator also provides the integral symbol as
the keystroke combination ‚Á (associated with the U key). The simplest
way to build an integral is by using the Equation Writer (see Chapter 2 for an
example). Within the Equation Writer, the symbol ‚Á produces theintegral sign and provides placeholders for the integration limits (a,b), for thefunction, f(x), and for the variable of integration (x). The following screen shotsshow how to build a particular integral. The insert cursor is first located in thelower limit of integration, enter a value and press the right-arrow key (™) tomove to the upper limit of integration. Enter a value in that location and press™ again to move to the integrand location. Type the integrand expression,and press once more to move to the differential place holder, type the variableof integration in that location and the integral is ready to be calculated.

At this point, you can press ` to return the integral to the stack, which willshow the following entry (ALG mode shown):

Page 13-15

This is the general format for the definite integral when typed directly into thestack, i.e., ∫ (lower limit, upper limit, integrand, variable of integration)
Pressing ` at this point will evaluate the integral in the stack:The integral can be evaluated also in the Equation Writer by selecting the entire
expression an using the soft menu key @EVAL.

Step-by-step evaluation of derivatives and integrals
With the Step/Step option in the CAS MODES windows selected (see Chapter1), the evaluation of derivatives and integrals will be shown step by step. For
example, here is the evaluation of a derivative in the Equation Writer:ʳʳʳʳʳ
Notice the application of the chain rule in the first step, leaving the derivative of
the function under the integral explicitly in the numerator. In the second step, theresulting fraction is rationalized (eliminating the square root from thedenominator), and simplified. The final version is shown in the third step. Eachstep is shown by pressing the @EVAL menu key, until reaching the point where
further application of function EVAL produce no more changes in theexpression.
Page 13-16

The following example shows the evaluation of a definite integral in the
Equation Writer, step-by-step:

ʳʳʳʳʳ

Notice that the step-by-step process provides information on the intermediate
steps followed by the CAS to solve this integral. First, CAS identifies a squareroot integral, next, a rational fraction, and a second rational expression, tocome up with the final result. Notice that these steps make a lot of sense to thecalculator, although not enough information is provided to the user on theindividual steps.

Integrating an equation
Integrating an equation is straightforward, the calculator simply integrates bothsides of the equation simultaneously, e.g.,

Page 13-17

Techniques of integration
Several techniques of integration can be implemented in the calculators, as
shown in the following examples.

Substitution or change of variables
Suppose we want to calculate the integral. If we use step-by-

step calculation in the Equation Writer, this is the sequence of variable
substitutions:This second step shows the proper substitution to use, u = x2-1.

The last four steps show the progression of the solution: a square root, followed
by a fraction, a second fraction, and the final result. This result can be
simplified by using function @SIMP, to read:Page 13-18

Integration by parts and differentials
A differential of a function y = f(x), is defined as dy = f’(x) dx, where f’(x) is thederivative of f(x). Differentials are used to represent small increments in thevariables. The differential of a product of two functions, y = u(x)v(x), is given bydy = u(x)dv(x) +du(x)v(x), or, simply, d(uv) = udv - vdu. Thus, the integral of udv= d(uv) - vdu, is written as∫ udv = ∫ d (uv) − ∫ vdu . Since by the definition ofa differential, ∫dy = y, we write the previous expression as∫ udv = uv − ∫ vdu .
This formulation, known as integration by parts, can be used to find an integral
if dv is easily integrable. For example, the integral ∫xexdx can be solved byintegration by parts if we use u = x, dv = exdx, since, v = ex. With du = dx, theintegral becomes ∫xexdx = ∫udv = uv - ∫vdu = xex - ∫exdx = xex - ex.
The calculator provides function IBP, under the CALC/DERIV&INTG menu, thattakes as arguments the original function to integrate, namely, u(X)*v’(X), andthe function v(X), and returns u(X)*v(X) and -v(X)*u’(X). In other words, function
IBP returns the two terms of the right-hand side in the integration by partsequation. For the example used above, we can write in ALG mode:Thus, we can use function IBP to provide the components of an integration byparts. The next step will have to be carried out separately.
It is important to mention that the integral can be calculated directly by using,for example,

Page 13-19

Integration by partial fractions
Function PARTFRAC, presented in Chapter 5, provides the decomposition of afraction into partial fractions. This technique is useful to reduce a complicatedfraction into a sum of simple fractions that can then be integrated term by term.
For example, to integrate

X5 +5∫ X 4 + 2 X 3 + X dX
we can decompose the fraction into its partial component fractions, as follows:

The direct integration produces the same result, with some switching of the terms(Rigorous mode set in the CAS – see Chapter 2):

Improper integrals
These are integrals with infinite limits of integration. Typically, an improper
integral is dealt with by first calculating the integral as a limit to infinity, e.g.,
∞

dx

ε

dx

1

2

→∞ 1

2

∫ x = εlim ∫ x .
Page 13-20

Using the calculator, we proceed as follows:

Alternatively, you can evaluate the integral to infinity from the start, e.g.,

Integration with units
An integral can be calculated with units incorporated into the limits ofintegration, as in the example shown below that uses ALG mode, with the CAS
set to Approx mode. The left-hand side figure shows the integral typed in theline editor before pressing `. The right-hand figure shows the result afterpressing `.

If you enter the integral with the CAS set to Exact mode, you will be asked tochange to Approx mode, however, the limits of the integral will be shown in adifferent format as shown here:

These limits represent 1×1_mm and 0×1_mm, which is the same as 1_mm and
0_mm, as before. Just be aware of the different formats in the output.
Page 13-21

Some notes in the use of units in the limits of integrations:
1 – The units of the lower limit of integration will be the ones used in the final
result, as illustrated in the two examples below:

2 - Upper limit units must be consistent with lower limit units. Otherwise, thecalculator simply returns the unevaluated integral. For example,

3 – The integrand may have units too. For example:

4 – If both the limits of integration and the integrand have units, the resulting
units are combined according to the rules of integration. For example,

Infinite series∞

An infinite series has the form

∑ h(n)( x − a) . The infinite series typicallynn = 0 ,1starts with indices n = 0 or n = 1. Each term in the series has a coefficient h(n)that depends on the index n.

Page 13-22

Taylor and Maclaurin’s series
A function f(x) can be expanded into an infinite series around a point x=x0 byusing a Taylor’s series, namely,f ( n ) ( xo )⋅ ( x − xo ) n ,
n
!
n=0
∞

f ( x) = ∑where f(n)(x) represents the n-th derivative of f(x) with respect to x, f(0)(x) = f(x).
If the value x0 is zero, the series is referred to as a Maclaurin’s series, i.e.,f ( n ) (0) n
⋅x
n!
n=0
∞

f ( x) = ∑Taylor polynomial and reminder
In practice, we cannot evaluate all terms in an infinite series, instead, we
approximate the series by a polynomial of order k, Pk(x), and estimate the orderof a residual, Rk(x), such that∞f ( n ) ( xo )f ( n ) ( xo )nf ( x) = ∑⋅ ( x − xo ) + ∑⋅ ( x − xo ) n ,
n!
n!
n =0
n = k +1kf ( x) = P ( x) + R ( x).

k
k
i.e.,
The polynomial Pk(x) is referred to as Taylor’s polynomial. The order of theresidual is estimated in terms of a small quantity h = x-x0, i.e., evaluating thepolynomial at a value of x very close to x0. The residual if given byf ( k +1) (ξ ) k +1
Rk ( x ) =⋅h ,k!

Page 13-23

where ξ is a number near x = x0. Since ξ is typically unknown, instead of an
estimate of the residual, we provide an estimate of the order of the residual inreference to h, i.e., we say that Rk(x) has an error of order hn+1, or R ≈ O(hk+1).
If h is a small number, say, h<<1, then hk+1 will be typically very small, i.e.,hk+1<<hk<< …<< h << 1. Thus, for x close to x0, the larger the number of
elements in the Taylor polynomial, the smaller the order of the residual.

Functions TAYLR, TAYLR0, and SERIESFunctions TAYLR, TAYLR0, and SERIES are used to generate Taylor polynomials,
as well as Taylor series with residuals. These functions are available in the
CALC/LIMITS&SERIES menu described earlier in this Chapter.
Function TAYLOR0 performs a Maclaurin series expansion, i.e., about X = 0, of
an expression in the default independent variable, VX (typically ‘X’). The
expansion uses a 4-th order relative power, i.e., the difference between thehighest and lowest power in the expansion is 4. For example,

Function TAYLR produces a Taylor series expansion of a function of any variable
x about a point x = a for the order k specified by the user. Thus, the function has
the format TAYLR(f(x-a),x,k). For example,

Function SERIES produces a Taylor polynomial using as arguments the function
f(x) to be expanded, a variable name alone (for Maclaurin’s series) or an
expression of the form ‘variable = value’ indicating the point of expansion of a
Taylor series, and the order of the series to be produced. Function SERIES
returns two output items a list with four items, and an expression for h = x - a, if
the second argument in the function call is ‘x=a’, i.e., an expression for the

Page 13-24

increment h. The list returned as the first output object includes the following
items:
1 - Bi-directional limit of the function at point of expansion, i.e., lim f ( x)x→ a

2 - An equivalent value of the function near x = a
3 - Expression for the Taylor polynomial
4 - Order of the residual or remainder
Because of the relatively large amount of output, this function is easier to handle
in RPN mode. For example:

Drop the contents of stack level 1 by pressing ƒ, and then enter μ, todecompose the list. The results are as follows:

In the right-hand side figure above, we are using the line editor to see the series
expansion in detail.

Page 13-25

Chapter 14
Multi-variate Calculus Applications
Multi-variate calculus refers to functions of two or more variables. In this
Chapter we discuss the basic concepts of multi-variate calculus including partial
derivatives and multiple integrals.

Multi-variate functions
A function of two or more variables can be defined in the calculator by using
the DEFINE function („à). To illustrate the concept of partial derivative,
we will define a couple of multi-variate functions, f(x,y) = x cos(y), and g(x,y,z)= (x2+y2)1/2sin(z), as follows:

We can evaluate the functions as we would evaluate any other calculator
function, e.g.,

Graphics of two-dimensional functions are possible using Fast3D, Wireframe,
Ps-Contour, Y-Slice, Gridmap, and Pr-Surface plots as described in Chapter 12.

Partial derivatives
Consider the function of two variables z = f(x,y), the partial derivative of thefunction with respect to x is defined by the limit

Page 14-1

∂ff ( x + h, y ) − f ( x, y )
= lim
.
h
→
0
∂x
h
Similarly,∂ff ( x, y + k ) − f ( x , y )
= lim
.
k
→
0
∂y
k
We will use the multi-variate functions defined earlier to calculate partial
derivatives using these definitions. Here are the derivatives of f(x,y) with respect
to x and y, respectively:

Notice that the definition of partial derivative with respect to x, for example,
requires that we keep y fixed while taking the limit as h0. This suggest a way
to quickly calculate partial derivatives of multi-variate functions: use the rules ofordinary derivatives with respect to the variable of interest, while considering allother variables as constant. Thus, for example,∂(x cos( y ) ) = cos( y ), ∂ (x cos( y ) ) = − x sin( y ) ,∂x∂ywhich are the same results as found with the limits calculated earlier.
Consider another example,∂yx 2 + y 2 = 2 yx + 0 = 2 xy
∂x

(

)

In this calculation we treat y as a constant and take derivatives of the expression
with respect to x.
Similarly, you can use the derivative functions in the calculator, e.g., DERVX,DERIV, ∂ (described in detail in Chapter 13) to calculate partial derivatives.
Recall that function DERVX uses the CAS default variable VX (typically, ‘X’),

Page 14-2

therefore, with DERVX you can only calculate derivatives with respect to X.
Some examples of first-order partial derivatives are shown next:

ʳʳʳʳʳ

Higher-order derivatives
The following second-order derivatives can be defined∂2 f∂ ⎛ ∂f ⎞ ∂ 2 f∂ ⎛ ∂f ⎞= ⎜ ⎟, 2 = ⎜⎜ ⎟⎟,2∂x ⎝ ∂x ⎠ ∂y∂y ⎝ ∂y ⎠∂x∂2 f∂ ⎛ ∂f ⎞ ∂ 2 f∂ ⎛ ∂f ⎞= ⎜ ⎟,= ⎜⎜ ⎟⎟∂y∂x ∂y ⎝ ∂x ⎠ ∂x∂y ∂x ⎝ ∂y ⎠The last two expressions represent cross-derivatives, the partial derivatives signs
in the denominator shows the order of derivation. In the left-hand side, thederivation is taking first with respect to x and then with respect to y, and in theright-hand side, the opposite is true. It is important to indicate that, if afunction is continuous and differentiable, then

∂2 f
∂2 f
=
.
∂y∂x ∂x∂y

Page 14-3

Third-, fourth-, and higher order derivatives are defined in a similar manner.
To calculate higher order derivatives in the calculator, simply repeat thederivative function as many times as needed. Some examples are shown
below:

The chain rule for partial derivatives
Consider the function z = f(x,y), such that x = x(t), y = y(t). The function z
actually represents a composite function of t if we write it as z = f[x(t),y(t)]. The
chain rule for the derivative dz/dt for this case is written as∂z ∂z ∂x ∂z ∂y=⋅ + ⋅∂v ∂x ∂v ∂y ∂v
To see the expression that the calculator produces for this version of the chain
rule use:

The result is given by d1y(t)⋅d2z(x(t),y(t))+d1x(t)⋅d1z(x(y),y(t)). The term d1y(t)is to be interpreted as “the derivative of y(t) with respect to the 1st independent
variable, i.e., t”, or d1y(t) = dy/dt. Similarly, d1x(t) = dx/dt. On the other
hand, d1z(x(t),y(t)) means “the first derivative of z(x,y) with respect to the firstindependent variable, i.e., x”, or d1z(x(t),y(t)) = ∂z/∂x. Similarly, d2z(x(t),y(t))= ∂z/∂y. Thus, the expression above is to be interpreted as:
dz/dt = (dy/dt)⋅(∂z/∂y) + (dx/dt)⋅(∂z/∂x).

Page 14-4

Total differential of a function z = z(x,y)
From the last equation, if we multiply by dt, we get the total differential of thefunction z = z(x,y), i.e., dz = (∂z/∂x)⋅dx + (∂z/∂y)⋅dy.
A different version of the chain rule applies to the case in which z = f(x,y), x =x(u,v), y = y(u,v), so that z = f[x(u,v), y(u,v)]. The following formulas represent
the chain rule for this situation:∂z ∂z ∂x ∂z ∂y
=
⋅
+ ⋅ ,
∂u ∂x ∂u ∂y ∂u∂z ∂z ∂x ∂z ∂y=⋅ + ⋅∂v ∂x ∂v ∂y ∂v

Determining extrema in functions of two variables
In order for the function z = f(x,y) to have an extreme point (extrema) at (xo,yo),its derivatives ∂f/∂x and ∂f/∂y must vanish at that point. These are necessary
conditions. The sufficient conditions for the function to have an extreme at point(xo,yo) are ∂f/∂x = 0, ∂f/∂y = 0, and Δ = (∂2f/∂x2)⋅ (∂2f/∂y2)-[∂2f/∂x∂y]2 > 0.
The point (xo,yo) is a relative maximum if ∂2f/∂x2 < 0, or a relative minimum if∂2f/∂x2> 0. The value Δ is referred to as the discriminant.
If Δ = (∂2f/∂x2)⋅ (∂2f/∂y2)-[∂2f/∂x∂y]2 < 0, we have a condition known as asaddle point, where the function would attain a maximum in x if we were to
hold y constant, while, at the same time, attaining a minimum if we were to
hold x constant, or vice versa.
Example 1 – Determine the extreme points (if any) of the function f(X,Y) = X3-3XY2+5. First, we define the function f(X,Y), and its derivatives fX(X,Y) = ∂f/∂X,
fY(X,Y) = ∂f/∂Y. Then, we solve the equations fX(X,Y) = 0 and fY(X,Y) = 0,
simultaneously:

Page 14-5

We find critical points at (X,Y) = (1,0), and (X,Y) = (-1,0). To calculate thediscriminant, we proceed to calculate the second derivatives, fXX(X,Y) = ∂2f/
∂X2, fXY(X,Y) = ∂2f/∂X/∂Y, and fYY(X,Y) = ∂2f/∂Y2.

The last result indicates that the discriminant is Δ = -12X, thus, for (X,Y) = (1,0),
Δ <0 (saddle point), and for (X,Y) = (-1,0), Δ>0 and ∂2f/∂X2<0 (relative
maximum). The figure below, produced in the calculator, and edited in thecomputer, illustrates the existence of these two points:

Using function HESS to analyze extrema
Function HESS can be used to analyze extrema of a function of two variables asshown next. Function HESS, in general, takes as input a function of n
independent variables φ(x1, x2, …,xn), and a vector of the functions [‘x1’‘x2’…’xn’]. Function HESS returns the Hessian matrix of the function φ, definedas the matrix H = [hij] = [∂2φ/∂xi∂xj], the gradient of the function with respect tothe n-variables, grad f = [ ∂φ/∂x1, ∂φ/∂x2 , … ∂φ/∂xn], and the list ofvariables [‘x1’ ‘x2’…’xn’].

Page 14-6

Applications of function HESS are easier to visualize in the RPN mode.
Consider as an example the function φ(X,Y,Z) = X2 + XY + XZ, we’ll apply
function HESS to function φ in the following example. The screen shots show the
RPN stack before and after applying function HESS.

When applied to a function of two variables, the gradient in level 2, when
made equal to zero, represents the equations for critical points, i.e., ∂φ/∂xi = 0,
while the matrix in level 3 represent second derivatives. Thus, the results fromthe HESS function can be used to analyze extrema in functions of two variables.
For example, for the function f(X,Y) = X3-3X-Y2+5, proceed as follows in RPN
mode:‘X^3-3*X-Y^2+5’ ` [‘X’,’Y’] `
HESS
SOLVE
μ
‘s1’ K ‘s2’ K

Enter function and variables
Apply function HESS
Find critical points
Decompose vector
Store critical points

The variables s1 and s2, at this point, contain the vectors [‘X=-1’,’Y=0] and[‘X=1’,’Y=0], respect‘H’ K
J @@@H@@@ @@s1@@ SUBST ‚ïStore Hessian matrix
Substitute s1 into H

The resulting matrix A has a11 elements a11 = ∂2φ/∂X2 = -6., a22 = ∂2φ/∂X2 =-2., and a12 = a21 = ∂2φ/∂X∂Y = 0. The discriminant, for this critical points1(-1,0) is Δ = (∂2f/∂x2)⋅ (∂2f/∂y2)-[∂2f/∂x∂y]2 = (-6.)(-2.) = 12.0 > 0. Since∂2φ/∂X2 <0, point s1 represents a relative maximum.
Next, we substitute the second point, s2, into H:
J @@@H@@@ @@s2@@ SUBST ‚ï

Substitute s2 into H

Page 14-7

The resulting matrix has elements a11 = ∂2φ/∂X2 = 6., a22 = ∂2φ/∂X2 = -2.,and a12 = a21 = ∂2φ/∂X∂Y = 0. The discriminant, for this critical point s2(1,0)
is Δ = (∂2f/∂x2)⋅ (∂2f/∂y2)-[∂2f/∂x∂y]2 = (6.)(-2.) = -12.0 < 0, indicating asaddle point.

Multiple integralsb

A physical interpretation of an ordinary integral,∫ f ( x)dx , is the area underathe curve y = f(x) and abscissas x = a and x = b. The generalization to three
dimensions of an ordinary integral is a double integral of a function f(x,y) overa region R on the x-y plane representing the volume of the solid body contained
under the surface f(x,y) above the region R. The region R can be described as
R = {a<x<b, f(x)<y<g(x)} or as R = {c<y<d, r(y)<x<s(y)}. Thus, the double
integral can be written asb g ( x)ds( y)f ( x)cr( y)∫∫ φ ( x, y)dA = ∫ ∫aRφ ( x, y )dydx = ∫ ∫φ ( x, y )dydx

Calculating a double integral in the calculator is straightforward. A double
integral can be built in the Equation Writer (see example in Chapter 2). An
example follows. This double integral is calculated directly in the Equation
Writer by selecting the entire expression and using function @EVAL. The result is
3/2. Step-by-step output is possible by setting the Step/Step option in the CAS
MODES screen.

Page 14-8

Jacobian of coordinate transformation
Consider the coordinate transformation x = x(u,v), y = y(u,v). The Jacobian of
this transformation is defined as⎛ ∂x⎜| J |= det( J ) = det⎜ ∂u
⎜ ∂y
⎜
⎝ ∂u

∂x ⎞
⎟
∂v ⎟ .
∂y ⎟⎟∂v ⎠When calculating an integral using such transformation, the expression to useis∫∫ φ ( x, y)dydx = ∫∫ φ[ x(u, v), y(u, v)] | J | dudv , where R’ is the region R
R

R'

expressed in (u,v) coordinates.

Double integral in polar coordinates
To transform from polar to Cartesian coordinates we use x(r,θ) = r cos θ, andy(r, θ) = r sin θ. Thus, the Jacobian of the transformation is∂x| J |= ∂r∂y∂r∂x∂θ = cos(θ ) − r ⋅ sin(θ ) = r∂ysin(θ ) r ⋅ cos(θ )∂θWith this result, integrals in polar coordinates are written as

Page 14-9βg (θ )∫∫ φ (r ,θ )dA = ∫α ∫ θ φ (r ,θ )rdrdθ
R'

f( )

where the region R’ in polar coordinates is R’ = {α < θ < β, f(θ) < r < g(θ)}.
Double integrals in polar coordinates can be entered in the calculator, making
sure that the Jacobian |J| = r is included in the integrand. The following is an
example of a double integral calculated in polar coordinates, shown step-bystep:

Page 14-10

Chapter 15
Vector Analysis Applications
In this Chapter we present a number of functions from the CALC menu that
apply to the analysis of scalar and vector fields. The CALC menu waspresented in detail in Chapter 13. In particular, in the DERIV&INTEG menu we
identified a number of functions that have applications in vector analysis,
namely, CURL, DIV, HESS, LAPL. For the exercises in this Chapter, change yourangle measure to radians.

Definitions
A function defined in a region of space such as φ(x,y,z) is known as a scalar
field, examples are temperature, density, and voltage near a charge. If thefunction is defined by a vector, i.e., F(x,y,z) = f(x,y,z)i+g(x,y,z)j+h(x,y,z)k, it isreferred to as a vector field.
The following operator, referred to as the ‘del’ or ‘nabla’ operator, is a vectorbased operator that can be applied to a scalar or vector function:∇[ ] = i ⋅∂[ ]+ j ⋅ ∂ [ ]+ k ⋅ ∂ [ ]
∂x
∂y
∂z

When this operator is applied to a scalar function we can obtain the gradientof the function, and when applied to a vector function we can obtain thedivergence and the curl of that function. A combination of gradient anddivergence produces another operator, called the Laplacian of a scalarfunction. These operations are presented next.

Gradient and directional derivative
The gradient of a scalar function φ(x,y,z) is a vector function defined by

gradφ = ∇φ = i ⋅

∂φ
∂φ
∂φ
+ j⋅
+k⋅
∂x
∂y
∂z

The dot product of the gradient of a function with a given unit vector represents
the rate of change of the function along that particular vector. This rate ofchange is called the directional derivative of the function, Duφ(x,y,z) = u•∇φ.

Page 15-1

At any particular point, the maximum rate of change of the function occurs in
the direction of the gradient, i.e., along a unit vector u = ∇φ/|∇φ|.
The value of that directional derivative is equal to the magnitude of the gradientat any point Dmaxφ(x,y,z) = ∇φ •∇φ/|∇φ| = |∇φ|
The equation φ(x,y,z) = 0 represents a surface in space. It turns out that thegradient of the function at any point on this surface is normal to the surface.
Thus, the equation of a plane tangent to the curve at that point can be found byusing a technique presented in Chapter 9.
The simplest way to obtain the gradient is by using function DERIV, available in
the CALC menu, e.g.,

A program to calculate the gradient
The following program, which you can store into variable GRADIENT, uses
function DERIV to calculate the gradient of a scalar function of X,Y,Z.
Calculations for other base variables will not work. If you work frequently in the(X,Y,Z) system, however, this function will facilitate calculations:<< X Y Z 3 ARRY DERIV >>Type the program while in RPN mode. After switching to ALG mode, you cancall the function GRADIENT as in the following example:

Using function HESS to obtain the gradient
The function HESS can be used to obtain the gradient of a function as shown
next. As indicated in Chapter 14, function HESS takes as input a function of n
independent variables φ(x1, x2, …,xn), and a vector of the functions [‘x1’‘x2’…’xn’]. Function HESS returns the Hessian matrix of the function φ, definedPage 15-2

as the matrix H = [hij] = [∂φ/∂xi∂xj], the gradient of the function with respect tothe n-variables, grad f = [ ∂φ/∂x1, ∂φ/∂x2 , … ∂φ/∂xn], and the list ofvariables [‘x1’ ‘x2’…’xn’]. Consider as an example the function φ(X,Y,Z) = X2 +XY + XZ, we’ll apply function HESS to this scalar field in the following example
in RPN mode:Thus, the gradient is [2X+Y+Z, X, X]. Alternatively, one can use function DERIV
as follows: DERIV(X^2+X*Y+X*Z,[X,Y,Z]), to obtain the same result.

Potential of a gradient
Given the vector field, F(x,y,z) = f(x,y,z)i+g(x,y,z)j+h(x,y,z)k, if there exists afunction φ(x,y,z), such that f = ∂φ/∂x, g = ∂φ/∂y, and h = ∂φ/∂z, then φ(x,y,z) isreferred to as the potential function for the vector field F. It follows that F = grad
φ = ∇φ.
The calculator provides function POTENTIAL, available through the command
catalog (‚N), to calculate the potential function of a vector field, if itexists. For example, if F(x,y,z) = xi + yj + zk, applying function POTENTIAL wefind:

Since function SQ(x) represents x2, this results indicates that the potentialfunction for the vector field F(x,y,z) = xi + yj + zk, is φ(x,y,z) = (x2+y2+z2)/2.
Notice that the conditions for the existence of φ(x,y,z), namely, f = ∂φ/∂x, g =∂φ/∂y, and h = ∂φ/∂z, are equivalent to the conditions: ∂f/∂y = ∂g/∂x, ∂f/∂z =∂h/∂x, and ∂g/∂z = ∂h/∂y. These conditions provide a quick way to determine
if the vector field has an associated potential function. If one of the conditions∂f/∂y = ∂g/∂x, ∂f/∂z = ∂h/∂x, ∂g/∂z = ∂h/∂y, fails, a potential function
φ(x,y,z) does not exist. In such case, function POTENTIAL returns an error
message. For example, the vector field F(x,y,z) = (x+y)i + (x-y+z)j + xzk, does

Page 15-3

not have a potential function associated with it, since, ∂f/∂z ≠ ∂h/∂x. The
calculator response in this case is shown below:

Divergence
The divergence of a vector function, F(x,y,z) = f(x,y,z)i+g(x,y,z)j+h(x,y,z)k,is defined by taking a “dot-product” of the del operator with the function, i.e.,

divF = ∇ • F =∂f ∂g ∂h++∂x ∂y ∂z

Function DIV can be used to calculate the divergence of a vector field. For
example, for F(X,Y,Z) = [XY,X2+Y2+Z2,YZ], the divergence is calculated, in ALG
mode, as follows:

LaplacianThe divergence of the gradient of a scalar function produces an operator called
the Laplacian operator. Thus, the Laplacian of a scalar function φ(x,y,z) is givenby∇ 2φ = ∇ • ∇ φ =∂ 2φ ∂ 2φ ∂ 2φ++
∂x 2 ∂x 2 ∂x 2

The partial differential equation ∇2φ = 0 is known as Laplace’s equation.
Function LAPL can be used to calculate the Laplacian of a scalar function. For
example, to calculate the Laplacian of the function φ(X,Y,Z) = (X2+Y2)cos(Z),use:Page 15-4

Curl
The curl of a vector field F(x,y,z) = f(x,y,z)i+g(x,y,z)j+h(x,y,z)k, is defined by a“cross-product” of the del operator with the vector field, i.e.,

i
j
k
∂
∂
∂
[]
[]
[]
curlF = ∇ × F =∂x∂y∂zf ( x , y , z ) g ( x, y , z ) h ( x , y , z )⎛ ∂h ∂g ⎞ ⎛ ∂f ∂h ⎞⎛ ∂h ∂g ⎞= i⎜⎜ − ⎟⎟ + j⎜ − ⎟ + k ⎜⎜ − ⎟⎟⎝ ∂y ∂z ⎠ ⎝ ∂z ∂x ⎠⎝ ∂y ∂z ⎠The curl of vector field can be calculated with function CURL. For example, forthe function F(X,Y,Z) = [XY,X2+Y2+Z2,YZ], the curl is calculated as follows:

Irrotational fields and potential function
In an earlier section in this chapter we introduced function POTENTIAL to
calculate the potential function φ(x,y,z) for a vector field, F(x,y,z) = f(x,y,z)i+g(x,y,z)j+ h(x,y,z)k, such that F = grad φ = ∇φ. We also indicated that theconditions for the existence of φ, were: ∂f/∂y = ∂g/∂x, ∂f/∂z = ∂h/∂x, and ∂g/∂z = ∂h/∂y. These conditions are equivalent to the vector expression
curl F = ∇×F = 0.
A vector field F(x,y,z), with zero curl, is known as an irrotational field. Thus, weconclude that a potential function φ(x,y,z) always exists for an irrotational field
F(x,y,z).

Page 15-5

As an example, in an earlier example we attempted to find a potential function
for the vector field F(x,y,z) = (x+y)i + (x-y+z)j + xzk, and got an error message
back from function POTENTIAL. To verify that this is a rotational field (i.e., ∇×F≠ 0), we use function CURL on this field:

On the other hand, the vector field F(x,y,z) = xi + yj + zk, is indeed irrotational
as shown below:

Vector potential
Given a vector field F(x,y,z) = f(x,y,z)i+g(x,y,z)j+h(x,y,z)k, if there exists a
vector function Φ(x,y,z) = φ(x,y,z)i+ψ(x,y,z)j+η(x,y,z)k, such that F = curl Φ = ∇× Φ, then function Φ(x,y,z) is referred to as the vector potential of F(x,y,z).
The calculator provides function VPOTENTIAL, available through the command
catalog (‚N), to calculate the vector potential, Φ(x,y,z), given the vector
field, F(x,y,z) = f(x,y,z)i+g(x,y,z)j+h(x,y,z)k. For example, given the vector
field, F(x,y,z) = -(yi+zj+xk), function VPOTENTIAL produces

i.e., Φ(x,y,z) = -x2/2j + (-y2/2+zx)k.
It should be indicated that there is more than one possible vector potentialfunctions Φ for a given vector field F. For example, the following screen shotshows that the curl of the vector function Φ1 = [X2+Y2+Z2,XYZ,X+Y+Z] is thevector F = ∇× Φ2 = [1-XY,2Z-1,ZY-2Y]. Application of function VPOTENTIAL

Page 15-6

produces the vector potential function Φ2 = [0, ZYX-2YX, Y-(2ZX-X)], which isdifferent from Φ1. The last command in the screen shot shows that indeed F =∇× Φ2. Thus, a vector potential function is not uniquely determined.

The components of the given vector field, F(x,y,z) = f(x,y,z)i+g(x,y,z)j+h(x,y,z)k, and those of the vector potential function, Φ(x,y,z) =φ(x,y,z)i+ψ(x,y,z)j+η(x,y,z)k, are related by f = ∂η/∂y - ∂ψ/∂x, g = ∂φ/∂z - ∂η/∂x, and h = ∂ψ/∂x - ∂φ/∂y.
A condition for function Φ(x,y,z) to exists is that div F = ∇•F = 0, i.e., ∂f/∂x +∂g/∂y + ∂f/∂z = 0. Thus, if this condition is not satisfied, the vector potentialfunction Φ(x,y,z) does not exist. For example, given F = [X+Y,X-Y,Z^2], function
VPOTENTIAL returns an error message, since function F does not satisfy thecondition ∇•F = 0:

The condition ∇•F ≠ 0 is verified in the following screen shot:

Page 15-7

Chapter 16
Differential Equations
In this Chapter we present examples of solving ordinary differential equations(ODE) using calculator functions. A differential equation is an equation
involving derivatives of the independent variable. In most cases, we seek thedependent function that satisfies the differential equation.

Basic operations with differential equations
In this section we present some uses of the calculator for entering, checking andvisualizing the solution of ODEs.

Entering differential equations
The key to using differential equations in the calculator is typing in thederivatives in the equation. The easiest way to enter a differential equation is totype it in the equation writer. For example, to type the following ODE:(x-1)⋅(dy(x)/dx)2 + 2⋅x⋅y(x) = ex sin x, use:‚O „ Ü~ „x -1 ™™™*‚¿ ~„x™~„y„Ü~„x™™ Q2 ™™+2*~„ x * ~„ y „Ü~„x ™™™™
‚= „¸ ~„ x ™*S~„x `The derivative dy/dx is represented by ∂x(y(x)) or by d1y(x). For solution
or calculation purposes, you need to specify y(x) in the expression, i.e., thedependent variable must include its independent variable(s) in any derivative inthe equation.
You can also type an equation directly into the stack by using the symbol ∂ inthe derivatives. For example, to type the following ODE involving second-orderderivatives: d2u(x)/dx2 + 3u(x)⋅(du(x)/dx) + u(x)2 = 1/x, directly into thescreen, use:³‚∂ ~„x„Ü‚¿~„x„ Ü~ „u„Ü ~„x™™™+3*~ „u„Ü~„x™*‚¿~„x„ Ü~„u„ Ü~„x ™™ +~„u„ Ü ~„x™ Q2‚ Å 1/ ~„x`
The result is ‘∂x(∂x(u(x)))+3*u(x)*∂x(u(x))+u^2=1/x ’. This format
shows up in the screen when the _Textbook option in the display setting

Page 16-1

(H@)DISP) is not selected. Press ˜ to see the equation in the Equation
Writer.
An alternative notation for derivatives typed directly in the stack is to use ‘d1’ forthe derivative with respect to the first independent variable, ‘d2’ for thederivative with respect to the second independent variable, etc. A secondorder derivative, e.g., d2x/dt2, where x = x(t), would be written as ‘d1d1x(t)’,while (dx/dt)2 would be written ‘d1x(t)^2’. Thus, the PDE ∂2y/∂t2 – g(x,y)⋅(∂2y/∂x2)2 = r(x,y), would be written, using this notation, as ‘d2d2y(x,t)g(x,y)*d1d1y(x,t)^2=r(x,y)’.
The notation using ‘d’ and the order of the independent variable is the notationpreferred by the calculator when derivatives are involved in a calculation. For
example, using function DERIV, in ALG mode, as shown next
DERIV(‘x*f(x,t)+g(t,y) = h(x,y,t)’,t), produces the following expression:‘x*d2f(x,t)+d1g(t,y)=d3h(x,y,t)’. Translated to paper, thisexpression represents the partial differential equation x⋅(∂f/∂t) + ∂g/∂t = ∂h/∂t.
Because the order of the variable t is different in f(x,t), g(t,y), and h(x,y,t),derivatives with respect to t have different indices, i.e., d2f(x,t), d1g(t,y), andd3h(x,y,t). All of them, however, represent derivatives with respect to the same
variable.
Expressions for derivatives using the order-of-variable index notation do nottranslate into derivative notation in the equation writer, as you can check bypressing ˜ while the last result is in stack level 1. However, the calculator
understands both notations and operates accordingly regarding of the notation
used.

Checking solutions in the calculator
To check if a function satisfy a certain equation using the calculator, usefunction SUBST (see Chapter 5) to replace the solution in the form ‘y = f(x)’ or ‘y= f(x,t)’, etc., into the differential equation. You may need to simplify the result
by using function EVAL to verify the solution. For example, to check that u = A
sin ωot is a solution of the equation d2u/dt2 + ωo2⋅u = 0, use the following:
In ALG mode:
SUBST(‘∂t(∂t(u(t)))+ ω0^2*u(t) = 0’,‘u(t)=A*SIN (ω0*t)’) `Page 16-2

EVAL(ANS(1)) `In RPN mode:‘∂t(∂t(u(t)))+ ω0^2*u(t) = 0’ ` ‘u(t)=A*SIN (ω0*t)’ `SUBST EVAL
The result is‘0=0’.

For this example, you could also use: ‘∂t(∂t(u(t))))+ ω0^2*u(t) = 0’ to enter thedifferential equation.

Slope field visualization of solutions
Slope field plots, introduced in Chapter 12, are used to visualize the solutions toa differential equation of the form dy/dx = f(x,y). A slope field plot shows anumber of segments tangential to the solution curves, y = f(x). The slope of thesegments at any point (x,y) is given by dy/dx = f(x,y), evaluated at any point(x,y), represents the slope of the tangent line at point (x,y).
Example 1 -- Trace the solution to the differential equation y’ = f(x,y) = sin x cos
y, using a slope field plot. To solve this problem, follow the instructions in
Chapter 12 for slopefield plots.
If you could reproduce the slope field plot in paper, you can trace by hand linesthat are tangent to the line segments shown in the plot. This lines constitute linesof y(x,y) = constant, for the solution of y’ = f(x,y). Thus, slope fields are usefultools for visualizing particularly difficult equations to solve.
In summary, slope fields are graphical aids to sketch the curves y = g(x) that
correspond to solutions of the differential equation dy/dx = f(x,y).

The CALC/DIFF menu
The DIFFERENTIAL EQNS.. sub-menu within the CALC („Ö) menu provides
functions for the solution of differential equations. The menu is listed below withsystem flag 117 set to CHOOSE boxes:

Page 16-3

These functions are briefly described next. They will be described in more detailin later parts of this Chapter.
DESOLVE: Differential Equation SOLVEr, provides a solution if possible
ILAP: Inverse LAPlace transform, L-1[F(s)] = f(t)LAP: LAPlace transform, L[f(t)]=F(s)LDEC: solves Linear Differential Equations with Constant coefficients, including
systems of differential equations with constant coefficients

Solution to linear and non-linear equations
An equation in which the dependent variable and all its pertinent derivatives
are of the first degree is referred to as a linear differential equation. Otherwise,
the equation is said to be non-linear. Examples of linear differential equations
are: d2x/dt2 + β⋅(dx/dt) + ωo⋅x = A sin ωf t, and ∂C/∂t + u⋅(∂C/∂x) = D⋅(∂2C/∂x2).
An equation whose right-hand side (not involving the function or its derivatives)is equal to zero is called a homogeneous equation. Otherwise, it is called nonhomogeneous. The solution to the homogeneous equation is known as a
general solution. A particular solution is one that satisfies the nonhomogeneous equation.

Function LDEC
The calculator provides function LDEC (Linear Differential Equation Command)
to find the general solution to a linear ODE of any order with constantcoefficients, whether it is homogeneous or not. This function requires you toprovide two pieces of input:•

the right-hand side of the ODE•

the characteristic equation of the ODE
Page 16-4

Both of these inputs must be given in terms of the default independent variable
for the calculator’s CAS (typically ‘X’). The output from the function is thegeneral solution of the ODE. The function LDEC is available through in the
CALC/DIFF menu. The examples are shown in the RPN mode, however,translating them to the ALG mode is straightforward.
Example 1 – To solve the homogeneous ODE: d3y/dx3-4⋅(d2y/dx2)-11⋅(dy/dx)+30⋅y = 0, enter: 0 ` 'X^3-4*X^2-11*X+30' ` LDEC μ.
The solution is:where cC0, cC1, and cC2 are constants of integration. While this result seems
very complicated, it can be simplified if we takeandK1 = (10*cC0-(7+cC1-cC2))/40, K2 = -(6*cC0-(cC1+cC2))/24,
K3 = (15*cC0+(2*cC1-cC2))/15.

Then, the solution is
y = K1⋅e–3x + K2⋅e5x + K3⋅e2x.
The reason why the result provided by LDEC shows such complicatedcombination of constants is because, internally, to produce the solution, LDEC
utilizes Laplace transforms (to be presented later in this chapter), whichtransform the solution of an ODE into an algebraic solution. The combinationof constants result from factoring out the exponential terms after the Laplacetransform solution is obtained.

Example 2 – Using the function LDEC, solve the non-homogeneous ODE:
d3y/dx3-4⋅(d2y/dx2)-11⋅(dy/dx)+30⋅y = x2.
Enter:'X^2' ` 'X^3-4*X^2-11*X+30' ` LDEC μ

Page 16-5

The solution, shown partially here in the Equation Writer, is:Replacing the combination of constants accompanying the exponential termswith simpler values, the expression can be simplified to y = K1⋅e–3x + K2⋅e5x +K3⋅e2x + (450⋅x2+330⋅x+241)/13500.
We recognize the first three terms as the general solution of the homogeneous
equation (see Example 1, above). If yh represents the solution to thehomogeneous equation, i.e., yh = K1⋅e–3x + K2⋅e5x + K3⋅e2x. You can provethat the remaining terms in the solution shown above, i.e., yp =(450⋅x2+330⋅x+241)/13500, constitute a particular solution of the ODE.
Note: This result is general for all non-homogeneous linear ODEs, i.e., given
the solution of the homogeneous equation, yh(x), the solution of thecorresponding non-homogeneous equation, y(x), can be written asy(x) = yh(x) + yp(x),where yp(x) is a particular solution to the ODE.
To verify that yp = (450⋅x2+330⋅x+241)/13500, is indeed a particular solutionof the ODE, use the following:'d1d1d1Y(X)-4*d1d1Y(X)-11*d1Y(X)+30*Y(X) = X^2'`'Y(X)=(450*X^2+330*X+241)/13500' `SUBST EV L
Allow the calculator about ten seconds to produce the result: ‘X^2 = X^2’.
Example 3 - Solving a system of linear differential equations with constantcoefficients.
Consider the system of linear differential equations:x1’(t) + 2x2’(t) = 0,Page 16-6

2x1’(t) + x2’(t) = 0.

⎡1 2 ⎤⎥ . The⎣2 1 ⎦In algebraic form, this is written as: A⋅x’(t) = 0, where A = ⎢system can be solved by using function LDEC with arguments [0,0] and matrix
A, as shown in the following screen using ALG mode:

The solution is given as a vector containing the functions [x1(t), x2(t)]. Pressing
˜ will trigger the Matrix Writer allowing the user to see the two componentsof the vector. To see all the details of each component, press the @EDIT! soft
menu key. Verify that the components are:Function DESOLVE
The calculator provides function DESOLVE (Differential Equation SOLVEr) tosolve certain types of differential equations. The function requires as input thedifferential equation and the unknown function, and returns the solution to theequation if available. You can also provide a vector containing the differential
equation and the initial conditions, instead of only a differential equation, as
input to DESOLVE. The function DESOLVE is available in the CALC/DIFF
menu. Examples of DESOLVE applications are shown below using RPN mode.
Example 1 – Solve the first-order ODE:
dy/dx + x2⋅y(x) = 5.
In the calculator use:'d1y(x)+x^2*y(x)=5' ` 'y(x)' ` DESOLVE
The solution provided is{‘y = (INT(5*EXP(xt^3/3),xt,x)+cC0)*1/EXP(x^3/3)}’ }, i.e.,

Page 16-7

The variable ODETYPE
You will notice in the soft-menu key labels a new variable called @ODETY(ODETYPE). This variable is produced with the call to the DESOL function andholds a string showing the type of ODE used as input for DESOLVE. Press @ODETY
to obtain the string “1st order linear”.
Example 2 -- Solve the second-order ODE:
d2y/dx2 + x (dy/dx) = exp(x).
In the calculator use:
‘d1d1y(x)+x*d1y(x) = EXP(x)’ ` ‘y(x)’ ` DESOLVE
The result is an expression having two implicit integrations, namely,

For this particular equation, however, we realize that the left-hand side of theequation represents d/dx(x dy/dx), thus, the ODE is now written:
d/dx(x dy/dx ) = exp x,
andx dy/dx = exp x + C.
Next, we can write
dy/dx = (C + exp x)/x = C/x + ex/x.
In the calculator, you may try to integrate:‘d1y(x) = (C + EXP(x))/x’ ` ‘y(x)’ ` DESOLVE
The result is{ ‘y(x) = INT((EXP(xt)+C)/xt,xt,x)+C0’ }, i.e.,

Page 16-8

y ( x) = ∫ ⋅ex + Cdx + C 0x

Performing the integration by hand, we can only get it as far as:exy ( x) = ∫ ⋅ dx + C ⋅ ln x + C 0xbecause the integral of exp(x)/x is not available in closed form.
Example 3 – Solving an equation with initial conditions. Solved2y/dt2 + 5y = 2 cos(t/2),
with initial conditions
y(0) = 1.2, y’(0) = -0.5.
In the calculator, use:[‘d1d1y(t)+5*y(t) = 2*COS(t/2)’ ‘y(0) = 6/5’ ‘d1y(0) = -1/2’] `‘y(t)’ `DESOLVE
Notice that the initial conditions were changed to their Exact expressions, ‘y(0)= 6/5’, rather than ‘y(0)=1.2’, and ‘d1y(0) = -1/2’, rather than, ‘d1y(0) = -0.5’.
Changing to these Exact expressions facilitates the solution.
Note: To obtain fractional expressions for decimal values use function Q(See Chapter 5).
The solution is:

Press μμto simplify the result to‘y(t) = -((19*√5*SIN(√5*t)-(148*COS(√5*t)+80*COS(t/2)))/190)’.

Page 16-9

Press J @ODETY to get the string “Linear w/ cst coeff” for the ODE type inthis case.

Laplace Transforms
The Laplace transform of a function f(t) produces a function F(s) in the image
domain that can be utilized to find the solution of a linear differential equation
involving f(t) through algebraic methods. The steps involved in this application
are three:
1.
2.
3.

Use of the Laplace transform converts the linear ODE involving f(t) into an
algebraic equation.
The unknown F(s) is solved for in the image domain through algebraic
manipulation.
An inverse Laplace transform is used to convert the image function found instep 2 into the solution to the differential equation f(t).

Definitions
The Laplace transform for function f(t) is the function F(s) defined as∞

L{ f (t )} = F ( s ) = ∫ f (t ) ⋅ e − st dt.
0

The image variable s can be, and it generally is, a complex number.
Many practical applications of Laplace transforms involve an original function
f(t) where t represents time, e.g., control systems in electric or hydraulic circuits.
In most cases one is interested in the system response after time t>0, thus, thedefinition of the Laplace transform, given above, involves an integration forvalues of t larger than zero.
The inverse Laplace transform maps the function F(s) onto the original function
f(t) in the time domain, i.e., L -1{F(s)} = f(t).
The convolution integral or convolution product of two functions f(t) and g(t),where g is shifted in time, is defined ast( f * g )( t ) = ∫ f ( u ) ⋅ g ( t − u ) ⋅ du .
0Page 16-10

Laplace transform and inverses in the calculator
The calculator provides the functions LAP and ILAP to calculate the Laplacetransform and the inverse Laplace transform, respectively, of a function f(VX),
where VX is the CAS default independent variable, which you should set to ‘X’.
Thus, the calculator returns the transform or inverse transform as a function of X.
The functions LAP and ILAP are available under the CALC/DIFF menu. The
examples are worked out in the RPN mode, but translating them to ALG mode isstraightforward. For these examples, set the CAS mode to Real and Exact.
Example 1 –You can get the definition of the Laplace transform use thefollowing: ‘f(X)’ ` L P in RPN mode, or L P(f(X))in ALG mode.
The calculator returns the result (RPN, left; ALG, right):

Compare these expressions with the one given earlier in the definition of the
Laplace transform, i.e.,

L{ f (t )} = F ( s ) = ∫∞0f (t ) ⋅ e − st dt ,and you will notice that the CAS default variable X in the equation writer screen
replaces the variable s in this definition. Therefore, when using the function
LAP you get back a function of X, which is the Laplace transform of f(X).
Example 2 – Determine the Laplace transform of f(t) = e2t⋅sin(t). Use:
‘EXP(2*X)*SIN(X)’ ` LAP The calculator returns the result: 1/(SQ(X-2)+1).
Press μ to obtain, 1/(X2-4X+5).
When you translate this result in paper you would write

F ( s ) = L{e 2t ⋅ sin t} =1
s − 4⋅s +5
2Page 16-11

Example 3 – Determine the inverse Laplace transform of F(s) = sin(s). Use:
‘SIN(X)’ ` ILAP. The calculator takes a few seconds to return the result:‘ILAP(SIN(X))’, meaning that there is no closed-form expression f(t), such that f(t)= L -1{sin(s)}.
Example 4 – Determine the inverse Laplace transform of F(s) = 1/s3. Use:
‘1/X^3’ ` ILAP μ. The calculator returns the result: ‘X^2/2’, which isinterpreted as L -1{1/s3} = t2/2.
Example 5 – Determine the Laplace transform of the function f(t) = cos (a⋅t+b).
Use: ‘COS(a*X+b)’ ` LAP . The calculator returns the result:Press μ to obtain –(a sin(b) – X cos(b))/(X2+a2). The transform is interpreted
as follows: L {cos(a⋅t+b)} = (s⋅cos b – a⋅sin b)/(s2+a2).

Laplace transform theorems
To help you determine the Laplace transform of functions you can use a numberof theorems, some of which are listed below. A few examples of the theorem
applications are also included.
Θ

Differentiation theorem for the first derivative. Let fo be the initial condition
for f(t), i.e., f(0) = fo, thenL{df/dt} = s⋅F(s) - fo.

Example 1 – The velocity of a moving particle v(t) is defined as v(t) = dr/dt,
where r = r(t) is the position of the particle. Let ro = r(0), and R(s) =L{r(t)}, then,
the transform of the velocity can be written as V(s) = L{v(t)}=L{dr/dt}= s⋅R(s)-ro.
Θ

Differentiation theorem for the second derivative. Let fo = f(0), and (df/dt)o= df/dt|t=0, then L{d2f/dt2} = s2⋅F(s) - s⋅fo – (df/dt) o.

Page 16-12

Example 2 – As a follow up to Example 1, the acceleration a(t) is defined asa(t) = d2r/dt2. If the initial velocity is vo = v(0) = dr/dt|t=0, then the Laplacetransform of the acceleration can be written as:
A(s) = L{a(t)} = L{d2r/dt2}= s2⋅R(s) - s⋅ro – v o.
Θ

Differentiation theorem for the n-th derivative.
Let f (k)o = dkf/dxk|t = 0, and fo = f(0), thenL{dnf/dtn} = sn⋅F(s) – sn-1⋅fo −…– s⋅f(n-2)o – f (n-1) o.

ΘLinearity theorem. L{af(t)+bg(t)} = a⋅L{f(t)} + b⋅L{g(t)}.

ΘDifferentiation theorem for the image function. Let F(s) = L{f(t)}, then dnF/
dsn = L{(-t)n⋅f(t)}.

Example 3 – Let f(t) = e–at, using the calculator with ‘EXP(-a*X)’ ` LAP, you
get ‘1/(X+a)’, or F(s) = 1/(s+a). The third derivative of this expression can becalculated by using:‘X’ ` ‚¿ ‘X’ `‚¿ ‘X’ ` ‚¿ μ
The result is‘-6/(X^4+4*a*X^3+6*a^2*X^2+4*a^3*X+a^4)’, or
d3F/ds3 = -6/(s4+4⋅a⋅s3+6⋅a2⋅s2+4⋅a3⋅s+a4).
Now, use ‘(-X)^3*EXP(-a*X)’ ` LAP μ. The result is exactly the same.
ΘIntegration theorem. Let F(s) = L{f(t)}, then{t

} 1s ⋅ F (s).

L ∫ f (u )du =Θ

0Convolution theorem. Let F(s) = L{f(t)} and G(s) = L{g(t)}, thenPage 16-13

{

}

t

L ∫ f (u ) g (t − u )du = L{( f * g )(t )} =0

L{ f (t )} ⋅L{g (t )} = F ( s) ⋅ G ( s )Example 4 – Using the convolution theorem, find the Laplace transform of(f*g)(t), if f(t) = sin(t), and g(t) = exp(t). To find F(s) = L{f(t)}, and G(s) = L{g(t)},use: ‘SIN(X)’ ` LAP μ. Result, ‘1/(X^2+1)’, i.e., F(s) = 1/(s2+1).
Also, ‘EXP(X)’ ` LAP. Result, ‘1/(X-1)’, i.e., G(s) = 1/(s-1). Thus, L{(f*g)(t)} =F(s)⋅G(s) = 1/(s2+1)⋅1/(s-1) = 1/((s-1)(s2+1)) = 1/(s3-s2+s-1).
Θ

Shift theorem for a shift to the right. Let F(s) = L{f(t)}, thenΘ

L{f(t-a)}=e–as⋅L{f(t)} = e–as⋅F(s).
Shift theorem for a shift to the left. Let F(s) = L{f(t)}, and a >0, thenaL{ f (t + a )} = e as ⋅ ⎛⎜ F ( s ) − ∫ f (t ) ⋅ e − st ⋅ dt ⎞⎟.
0
⎝
⎠

Θ
Θ
Θ

Similarity theorem. Let F(s) = L{f(t)}, and a>0, then L{f(a⋅t)} = (1/a)⋅F(s/a).
Damping theorem. Let F(s) = L{f(t)}, then L{e–bt⋅f(t)} = F(s+b).
Division theorem. Let F(s) = L{f(t)}, then∞⎧ f (t ) ⎫L⎨⎬ = ∫ s F (u )du.
⎩ t ⎭

Θ

Laplace transform of a periodic function of period T:

L{ f (t )} =•T
1
⋅ f (t ) ⋅ e − st ⋅ dt.
− sT ∫ 01− eLimit theorem for the initial value: Let F(s) = L{f(t)}, thenf 0 = lim f (t ) = lim[ s ⋅ F ( s)].
t →0

•

s →∞

Limit theorem for the final value: Let F(s) = L{f(t)}, thenPage 16-14

f ∞ = lim f (t ) = lim[ s ⋅ F ( s)].
t →∞

s →0

Dirac’s delta function and Heaviside’s step function
In the analysis of control systems it is customary to utilize a type of functions that
represent certain physical occurrences such as the sudden activation of a switch(Heaviside’s step function, H(t)) or a sudden, instantaneous, peak in an input tothe system (Dirac’s delta function, δ(t)). These belong to a class of functions
known as generalized or symbolic functions [e.g., see Friedman, B., 1956,
Principles and Techniques of Applied Mathematics, Dover Publications Inc.,New York (1990 reprint) ].

The formal definition of Dirac’s delta function, δ(x), is δ(x) = 0, for x ≠0, and∞∫ δ ( x)dx = 1.0.
−∞

Also, if f(x) is a continuous function, then

∫

∞
−∞

f ( x)δ ( x − x0 )dx = f ( x0 ).

An interpretation for the integral above, paraphrased from Friedman (1990), isthat the δ-function “picks out” the value of the function f(x) at x = x0. Dirac’sdelta function is typically represented by an upward arrow at the point x = x0,
indicating that the function has a non-zero value only at that particular value ofx 0.
Heaviside’s step function, H(x), is defined as⎧1, x > 0
H ( x) = ⎨⎩0, x < 0Also, for a continuous function f(x),

∫

∞
−∞

f ( x) H ( x − x0 )dx = ∫∞x0

f ( x)dx.

Dirac’s delta function and Heaviside’s step function are related by dH/dx =δ(x). The two functions are illustrated in the figure below.

Page 16-15yy(x _ x 0 )H(x _ x 0 )

1
x0

x

You can prove that

L{H(t)} = 1/s,

from which it follows that

L{Uo⋅H(t)} = Uo/s,

x0xwhere Uo is a constant. Also, L -1{1/s}=H(t),andL -1{ Uo /s}= Uo⋅H(t).

Also, using the shift theorem for a shift to the right, L{f(t-a)}=e–as⋅L{f(t)} =e–as⋅F(s), we can write L{H(t-k)}=e–ks⋅L{H(t)} = e–ks⋅(1/s) = (1/s)⋅e–ks.
Another important result, known as the second shift theorem for a shift to theright, is that L -1{e–as ⋅F(s)}=f(t-a)⋅H(t-a), with F(s) = L{f(t)}.
In the calculator the Heaviside step function H(t) is simply referred to as ‘1’. To
check the transform in the calculator use: 1 ` LAP. The result is ‘1/X’, i.e.,
L{1} = 1/s. Similarly, ‘U0’ ` LAP , produces the result ‘U0/X’, i.e., L{U0}= U0/s.
You can obtain Dirac’s delta function in the calculator by using: 1` ILAP
The result is‘Delta(X)’.

This result is simply symbolic, i.e., you cannot find a numerical value for, say‘Delta(5)’.
This result can be defined the Laplace transform for Dirac’s delta function,
because from L -1{1.0}= δ(t), it follows that L{δ(t)} = 1.0
Also, using the shift theorem for a shift to the right, L{f(t-a)}=e–as⋅L{f(t)} =e–as⋅F(s), we can write L{δ(t-k)}=e–ks⋅L{δ(t)} = e–ks⋅1.0 = e–ks.

Page 16-16

Applications of Laplace transform in the solution of linear ODEs
At the beginning of the section on Laplace transforms we indicated that you
could use these transforms to convert a linear ODE in the time domain into an
algebraic equation in the image domain. The resulting equation is then solved
for a function F(s) through algebraic methods, and the solution to the ODE isfound by using the inverse Laplace transform on F(s).
The theorems on derivatives of a function, i.e.,
L{df/dt} = s⋅F(s) - fo,
L{d2f/dt2} = s2⋅F(s) - s⋅fo – (df/dt) o,and, in general,L{dnf/dtn} = sn⋅F(s) – sn-1⋅fo −…– s⋅f(n-2)o – f (n-1) o,are particularly useful in transforming an ODE into an algebraic equation.
Example 1 – To solve the first order equation,
dh/dt + k⋅h(t) = a⋅e–t,
by using Laplace transforms, we can write:L{dh/dt + k⋅h(t)} = L{a⋅e–t},
L{dh/dt} + k⋅L{h(t)} = a⋅L{e–t}.
Note: ‘EXP(-X)’ ` LAP , produces ‘1/(X+1)’, i.e., L{e–t }=1/(s+1).
With H(s) = L{h(t)}, and L{dh/dt} = s⋅H(s) - ho, where ho = h(0), the transformed
equation iss⋅H(s)-ho+k⋅H(s) = a/(s+1).
Use the calculator to solve for H(s), by writing:‘X*H-h0+k*H=a/(X+1)’ ` ‘H’ ISOL

Page 16-17

The result is‘H=((X+1)*h0+a)/(X^2+(k+1)*X+k)’.

To find the solution to the ODE, h(t), we need to use the inverse Laplacetransform, as follows:
OBJ ƒ ƒ

Isolates right-hand side of last expression

ILAP μObtains the inverse Laplace transform

The result is. Replacing X with t in this expression andsimplifying, results inh(t) = a/(k-1)⋅e-t +((k-1)⋅ho -a)/(k-1)⋅e-kt.

Check what the solution to the ODE would be if you use the function LDEC:‘a*EXP(-X)’ ` ‘X+k’ ` LDEC μ

The result is:, i.e.,
h(t) = a/(k-1)⋅e -t +((k-1)⋅cCo -a)/(k-1)⋅e-kt.

Thus, cC0 in the results from LDEC represents the initial condition h(0).
Note: When using the function LDEC to solve a linear ODE of order n in f(X),the result will be given in terms of n constants cC0, cC1, cC2, …, cC(n-1),
representing the initial conditions f(0), f’(0), f”(0), …, f(n-1) (0).
Example 2 – Use Laplace transforms to solve the second-order linear equation,
d2y/dt2+2y = sin 3t.
Using Laplace transforms, we can write:L{d2y/dt2+2y} = L{sin 3t},L{d2y/dt2} + 2⋅L{y(t)} = L{sin 3t}.
Page 16-18

Note: ‘SIN(3*X)’ ` LAP μ produces ‘3/(X^2+9)’, i.e.,L{sin 3t}=3/(s2+9).
With Y(s) = L{y(t)}, and L{d2y/dt2} = s2⋅Y(s) - s⋅yo – y1, where yo = h(0) and y1= h’(0), the transformed equation iss2⋅Y(s) – s⋅yo – y1 + 2⋅Y(s) = 3/(s2+9).
Use the calculator to solve for Y(s), by writing:‘X^2*Y-X*y0-y1+2*Y=3/(X^2+9)’ ` ‘Y’ ISOL
The result is‘Y=((X^2+9)*y1+(y0*X^3+9*y0*X+3))/(X^4+11*X^2+18)’.
To find the solution to the ODE, y(t), we need to use the inverse Laplacetransform, as follows:
OBJ ƒ ƒ

Isolates right-hand side of last expression

ILAPμObtains the inverse Laplace transform

The result isi.e.,y(t) = -(1/7) sin 3x + yo cos √2x + (√2 (7y1+3)/14) sin √2x.
Check what the solution to the ODE would be if you use the function LDEC:

The result is:‘SIN(3*X)’ ` ‘X^2+2’ ` LDEC μi.e., the same as before with cC0 = y0 and cC1 = y1.

Page 16-19

Note: Using the two examples shown here, we can confirm what we indicatedearlier, i.e., that function ILAP uses Laplace transforms and inverse transforms tosolve linear ODEs given the right-hand side of the equation and thecharacteristic equation of the corresponding homogeneous ODE.
Example 3 – Consider the equation
d2y/dt2+y = δ(t-3),
where δ(t) is Dirac’s delta function.
Using Laplace transforms, we can write:L{d2y/dt2+y} = L{δ(t-3)},L{d2y/dt2} + L{y(t)} = L{δ(t-3)}.
With ‘Delta(X-3)’ ` LAP , the calculator produces EXP(-3*X), i.e., L{δ(t-3)}= e–3s. With Y(s) = L{y(t)}, and L{d2y/dt2} = s2⋅Y(s) - s⋅yo – y1, where yo = h(0)and y1 = h’(0), the transformed equation is s2⋅Y(s) – s⋅yo – y1 + Y(s) = e–3s. Use
the calculator to solve for Y(s), by writing:‘X^2*Y-X*y0-y1+Y=EXP(-3*X)’ ` ‘Y’ ISOL
The result is‘Y=(X*y0+(y1+EXP(-(3*X))))/(X^2+1)’.

To find the solution to the ODE, y(t), we need to use the inverse Laplacetransform, as follows:
OBJ ƒ ƒ
ILAP

μThe result is

Isolates right-hand side of last expression
Obtains the inverse Laplace transform‘y1*SIN(X)+y0*COS(X)+SIN(X-3)*Heaviside(X-3)’.

Page 16-20

Notes:[1]. An alternative way to obtain the inverse Laplace transform of theexpression ‘(X*y0+(y1+EXP(-(3*X))))/(X^2+1)’ is by separating theexpression into partial fractions, i.e.,‘y0*X/(X^2+1) + y1/(X^2+1) + EXP(-3*X)/(X^2+1)’,
and use the linearity theorem of the inverse Laplace transform

L -1{a⋅F(s)+b⋅G(s)} = a⋅L -1{F(s)} + b⋅L -1{G(s)},to write,
L -1{yo⋅s/(s2+1)+y1/(s2+1)) + e–3s/(s2+1)) } =yo⋅L -1{s/(s2+1)}+ y1⋅L -1{1/(s2+1)}+ L -1{e–3s/(s2+1))},
Then, we use the calculator to obtain the following:‘X/(X^2+1)’ ` ILAP

Result, ‘COS(X)’, i.e., L -1{s/(s2+1)}= cos t.

‘1/(X^2+1)’ ` ILAP

Result, ‘SIN(X)’, i.e., L -1{1/(s2+1)}= sin t.

‘EXP(-3*X)/(X^2+1)’ ` ILAP Result, SIN(X-3)*Heaviside(X-3)’.
[2]. The very last result, i.e., the inverse Laplace transform of the expression‘(EXP(-3*X)/(X^2+1))’, can also be calculated by using the second shifting
theorem for a shift to the rightL -1{e–as ⋅F(s)}=f(t-a)⋅H(t-a),
if we can find an inverse Laplace transform for 1/(s2+1). With the calculator,
try ‘1/(X^2+1)’ ` ILAP. The result is ‘SIN(X)’. Thus, L -1{e–3s/(s2+1)}} =sin(t-3)⋅H(t-3),
Check what the solution to the ODE would be if you use the function LDEC:‘Delta(X-3)’ ` ‘X^2+1’ ` LDEC μ
Page 16-21

The result is:‘SIN(X-3)*Heaviside(X-3) + cC1*SIN(X) + cC0*COS(X)’.
Please notice that the variable X in this expression actually represents thevariable t in the original ODE. Thus, the translation of the solution in paper may
be written as:y (t ) = Co ⋅ cos t + C1 ⋅ sin t + sin(t − 3) ⋅ H (t − 3)
When comparing this result with the previous result for y(t), we conclude thatcCo = yo, cC1 = y1.

Defining and using Heaviside’s step function in the calculator
The previous example provided some experience with the use of Dirac’s delta
function as input to a system (i.e., in the right-hand side of the ODE describing
the system). In this example, we want to use Heaviside’s step function, H(t). In
the calculator we can define this function as:‘H(X) = IFTE(X>0, 1, 0)’ `„àThis definition will create the variable @@@H@@@ in the calculator’s soft menu key.
Example 1 – To see a plot of H(t-2), for example, use a FUNCTION type ofplot (see Chapter 12):





Θ


Press „ô, simultaneously in RPN mode, to access to the PLOT SETUP
window.
Change TYPE to FUNCTION, if needed
Change EQ to ‘H(X-2)’.
Make sure that Indep is set to ‘X’.
Press L @@@OK@@@ to return to normal calculator display.
Press „ò, simultaneously, to access the PLOT window.
Change the H-VIEW range to 0 to 20, and the V-VIEW range to -2 to 2.

Press @ERASE @DRAW to plot the function .

Page 16-22

Use of the function H(X) with LDEC, LAP, or ILAP, is not allowed in the calculator.
You have to use the main results provided earlier when dealing with the
Heaviside step function, i.e., L{H(t)} = 1/s, L -1{1/s}=H(t),L{H(t-k)}=e–ks⋅L{H(t)} = e–ks⋅(1/s) = ⋅(1/s)⋅e–ks and L -1{e–as ⋅F(s)}=f(t-a)⋅H(t-a).
Example 2 – The function H(t-to) when multiplied to a function f(t), i.e., H(t-to)f(t),has the effect of switching on the function f(t) at t = to. For example, the solution
obtained in Example 3, above, was y(t) = yo cos t + y1 sin t + sin(t-3)⋅H(t-3).
Suppose we use the initial conditions yo = 0.5, and y1 = -0.25. Let’s plot thisfunction to see what it looks like:ΘPress „ô, simultaneously if in RPN mode, to access to the PLOT SETUP
window.



Change TYPE to FUNCTION, if neededChange EQ to ‘0.5*COS(X)-0.25*SIN(X)+SIN(X-3)*H(X-3)’.



Make sure that Indep is set to ‘X’.



H-VIEW: 0 20, V-VIEW: -3 2.

Press @ERASE @DRAW to plot the function.

Press @EDIT L @LABEL to see the plot.

The resulting graph will look like this:Notice that the signal starts with a relatively small amplitude, but suddenly, at
t=3, it switches to an oscillatory signal with a larger amplitude. The difference
between the behavior of the signal before and after t = 3 is the “switching on”
of the particular solution yp(t) = sin(t-3)⋅H(t-3). The behavior of the signal beforet = 3 represents the contribution of the homogeneous solution, yh(t) = yo cos t +y1 sin t.
The solution of an equation with a driving signal given by a Heaviside step
function is shown below.
Example 3 – Determine the solution to the equation, d2y/dt2+y = H(t-3),

Page 16-23

where H(t) is Heaviside’s step function. Using Laplace transforms, we canwrite: L{d2y/dt2+y} = L{H(t-3)}, L{d2y/dt2} + L{y(t)} = L{H(t-3)}. The last term inthis expression is: L{H(t-3)} = (1/s)⋅e–3s. With Y(s) = L{y(t)}, and L{d2y/dt2} =s2⋅Y(s) - s⋅yo – y1, where yo = h(0) and y1 = h’(0), the transformed equation iss2⋅Y(s) – s⋅yo – y1 + Y(s) = (1/s)⋅e–3s. Change CAS mode to Exact, if
necessary. Use the calculator to solve for Y(s), by writing:‘X^2*Y-X*y0-y1+Y=(1/X)*EXP(-3*X)’ ` ‘Y’ ISOL
The result is‘Y=(X^2*y0+X*y1+EXP(-3*X))/(X^3+X)’.

To find the solution to the ODE, y(t), we need to use the inverse Laplacetransform, as follows:
OBJ ƒ ƒ

Isolates right-hand side of last expression

ILAP

Obtains the inverse Laplace transform

The result is‘y1*SIN(X-1)+y0*COS(X-1)-(COS(X-3)-1)*Heaviside(X-3)’.

Thus, we write as the solution: y(t) = yo cos t + y1 sin t + H(t-3)⋅(1+sin(t-3)).
Check what the solution to the ODE would be if you use the function LDEC:‘H(X-3)’ `[ENTER] ‘X^2+1’ ` LDEC
The result is:

Please notice that the variable X in this expression actually represents thevariable t in the original ODE, and that the variable ttt in this expression is adummy variable. Thus, the translation of the solution in paper may be writtenas:∞y (t ) = Co ⋅ cos t + C1 ⋅ sin t + sin t ⋅ ∫ H (u − 3) ⋅ e −ut ⋅ du.
0Page 16-24

Example 4 – Plot the solution to Example 3 using the same values of yo and y1
used in the plot of Example 1, above. We now plot the function
y(t) = 0.5 cos t –0.25 sin t + (1+sin(t-3))⋅H(t-3).
In the range 0 < t < 20, and changing the vertical range to (-1,3), the graphshould look like this:Again, there is a new component to the motion switched at t=3, namely, theparticular solution yp(t) = [1+sin(t-3)]⋅H(t-3), which changes the nature of thesolution for t>3.
The Heaviside step function can be combined with a constant function and withlinear functions to generate square, triangular, and saw tooth finite pulses, as
follows:
Θ

Square pulse of size Uo in the interval a < t < b:f(t) = Uo[H(t-a)-H(t-b)].

Θ

Triangular pulse with a maximum value Uo, increasing from a < t < b,decreasing from b < t < c:f(t) = Uo⋅ ((t-a)/(b-a)⋅[H(t-a)-H(t-b)]+(1-(t-b)/(b-c))[H(t-b)-H(t-c)]).

Θ

Saw tooth pulse increasing to a maximum value Uo for a < t < b, dropping
suddenly down to zero at t = b:f(t) = Uo⋅ (t-a)/(b-a)⋅[H(t-a)-H(t-b)].

ΘSaw tooth pulse increasing suddenly to a maximum of Uo at t = a, thendecreasing linearly to zero for a < t < b:Page 16-25

f(t) = Uo⋅[1-(t-a)/(b-1)]⋅[H(t-a)-H(t-b)].
Examples of the plots generated by these functions, for Uo = 1, a = 2, b = 3, c
= 4, horizontal range = (0,5), and vertical range = (-1, 1.5), are shown in the
figures below:

Fourier series
Fourier series are series involving sine and cosine functions typically used to
expand periodic functions. A function f(x) is said to be periodic, of period T, if
f(x+T) = f(t). For example, because sin(x+2π) = sin x, and cos(x+2π) = cos x,
the functions sin and cos are 2π-periodic functions. If two functions f(x) and g(x)are periodic of period T, then their linear combination h(x) = a⋅f(x) + b⋅g(x), is
also periodic of period T. A T-periodic function f(t) can be expanded into a
series of sine and cosine functions known as a Fourier series given by
∞
2nπ
2nπ ⎞
⎛
f (t ) = a 0 + ∑ ⎜ a n ⋅ cos
t + bn ⋅ sint⎟TT ⎠n =1 ⎝

where the coefficients an and bn are given by

a0 =1 T /2
2 T /22 nπ
f (t ) ⋅ dt , a n = ∫f (t ) ⋅ cost ⋅ dt ,∫T −T / 2
T −T / 2T
bn = ∫

T /2−T / 2f (t ) ⋅ sin

2 nπt ⋅ dt.
T
Page 16-26

The following exercises are in ALG mode, with CAS mode set to Exact. (Whenyou produce a graph, the CAS mode will be reset to Approx. Make sure to set
it back to Exact after producing the graph.) Suppose, for example, that thefunction f(t) = t2+t is periodic with period T = 2. To determine the coefficientsa0, a1, and b1 for the corresponding Fourier series, we proceed as follows:First, define function f(t) = t2+t :Next, we’ll use the Equation Writer to calculate the coefficients:

Thus, the first three terms of the function are:f(t) ≈ 1/3 – (4/π2)⋅cos (π⋅t)+(2/π)⋅sin (π⋅t).
A graphical comparison of the original function with the Fourier expansion
using these three terms shows that the fitting is acceptable for t < 1, or
thereabouts. But, then, again, we stipulated that T/2 = 1. Therefore, the fitting
is valid only between –1 < t < 1.

Page 16-27

Function FOURIER
An alternative way to define a Fourier series is by using complex numbers as
follows:+∞f (t ) = ∑ c n ⋅ exp(
n = −∞

2inπt
),
T

where

cn =

1 T
2 ⋅ i ⋅ n ⋅π⋅ t ) ⋅ dt , n = −∞,...,−2,−1,0,1,2,...∞.
f (t ) ⋅ exp(∫
0
T
T

Function FOURIER provides the coefficient cn of the complex-form of the Fourier
series given the function f(t) and the value of n. The function FOURIER requires
you to store the value of the period (T) of a T-periodic function into the CAS
variable PERIOD before calling the function. The function FOURIER is available
in the DERIV sub-menu within the CALC menu („Ö).

Fourier series for a quadratic function
Determine the coefficients c0, c1, and c2 for the function f(t) = t2+t, with period
T = 2. (Note: Because the integral used by function FOURIER is calculated in
the interval [0,T], while the one defined earlier was calculated in the interval[-T/2,T/2], we need to shift the function in the t-axis, by subtracting T/2 from t,i.e., we will use g(t) = f(t-1) = (t-1)2+(t-1).)
Using the calculator in ALG mode, first we define functions f(t) and g(t):Page 16-28

Next, we move to the CASDIR sub-directory under HOME to change the valueof variable PERIOD, e.g., „ (hold) §`J @)CASDI `2 K @PERIOD`

Return to the sub-directory where you defined functions f and g, and calculate
the coefficients (Accept change to Complex mode when requested):Thus,

c0 = 1/3, c1 = (π⋅i+2)/π2, c2 = (π⋅i+1)/(2π2).

The Fourier series with three elements will be written asg(t) ≈ Re[(1/3) + (π⋅i+2)/π2⋅exp(i⋅π⋅t)+ (π⋅i+1)/(2π2)⋅exp(2⋅i⋅π⋅t)].
A plot of the shifted function g(t) and the Fourier series fitting follows:

Page 16-29

The fitting is somewhat acceptable for 0<t<2, although not as good as in theprevious example.
A general expression for cn
The function FOURIER can provide a general expression for the coefficient cn ofthe complex Fourier series expansion. For example, using the same function g(t)as before, the general term cn is given by (figures show normal font and small
font displays):

The general expression turns out to be, after simplifying the previous result,(nπ + 2i ) ⋅ e 2inπ + 2i 2 n 2π 2 + 3nπ − 2icn =2n 3π 3 ⋅ e 2inπ
We can simplify this expression even further by using Euler’s formula forcomplex numbers, namely, e2inπ = cos(2nπ) + i⋅sin(2nπ) = 1 + i⋅0 = 1, sincecos(2nπ) = 1, and sin(2nπ) = 0, for n integer.
Using the calculator you can simplify the expression in the equation writer(‚O) by replacing e2inπ = 1. The figure shows the expression after
simplification:

Page 16-30

cn = (i⋅n⋅π+2)/(n2⋅π2).

The result is

Putting together the complex Fourier series
Having determined the general expression for cn, we can put together a finite
complex Fourier series by using the summation function (Σ) in the calculator as
follows:
ΘFirst, define a function c(n) representing the general term cn in the complex
Fourier series.

Θ

Next, define the finite complex Fourier series, F(X,k), where X is theindependent variable and k determines the number of terms to be used.
Ideally we would like to write this finite complex Fourier series ask

F ( X , k ) = ∑ c(n) ⋅ exp(n=− k2 ⋅ i ⋅π ⋅ n⋅ X)
THowever, because the function c(n) is not defined for n = 0, we will bebetter advised to re-write the expression as

F ( X , k , c0) = c0 +k∑ [c(n) ⋅ exp(
n =1

2 ⋅ i ⋅π ⋅ n
2 ⋅ i ⋅π ⋅ n⋅ X ) + c(−n) ⋅ exp(−⋅ X )],
T
T
Page 16-31

Or, in the calculator entry line as:
DEFINE(‘F(X,k,c0) = c0+Σ(n=1,k,c(n)*EXP(2*i*π*n*X/T)+
c(-n)*EXP(-(2*i*π*n*X/T))’),
where T is the period, T = 2. The following screen shots show the definition offunction F and the storing of T = 2:

The function @@@F@@@ can be used to generate the expression for the complex
Fourier series for a finite value of k. For example, for k = 2, c0 = 1/3,and usingt as the independent variable, we can evaluate F(t,2,1/3) to get:This result shows only the first term (c0) and part of the first exponential term inthe series. The decimal display format was changed to Fix with 2 decimals tobe able to show some of the coefficients in the expansion and in the exponent.
As expected, the coefficients are complex numbers.
The function F, thus defined, is fine for obtaining values of the finite Fourier
series. For example, a single value of the series, e.g., F(0.5,2,1/3), can beobtained by using (CAS modes set to Exact, step-by-step, and Complex):Page 16-32

Accept change to Approx mode if requested. The result is the value–0.40467…. The actual value of the function g(0.5) is g(0.5) = -0.25. The
following calculations show how well the Fourier series approximates this value
as the number of components in the series, given by k, increases:
F (0.5, 1, 1/3) = (-0.303286439037,0.)F (0.5, 2, 1/3) = (-0.404607622676,0.)
F (0.5, 3, 1/3) = (-0.192401031886,0.)
F (0.5, 4, 1/3) = (-0.167070735979,0.)F (0.5, 5, 1/3) = (-0.294394690453,0.)F (0.5, 6, 1/3) = (-0.305652599743,0.)
To compare the results from the series with those of the original function, loadthese functions into the PLOT – FUNCTION input form („ñ, simultaneously
if using RPN mode):

Change the limits of the Plot Window („ò) as follows:

Press the soft-menu keys @ERASE @DRAW to produce the plot:

Notice that the series, with 5 terms, “hugs” the graph of the function very closelyin the interval 0 to 2 (i.e., through the period T = 2). You can also notice a
Page 16-33

periodicity in the graph of the series. This periodicity is easy to visualize by
expanding the horizontal range of the plot to (-0.5,4):

Fourier series for a triangular wave
Consider the function⎧ x, if 0 < x < 1g ( x) = ⎨⎩2 − x, if 1 < x < 2
which we assume to be periodic with period T = 2. This function can be
defined in the calculator, in ALG mode, by the expression
DEFINE(‘g(X) = IFTE(X<1,X,2-X)’)
If you started this example after finishing example 1 you already have a valueof 2 stored in CAS variable PERIOD. If you are not sure, check the value of thisvariable, and store a 2 in it if needed. The coefficient c0 for the Fourier series
is calculated as follows:

The calculator will request a change to Approx mode because of the integrationof the function IFTE() included in the integrand. Accepting, the change toApprox produces c0 = 0.5. If we now want to obtain a generic expression forthe coefficient cn use:

Page 16-34

The calculator returns an integral that cannot be evaluated numerically because
it depends on the parameter n. The coefficient can still be calculated bytyping its definition in the calculator, i.e.,

1 1⎛ i⋅2⋅n ⋅π⋅X⎞⋅ ∫ X ⋅ EXP⎜ −⎟ ⋅ dX +
0
2
T
⎝
⎠
1 2
⎛ i⋅2⋅n ⋅π⋅X⎞⋅ ∫ (2 − X) ⋅ EXP⎜ −⎟ ⋅ dX
2 1
T⎝⎠
where T = 2 is the period. The value of T can be stored using:

Typing the first integral above in the Equation Writer, selecting the entire
expression, and using @EVAL@, will produce the following:

Recall the einπ = cos(nπ) + i⋅sin(nπ) = (-1)n . Performing this substitution in the
result above we have:

Page 16-35

Press `` to copy this result to the screen. Then, reactivate the Equation
Writer to calculate the second integral defining the coefficient cn, namely,

Once again, replacing einπ = (-1)n, and using e2inπ = 1, we get:Press `` to copy this second result to the screen. Now, add ANS(1) andANS(2) to get the full expression for cn:

Pressing ˜ will place this result in the Equation Writer, where we can simplify(@SIMP@) it to read:Once again, replacing einπ = (-1)n, results inPage 16-36

This result is used to define the function c(n) as follows:
DEFINE(‘c(n) = - (((-1)^n-1)/(n^2*π^2*(-1)^n)’)i.e.,

Next, we define function F(X,k,c0) to calculate the Fourier series (if you
completed example 1, you already have this function stored):
DEFINE(‘F(X,k,c0) = c0+Σ(n=1,k,c(n)*EXP(2*i*π*n*X/T)+
c(-n)*EXP(-(2*i*π*n*X/T))’),
To compare the original function and the Fourier series we can produce thesimultaneous plot of both functions. The details are similar to those of example
1, except that here we use a horizontal range of 0 to 2 and a vertical range
from 0 to 1, and adjust the equations to plot as shown here:

The resulting graph is shown below for k = 5 (the number of elements in theseries is 2k+1, i.e., 11, in this case):

Page 16-37

From the plot it is very difficult to distinguish the original function from theFourier series approximation. Using k = 2, or 5 terms in the series, shows not sogood a fitting:

The Fourier series can be used to generate a periodic triangular wave (or saw
tooth wave) by changing the horizontal axis range, for example, from –2 to 4.
The graph shown below uses k = 5:

Fourier series for a square wave
A square wave can be generated by using the function⎧ 0, if 0 < x < 1⎪g ( x) = ⎨ 1, if 1 < x < 3⎪0, if 3 < x < 4⎩Page 16-38

In this case, the period T, is 4. Make sure to change the value of variable @@@T@@@
to 4 (use: 4 K @@@T@@ `). Function g(X) can be defined in the calculator
by using
DEFINE(‘g(X) = IFTE((X>1) AND (X<3),1,0)’)The function plotted as follows (horizontal range: 0 to 4, vertical range:0 to 1.2):

Using a procedure similar to that of the triangular shape in example 2, above,
you can find that

c0 =

1 ⎛ 3
⋅ ⎜ ∫ 1 ⋅ dX ⎞⎟ = 0.5 ,
⎠
T ⎝ 1

and

We can simplify this expression by using einπ/2 = in and e3inπ/2 = (-i)n to get:

Page 16-39

The simplification of the right-hand side of c(n), above, is easier done on paper(i.e., by hand). Then, retype the expression for c(n) as shown in the figure to theleft above, to define function c(n). The Fourier series is calculated with
F(X,k,c0), as in examples 1 and 2 above, with c0 = 0.5. For example, for k =5, i.e., with 11 components, the approximation is shown below:

A better approximation is obtained by using k = 10, i.e.,

For k = 20, the fitting is even better, but it takes longer to produce the graph:

Fourier series applications in differential equations
Suppose we want to use the periodic square wave defined in the previous
example as the excitation of an undamped spring-mass system whose
homogeneous equation is: d2y/dX2 + 0.25y = 0.
We can generate the excitation force by obtaining an approximation with k=10 out of the Fourier series by using SW(X) = F(X,10,0.5):

Page 16-40

We can use this result as the first input to the function LDEC when used to obtaina solution to the system d2y/dX2 + 0.25y = SW(X), where SW(X) stands for
Square Wave function of X. The second input item will be the characteristic
equation corresponding to the homogeneous ODE shown above, i.e.,‘X^2+0.25’ .
With these two inputs, function LDEC produces the following result (decimalformat changed to Fix with 3 decimals).

Pressing ˜ allows you to see the entire expression in the Equation writer.
Exploring the equation in the Equation Writer reveals the existence of two
constants of integration, cC0 and cC1. These values would be calculated using
initial conditions. Suppose that we use the values cC0 = 0.5 and cC1 = -0.5,
we can replace those values in the solution above by using function SUBST (seeChapter 5). For this case, use SUBST(ANS(1),cC0=0.5) `, followed by
SUBST(ANS(1),cC1=-0.5) `. Back into normal calculator display we canuse:

The latter result can be defined as a function, FW(X), as follows (cutting andpasting the last result into the command):We can now plot the real part of this function. Change the decimal mode toStandard, and use the following:

Page 16-41

The solution is shown below:

Fourier Transforms
Before presenting the concept of Fourier transforms, we’ll discuss the generaldefinition of an integral transform. In general, an integral transform is atransformation that relates a function f(t) to a new function F(s) by an integrationof the form F ( s ) =b∫ κ (s, t ) ⋅ f (t ) ⋅ dt. The function κ(s,t) is known as theakernel of the transformation.
The use of an integral transform allows us to resolve a function into a given
spectrum of components. To understand the concept of a spectrum, consider
the Fourier series∞f (t ) = a0 + ∑ (an ⋅ cos ω n x + bn ⋅ sin ω n x ),n =1

representing a periodic function with a period T. This Fourier series can be re∞written asf ( x) = a0 + ∑ An ⋅ cos(ϖ n x + φ n ), where
n =1

⎛b ⎞
An = a n2 + bn2 , φ n = tan −1 ⎜⎜ n ⎟⎟,⎝ an ⎠
for n =1,2, …

Page 16-42

The amplitudes An will be referred to as the spectrum of the function and will bea measure of the magnitude of the component of f(x) with frequency fn = n/T.
The basic or fundamental frequency in the Fourier series is f0 = 1/T, thus, allother frequencies are multiples of this basic frequency, i.e., fn = n⋅f0. Also, we
can define an angular frequency, ωn = 2nπ/T = 2π⋅fn = 2π⋅ n⋅f0 = n⋅ω0, whereω0 is the basic or fundamental angular frequency of the Fourier series.
Using the angular frequency notation, the Fourier series expansion is written as∞f ( x) = a 0 + ∑ An ⋅ cos(ω n x + φ n ).
n =1∞

= a 0 + ∑ (a n ⋅ cos ω n x + bn ⋅ sin ω n x )n =1

A plot of the values An vs. ωn is the typical representation of a discrete
spectrum for a function. The discrete spectrum will show that the function hascomponents at angular frequencies ωn which are integer multiples of thefundamental angular frequency ω0.
Suppose that we are faced with the need to expand a non-periodic function intosine and cosine components. A non-periodic function can be thought of as
having an infinitely large period. Thus, for a very large value of T, thefundamental angular frequency, ω0 = 2π/T, becomes a very small quantity, say
Δω. Also, the angular frequencies corresponding to ωn = n⋅ω0 = n⋅Δω, (n = 1,
2, …, ∞), now take values closer and closer to each other, suggesting the needfor a continuous spectrum of values.
The non-periodic function can be written, therefore, as∞f ( x) = ∫ [C (ω ) ⋅ cos(ω ⋅ x) + S (ω ) ⋅ sin(ω ⋅ x)]dω ,
0

where

C (ω ) =∞1⋅ ∫ f ( x) ⋅ cos(ω ⋅ x) ⋅ dx,
2π −∞Page 16-43

and

S (ω ) =∞1⋅ ∫ f ( x) ⋅ sin(ω ⋅ x) ⋅ dx.
2π −∞The continuous spectrum is given byA(ω ) = [C (ω )] 2 + [ S (ω )] 2
The functions C(ω), S(ω), and A(ω) are continuous functions of a variable ω,
which becomes the transform variable for the Fourier transforms defined below.
Example 1 – Determine the coefficients C(ω), S(ω), and the continuous spectrum
A(ω), for the function f(x) = exp(-x), for x > 0, and f(x) = 0, x < 0.
In the calculator, set up and evaluate the following integrals to calculate C(ω)
and S(ω), respectively. CAS modes are set to Exact and Real.

Their results are, respectively:

The continuous spectrum, A(ω) is calculated as:Page 16-44

Define this expression as a function by using function DEFINE („à). Then,plot the continuous spectrum, in the range 0 < ω < 10, as:Definition of Fourier transforms
Different types of Fourier transforms can be defined. The following are thedefinitions of the sine, cosine, and full Fourier transforms and their inverses usedin this Chapter.
Fourier sine transformFs{ f (t )} = F (ω ) =

2

π

⋅∫

∞
0

f (t ) ⋅ sin(ω ⋅ t ) ⋅ dt

Inverse sine transform∞

Fs−1{F (ω )} = f (t ) = ∫ F (ω ) ⋅ sin(ω ⋅ t ) ⋅ dt
0

Fourier cosine transform

Fc{ f (t )} = F (ω ) =

2

π

⋅∫

∞
0

f (t ) ⋅ cos(ω ⋅ t ) ⋅ dt

Inverse cosine transform∞

Fc−1 {F (ω )} = f (t ) = ∫ F (ω ) ⋅ cos(ω ⋅ t ) ⋅ dt
0

Fourier transform (proper)F { f (t )} = F (ω ) =∞1⋅ ∫ f (t ) ⋅ e −iωt ⋅ dt
2π −∞Inverse Fourier transform (proper)F −1{F (ω )} = f (t ) =∞1⋅ ∫ F (ω ) ⋅ e −iωt ⋅ dt
2π −∞Example 1 – Determine the Fourier transform of the function f(t) = exp(- t), for t>0, and f(t) = 0, for t<0.

Page 16-45

The continuous spectrum, F(ω), is calculated with the integral:

1

∫
2π
= lim

ε →∞

∞
0

e −(1+iω )t dt = lim

ε →∞

1

ε

∫ e
2π

− (1+ iω ) t

0

1 ⎡1 − exp(−(1 + iω )t ) ⎤⎥=1 + iω
2π ⎢⎣
⎦

1

dt

1
.
2π 1 + iω
⋅This result can be rationalized by multiplying numerator and denominator by
the conjugate of the denominator, namely, 1-iω. The result is now:

F (ω ) =1
1
1 ⎛ 1 ⎞ ⎛ 1 − iω ⎞
⋅
=
⋅⎜
⎟⋅⎜
⎟
2π 1 + iω 2π ⎝ 1 + iω ⎠ ⎝ 1 − iω ⎠
=

1 ⎛ 1
ω ⎞
−i⋅
⎜
⎟
2
2π ⎝ 1 + ω
1+ ω 2 ⎠which is a complex function.
The absolute value of the real and imaginary parts of the function can beplotted as shown below

Notes:The magnitude, or absolute value, of the Fourier transform, |F(ω)|, is thefrequency spectrum of the original function f(t). For the example shown above,|F(ω)| = 1/[2π(1+ω2)]1/2. The plot of |F(ω)| vs. ω was shown earlier.
Some functions, such as constant values, sin x, exp(x), x2, etc., do not have
Fourier transform. Functions that go to zero sufficiently fast as x goes to infinity
do have Fourier transforms.

Page 16-46

Properties of the Fourier transform
Linearity: If a and b are constants, and f and g functions, then F{a⋅f + b⋅g} = a
F{f }+ b F{g}.
Transformation of partial derivatives. Let u = u(x,t). If the Fourier transform
transforms the variable x, thenF{∂u/∂x} = iω F{u}, F{∂2u/∂x2} = -ω2 F{u},F{∂u/∂t} = ∂F{u}/∂t, F{∂2u/∂t2} = ∂2F{u}/∂t2
Convolution: For Fourier transform applications, the operation of convolution isdefined as( f * g )( x) =12π

⋅ ∫ f ( x − ξ ) ⋅ g (ξ ) ⋅ dξ .

The following property holds for convolution:F{f*g} = F{f}⋅F{g}.

Fast Fourier Transform (FFT)The Fast Fourier Transform is a computer algorithm by which one can calculatevery efficiently a discrete Fourier transform (DFT). This algorithm hasapplications in the analysis of different types of time-dependent signals, fromturbulence measurements to communication signals.
The discrete Fourier transform of a sequence of data values {xj}, j = 0, 1, 2, …,
n-1, is a new finite sequence {Xk}, defined as

Xk =1 n −1∑ x j ⋅ exp(−i ⋅ 2πkj / n),n j =0k = 0,1,2,..., n − 1

The direct calculation of the sequence Xk involves n2 products, which would
involve enormous amounts of computer (or calculator) time particularly for large
values of n. The Fast Fourier Transform reduces the number of operations to theorder of n⋅log2n. For example, for n = 100, the FFT requires about 664
operations, while the direct calculation would require 10,000 operations. Thus,

Page 16-47

the number of operations using the FFT is reduced by a factor of 10000/664 ≈15.
The FFT operates on the sequence {xj} by partitioning it into a number of shorter
sequences. The DFT’s of the shorter sequences are calculated and later
combined together in a highly efficient manner. For details on the algorithm
refer, for example, to Chapter 12 in Newland, D.E., 1993, “An Introduction to
Random Vibrations, Spectral & Wavelet Analysis – Third Edition,” Longman
Scientific and Technical, New York.
The only requirement for the application of the FFT is that the number n be a
power of 2, i.e., select your data so that it contains 2, 4, 8, 16, 32, 62, etc.,
points.

Examples of FFT applications
FFT applications usually involve data discretized from a time-dependent signal.
The calculator can be fed that data, say from a computer or a data logger, forprocessing. Or, you can generate your own data by programming a function
and adding a few random numbers to it.
Example 1 – Define the function f(x) = 2 sin (3x) + 5 cos(5x) + 0.5*RAND,
where RAND is the uniform random number generator provided by thecalculator. Generate 128 data points by using values of x in the interval(0,12.8). Store those values in an array, and perform a FFT on the array.
First, we define the function f(x) as a RPN program:<<  x ‘2*SIN(3*x) + 5*COS(5*x)’ EVAL RAND 5 * + NUM >>and store this program in variable @@@@f@@@. Next, type the following program togenerate 2m data values between a and b. The program will take the values ofm, a, and b:<<  m a b << ‘2^m’ EVAL  n << ‘(b-a)/(n+1)’ EVAL  Dx << 1 n FOR j‘a+(j-1)*Dx’ EVAL f NEXT n ARRY >> >> >> >>Store this program under the name GDATA (Generate DATA). Then, run the
program for the values, m = 5, a = 0, b = 100. In RPN mode, use:
5#0#100@GDATA!

Page 16-48

The figure below is a box plot of the data produced. To obtain the graph, first
copy the array just created, then transform it into a column vector by using:
OBJ 1 + ARRY (Functions OBJ and ARRY are available in thecommand catalog, ‚N). Store the array into variable ΣDAT by using
function STOΣ (also available through ‚N). Select Bar in the TYPE forgraphs, change the view window to H-VIEW: 0 32, V-VIEW: -10 10, andBarWidth to 1. Press @CANCL $ to return to normal calculator display.

To perform the FFT on the array in stack level 1 use function FFT available in the
MTH/FFT menu on array ΣDAT: @£DAT FFT. The FFT returns an array of complex
numbers that are the arrays of coefficients Xk of the DFT. The magnitude of thecoefficients Xk represents a frequency spectrum of the original data. To obtainthe magnitude of the coefficients you could transform the array into a list, andthen apply function ABS to the list. This is accomplished by using: OBJ μƒ LIST „Ê
Finally, you can convert the list back to a column vector to be stored in ΣDAT, as
follows:

OBJ 1 ` 2 LIST ARRY STOΣTo plot the spectrum, follow the instructions for producing a bar plot given
earlier. The vertical range needs to be changed to –1 to 80. The spectrum of
frequencies is the following:

The spectrum shows two large components for two frequencies (these are thesinusoidal components, sin (3x) and cos(5x)), and a number of smaller
components for other frequencies.

Page 16-49

Example 2 – To produce the signal given the spectrum, we modify the program
GDATA to include an absolute value, so that it reads:<<  m a b << ‘2^m’ EVAL  n << ‘(b-a)/(n+1)’ EVAL  Dx << 1 n FOR j‘a+(j-1)*Dx’ EVAL f ABS NEXT n ARRY >> >> >> >>Store this version of the program under GSPEC (Generate SPECtrum). Run the
program with m = 6, a = 0, b = 100. In RPN mode, use:
6#0#100@GSPEC!
Press ` when done, to keep an additional copy of the spectrum array.
Convert this row vector into a column vector and store it into ΣDAT. Following
the procedure for generating a bar plot, the spectrum generated for thisexample looks as shown below. The horizontal range in this case is 0 to 64,
while the vertical range is –1 to 10:

To reproduce the signal whose spectrum is shown , use function IFFT. Since weleft a copy of the spectrum in the stack (a row vector), all you need to do if findfunction IFFT in the MTH/FFT menu or through the command catalog, ‚N.
As an alternative, you could simply type the function name, i.e., type~~ifft`. The signal is shown as an array (row vector) withcomplex numbers. We are interested only in the real part of the elements. To
extract the real part of the complex numbers, use function RE from the CMPLX
menu (see Chapter 4), e.g., type ~~re`. What results is anotherrow vector. Convert it into a column vector, store it into ΣDAT, and plot a bar
plot to show the signal. The signal for this example is shown below, using ahorizontal range of 0 to 64, and a vertical range of –1 to 1:

Page 16-50

Except for a large peak at t = 0, the signal is mostly noise. A smaller verticalscale (-0.5 to 0.5) shows the signal as follows:

Solution to specific second-order differential equations
In this section we present and solve specific types of ordinary differential
equations whose solutions are defined in terms of some classical functions, e.g.,
Bessel’s functions, Hermite polynomials, etc. Examples are presented in RPN
mode.

The Cauchy or Euler equation
An equation of the form x2⋅(d2y/dx2) + a⋅x⋅ (dy/dx) + b⋅y = 0, where a and b
are real constants, is known as the Cauchy or Euler equation. A solution to the
Cauchy equation can be found by assuming that y(x) = xn.
Type the equation as: ‘x^2*d1d1y(x)+a*x*d1y(x)+b*y(x)=0’ `Then, type and substitute the suggested solution: ‘y(x) = x^n’ ` @SUBSTThe result is: ‘x^2*(n*(x^(n-1-1)*(n-1)))+a*x*(n*x^(n-1))+b*x^n =0, whichsimplifies to ‘n*(n-1)*x^n+a*n*x^n+b*x^n = 0’. Dividing by x^n, results in
an auxiliary algebraic equation: ‘n*(n-1)+a*n+b = 0’, or.

n 2 + (a − 1) ⋅ n + b = 0 .
Θ

If the equation has two different roots, say n1 and n2, then the generalsolution of this equation is y(x) = K1⋅x n1 + K2⋅x n2.

Θ

If b = (1-a)2/4, then the equation has a double root n1 = n2 = n =(1-a)/2, and the solution turns out to be y(x) = (K1 + K2⋅ln x)xn.

Legendre’s equation
An equation of the form (1-x2)⋅(d2y/dx2)-2⋅x⋅ (dy/dx)+n⋅ (n+1) ⋅y = 0, where n
is a real number, is known as the Legendre’s differential equation. Any solution
for this equation is known as a Legendre’s function. When n is a nonnegative
integer, the solutions are called Legendre’s polynomials. Legendre’s
polynomial of order n is given by

Page 16-51

M

Pn ( x) = ∑ (−1) m ⋅m =0=(2n − 2m)!
⋅x n − 2 m
2 ⋅ m!⋅(n − m)!⋅(n − 2m)!
n(2n)!
(2n − 2)!
⋅ xn − n⋅ x n −2 + ... − ..
22 ⋅ (n!)2 ⋅ 1!⋅(n − 1)!(n − 2)!
nwhere M = n/2 or (n-1)/2, whichever is an integer.
Legendre’s polynomials are pre-programmed in the calculator and can berecalled by using the function LEGENDRE given the order of the polynomial, n.
The function LEGENDRE can be obtained from the command catalog (‚N)
or through the menu ARITHMETIC/POLYNOMIAL menu (see Chapter 5). In
RPN mode, the first six Legendre polynomials are obtained as follows:
0 LEGENDRE, result: 1,i.e.,
P0(x) = 1.0.
1 LEGENDRE, result: ‘X’,i.e.,
P1(x) = x.
2 LEGENDRE, result: ‘(3*X^2-1)/2’,i.e.,

3 LEGENDRE, result: ‘(5*X^3-3*X)/2’,i.e.,
4 LEGENDRE, result: ‘(35*X^4-30*X^2+3)/8’, i.e.,
P4(x) =(35x4 -30x2+3)/8.
5 LEGENDRE, result: ‘(63*X^5-70*X^3+15*X)/8’, i.e.,
P5(x) =(63x5-70x3+15x)/8.

P2(x) = (3x2-1)/2.
P3(x) =(5x3-3x)/2.

The ODE (1-x2)⋅(d2y/dx2)-2⋅x⋅ (dy/dx)+[n⋅ (n+1)-m2/(1-x2)] ⋅y = 0, has forsolution the function y(x) = Pnm(x)= (1-x2)m/2⋅(dmPn/dxm). This function isreferred to as an associated Legendre function.

Bessel’s equation
The ordinary differential equation x2⋅(d2y/dx2) + x⋅ (dy/dx)+ (x2-ν2) ⋅y = 0,
where the parameter ν is a nonnegative real number, is known as Bessel’s
differential equation. Solutions to Bessel’s equation are given in terms ofBessel functions of the first kind of order ν:(−1) m ⋅ x 2 m,
2 m +ν
⋅ m!⋅Γ(ν + m + 1)
m =0 2∞J ν ( x ) = xν ⋅ ∑Page 16-52

where ν is not an integer, and the function Gamma Γ(α) is defined in Chapter
3.
If ν = n, an integer, the Bessel functions of the first kind for n = integer are
defined by(−1) m ⋅ x 2 m.
2m+n⋅ m!⋅(n + m)!
m =0 2∞J n ( x) = x n ⋅ ∑Regardless of whether we use ν (non-integer) or n (integer) in the calculator, we
can define the Bessel functions of the first kind by using the following finite
series:Thus, we have control over the function’s order, n, and of the number of
elements in the series, k. Once you have typed this function, you can use
function DEFINE to define function J(x,n,k). This will create the variable @@@J@@@ in
the soft-menu keys. For example, to evaluate J3(0.1) using 5 terms in the series,
calculate J(0.1,3,5), i.e., in RPN mode: .1#3#5@@@J@@@ The
result is 2.08203157E-5.
If you want to obtain an expression for J0(x) with, say, 5 terms in the series, use
J(x,0,5). The result is‘1-0.25*x^2+0.015625*x^4-4.3403777E-4*x^6+6.782168E-6*x^86.78168*x^10’.
For non-integer values ν, the solution to the Bessel equation is given by
y(x) = K1⋅Jν(x)+K2⋅J-ν(x).
For integer values, the functions Jn(x) and J-n(x) are linearly dependent, sinceJn(x) = (-1)n⋅J-n(x),therefore, we cannot use them to obtain a general function to the equation.
Instead, we introduce the Bessel functions of the second kind defined asPage 16-53

Yν(x) = [Jν(x) cos νπ – J−ν(x)]/sin νπ,
for non-integer ν, and for n integer, with n > 0, by

Yn ( x) =x
x n ∞ (−1) m−1 ⋅ (hm + hm+ n ) 2 m⋅ J n ( x) ⋅ (ln + γ ) + ⋅ ∑ 2 m+ n⋅xπ2π m =0 2⋅ m!⋅(m + n)!
2

−

x −n

π

(n − m − 1)! 2 m
⋅x
2 m−n
⋅ m!
m =0 2n −1⋅∑where γ is the Euler constant, defined byγ = lim[1 +
r →∞

1 1
1
+ + ... + − ln r ] ≈ 0.57721566490...,2 3
rand hm represents the harmonic series

hm = 1 +1 1
1+ + ... +2 3m

For the case n = 0, the Bessel function of the second kind is defined as∞(−1) m −1 ⋅ hm 2 m ⎤2 ⎡x
Y0 ( x) = ⋅ ⎢ J 0 ( x) ⋅ (ln + γ ) + ∑ 2 m⋅ x ⎥.
2π ⎣⋅ (m!) 2
m =0 2⎦

With these definitions, a general solution of Bessel’s equation for all values of ν
is given by
y(x) = K1⋅Jν(x)+K2⋅Yν(x).
In some instances, it is necessary to provide complex solutions to Bessel’sequations by defining the Bessel functions of the third kind of order ν as
Hn(1)(x) = Jν(x)+i⋅Yν(x), and Hn(2)(x) = Jν(x)−i⋅Yν(x),These functions are also known as the first and second Hankel functions of orderν.
In some applications you may also have to utilize the so-called modified Bessel
functions of the first kind of order ν defined as Iν(x)= i-ν⋅Jν(i⋅x), where i is the unit
imaginary number. These functions are solutions to the differential equation
x2⋅(d2y/dx2) + x⋅ (dy/dx)- (x2+ν2) ⋅y = 0.
Page 16-54

The modified Bessel functions of the second kind,Kν(x) = (π/2)⋅[I-ν (x)−Iν (x)]/sin νπ,
are also solutions of this ODE.
You can implement functions representing Bessel’s functions in the calculator ina similar manner to that used to define Bessel’s functions of the first kind, but
keeping in mind that the infinite series in the calculator need to be translated
into a finite series.

Chebyshev or Tchebycheff polynomials
The functions Tn(x) = cos(n⋅cos-1 x), and Un(x) = sin[(n+1) cos-1 x]/(1-x2)1/2,
n = 0, 1, … are called Chebyshev or Tchebycheff polynomials of the first andsecond kind, respectively. The polynomials Tn(x) are solutions of the differential
equation (1-x2)⋅(d2y/dx2) − x⋅ (dy/dx) + n2⋅y = 0.
In the calculator the function TCHEBYCHEFF generates the Chebyshev orTchebycheff polynomial of the first kind of order n, given a value of n > 0. If
the integer n is negative (n < 0), the function TCHEBYCHEFF generates a
Tchebycheff polynomial of the second kind of order n whose definition isUn(x) = sin(n⋅arccos(x))/sin(arccos(x)).
You can access the function TCHEBYCHEFF through the command catalog(‚N).
The first four Chebyshev or Tchebycheff polynomials of the first and second kindare obtained as follows:
0 TCHEBYCHEFF, result: 1,-0 TCHEBYCHEFF, result: 1,
1 TCHEBYCHEFF, result: ‘X’,
-1 TCHEBYCHEFF, result: 1,

i.e.,
i.e.,
i.e.,
i.e.,

T0(x) = 1.0.
U0(x) = 1.0.
T1(x) = x.
U1(x) =1.0.

2 TCHEBYCHEFF, result: ‘2*X^2-1,-2 TCHEBYCHEFF, result: ‘2*X’,

i.e.,
i.e.,

T2(x) =2x2-1.
U2(x) =2x.

3 TCHEBYCHEFF, result: ‘4*X^3-3*X’,i.e.,T3(x) = 4x3-3x.

-3 TCHEBYCHEFF, result: ‘4*X^2-1’,i.e.,

U3(x) = 4x2-1.

Page 16-55

Laguerre’s equation
Laguerre’s equation is the second-order, linear ODE of the form x⋅(d2y/dx2)+(1−x)⋅ (dy/dx) + n⋅y = 0. Laguerre polynomials, defined as

L0 ( x) = 1,

Ln ( x) =e x d n (x n ⋅ e−x )⋅, n = 1,2,...
n!
dx n
,

are solutions to Laguerre’s equation. Laguerre’s polynomials can also be
calculated with:(−1) m ⎛ n ⎞ m⋅⎜ ⎟⋅ x .
m! ⎜⎝ m ⎟⎠m =0n

Ln ( x ) = ∑n ( n − 1) 2
( −1) n n
= 1− n ⋅ x +⋅ x − ... + .... +⋅x
4n!
The term⎛n⎞n!
⎜⎜ ⎟⎟ == C (n, m)⎝ m ⎠ m!(n − m)!
is the m-th coefficient of the binomial expansion (x+y)n. It also represents thenumber of combinations of n elements taken m at a time. This function isavailable in the calculator as function COMB in the MTH/PROB menu (see also
Chapter 17).
You can define the following function to calculate Laguerre’s polynomials:

When done typing it in the equation writer press use function DEFINE to create
the function L(x,n) into variable @@@L@@@ .
To generate the first four Laguerre polynomials use, L(x,0), L(x,1), L(x,2), L(x,3).
The results are:
L0(x) = .
L 1(x) = 1-x.

Page 16-56

L 2(x) = 1-2x+ 0.5x2
L 3(x) = 1-3x+1.5x2-0.16666…x3.

Weber’s equation and Hermite polynomials
Weber’s equation is defined as d2y/dx2+(n+1/2-x2/4)y = 0, for n = 0, 1, 2,… A particular solution of this equation is given by the function , y(x) =exp(-x2/4)H*(x/√2), where the function H*(x) is the Hermite polynomial:

H 0 * = 1, H n * ( x) = (−1) n e x2d n − x2(e ), n = 1,2,..
dx n

In the calculator, the function HERMITE, available through the menu
ARITHMETIC/POLYNOMIAL. Function HERMITE takes as argument an integer
number, n, and returns the Hermite polynomial of n-th degree. For example, thefirst four Hermite polynomials are obtained by using:
0 HERMITE, result: 1,

i.e., H0* = 1.

1 HERMITE, result: ’2*X’,i.e., H1* = 2x.

2 HERMITE, result: ’4*X^2-2’,

i.e., H2* = 4x2-2.

3 HERMITE, result: ’8*X^3-12*X’,i.e., H3* = 8x3-12x.

Numerical and graphical solutions to ODEs
Differential equations that cannot be solved analytically can be solved
numerically or graphically as illustrated below.

Numerical solution of first-order ODE
Through the use of the numerical solver (‚Ï), you can access an input
form that lets you solve first-order, linear ordinary differential equations. The
use of this feature is presented using the following example. The method usedin the solution is a fourth-order Runge-Kutta algorithm preprogrammed in thecalculator.
Example 1 -- Suppose we want to solve the differential equation, dv/dt = -1.5
v1/2, with v = 4 at t = 0. We are asked to find v for t = 2.

Page 16-57

First, create the expression defining the derivative and store it into variable EQ.
The figure to the left shows the ALG mode command, while the right-hand side
figure shows the RPN stack before pressing K.

Then, enter the NUMERICAL SOLVER environment and select the differential
equation solver: ‚Ï˜ @@@OK@@@ . Enter the following parameters:

To solve, press: @SOLVE (wait) @EDIT@.

The result is 0.2499 ≈ 0.25. Press @@@OK@@@.

Solution presented as a table of values
Suppose we wanted to produce a table of values of v, for t = 0.00, 0.25, …,
2.00, we will proceed as follows:First, prepare a table to write down your results. Write down in your table thestep-by-step results:
t
0.00
0.25
…
2.00

v
0.00
…

Next, within the SOLVE environment, change the final value of the independent
variable to 0.25, use :—.25 @@OK@@ ™™ @SOLVE (wait) @EDIT(Solves for v at t = 0.25, v = 3.285 …. )@@OK@@ INIT+ — . 5 @@OK@@ ™™@SOLVE (wait) @EDIT(Changes initial value of t to 0.25, and final value of t to 0.5, solve for v(0.5) =2.640…)
Page 16-58

@@OK@@ @INIT+—.75 @@OK@@ ™™@SOLVE (wait) @EDIT(Changes initial value of t to 0.5, and final value of t to 0.75, solve for v(0.75)= 2.066…)@@OK@@ @INIT+—1 @@OK@@ ™ ™ @SOLVE (wait) @EDIT(Changes initial value of t to 0.75, and final value of t to 1, solve for v(1) =1.562…)
Repeat for t = 1.25, 1.50, 1.75, 2.00. Press @@OK@@ after viewing the last result in@EDIT. To return to normal calculator display, press $ or L@@OK@@. The
different solutions will be shown in the stack, with the latest result in level 1.
The final results look as follows (rounded to the third decimal):

t
0.00
0.25
0.50
0.75
1.00
1.25
1.50
1.75
2.00

v
4.000
3.285
2.640
2.066
1.562
1.129
0.766
0.473
0.250

Graphical solution of first-order ODE
When we can not obtain a closed-form solution for the integral, we can always
plot the integral by selecting Diff Eq in the TYPE field of the PLOT
environment as follows: suppose that we want to plot the position x(t) for avelocity function v(t) = exp(-t2), with x = 0 at t = 0. We know there is no
closed-form expression for the integral, however, we know that the definition ofv(t) is dx/dt = exp(-t2).
The calculator allows for the plotting of the solution of differential equations of
the form Y'(T) = F(T,Y). For our case, we let Y = x and T = t, therefore, F(T,Y) =f(t, x) = exp(-t2). Let's plot the solution, x(t), for t = 0 to 5, by using the following
keystroke sequence:

Page 16-59

Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ
Θ

„ô (simultaneously, if in RPN mode) to enter PLOT environment
Highlight the field in front of TYPE, using the —˜keys. Then, press@CHOOS, and highlight Diff Eq, using the —˜keys. Press @@OK@@.
Change field F: to ‘EXP(- t^2)’
Make sure that the following parameters are set to: H-VAR: 0, V-VAR:
1
Change the independent variable to t .
Accept changes to PLOT SETUP: L @@OK@@„ò (simultaneously, if in RPN mode). To enter PLOT WINDOW
environment
Change the horizontal and vertical view window to the following settings:
H-VIEW: -1
5; V-VIEW: -1 !!!!1.5
Also, use the following values for the remaining parameters: Init: 0, Final:
5, Step: Default, Tol: 0.0001, Init-Soln: 0
To plot the graph use: @ERASE @DRAW

When you observe the graph being plotted, you'll notice that the graph is notvery smooth. That is because the plotter is using a time step that may be a bit
large for a smooth graph. To refine the graph and make it smoother, use a stepof 0.1. Press @CANCL and change the Step : value to 0.1, then use @ERASE @DRAW
once more to repeat the graph. The plot will take longer to be completed, but
the shape is definitely smoother than before. Try the following: @EDIT L @LABEL@MENU to see axes labels and range.

Notice that the labels for the axes are shown as 0 (horizontal, for t) and 1(vertical, for x). These are the definitions for the axes as given in the PLOT
SETUP window („ô) i.e., H-VAR: 0, and V-VAR: 1. To see the graphicalsolution in detail use the following:
Page 16-60

LL@)PICT

To recover menu and return to PICT environment.

@(X,Y)@

To determine coordinates of any point on the graph.

Use the š™ keys to move the cursor around the plot area. At the bottom of
the screen you will see the coordinates of the cursor as (X,Y), i.e., the calculator
uses X and Y as the default names for the horizontal and vertical axes,
respectively. Press L@CANCL to recover the menu and return to the PLOT
WINDOW environment. Finally, press $ to return to normal display.

Numerical solution of second-order ODE
Integration of second-order ODEs can be accomplished by defining the solution
as a vector. As an example, suppose that a spring-mass system is subject to adamping force proportional to its speed, so that the resulting differential
equation is:
or,

d 2x
dx
= −18.75 ⋅ x − 1.962 ⋅2dt
dtx" = - 18.75 x - 1.962 x',

subject to the initial conditions, v = x' = 6, x = 0, at t = 0. We want to find x,
x' at t = 2.
Re-write the ODE as: w' = Aw, where w = [ x x' ]T, and A is the 2 x 2 matrix
shown below.
'

1 ⎤ ⎡ x⎤⎡ x⎤ ⎡ 0⎢ x'⎥ = ⎢− 18.75 − 1.962⎥ ⋅ ⎢ x'⎥
⎣ ⎦ ⎣
⎦ ⎣ ⎦

The initial conditions are now written as w = [0 6]T, for t = 0. (Note: Thesymbol [ ]T means the transpose of the vector or matrix).
To solve this problem, first, create and store the matrix A, e.g., in ALG mode:

Then, activate the numerical differential equation solver by using: ‚ Ï
˜ @@@OK@@@ . To solve the differential equation with starting time t = 0 and final
Page 16-61

time t = 2, the input form for the differential equation solver should look as
follows (notice that the Init: value for the Soln: is a vector [0, 6]):

Press @SOLVE (wait) @EDIT to solve for w(t=2). The solution reads [.16716… .6271…], i.e., x(2) = 0.16716, and x'(2) = v(2) = -0.6271. Press @CANCL toreturn to SOLVE environment.
Solution presented as a table of values
In the previous example we were interested only in finding the values of theposition and velocity at a given time t. If we wanted to produce a table ofvalues of x and x', for t = 0.00, 0.25, …, 2.00, we will proceed as follows:First, prepare a table to write down your results:
t
0.00
0.25
…
2.00

x
0.00

x'
6.00

…

…

Next, within the SOLVE environment, change the final value of the independent
variable to 0.25, use:—.25 @@OK@@ ™™ @SOLVE (wait) @EDIT(Solves for w at t = 0.25, w = [0.968 1.368]. )@@OK@@ INIT+ — . 5 @@OK@@ ™™@SOLVE (wait) @EDIT(Changes initial value of t to 0.25, and final value of t to 0.5, solve again forw(0.5) = [0.748 -2.616])@@OK@@ @INIT+ —.75 @@OK@@™™@SOLVE (wait) @EDIT(Changes initial value of t to 0.5, and final value of t to 0.75, solve again forw(0.75) = [0.0147 -2.859])@@OK@@ @INIT+ —1 @@OK@@ ™ ™ @SOLVE (wait) @EDIT

Page 16-62

(Changes initial value of t to 0.75, and final value of t to 1, solve again for w(1)= [-0.469 -0.607])
Repeat for t = 1.25, 1.50, 1.75, 2.00. Press @@OK@@ after viewing the last result in@EDIT. To return to normal calculator display, press $ or L@@OK@@. The
different solutions will be shown in the stack, with the latest result in level 1.
The final results look as follows:
t
0.00
0.25
0.50
0.75
1.00

x
0.000
0.968
0.748
-0.015-0.469

x'
6.000
1.368
-2.616-2.859-0.607txx'1.25 -0.354 1.281
1.50 0.141 1.362
1.75 0.227 0.268
2.00 0.167 -0.627

Graphical solution for a second-order ODE
Start by activating the differential equation numerical solver, ‚ Ï ˜@@@OK@@@ . The SOLVE screen should look like this:Notice that the initial condition for the solution (Soln: w Init:[0., …) includes thevector [0, 6]. Press L @@OK@@.
Next, press „ô (simultaneously, if in RPN mode) to enter the PLOT
environment. Highlight the field in front of TYPE, using the —˜keys. Then,press @CHOOS, and highlight Diff Eq, using the —˜keys. Press @@OK@@.
Modify the rest of the PLOT SETUP screen to look like this:Page 16-63

Notice that the option V-Var: is set to 1, indicating that the first element in thevector solution, namely, x’, is to be plotted against the independent variable t.
Accept changes to PLOT SETUP by pressing L @@OK@@.
Press „ò (simultaneously, if in RPN mode) to enter the PLOT WINDOW
environment. Modify this input form to look like this:To plot the x’ vs. t graph use: @ERASE @DRAW . The plot of x’ vs. t looks like this:To plot the second curve we need to use the PLOT SETUP input form once, more.
To reach this form from the graph above use: @CANCL L @@OK@@„ô(simultaneously, if in RPN mode) . Change the value of the V-Var: field
to 2, and press @DRAW (do not press @ERASE or you would loose the graphproduced above). Use: @EDIT L @LABEL @MENU to see axes labels and range.
Notice that the x axis label is the number 0 (indicating the independent
variable), while the y-axis label is the number 2 (indicating the second variable,i.e., the last variable plotted). The combined graph looks like this:Page 16-64

Press LL @PICT @CANCL $ to return to normal calculator display.

Numerical solution for stiff first-order ODE
Consider the ODE: dy/dt = -100y+100t+101, subject to the initial conditiony(0) = 1.
Exact solution
This equation can be written as dy/dt + 100 y = 100 t + 101, and solved
using an integrating factor, IF(t) = exp(100t), as follows (RPN mode, with CAS
set to Exact mode):‘(100*t+101)*EXP(100*t)’ ` ‘t’ ` RISCH
The result is‘(t+1)*EXP(100*t)’.

Next, we add an integration constant, by using: ‘C’ `+Then, we divide by FI(x), by using: ‘EXP(100*t)’ `/.
The result is: ‘((t+1)*EXP(100*t)+C)/EXP(100*t)’, i.e., y(t) = 1+ t +C⋅e100t. Use of
the initial condition y(0) = 1, results in 1 = 1 + 0 + C⋅e0, or C = 0, theparticular solution being y(t) = 1+t.
Numerical solution
If we attempt a direct numerical solution of the original equation dy/dt = 100y+100t+101, using the calculator’s own numerical solver, we find that thecalculator takes longer to produce a solution that in the previous first-order
example. To check this out, set your differential equation numerical solver (‚Ï˜ @@@OK@@@) to:

Page 16-65

Here we are trying to obtain the value of y(2) given y(0) = 1. With the Soln:
Final field highlighted, press @SOLVE. You can check that a solution takes about
6 seconds, while in the previous first-order example the solution was almost
instantaneous. Press $ to cancel the calculation.
This is an example of a stiff ordinary differential equation. A stiff ODE is one
whose general solution contains components that vary at widely different rates
under the same increment in the independent variable. In this particular case,the general solution, y(t) = 1+ t +C⋅e100t, contains the components ‘t’ and‘C⋅e100t’, which vary at very different rates, except for the cases C=0 or C≈0(e.g., for C = 1, t =0.1, C⋅e100t =22026).
The calculator’s ODE numerical solver allows for the solution of stiff ODEs byselecting the option _Stiff in the SOLVE Y’(T) = F(T,Y) screen. With thisoption selected you need to provide the values of ∂f/∂y and ∂f/∂t. For the caseunder consideration ∂f/∂y = -100 and ∂f/∂t = 100.
Enter those values in the corresponding fields of the SOLVE Y’(T) = F(T,Y)
screen:When done, move the cursor to the Soln:Final field and press @SOLVE.
time, the solution in produced in about 1 second.

This

Press @EDIT to see thesolution: 2.9999999999, i.e., 3.0.

Page 16-66

Note: The option Stiff is also available for graphical solutions of differential
equations.

Numerical solution to ODEs with the SOLVE/DIFF menu
The SOLVE soft menu is activated by using 74 MENU in RPN mode. This menu
is presented in detail in Chapter 6. One of the sub-menus, DIFF, contains
functions for the numerical solution of ordinary differential equations for use inprogramming. These functions are described next using RPN mode and system
flag 117 set to SOFT menus. (See note in page 16-75).
The functions provided by the SOLVE/DIFF menu are the following:

Function RKF
This function is used to compute the solution to an initial value problem for a
first-order differential equation using the Runge-Kutta-Fehlbert 4th -5th ordersolution scheme. Suppose that the differential equation to be solved is given by
dy/dx = f(x,y), with y = 0 at x = 0, and that you will allow a convergencecriteria ε for the solution. You can also specify an increment in the independent
variable, Δx, to be used by the function. To run this function you will prepare
your stack as follows:
3:{‘x’, ‘y’, ‘f(x,y)’}2:{ ε Δx }1:

xfinal

The value in the first stack level is the value of the independent variable where
you want to find your solution, i.e., you want to find, yfinal = fs(xfinal), where fs(x)represents the solution to the differential equation. The second stack level may
contain only the value of ε, and the step Δx will be taken as a small default
value. After running function @@RKF@@, the stack will show the lines:
2:
1:{‘x’, ‘y’, ‘f(x,y)’}εPage 16-67

The value of the solution, yfinal, will be available in variable @@@y@@@. This function
is appropriate for programming since it leaves the differential equation
specifications and the tolerance in the stack ready for a new solution. Noticethat the solution uses the initial conditions x = 0 at y = 0. If, your actual initialsolutions are x = xinit at y = yinit, you can always add these values to thesolution provided by RKF, keeping in mind the following relationship:

RKF solutionxy0
xfinal0yfinalActual solution
x
y
xinit
yinit
xinit + xfinal yinit + yfinal

The following screens show the RPN stack before and after applying function
RKF for the differential equation dy/dx = x+y, ε = 0.001, Δx = 0.1.

After applying function RKF, variable @@@y@@@ contains the value 4.3880...

Function RRKThis function is similar to the RKF function, except that RRK (Rosenbrock andRunge-Kutta methods) requires as the list in stack level 3 for input not only thenames of the independent and dependent variables and the function defining
the differential equation, but also the expressions for the first and second
derivatives of the expression. Thus, the input stack for this function will look as
follows:ˆˍʳʳʳʳʳ {'x', 'y', 'f(x,y)' '∂f/∂x' '∂f/∂y' }2:{ ε Δx }1:

xfinal

The value in the first stack level is the value of the independent variable where
you want to find your solution, i.e., you want to find, yfinal = fs(xfinal), where fs(x)represents the solution to the differential equation. The second stack level may

Page 16-68

contain only the value of ε, and the step Δx will be taken as a small default
value. After running function @@RKF@@, the stack will show the lines:
2:{‘x’, ‘y’, ‘f(x,y)’ ‘∂f/∂x’ ‘∂f/vy’ }1:{ ε Δx }The value of the solution, yfinal, will be available in variable @@@y@@@.
This function can be used to solve so-called “stiff” differential equations.
The following screen shots show the RPN stack before and after application offunction RRK:

The value stored in variable y is 3.00000000004.

Function RKFSTEPThis function uses an input list similar to that of function RKF, as well as thetolerance for the solution, and a possible step Δx, and returns the same input
list, followed by the tolerance, and an estimate of the next step in the
independent variable. The function returns the input list, the tolerance, and thenext step in the independent variable that satisfies that tolerance. Thus, theinput stack looks as follows:ˆˍʳʳʳʳʳʳ {‘x’, ‘y’, ‘f(x,y)’}
2:

ε

1:

Δx

After running this function, the stack will show the lines:
3:{‘x’, ‘y’, ‘f(x,y)’}

2:

ε

1:

(Δx)nextThus, this function is used to determine the appropriate size of a time step tosatisfy the required tolerance.
The following screen shots show the RPN stack before and after application offunction RKFSTEP:
Page 16-69

These results indicate that (Δx)next = 0.34049…

Function RRKSTEPThis function uses an input list similar to that of function RRK, as well as thetolerance for the solution, a possible step Δx, and a number (LAST) specifying
the last method used in the solution (1, if RKF was used, or 2, if RRK was used).
Function RRKSTEP returns the same input list, followed by the tolerance, anestimate of the next step in the independent variable, and the current method(CURRENT) used to arrive at the next step. Thus, the input stack looks asfollows:
4:{‘x’, ‘y’, ‘f(x,y)’}

3:

ε

2:

Δx

1:

LAST

After running this function, the stack will show the lines:
4:{‘x’, ‘y’, ‘f(x,y)’}

3:

ε

2:

(Δx)next

1:

CURRENTThus, this function is used to determine the appropriate size of a time step((Δx)next) to satisfy the required tolerance, and the method used to arrive at that
result (CURRENT).
The following screen shots show the RPN stack before and after application offunction RRKSTEP:

Page 16-70

These results indicate that (Δx)next = 0.00558… and that the RKF method(CURRENT = 1) should be used.

Function RKFERR
This function returns the absolute error estimate for a given step when solving aproblem as that described for function RKF. The input stack looks as follows:
2: ʳʳʳ {‘x’, ‘y’, ‘f(x,y)’}1:

ΔxAfter running this function, the stack will show the lines:
4:{‘x’, ‘y’, ‘f(x,y)’}

3:

ε

2:

Δy

1:
error
Thus, this function is used to determine the increment in the solution, Δy, as wellas the absolute error (error).
The following screen shots show the RPN stack before and after application offunction RKFERR:

These result show that Δy = 0.827… and error = -1.89…×10 -6.

Function RSBERRThis function performs similarly to RKERR but with the input elements listed forfunction RRK. Thus, the input stack for this function will look as follows:
2:{‘x’, ‘y’, ‘f(x,y)’ ‘∂f/∂x’ ‘∂f/vy’ }1:Δx

After running the function, the stack will show the lines:
4:{‘x’, ‘y’, ‘f(x,y)’ ‘∂f/∂x’ ‘∂f/vy’ }:

3:

ε

2:

Δy

1:

error
Page 16-71

The following screen shots show the RPN stack before and after application offunction RSBERR:

These results indicate that Δy = 4.1514… and error = 2.762..., for Dx = 0.1.
Check that, if Dx is reduced to 0.01, Δy = -0.00307… and error = 0.000547.

Note: As you execute the commands in the DIFF menu values of x and y will
be produced and stored as variables in your calculator. The results provided
by the functions in this section will depend on the current values of x and y.
Therefore, some of the results illustrated above may differ from what you get inyour calculator.

Page 16-72

Chapter 17
Probability Applications
In this Chapter we provide examples of applications of calculator’s functions toprobability distributions.

The MTH/PROBABILITY.. sub-menu - part 1
The MTH/PROBABILITY.. sub-menu is accessible through the keystroke sequence„´. With system flag 117 set to CHOOSE boxes, the following list of
MTH options is provided (see left-hand side figure below). We have selected
the PROBABILITY.. option (option 7), to show the following functions (see righthand side figure below):

In this section we discuss functions COMB, PERM, ! (factorial), RAND, and RDZ.

Factorials, combinations, and permutations
The factorial of an integer n is defined as: n! = n⋅ (n-1) ⋅ (n-2)…3⋅2⋅1. By
definition, 0! = 1. Factorials are used in the calculation of the number of
permutations and combinations of objects. For example, the number of
permutations of r objects from a set of n distinct objects isnPr = n(n − 1)(n − 1)...(n − r + 1) = n! /( n − r )!

Also, the number of combinations of n objects taken r at a time is⎛ n ⎞ n(n − 1)(n − 2)...(n − r + 1)n!
⎜⎜ ⎟⎟ ==r!
r!(n − r )!
⎝r⎠Page 17-1

To simplify notation, use P(n,r) for permutations, and C(n,r) for combinations.
We can calculate combinations, permutations, and factorials with functions
COMB, PERM, and ! from the MTH/PROBABILITY.. sub-menu. The operation of
those functions is described next:ΘΘΘ

COMB(n,r): Combinations of n items taken r at a time
PERM(n,r): Permutations of n items taken r at a timen!: Factorial of a positive integer. For a non-integer, x! returns Γ(x+1),
where Γ(x) is the Gamma function (see Chapter 3). The factorial
symbol (!) can be entered also as the keystroke combination~‚2.

Example of applications of these functions are shown next:

Random numbers
The calculator provides a random number generator that returns a uniformly
distributed, random real number between 0 and 1. The generator is able toproduce sequences of random numbers. However, after a certain number oftimes (a very large number indeed), the sequence tends to repeat itself. For thatreason, the random number generator is more properly referred to as a pseudorandom number generator. To generate a random number with your calculator
use function RAND from the MTH/PROBABILITY sub-menu. The following
screen shows a number of random numbers produced using RAND. The
numbers in the left-hand side figure are produced with calling function RAND
without an argument. If you place an argument list in function RAND, you getback the list of numbers plus an additional random number attached to it as
illustrated in the right-hand side figure.

Page 17-2

Random number generators, in general, operate by taking a value, called the“seed” of the generator, and performing some mathematical algorithm on that“seed” that generates a new (pseudo)random number. If you want to generatea sequence of number and be able to repeat the same sequence later, you canchange the "seed" of the generator by using function RDZ(n), where n is the“seed,” before generating the sequence. Random number generators operateby starting with a "seed" number that is transformed into the first random
number of the series. The current number then serves as the "seed" for the next
number and so on. By "re-seeding" the sequence with the same number you
can reproduce the same sequence more than once. For example, try thefollowing:
RDZ(0.25) `Use 0.25 as the "seed."
RAND() `First random number = 0.75285…
RAND() `Second random number = 0.51109…
RAND() `Third random number= 0.085429….
Re-start the sequence:
RDZ(0.25) `Use 0.25 as the "seed."
RAND() `First random number = 0.75285…
RAND() `Second random number = 0.51109…
RAND() `Third random number= 0.085429….
To generate a sequence of random numbers use function SEQ. For example, togenerate a list of 5 random numbers you can use, in ALG mode:
SEQ(RAND(),j,1,5,1). In RPN mode, use the following program:«  n « 1 n FOR j RND NEXT n LIST » »Store it into variable RLST (Random LiST), and use J5@RLST! to produce alist of 5 random numbers.
Function RNDM(n,m) can be used to generate a matrix of n rows and mcolumns whose elements are random integers between -1 and 1(see Chapter
10).

Discrete probability distributions
A random variable is said to be discrete when it can only take a finite numberof values. For example, the number of rainy days in a given location can beconsidered a discrete random variable because we count them as integer
numbers only. Let X represent a discrete random variable, its probability mass

Page 17-3

function (pmf) is represented by f(x) = P[X=x], i.e., the probability that the
random variable X takes the value x.
The mass distribution function must satisfy the conditions thatf(x) >0, for all x,
and∑ f ( x) = 1.0

all x

A cumulative distribution function (cdf) is defined as

F ( x) = P[ X ≤ x] = ∑ f (k )k≤x

Next, we will define a number of functions to calculate discrete probability
distributions. We suggest that you create a sub-directory, say,
HOME\STATS\DFUN (Discrete FUNctions) where we will define the probability
mass function and cumulative distribution function for the binomial and Poisson
distributions.

Binomial distribution
The probability mass function of the binomial distribution is given by⎛n⎞f (n, p, x) = ⎜⎜ ⎟⎟ ⋅ p x ⋅ (1 − p ) n − x , x = 0,1,2,..., n⎝ x⎠where (nx) = C(n,x) is the combination of n elements taken x at a time. The
values n and p are the parameters of the distribution. The value n represents
the number of repetitions of an experiment or observation that can have one of
two outcomes, e.g., success and failure. If the random variable X represents thenumber of successes in the n repetitions, then p represents the probability ofgetting a success in any given repetition. The cumulative distribution function
for the binomial distribution is given by

Page 17-4

x

F (n, p, x) = ∑ f (n, p, x), x = 0,1,2,..., nk =0Poisson distribution
The probability mass function of the Poisson distribution is given byf (λ , x ) =e −λ ⋅ λx, x = 0,1,2,..., ∞x!
.

In this expression, if the random variable X represents the number ofoccurrences of an event or observation per unit time, length, area, volume, etc.,
then the parameter l represents the average number of occurrences per unit
time, length, area, volume, etc. The cumulative distribution function for the
Poisson distribution is given byx

F (λ , x) = ∑ f (λ , x), x = 0,1,2,..., ∞k =0

Next, use function DEFINE („à) to define the following probability massfunctions (pmf) and cumulative distribution functions (cdf):
DEFINE(pmfb(n,p,x) = COMB(n,x)*p^x*(1-p)^(n-x))
DEFINE(cdfb(n,p,x) = Σ(k=0,x,pmfb(n,p,k)))
DEFINE(pmfp(λ,x) = EXP(-λ)*λ^x/x!)
DEFINE(cdfp(λ,x) = Σ(k=0,x,pmfp(λ,x)))
The function names stand for:
Θ
Θ
Θ
Θ

pmfb:
cdfb:
pmfp:
cdfp:

probability mass function for the binomial distribution
cumulative distribution function for the binomial distribution
probability mass function for the Poisson distribution
cumulative distribution function for the Poisson distribution

Examples of calculations using these functions are shown next:

Page 17-5

Continuous probability distributions
The probability distribution for a continuous random variable, X, ischaracterized by a function f(x) known as the probability density function (pdf).
The pdf has the following properties: f(x) > 0, for all x, andP[ X < x ] = F ( x ) = ∫

∫

+∞
−∞

x
−∞

f (ξ )dξ .

f ( x)dx = 1.

Probabilities are calculated using the cumulative distribution function (cdf), F(x),defined by P[ X < x ] = F ( x ) =

∫

x
−∞

f (ξ )dξ , where P[X<x] stands for “theprobability that the random variable X is less than the value x”.
In this section we describe several continuous probability distributions including
the gamma, exponential, beta, and Weibull distributions. These distributions
are described in any statistics textbook. Some of these distributions make use ofa the Gamma function defined earlier, which is calculated in the calculator byusing the factorial function as Γ(x) = (x-1)!, for any real number x.

The gamma distribution
The probability distribution function (pdf) for the gamma distribution is given byf ( x) =1x⋅ x α −1 ⋅ exp(− ), forββ Γ(α )
αx > 0, α > 0, β > 0;

The corresponding (cumulative) distribution function (cdf) would be given by an
integral that has no closed-form solution.

The exponential distribution
The exponential distribution is the gamma distribution with a = 1. Its pdf isgiven by

Page 17-6

f ( x) =1

β⋅ exp(−

xβ), forx > 0, β > 0 ,while its cdf is given by F(x) = 1 - exp(-x/β), for x>0, β >0.

The beta distribution
The pdf for the gamma distribution is given byf ( x) =Γ(α + β )⋅ x α −1 ⋅ (1 − x) β −1 , for 0 < x < 1, α > 0, β > 0
Γ(α ) ⋅ Γ( β )As in the case of the gamma distribution, the corresponding cdf for the beta
distribution is also given by an integral with no closed-form solution.

The Weibull distribution
The pdf for the Weibull distribution is given byf ( x) = α ⋅ β ⋅ x β −1 ⋅ exp(−α ⋅ x β ),for x > 0,α > 0, β > 0

While the corresponding cdf is given by

F ( x) = 1 − exp(−α ⋅ x β ),for x > 0, α > 0, β > 0

Functions for continuous distributions
To define a collection of functions corresponding to the gamma, exponential,beta, and Weibull distributions, first create a sub-directory called CFUN
(Continuous FUNctions) and define the following functions (change to Approxmode):
Gamma pdf:

'gpdf(x) = x^(α-1)*EXP(-x/β)/(β^α*GAMMA(α))'

Gamma cdf:

'gcdf(x) = ∫(0,x,gpdf(t),t)'

Beta pdf:' βpdf(x)= GAMMA(α+β)*x^(α-1)*(1-x)^(β-1)/(GAMMA(α)*GAMMA(β))'

Beta cdf:'βcdf(x) = ∫(0,x, βpdf(t),t)'Page 17-7

Exponential pdf:

'epdf(x) = EXP(-x/β)/β'

Exponential cdf:

'ecdf(x) = 1 - EXP(-x/β)'

Weibull pdf:

'Wpdf(x) = α*β*x^(β-1)*EXP(-α*x^β)'

Weibull cdf:

'Wcdf(x) = 1 - EXP(-α*x^β)'

Use function DEFINE to define all these functions. Next, enter the values of αand β, e.g., 1K~‚a` 2K ~‚b`
Finally, for the cdf for Gamma and Beta cdf’s, you need to edit the program
definitions to add NUM to the programs produced by function DEFINE. For
example, the Gamma cdf, i.e., the function gcdf, should be modified to read: « x 'NUM( ∫ (0,x,gpdf(t),t))' » and stored back into @gcdf. Repeat
the procedure for βcdf. Use RPN mode to perform these changes.
Unlike the discrete functions defined earlier, the continuous functions defined inthis section do not include their parameters (α and/or β) in their definitions.
Therefore, you don't need to enter them in the display to calculate the functions.
However, those parameters must be previously defined by storing thecorresponding values in the variables α and β. Once all functions and thevalues α and β have been stored, you can order the menu labels by using
function ORDER. The call to the function will be the following:
ORDER({‘α’,’β’,’gpdf’,’gcdf’,’βpdf’,’βcdf’,’epdf’,’ecdf’,’Wpdf’,’Wcdf’})
Following this command the menu labels will show as follows (Press L tomove to the second list. Press L once more to move to the first list):

Some examples of application of these functions, for values of α = 2, β = 3, areshown below. Notice the variable IERR that shows up in the second screen shot.
This results from a numerical integration for function gcdf.

Page 17-8

Continuous distributions for statistical inference
In this section we discuss four continuous probability distributions that arecommonly used for problems related to statistical inference. These distributions
are the normal distribution, the Student’s t distribution, the Chi-square (χ2)
distribution, and the F-distribution. The functions provided by the calculator toevaluate probabilities for these distributions are contained in the MTH/
PROBABILITY menu introduced earlier in this chapter. The functions are NDIST,UTPN, UTPT, UTPC, and UTPF. Their application is described in the following
sections. To see these functions activate the MTH menu: „´ and selectthe PROBABILITY option:

Normal distribution pdf
The expression for the normal distribution pdf is:

f ( x) =

1

σ 2π

exp[−

(x − μ )2],2σ 2

Page 17-9where μ is the mean, and σ2 is the variance of the distribution. To calculate thevalue of f(μ,σ2,x) for the normal distribution, use function NDIST with thefollowing arguments: the mean, μ, the variance, σ2, and, the value x , i.e.,
NDIST(μ,σ2,x). For example, check that for a normal distribution, f(1.0,0.5,2.0)= 0.20755374.

Normal distribution cdf
The calculator has a function UTPN that calculates the upper-tail normal
distribution, i.e., UTPN(x) = P(X>x) = 1 - P(X<x). To obtain the value of theupper-tail normal distribution UTPN we need to enter the following values: themean, μ; the variance, σ2; and, the value x, e.g., UTPN((μ,σ2,x)For example, check that for a normal distribution, with μ = 1.0, σ2 = 0.5,
UTPN(0.75) = 0.638163. Use UTPN(1.0,0.5,0.75) = 0.638163.
Different probability calculations for normal distributions [X is N(μ,σ2)] can be
defined using the function UTPN, as follows:ΘΘΘ

P(X<a) = 1 - UTPN(μ, σ2,a)P(a<X<b) = P(X<b) - P(X<a) = 1 - UTPN(μ, σ2,b) - (1 - UTPN(μ, σ2,a)) =UTPN(μ, σ2,a) - UTPN(μ, σ2,b)P(X>c) = UTPN(μ, σ2,c)Examples: Using μ = 1.5, and σ2 = 0.5, find:P(X<1.0) = 1 - P(X>1.0) = 1 - UTPN(1.5, 0.5, 1.0) = 0.239750.
P(X>2.0) = UTPN(1.5, 0.5, 2.0) = 0.239750.
P(1.0<X<2.0) = F(1.0) - F(2.0) = UTPN(1.5,0.5,1.0) - UTPN(1.5,0.5,2.0) =0.7602499 - 0.2397500 = 0.524998.

The Student-t distribution
The Student-t, or simply, the t-, distribution has one parameter ν, known as thedegrees of freedom of the distribution. The probability distribution function (pdf)
is given by

Page 17-10ν +1

f (t ) =

Γ(

ν

2

)

Γ( ) ⋅ πν
2⋅ (1 +

ν +1

t2 − 2),−∞ < t < ∞νwhere Γ(α) = (α-1)! is the GAMMA function defined in Chapter 3.
The calculator provides for values of the upper-tail (cumulative) distributionfunction for the t-distribution, function UTPT, given the parameter ν and the valueof t, i.e., UTPT(ν,t). The definition of this function is, therefore,
∞

t

t

−∞

UTPT (ν , t ) = ∫ f (t )dt = 1 − ∫ f (t )dt = 1 − P (T ≤ t )For example, UTPT(5,2.5) = 2.7245…E-2. Other probability calculations for thet-distribution can be defined using the function UTPT, as follows:ΘΘΘP(T<a) = 1 - UTPT(ν,a)
P(a<T<b) = P(T<b) - P(T<a) = 1 - UTPT(ν,b) - (1 - UTPT(ν,a)) =UTPT(ν,a) - UTPT(ν,b)
P(T>c) = UTPT(ν,c)

Examples: Given ν = 12, determine:P(T<0.5) = 1-UTPT(12,0.5) = 0.68694..
P(-0.5<T<0.5) = UTPT(12,-0.5)-UTPT(12,0.5) = 0.3738…
P(T> -1.2) = UTPT(12,-1.2) = 0.8733…

The Chi-square distribution
The Chi-square (χ2) distribution has one parameter ν, known as the degrees of
freedom. The probability distribution function (pdf) is given byf ( x) =

ν

1
ν

ν

−1

−

x

⋅ x 2 ⋅ e 2 ,ν > 0, x > 0

2 2 ⋅ Γ( )2Page 17-11

The calculator provides for values of the upper-tail (cumulative) distributionfunction for the χ2-distribution using [UTPC] given the value of x and theparameter ν. The definition of this function is, therefore,
∞

t

t

−∞

UTPC (ν , x) = ∫ f ( x)dx = 1 − ∫f ( x)dx = 1 − P( X ≤ x)

To use this function, we need the degrees of freedom, ν, and the value of thechi-square variable, x, i.e., UTPC(ν,x). For example, UTPC(5, 2.5) =0.776495…
Different probability calculations for the Chi-squared distribution can be definedusing the function UTPC, as follows:ΘΘΘ

P(X<a) = 1 - UTPC(ν,a)
P(a<X<b) = P(X<b) - P(X<a) = 1 - UTPC(ν,b) - (1 - UTPC(ν,a)) =UTPC(ν,a) - UTPC(ν,b)
P(X>c) = UTPC(ν,c)

Examples: Given ν = 6, determine:P(X<5.32) = 1-UTPC(6,5.32) = 0.4965..
P(1.2<X<10.5) = UTPC(6,1.2)-UTPC(6,10.5) = 0.8717…
P(X> 20) = UTPC(6,20) = 2.769..E-3

The F distribution
The F distribution has two parameters νN = numerator degrees of freedom, andνD = denominator degrees of freedom. The probability distributionfunction (pdf) is given byνN ν2N ν2N −1
) ⋅F
ν
D
2
f ( x) =νNνDνN ⋅ F (νN +2νD ))Γ( ) ⋅ Γ( ) ⋅ (1 −νD
22
νN + νDΓ()⋅(

Page 17-12

The calculator provides for values of the upper-tail (cumulative) distributionfunction for the F distribution, function UTPF, given the parameters νN and νD,
and the value of F. The definition of this function is, therefore,
∞

t

t

−∞

UTPF (νN ,νD, F ) = ∫ f ( F )dF = 1 − ∫f ( F )dF = 1 − P (ℑ ≤ F )For example, to calculate UTPF(10,5, 2.5) = 0.161834…
Different probability calculations for the F distribution can be defined using thefunction UTPF, as follows:ΘΘ

P(F<a) = 1 - UTPF(νN, νD,a)P(a<F<b) = P(F<b) - P(F<a) = 1 -UTPF(νN, νD,b)- (1 - UTPF(νN, νD,a))Θ= UTPF(νN, νD,a) - UTPF(νN, νD,b)
P(F>c) = UTPF(νN, νD,a)

Example: Given νN = 10, νD = 5, find:P(F<2) = 1-UTPF(10,5,2) = 0.7700…
P(5<F<10) = UTPF(10,5,5) – UTPF(10,5,10) = 3.4693..E-2
P(F>5) = UTPF(10,5,5) = 4.4808..E-2

Inverse cumulative distribution functions
For a continuous random variable X with cumulative density function (cdf) F(x) =P(X<x) = p, to calculate the inverse cumulative distribution function we need tofind the value of x, such that x = F-1(p). This value is relatively simple to find forthe cases of the exponential and Weibull distributions since their cdf’s have aclosed form expression:ΘΘ

Exponential, F(x) = 1 - exp(-x/β)
Weibull, F(x) = 1-exp(-αxβ)(Before continuing, make sure to purge variables α and β). To find the inverse
cdf’s for these two distributions we need just solve for x from these expressions,i.e.,Page 17-13

Exponential:

Weibull:

For the Gamma and Beta distributions the expressions to solve will be more
complicated due to the presence of integrals, i.e.,•

Gamma,

•

Beta,

p=∫
p=∫

x
0

x
0

1
z
⋅ z α −1 ⋅ exp(− )dzββ Γ(α )αΓ(α + β )⋅ z α −1 ⋅ (1 − z ) β −1 dz
Γ(α ) ⋅ Γ( β )A numerical solution with the numerical solver will not be feasible because of
the integral sign involved in the expression. However, a graphical solution ispossible. Details on how to find the root of a graph are presented in Chapter
12. To ensure numerical results, change the CAS setting to Approx. The
function to plot for the Gamma distribution isY(X) = ∫(0,X,z^(α-1)*exp(-z/β)/(β^α*GAMMA(α)),z)-p
For the Beta distribution, the function to plot isY(X) =∫(0,X,z^(α-1)*(1-z)^(β-1)*GAMMA(α+β)/(GAMMA(α)*GAMMA(β)),z)-p
To produce the plot, it is necessary to store values of α, β, and p, before
attempting the plot. For example, for α = 2, β = 3, and p = 0.3, the plot ofY(X) for the Gamma distribution is shown below. (Please notice that, because of
the complicated nature of function Y(X), it will take some time before the graphis produced. Be patient.)

Page 17-14

There are two roots of this function found by using function @ROOT within the plot
environment. Because of the integral in the equation, the root is approximatedand will not be shown in the plot screen. You will only get the message
Constant? Shown in the screen. However, if you press ` at this point, theapproximate root will be listed in the display. Two roots are shown in the righthand figure below.

Alternatively, you can use function @TRACE @(X,Y)@ to estimate the roots by tracing
the curve near its intercepts with the x-axis. Two estimates are shown below:

These estimates suggest solutions x = -1.9 and x = 3.3. You can verify these“solutions” by evaluating function Y1(X) for X = -1.9 and X = 3.3, i.e.,

For the normal, Student’s t, Chi-square (χ2), and F distributions, which are
represented by functions UTPN, UTPT, UPTC, and UTPF in the calculator, theinverse cuff can be found by solving one of the following equations:ΘΘΘΘNormal, p = 1 – UTPN(μ,σ2,x)Student’s t, p = 1 – UTPT(ν,t)
Chi-square, p = 1 – UTPC(ν,x)
F distribution: p = 1 – UTPF(νN,νD,F)

Page 17-15

Notice that the second parameter in the UTPN function is σ2, not σ2,
representing the variance of the distribution. Also, the symbol ν (the lower-caseGreek letter no) is not available in the calculator. You can use, for example, γ(gamma) instead of ν. The letter γ is available thought the character set(‚±).
For example, to obtain the value of x for a normal distribution, with μ = 10, σ2= 2, with p = 0.25, store the equation ‘p=1-UTPN(μ,σ2,x)’ into variable
EQ (figure in the left-hand side below). Then, launch the numerical solver, to
get the input form in the right-hand side figure:

The next step is to enter the values of μ, σ2, and p, and solve for x:

This input form can be used to solve for any of the four variables involved in theequation for the normal distribution.
To facilitate solution of equations involving functions UTPN, UTPT, UTPC, andUTPF, you may want to create a sub-directory UTPEQ were you will store theequations listed above:

Page 17-16

Thus, at this point, you will have the four equations available for solution. You
needs just load one of the equations into the EQ field in the numerical solver
and proceed with solving for one of the variables. Examples of the UTPT, UTPC,
and UPTF are shown below:

Notice that in all the examples shown above, we are working with p = P(X<x).
In many statistical inference problems we will actually try to find the value of x
for which P(X>x) = α. Furthermore, for the normal distribution, we most likely
will be working with the standard normal distribution in which μ =0, and σ2 =1. The standard normal variable is typically referred to as Z, so that the
problem to solve will be P(Z>z) = α. For these cases of statistical inference
problems, we could store the following equations:Page 17-17

With these four equations, whenever you launch the numerical solver you havethe following choices:

Examples of solution of equations EQNA, EQTA, EQCA, and EQFA are shown
below:

ʳʳʳʳʳ

Page 17-18

Chapter 18
Statistical Applications
In this Chapter we introduce statistical applications of the calculator including
statistics of a sample, frequency distribution of data, simple regression,confidence intervals, and hypothesis testing.

Pre-programmed statistical features
The calculator provides pre-programmed statistical features that are accessible
through the keystroke combination ‚Ù (same key as the number 5 key).
The statistical applications available in the calculator are:

These applications are presented in detail in this Chapter. First, however, wedemonstrate how to enter data for statistical analysis.

Entering data
For the analysis of a single set of data (a sample) we can use applications
number 1, 2, and 4 from the list above. All of these applications require thatthe data be available as columns of the matrix ΣDAT. This can beaccomplished by entering the data in columns using the matrix writer, „².
This operation may become tedious for large number of data points. Instead,
you may want to enter the data as a list (see Chapter 8) and convert the list intoa column vector by using program CRMC (see Chapter 10). Alternatively, you
can enter the following program to convert a list into a column vector. Type theprogram in RPN mode:« OBJ 1 2 LIST ARRY »Page 18-1

Store the program in a variable called LXC. After storing this program in RPN
mode you can also use it in ALG mode.
To store a column vector into variable ΣDAT use function STOΣ, available
through the catalog (‚N), e.g., STOΣ (ANS(1)) in ALG mode.
Example 1 – Using the program LXC, defined above, create a column vector
using the following data: 2.1 1.2 3.1 4.5 2.3 1.1 2.3 1.5 1.6 2.2
1.2 2.5.
In RPG mode, type in the data in a list:{2.1 1.2 3.1 4.5 2.3 1.1 2.3 1.5 1.6 2.2 1.2 2.5 } `@LXC
Use function STOΣ to store the data into ΣDAT.
Note: You can also enter statistical data by launching a statistics application(such as Single-var, Frequencies or Summary stats) andpressing #EDIT#. This launches the Matrix Writer. Enter the data as you usually
do. In this case, when you exit the Matrix Writer, the data you have entered is
automatically saved in ΣDAT.

Calculating single-variable statistics
Assuming that the single data set was stored as a column vector in variable
ΣDAT. To access the different STAT programs, press ‚Ù. Press @@@OK@@ toselect 1. Single-var.. There will be available to you an input form labeled
SINGLE-VARIABLE STATISTICS, with the data currently in your ΣDAT variable
listed in the form as a vector. Since you only have one column, the field Col:should have the value 1 in front of it. The Type field determines whether you
are working with a sample or a population, the default setting is Sample. Movethe cursor to the horizontal line preceding the fields Mean, Std Dev, Variance,
Total, Maximum, Minimum, pressing the @CHK@ soft menu key to select thosemeasures that you want as output of this program. When ready, press @@@OK@@.
The selected values will be listed, appropriately labeled, in the screen of yourcalculator.

Page 18-2

Example 1 -- For the data stored in the previous example, the single-variable
statistics results are the following:
Mean: 2.13333333333, Std Dev: 0.964207949406,
Variance: 0.929696969697
Total: 25.6, Maximum: 4.5, Minimum: 1.1
Definitions
The definitions used for these quantities are the following:
Suppose that you have a number data points x1, x2, x3, …, representing
different measurements of the same discrete or continuous variable x. The set of
all possible values of the quantity x is referred to as the population of x. A
finite population will have only a fixed number of elements xi. If the quantity x
represents the measurement of a continuous quantity, and since, in theory, sucha quantity can take an infinite number of values, the population of x in this caseis infinite. If you select a sub-set of a population, represented by the n data
values {x1, x2, …, xn}, we say you have selected a sample of values of x.
Samples are characterized by a number of measures or statistics. There aremeasures of central tendency, such as the mean, median, and mode, andmeasures of spreading, such as the range, variance, and standard deviation.
Measures of central tendency
The mean (or arithmetic mean) of the sample, ⎯x, is defined as the averagevalue of the sample elements,x=

1 n⋅ ∑ xi .
n i =1The value labeled Total obtained above represents the summation of thevalues of x, or Σxi = n⋅⎯x. This is the value provided by the calculator under theheading Mean. Other mean values used in certain applications are thegeometric mean, xg, or the harmonic mean, xh, defined as:

x g = n x1 ⋅ x 2 L x n ,

n
1
1
=∑ .
x h i =1 xi

Page 18-3

Examples of calculation of these measures, using lists, are available in Chapter
8.
The median is the value that splits the data set in the middle when the elements
are placed in increasing order. If you have an odd number, n, of orderedelements, the median of this sample is the value located in position (n+1)/2. If
you have an even number, n, of elements, the median is the average of theelements located in positions n/2 and (n+1)/2. Although the pre-programmed
statistical features of the calculator do not include the calculation of the median,
it is very easily to write a program to calculate such quantity by working withlists. For example, if you want to use the data in ΣDAT to find the median, typethe following program in RPN mode (see Chapter 21 for more information on
programming in User RPL language).:«  nC « RCLΣ DUP SIZE 2 GET IF 1 > THEN nC COL− SWAP DROP OBJ
1 + ARRY END OBJ OBJ DROP DROP DUP  n « LIST SORT IF ‘n
MOD 2 == 0’ THEN DUP ‘n/2’ EVAL GET SWAP ‘(n+1)/2’ EVAL GET + 2 /ELSE ‘(n+1)/2’ EVAL GET END “Median” TAG » » »Store this program under the name MED. An example of application of thisprogram is shown next.
Example 2 – To run the program, first you need to prepare your ΣDAT matrix.
Then, enter the number of the column in ΣDAT whose median you want to find,and press @@MED@@. For the data currently in ΣDAT (entered in an earlier example),use program MED to show that Median: 2.15.
The mode of a sample is better determined from histograms, therefore, we leaveits definition for a later section.
Measures of spread
The variance (Var) of the sample is defined as s x2 =n1
⋅ ∑ ( xi − x ) 2 .
n − 1 i =1

The standard deviation (St Dev) of the sample is just the square root of thevariance, i.e., sx.

Page 18-4

The range of the sample is the difference between the maximum and minimum
values of the sample. Since the calculator, through the pre-programmed
statistical functions provides the maximum and minimum values of the sample,
you can easily calculate the range.
Coefficient of variation
The coefficient of variation of a sample combines the mean, a measure ofcentral tendency, with the standard deviation, a measure of spreading, and isdefined, as a percentage, by: Vx = (sx/⎯x)100.
Sample vs. population
The pre-programmed functions for single-variable statistics used above can beapplied to a finite population by selecting the Type: Population in the
SINGLE-VARIABLE STATISTICS screen. The main difference is in the values ofthe variance and standard deviation which are calculated using n in the
denominator of the variance, rather than (n-1).
Example 3 -- If you were to repeat the exercise in Example 1 of this section,using Population rather than Sample as the Type, you will get the samevalues for the mean, total, maximum, and minimum. The variance andstandard deviation, however, will be given by: Variance: 0.852, Std Dev:
0.923.

Obtaining frequency distributions
The application 2. Frequencies.. in the STAT menu can be used to obtainfrequency distributions for a set of data. Again, the data must be present in theform of a column vector stored in variable ΣDAT. To get started, press‚Ù˜ @@@OK@@@. The resulting input form contains the following fields:
ΣDAT:

the matrix containing the data of interest.

Col:the column of ΣDAT that is under scrutiny.

X-Min:

the minimum class boundary (default = -6.5).

Bin Count:the number of classes(default = 13).

Bin Width:the uniform width of each class (default = 1).

Page 18-5

Definitions
To understand the meaning of these parameters we present the following
definitions: Given a set of n data values: {x1, x2, …, xn} listed in no particularorder, it is often required to group these data into a series of classes bycounting the frequency or number of values corresponding to each class.
(Note: the calculators refers to classes as bins).
Suppose that the classes, or bins, will be selected by dividing the interval (xbot,xtop), into k = Bin Count classes by selecting a number of class boundaries, i.e.,{xB1, xB2, …, xBk+1}, so that class number 1 is limited by xB1-xB2, classnumber 2 by xB2- xB3, and so on. The last class, class number k, will be limited
by xBk - xB k +1.
The value of x corresponding to the middle of each class is known as the classmark, and is defined as xMi = (xBi + xB i+1)/2, for i = 1, 2, …, k.
If the classes are chosen such that the class size is the same, then we can define
the class size as the value Bin Width = Δx = (xmax - xmin) / k,and the class boundaries can be calculated as xBi = xbot + (i - 1) * Δx.
Any data point, xj, j = 1, 2, …, n, belongs to the i-th class, if xBi ≤ xj < xB i+1
The application 2. Frequencies.. in the STAT menu will perform this frequency
count, and will keep track of those values that may be below the minimum andabove the maximum class boundaries (i.e., the outliers).
Example 1 -- In order to better illustrate obtaining frequency distributions, wewant to generate a relatively large data set, say 200 points, by using thefollowing:ΘΘFirst, seed the random number generator using: RDZ(25) in ALG mode,or 25 ` RDZ in RPN mode (see Chapter 17).
Type in the following program in RPN mode:«  n « 1 n FOR j RAND 100 * 2 RND NEXT n LIST » »and save it under the name RDLIST (RanDom number LIST generator).

Page 18-6

Θ
Θ
Θ
Θ

Generate the list of 200 number by using RDLIST(200) in ALG mode, or
200 ` @RDLIST@ in RPN mode.
Use program LXC (see above) to convert the list thus generated into acolumn vector.
Store the column vector into ΣDAT, by using function STOΣ.
Obtain single-variable information using: ‚Ù @@@OK@@@. Use Sample for
the Type of data set, and select all options as results. The results for thisexample were:
Mean: 51.0406, Std Dev: 29.5893…, Variance: 875.529…
Total: 10208.12, Maximum: 99.35, Minimum: 0.13

This information indicates that our data ranges from values close to zero tovalues close to 100. Working with whole numbers, we can select the range ofvariation of the data as (0,100). To produce a frequency distribution we will
use the interval (10,90) dividing it into 8 bins of width 10 each.
ΘΘ

Select the program 2. Frequencies.. by using ‚Ù˜ @@@OK@@@. The
data is already loaded in ΣDAT, and the option Col should hold the value 1
since we have only one column in ΣDAT.
Change X-Min to 10, Bin Count to 8, and Bin Width to 10, then press@@@OK@@@.

Using the RPN mode, the results are shown in the stack as a column vector instack level 2, and a row vector of two components in stack level 1. The vector
in stack level 1 is the number of outliers outside of the interval where thefrequency count was performed. For this case, I get the values [ 25. 22.]indicating that there are, in my ΣDAT vector, 25 values smaller than 10 and 22
larger than 90.
ΘPress ƒ to drop the vector of outliers from the stack. The remaining result
is the frequency count of data. This can be translated into a table as shown
below.

This table was prepared from the information we provided to generate thefrequency distribution, although the only column returned by the calculator is
the Frequency column (fi). The class numbers, and class boundaries are easy

Page 18-7

to calculate for uniform-size classes (or bins), and the class mark is just the
average of the class boundaries for each class. Finally, the cumulative
frequency is obtained by adding to each value in the last column, except thefirst, the frequency in the next row, and replacing the result in the last column ofthe next row. Thus, for the second class, the cumulative frequency is 18+15 =33, while for class number 3, the cumulative frequency is 33 + 16 = 49, and soon. The cumulative frequency represents the frequency of those numbers thatare smaller than or equal to the upper boundary of any given class.

Class

Class

Bound.

Class

Frequency

Cumulative

No.
i

XBi

XB i+1

mark.
Xmi

fi

frequency< XB1

outlier

below

1
10
2
20
3
30
4
40
5
50
6
60
7
70
k=8
80
>XBk outliers

range
20
30
40
50
60
70
80
90
above

25
15
25
35
45
55
65
75
85

18
14
17
17
22
22
24
19
22

18
32
49
66
88
110
134
153

range

Given the (column) vector of frequencies generated by the calculator, you canobtain a cumulative frequency vector by using the following program in RPN
mode:

Page 18-8

« DUP SIZE 1 GET  freq k « {k 1} 0 CON  cfreq « ‘freq(1,1)’ EVAL
‘cfreq(1,1)’ STO 2 k FOR j ‘cfreq(j-1,1) +freq(j,1)’ EVAL ‘cfreq (j,1)’ STO NEXT
cfreq » » »Save it under the name CFREQ. Use this program to generate the list of
cumulative frequencies (press @CFREQ with the column vector of frequencies in thestack). The result, for this example, is a column vector representing the lastcolumn of the table above.
Histograms
A histogram is a bar plot showing the frequency count as the height of the bars
while the class boundaries shown the base of the bars. If you have your raw
data (i.e., the original data before the frequency count is made) in the variable
ΣDAT, you can select Histogram as your graph type and provide information
regarding the initial value of x, the number of bins, and the bin width, togenerate the histogram. Alternatively, you can generate the column vector
containing the frequency count, as performed in the example above, store thisvector into ΣDAT, and select Barplot as your graph type. In the next example,
we show you how to use the first method to generate a histogram.
Example 1 – Using the 200 data points generated in the example above(stored as a column vector in ΣDAT), generate a histogram plot of the datausing X-Min = 10, Bin Count = 16, and Bin Width = 5.
ΘΘΘFirst, press „ô (simultaneously, if in RPN mode) to enter the PLOT
SETUP screen. Within this screen, change Type: to Histogram, and checkthat the option Col: 1 is selected. Then, press L@@@OK@@@.
Next, press „ò (simultaneously, if in RPN mode) to enter the PLOT
WINDOW – HISTOGRAM screen. Within that screen modify the
information to H-View: 10 90, V-View: 0 15, Bar Width: 5.
Press @ERASE @DRAW@ to generate the following histogram:

Page 18-9

ΘPress @CANCEL to return to the previous screen. Change the V-view and Bar
Width once more, now to read V-View: 0 30, Bar Width: 10. The newhistogram, based on the same data set, now looks like this:A plot of frequency count, fi, vs. class marks, xMi, is known as a frequency
polygon. A plot of the cumulative frequency vs. the upper boundaries isknown as a cumulative frequency ogive. You can produce scatterplots thatsimulate these two plots by entering the proper data in columns 1 and 2 of anew ΣDAT matrix and changing the Type: to SCATTER in the PLOT SETUP
window.

Fitting data to a function y = f(x)The program 3. Fit data.., available as option number 3 in the STAT menu, canbe used to fit linear, logarithmic, exponential, and power functions to data sets(x,y), stored in columns of the ΣDAT matrix. In order for this program to beeffective, you need to have at least two columns in your ΣDAT variable.
Example 1 – Fit a linear relationship to the data shown in the table below:
x
y

0
0.5

1
2.3

2
3.6

3
6.7

4
7.2

5
11

Page 18-10

Θ
Θ

Θ

First, enter the two rows of data into column in the variable ΣDAT by using
the matrix writer, and function STOΣ.
To access the program 3. Fit data.., use the following keystrokes:‚Ù˜˜@@@OK@@@ The input form will show the current ΣDAT, alreadyloaded. If needed, change your set up screen to the following parameters
for a linear fitting:

To obtain the data fitting press @@OK@@. The output from this program, shown
below for our particular data set, consists of the following three lines in RPN
mode:
3: '0.195238095238 + 2.00857142857*X'
2: Correlation: 0.983781424465
1: Covariance: 7.03

Level 3 shows the form of the equation. In this case, y = 0.06924 + 0.00383 x.
Level 2 shows the sample correlation coefficient, and level 1 shows thecovariance of x-y.
Definitions
For a sample of data points (x,y), we define the sample covariance ass xy =1 n∑ ( xi − x )( y i − y )n − 1 i =1

The sample correlation coefficient for x,y is defined as

rxy =

s xy
sx ⋅ s y.

Page 18-11

Where sx, sy are the standard deviations of x and y, respectively, i.e.

s x2 =1 n∑ ( xi − x ) 2
n − 1 i=1

s y2 =1 n∑ ( yi − y ) 2
n − 1 i=1

The values sxy and rxy are the "Covariance" and "Correlation," respectively,
obtained by using the "Fit data" feature of the calculator.
Linearized relationships
Many curvilinear relationships "straighten out" to a linear form. For example,
the different models for data fitting provided by the calculator can be linearized
as described in the table below.
Indep.
variable

Depend.
VariableηyType of
Fitting

ActualModelLinearized
ModelLineary = a + bx

[same]

ξxLog.

y = a + b ln(x)[same]ln(x)ysln(x),yExp.

y = a ebx

ln(y) = ln(a) + bx

x

ln(y)

sx,ln(y)Powery = a xbln(y) = ln(a) + b ln(x)

ln(x)

ln(y)

sln(x),ln(y)The sample covariance of ξ,η is given by sξη =Covar.
sξη
sxy1∑ (ξ i − ξ )(ηi − η )n −1Also, we define the sample variances of ξ and η, respectively, as

sξ2 =

1 n
∑ (ξ i − ξ ) 2
n − 1 i =1sη2 =The sample correlation coefficient rξη is rξη =1 n∑ (ηi − η ) 2
n − 1 i =1sξηsξ ⋅ sηPage 18-12

The general form of the regression equation is η = A + Bξ.
Best data fitting
The calculator can determine which one of its linear or linearized relationshipoffers the best fitting for a set of (x,y) data points. We will illustrate the use ofthis feature with an example. Suppose you want to find which one of the data
fitting functions provides the best fit for the following data:
x
y

0.2
3.16

0.5
2.73

1
2.12

1.5
1.65

2
1.29

4
0.47

5
0.29

10
0.01

First, enter the data as a matrix, either by using the Matrix Writer and entering
the data, or by entering two lists of data corresponding to x and y and using
the program CRMC developed in Chapter 10. Next, save this matrix into thestatistical matrix ΣDAT, by using function STOΣ.
Finally, launch the data fit application by using: ‚Ù˜˜@@@OK@@@ . The
display shows the current ΣDAT, already loaded. Change your set up screen to
the following parameters if needed:

Press @@@OK@@@, to get:
3: '3.99504833324*EXP(-.579206831203*X)'
2: Correlation: -0.996624999526
1: Covariance: -6.23350666124

The best fit for the data is, therefore, y = 3.995 e -0.58⋅x.

Obtaining additional summary statistics
The application 4. Summary stats.. in the STAT menu can be useful in some
calculations for sample statistics. To get started, press ‚Ù once more,
move to the fourth option using the down-arrow key ˜, and press @@@OK@@@. The
resulting input form contains the following fields:
ΣDAT:

the matrix containing the data of interest.

Page 18-13

X-Col, Y-Col:these options apply only when you have more than twocolumns in the matrix ΣDAT.

By default, the x column iscolumn 1, and the y column is column 2.
_ΣX _

ΣY…:

summary statistics that you can choose as results of thisprogram by checking the appropriate field using [CHK]
when that field is selected.

Many of these summary statistics are used to calculate statistics of two variables(x,y) that may be related by a function y = f(x). Therefore, this program can bethought off as a companion to program 3. Fit data..
Example 1 – For the x-y data currently in ΣDAT, obtain all the summary statistics.
ΘΘΘΘTo access the summary stats… option, use: ‚Ù˜˜˜@@@OK@@@
Select the column numbers corresponding to the x- and y-data, i.e., X-Col:
1, and Y-Col: 2.
Using the @CHK@ key select all the options for outputs, i.e., _ΣX, _ΣY, etc.
Press @@@OK@@@ to obtain the following results:
ΣX: 24.2, ΣY: 11.72, ΣX2: 148.54, ΣY2: 26.6246, ΣXY: 12.602, NΣ:8

Note: There are two other applications under the STAT menu, namely, 5.
Hypth. tests.. and 6. Conf. Interval.. These two applications will be discussed

later in the chapter.

Calculation of percentiles
Percentiles are measures that divide a data set into 100 parts. The basic
procedure to calculate the 100⋅p-th Percentile (0 < p < 1) in a sample of size n
is as follows:
1. Order the n observations from smallest to largest.
2. Determine the product n⋅p
A. If n⋅p is not an integer, round it up to the next integer and find thecorresponding ordered value.

Page 18-14

B. If n⋅p is an integer, say k, calculate the mean of the k-th and (k-1) thordered observations.
Note: Integer rounding rule, for a non-integer x.yz…, if y ≥ 5, round up tox+1; if y < 5, round up to x.
This algorithm can be implemented in the following program typed in RPN
mode (See Chapter 21 for programming information):« SORT DUP SIZE  p X n « n p *  k « IF k CEIL k FLOOR - NOT THEN X k
GET X k 1 + GET + 2 / ELSE k 0 RND X SWAP GET END » » »which we’ll store in variable %TILE (percent-tile). This program requires as
input a value p within 0 and 1, representing the 100p percentile, and a list ofvalues. The program returns the 100p percentile of the list.
Example 1 - Determine the 27% percentile of the list { 2 1 0 1 3 5 1 2 3 6 7 9}.
In RPN mode, enter 0.27 ` { 2 1 0 1 3 5 1 2 3 6 7 9} ` @%TILE. In ALG
mode, enter %TILE(0.27,{2,1,0,1,3,5,1,2,3,6,7,9}. The result is 1.

The STAT soft menu
All the pre-programmed statistical functions described above are accessible
through a STAT soft menu. The STAT soft menu can be accessed by using, in
RPN mode, the command: 96 MENU
You can create your own program, say @STATm, to activate the STAT soft menu
directly. The contents of this program are simply: « 96 MENU ».
The STAT soft menu contains the following functions:

Pressing the key corresponding to any of these menus provides access todifferent functions as described below.

Page 18-15

The DATA sub-menu
The DATA sub-menu contains functions used to manipulate the statistics matrix
ΣDATA:The operation of these functions is as follows:
Σ+ : add row in level 1 to bottom of ΣDATA matrix.
Σ- : removes last row in ΣDATA matrix and places it in level of 1 of the stack.
The modified ΣDATA matrix remains in memory.
CLΣ : erases current ΣDATA matrix.
ΣDAT: places contents of current ΣDATA matrix in level 1 of the stack.
„ΣDAT: stores matrix in level 1 of stack into ΣDATA matrix.

The ΣPAR sub-menu

The ΣPAR sub-menu contains functions used to modify statistical parameters.
The parameters shown correspond to the last example of data fitting.

The parameters shown in the display are:Xcol: indicates column of ΣDATA representing x (Default: 1)
Ycol: indicates column of ΣDATA representing y (Default: 2)
Intercept: shows intercept of most recent data fitting (Default: 0)
Slope: shows slope of most recent data fitting (Default: 0)
Model: shows current data fit model (Default: LINFIT)
The functions listed in the soft menu keys operate as follows:
XCOL: entered as n @XCOL, changes Xcol to n.
YCOL: entered as n @YCOL, changes Ycol to n.

Page 18-16

ΣPAR: shows statistical parameters.
RESET: reset parameters to default values
INFO: shows statistical parameters
The MODL sub-menu within ΣPAR
This sub-menu contains functions that let you change the data-fitting model to
LINFIT, LOGFIT, EXPFIT, PWRFIT or BESTFIT by pressing the appropriate button.

The 1VAR sub menu
The 1VAR sub menu contains functions that are used to calculate statistics ofcolumns in the ΣDATA matrix.

The functions available are the following:
TOT: show sum of each column in ΣDATA matrix.
MEAN: shows average of each column in ΣDATA matrix.
SDEV: shows standard deviation of each column in ΣDATA matrix.
MAXΣ: shows maximum value of each column in ΣDATA matrix.
MINΣ: shows average of each column in ΣDATA matrix.
BINS: used as xs, Δx, n [BINS], provides frequency distribution for data in
Xcol column in ΣDATA matrix with the frequency bins defined as[xs,xs+Δx], [xs,xs+2Δx],…, [xs,xs+nΔx].
VAR: shows variance of each column in ΣDATA matrix.
PSDEV: shows population standard deviation (based on n rather than on (n-1))
of each column in ΣDATA matrix.
PVAR: shows population variance of each column in ΣDATA matrix.
MINΣ: shows average of each column in ΣDATA matrix.

The PLOT sub-menu
The PLOT sub-menu contains functions that are used to produce plots with thedata in the ΣDATA matrix.

Page 18-17

The functions included are:BARPL: produces a bar plot with data in Xcol column of the ΣDATA matrix.
HISTP: produces histogram of the data in Xcol column in the ΣDATA matrix,
using the default width corresponding to 13 bins unless the bin size ismodified using function BINS in the 1VAR sub-menu (see above).
SCATR: produces a scatterplot of the data in Ycol column of the ΣDATA matrix
vs. the data in Xcol column of the ΣDATA matrix. Equation fitted will be
stored in the variable EQ.

The FIT sub-menu
The FIT sub-menu contains functions used to fit equations to the data in columns
Xcol and Ycol of the ΣDATA matrix.

The functions available in this sub-menu are:
ΣLINE: provides the equation corresponding to the most recent fitting.
LR: provides intercept and slope of most recent fitting.
PREDX: used as y @PREDX, given y find x for the fitting y = f(x).
PREDY: used as x @PREDY, given x find y for the fitting y = f(x).
CORR: provides the correlation coefficient for the most recent fitting.
COV: provides sample co-variance for the most recent fitting
PCOV: shows population co-variance for the most recent fitting.

The SUMS sub-menu
The SUMS sub-menu contains functions used to obtain summary statistics of thedata in columns Xcol and Ycol of the ΣDATA matrix.

ΣX : provides the sum of values in Xcol column.
ΣY : provides the sum of values in Ycol column.

Page 18-18

ΣX^2 : provides the sum of squares of values in Xcol column.
ΣY^2 : provides the sum of squares of values in Ycol column.
ΣX*Y: provides the sum of x⋅y, i.e., the products of data in columns Xcol andYcol.
NΣ : provides the number of columns in the ΣDATA matrix.

Example of STAT menu operations
Let ΣDATA be the matrix shown in next page.
ΘΘΘType the matrix in level 1 of the stack by using the Matrix Writer.
To store the matrix into ΣDATA, use: @)DATA „ @£DAT
Calculate statistics of each column: @)STAT @)1VAR:
@TOT
@MEAN
@SDEV
@MAX£
@MIN£
L @VAR@PSDEV@PVAR
Θproduces [38.5 87.5 82799.8]
produces [5.5. 12.5 11828.54…]
produces [3.39… 6.78… 21097.01…]
produces [10 21.5 55066]
produces [1.1 3.7 7.8]
produces [11.52 46.08 445084146.33]
produces [3.142… 6.284… 19532.04…]
produces [9.87… 39.49… 381500696.85…]

Data:

⎡ 1.1
⎢ 3.7
⎢
⎢ 2.2
⎢
⎢ 5.5
⎢ 6.8
⎢
⎢ 9.2
⎢10.0
⎣
Θ

3.7
7.8 ⎤
8.9
101 ⎥⎥
5.9
25 ⎥⎥12.5 612 ⎥15.1 2245 ⎥⎥
19.9 24743⎥
21.5 55066⎥⎦

Generate a scatterplot of the data in columns 1 and 2 and fit a straight line
to it:

Page 18-19

Θ@)STAT @)£PAR @RESET

resets statistical parameters

L @)STAT @PLOT @SCATR@STATLproduces scatterplot
draws data fit as a straight line

@CANCL

returns to main display

Determine the fitting equation and some of its statistics:@)STAT @)FIT@ @£LINE@@@LR@@@
3 @PREDX
1 @PREDY@CORR@@COV@@
L@PCOVΘproduces '1.5+2*X'
produces Intercept: 1.5, Slope: 2
produces 0.75
produces 3. 50
produces 1.0
produces 23.04
produces 19.74…

Obtain summary statistics for data in columns 1 and 2: @)STAT @)SUMS:@@@£X@@@@@£Y@@@@£X2@@@£Y2@@@£XY@@@@N£@@

produces 38.5
produces 87.5
produces 280.87
produces 1370.23
produces 619.49
produces 7

Page 18-20

Θ

Fit data using columns 1 (x) and 3 (y) using a logarithmic fitting:
L @)STAT @)£PAR 3 @YCOL@)MODL @LOGFI

select Ycol = 3, andselect Model = Logfit

L @)STAT @PLOT @SCATR@STATLproduce scattergram of y vs. x
show line for log fitting

Obviously, the log-fit is not a good choice.
@CANCL
returns to normal display.

•

Select the best fitting by using:@)STAT @£PAR @)MODL @BESTF
shows EXPFIT as the best fit for these data

L@)STAT @)FIT @£LINE@CORR
2300 @PREDX
5.2 @PREDY

produces '2.6545*EXP(0.9927*X)'
produces 0.99995… (good correlation)
produces 6.8139
produces 463.33

Page 18-21

L @)STAT @PLOT @SCATR@STATLΘΘ

produce scattergram of y vs. x
show line for log fitting

To return to STAT menu use: L@)STAT
To get your variable menu back use: J.

Confidence intervals
Statistical inference is the process of making conclusions about a population
based on information from sample data. In order for the sample data to bemeaningful, the sample must be random, i.e., the selection of a particularsample must have the same probability as that of any other possible sample outof a given population. The following are some terms relevant to the concept ofrandom sampling:ΘΘΘΘPopulation: collection of all conceivable observations of a process or
attribute of a component.
Sample: sub-set of a population.
Random sample: a sample representative of the population.
Random variable: real-valued function defined on a sample space. Could
be discrete or continuous.
If the population follows a certain probability distribution that depends on aparameter θ, a random sample of observations (X1,X2,X3,... , Xn), of size n,
can be used to estimate θ.

ΘSampling distribution: the joint probability distribution of X1,X2,X3,... , Xn.

Θ

A statistic: any function of the observations that is quantifiable and does notcontain any unknown parameters. A statistic is a random variable thatprovides a means of estimation.

Page 18-22

Θ
Θ
Θ
Θ

Point estimation: when a single value of the parameter θ is provided.
Confidence interval: a numerical interval that contains the parameter θ at agiven level of probability.
Estimator: rule or method of estimation of the parameter θ.
Estimate: value that the estimator yields in a particular application.

Example 1 -- Let X represent the time (hours) required by a specificmanufacturing process to be completed. Given the following sample of valuesof X: 2.2 2.5 2.1 2.3 2.2. The population from where this sample istaken is the collection of all possible values of the process time, therefore, it isan infinite population. Suppose that the population parameter we are trying toestimate is its mean value, μ. We will use as an estimator the mean value of

X =

1 n
⋅ ∑ Xi.
n i =1the sample, ⎯X, defined by (a rule):
For the sample under consideration, the estimate of μ is the sample statistic ⎯x =(2.2+2.5+2.1+2.3+2.2)/5 = 2.26. This single value of ⎯X, namely ⎯x = 2.26,
constitutes a point estimation of the population parameter μ.

Estimation of Confidence Intervals
The next level of inference from point estimation is interval estimation, i.e.,
instead of obtaining a single value of an estimator we provide two statistics, aand b, which define an interval containing the parameter θ with a certain levelof probability. The end points of the interval are known as confidence limits,and the interval (a,b) is known as the confidence interval.

Definitions
Let (Cl,Cu) be a confidence interval containing an unknown parameter θ.
ΘΘConfidence level or confidence coefficient is the quantity (1-α), where 0 < α< 1, such that P[Cl < θ < Cu] = 1 - α, where P[ ] represents a probability(see Chapter 17). The previous expression defines the so-called two-sided
confidence limits.
A lower one-sided confidence interval is defined by Pr[Cl < θ] = 1 - α.

ΘAn upper one-sided confidence interval is defined by Pr[θ < Cu] = 1 - α.

Page 18-23

ΘThe parameter α is known as the significance level. Typical values of α are
0.01, 0.05, 0.1, corresponding to confidence levels of 0.99, 0.95, and0.90, respectively.

Confidence intervals for the population mean when the
population variance is known
Let ⎯X be the mean of a random sample of size n, drawn from an infinite
population with known standard deviation σ. The 100(1-α) % [i.e., 99%, 95%,
90%, etc.], central, two-sided confidence interval for the population mean μ is(⎯X−zα/2⋅σ/√n , ⎯X+zα/2⋅σ/√n ), where zα/2 is a standard normal variate thatis exceeded with a probability of α /2. The standard error of the sample
mean, ⎯X, is ⋅σ/√n.
The one-sided upper and lower 100(1-α) % confidence limits for the population
mean μ are, respectively, X+zα⋅σ/√n , and ⎯X−zα⋅σ/√n . Thus, a lower, onesided, confidence interval is defined as (-∞ , X+zα⋅σ/√n), and an upper, onesided, confidence interval as (X−zα⋅σ/√n,+∞). Notice that in these last two
intervals we use the value zα, rather than zα/2.
In general, the value zk in the standard normal distribution is defined as thatvalue of z whose probability of exceedence is k, i.e., Pr[Z>z k] = k, or Pr[Z<zk]= 1 – k. The normal distribution was described in Chapter 17.

Confidence intervals for the population mean when the
population variance is unknown
Let ⎯X and S, respectively, be the mean and standard deviation of a random
sample of size n, drawn from an infinite population that follows the normal
distribution with unknown standard deviation σ. The 100⋅(1−α) % [i.e., 99%,95%, 90%, etc.] central two-sided confidence interval for the population meanμ, is (⎯X− tn-1, α/2 ⋅S /√n , ⎯X+ tn-1, α/2 ⋅S/√n ), where tn-1, α/2 is Student's tvariate with ν = n-1 degrees of freedom and probability α/2 of exceedence.
The one-sided upper and lower 100⋅ (1-α) % confidence limits for the
population mean μ are, respectively,
X + tn-1, α/2 ⋅S/√n , and ⎯X− tn-1, α/2 ⋅S /√n.

Page 18-24

Small samples and large samples
The behavior of the Student’s t distribution is such that for n>30, the distribution
is indistinguishable from the standard normal distribution. Thus, for samples
larger than 30 elements when the population variance is unknown, you can use
the same confidence interval as when the population variance is known, but
replacing σ with S. Samples for which n>30 are typically referred to as large
samples, otherwise they are small samples.

Confidence interval for a proportion
A discrete random variable X follows a Bernoulli distribution if X can take only
two values, X = 0 (failure), and X = 1 (success). Let X ~ Bernoulli(p), where pis the probability of success, then the mean value, or expectation, of X is E[X] =p, and its variance is Var[X] = p(1-p).
If an experiment involving X is repeated n times, and k successful outcomes arerecorded, then an estimate of p is given by p’= k/n, while the standard error ofp’ is σp’ = √(p⋅(1-p)/n) . In practice, the sample estimate for p, i.e., p’ replaces
p in the standard error formula.
For a large sample size, n>30, and n⋅p > 5 and n⋅(1-p)>5, the sampling
distribution is very nearly normal. Therefore, the 100(1-α) % central two-sided
confidence interval for the population mean p is (p’+zα/2⋅σp’, p’+zα/2⋅σp’ ).
For a small sample (n<30), the interval can be estimated as (p’-tn-1,α/2⋅σp’,p’+tn1,α/2⋅σp’).

Sampling distribution of differences and sums of statistics
Let S1 and S2 be independent statistics from two populations based on samplesof sizes n1 and n2, respectively. Also, let the respective means and standard
errors of the sampling distributions of those statistics be μS1 and μS2, and σS1and σS2, respectively. The differences between the statistics from the two
populations, S1-S2, have a sampling distribution with mean μ S1−S2 = μS1 - μS2,
and standard error σ S1−S2 = (σS12 + σS22)1/2. Also, the sum of the statistics
T1+T2 has a mean μ S1+S2 = μS1 +μS2, and standard error σS1+S2 = (σS12 +σS22)1/2.

Page 18-25

Estimators for the mean and standard deviation of the difference and sum of thestatistics S1 and S2 are given by:μˆ S ± S = X 1 ± X 2 ,12σˆ S ± S =
1

2

σ S21
n1

+

σ S22
n2

In these expressions, ⎯X1 and ⎯X2 are the values of the statistics S1 and S2 fromsamples taken from the two populations, and σS12 and σS22 are the variancesof the populations of the statistics S1 and S2 from which the samples weretaken.

Confidence intervals for sums and differences of mean values
If the population variances σ12 and σ22 are known, the confidence intervals forthe difference and sum of the mean values of the populations, i.e., μ1±μ2, aregiven by:
2
2
2
2 ⎞
⎛
⎜(X ± X ) − z ⋅ σ1 + σ 2 , (X ± X ) + z ⋅ σ1 + σ 2 ⎟
α /2
α /2
2
1
2
⎜ 1
n1 n2
n1 n2 ⎟⎠⎝For large samples, i.e., n1 > 30 and n2 > 30, and unknown, but equal,
population variances σ12 = σ22, the confidence intervals for the difference andsum of the mean values of the populations, i.e., μ1±μ2, are given by:
2
2
2
2 ⎞
⎛
⎜ ( X ± X ) − z ⋅ S1 + S 2 , ( X ± X ) + z ⋅ S1 + S 2 ⎟.
2
1
2
α /2
α /2
⎜ 1
n1 n2
n1 n2 ⎟⎠⎝

If one of the samples is small, i.e., n1 < 30 or n2 < 30, and with unknown, butequal, population variances σ12 = σ22, we can obtain a “pooled” estimate of
the variance of μ1±μ2, as sp2 = [(n1-1)⋅s12+(n2-1)⋅s22]/( n1+n2-2).

Page 18-26

In this case, the centered confidence intervals for the sum and difference of themean values of the populations, i.e., μ1±μ2, are given by:(( X ± X ) − t1

ν ,α / 22⋅ s 2p , ( X 1 ± X 2 ) + tν ,α / 2 ⋅ s 2p)

where ν = n1+n2-2 is the number of degrees of freedom in the Student’s t
distribution.
In the last two options we specify that the population variances, althoughunknown, must be equal. This will be the case in which the two samples aretaken from the same population, or from two populations about which wesuspect that they have the same population variance. However, if we havereason to believe that the two unknown population variances are different, we
can use the following confidence interval(( X ± X ) − t12ν ,α / 2⋅ s X2 1 ± X 2 , ( X 1 ± X 2 ) + tν ,α / 2 ⋅ s X2 1 ± X 2)

where the estimated standard deviation for the sum or difference iss X1 ± X 2 =s12 s 22+n1 n2

and n, the degrees of freedom of the t variate, are calculated using the integer
value closest to[( S12 / n1 ) + ( S 22 / n 2 )] 2
ν=[( S12 / n1 ) /(n1 − 1)] + [( S 22 / n2 ) /(n2 − 1)]

Determining confidence intervals
The application 6. Conf Interval can be accessed by using ‚Ù—@@@OK@@@. The application offers the following options:Page 18-27

These options are to be interpreted as follows:
1. Z-INT: 1 μ.: Single sample confidence interval for the population mean, μ,with known population variance, or for large samples with unknown
population variance.
2. Z-INT: μ1−μ2.: Confidence interval for the difference of the populationmeans, μ1- μ2, with either known population variances, or for large
samples with unknown population variances.
3. Z-INT: 1 p.: Single sample confidence interval for the proportion, p, forlarge samples with unknown population variance.
4. Z-INT: p1− p2.: Confidence interval for the difference of two proportions,p1-p2, for large samples with unknown population variances.
5. T-INT: 1 μ.: Single sample confidence interval for the population mean, μ,for small samples with unknown population variance.
6. T-INT: μ1−μ2.: Confidence interval for the difference of the populationmeans, μ1- μ2, for small samples with unknown population variances.
Example 1 – Determine the centered confidence interval for the mean of a
population if a sample of 60 elements indicate that the mean value of thesample is ⎯x = 23.3, and its standard deviation is s = 5.2. Use α = 0.05. The
confidence level is C = 1-α = 0.95.
Select case 1 from the menu shown above by pressing @@@OK@@@. Enter the values
required in the input form as shown:

Page 18-28

Press @HELP to obtain a screen explaining the meaning of the confidence intervalin terms of random numbers generated by a calculator. To scroll down the
resulting screen use the down-arrow key ˜. Press @@@OK@@@ when done with thehelp screen. This will return you to the screen shown above.
To calculate the confidence interval, press @@@OK@@@. The result shown in thecalculator is:

The result indicates that a 95% confidence interval has been calculated. The
Critical z value shown in the screen above corresponds to the values ±zα/2 inthe confidence interval formula (⎯X−zα/2⋅σ/√n , ⎯X+zα/2⋅σ/√n ). The values μ
Min and μ Max are the lower and upper limits of this interval, i.e., μ Min = ⎯X−zα/2⋅σ/√n, and μ Max = ⎯X+zα/2⋅σ/√n.
Press @GRAPH to see a graphical display of the confidence interval information:

The graph shows the standard normal distribution pdf (probability density
function), the location of the critical points ±zα/2, the mean value (23.3) and thecorresponding interval limits (21.98424 and 24.61576). Press @TEXT to returnto the previous results screen, and/or press @@@OK@@@ to exit the confidence interval
environment. The results will be listed in the calculator’s display.

Page 18-29

Example 2 -- Data from two samples (samples 1 and 2) indicate that ⎯x1 =57.8 and ⎯x2 = 60.0. The sample sizes are n1 = 45 and n2 = 75. If it is
known that the populations’ standard deviations are σ1 = 3.2, and σ2 = 4.5,
determine the 90% confidence interval for the difference of the populationmeans, i.e., μ1- μ 2.
Press ‚Ù—@@@OK@@@to access the confidence interval feature in thecalculator. Press ˜@@@OK@@@ to select option 2. Z-INT: μ 1 – μ2.. Enter thefollowing values:

When done, press @@@OK@@@. The results, as text and graph, are shown below:

The variable Δμ represents μ 1 – μ2.
Example 3 – A survey of public opinion indicates that in a sample of 150
people 60 favor increasing property taxes to finance some public projects.
Determine the 99% confidence interval for the population proportion that would
favor increasing taxes.
Press ‚Ù—@@@OK@@@to access the confidence interval feature in thecalculator. Press ˜˜ @@@OK@@@ to select option 3. Z-INT: μ 1 – μ2.. Enter thefollowing values:

Page 18-30

When done, press @@@OK@@@. The results, as text and graph, are shown below:

Example 4 -- Determine a 90% confidence interval for the difference between
two proportions if sample 1 shows 20 successes out of 120 trials, and sample
2 shows 15 successes out of 100 trials.
Press ‚Ù—@@@OK@@@ to access the confidence interval feature in thecalculator. Press ˜˜˜@@@OK@@@ to select option 4. Z-INT: p1 – p2.. Enter
the following values:

When done, press @@@OK@@@. The results, as text and graph, are shown below:

Page 18-31

Example 5 – Determine a 95% confidence interval for the mean of the
population if a sample of 50 elements has a mean of 15.5 and a standard
deviation of 5. The population’s standard deviation is unknown.
Press ‚Ù—@@@OK@@@ to access the confidence interval feature in thecalculator. Press — — @@@OK@@@ to select option 5. T-INT: μ. Enter thefollowing values:

When done, press @@@OK@@@. The results, as text and graph, are shown below:

The figure shows the Student’s t pdf for ν = 50 – 1 = 49 degrees of freedom.
Example 6 -- Determine the 99% confidence interval for the difference in meansof two populations given the sample data:⎯x1 = 157.8 ,⎯x2 = 160.0, n1 = 50,
n2 = 55. The populations standard deviations are s1 = 13.2, s 2 = 24.5.
Press ‚Ù—@@@OK@@@ to access the confidence interval feature in thecalculator. Press —@@@OK@@@ to select option 6. T-INT: μ1−μ2.. Enter thefollowing values:

hen done, press @@@OK@@@. The results, as text and graph, are shown below:
Page 18-32

These results assume that the values s1 and s2 are the population standard
deviations. If these values actually represent the samples’ standard deviations,
you should enter the same values as before, but with the option _pooled
selected. The results now become:

Confidence intervals for the varianceTo develop a formula for the confidence interval for the variance, first we
introduce the sampling distribution of the variance: Consider a random sample
X1, X2 ..., Xn of independent normally-distributed variables with mean μ,
variance σ2, and sample mean ⎯X. The statisticn1
Sˆ 2 =⋅ ∑ ( X i − X )2 ,n − 1 i =1

is an unbiased estimator of the variance σ2.
The quantity ( n − 1) ⋅

Sˆ 2

σ

n

= ∑ ( X i − X ) 2 , has a χn-12 (chi-square)2
i =1

distribution with ν = n-1 degrees of freedom. The (1-α)⋅100 % two-sided
confidence interval is found fromPr[χ2n-1,1-α/2 < (n-1)⋅S2/σ2 < χ2n-1,α/2] = 1- α.

Page 18-33

The confidence interval for the population variance σ2 is therefore,[(n-1)⋅S2/ χ2n-1,α/2 ; (n-1)⋅S2/ χ2n-1,1-α/2].
where χ2n-1,α/2 , and χ2n-1,1-α/2 are the values that a χ2 variable, with ν = n-1
degrees of freedom, exceeds with probabilities α/2 and 1- α /2, respectively.
The one-sided upper confidence limit for σ2 is defined as (n-1)⋅S2/ χ2n-1,1-α.
Example 1 – Determine the 95% confidence interval for the population varianceσ2 based on the results from a sample of size n = 25 that indicates that the
sample variance is s2 = 12.5.
In Chapter 17 we use the numerical solver to solve the equation α = UTPC(γ,x).
In this program, γ represents the degrees of freedom (n-1), and α represents theprobability of exceeding a certain value of x (χ2), i.e., Pr[χ2 > χα2] = α.
For the present example, α = 0.05, γ = 24 and α = 0.025. Solving theequation presented above results in χ2n-1,α/2 = χ224,0.025 = 39.3640770266.
On the other hand, the value χ2n-1,α/2 = χ224,0.975 is calculated by using thevalues γ = 24 and α = 0.975. The result is χ2n-1,1-α/2 = χ224,0.975 =12.4011502175.
The lower and upper limits of the interval will be (Use ALG mode for thesecalculations):(n-1)⋅S2/ χ2n-1,α/2 = (25-1)⋅12.5/39.3640770266 = 7.62116179676(n-1)⋅S2/ χ2n-1,1-α/2 = (25-1)⋅12.5/12.4011502175 = 24.1913044144
Thus, the 95% confidence interval for this example is:7.62116179676 < σ2 < 24.1913044144.

Page 18-34

Hypothesis testingA hypothesis is a declaration made about a population (for instance, withrespect to its mean). Acceptance of the hypothesis is based on a statistical test
on a sample taken from the population. The consequent action and decisionmaking are called hypothesis testing.
The process of hypothesis testing consists on taking a random sample from the
population and making a statistical hypothesis about the population. If theobservations do not support the model or theory postulated, the hypothesis isrejected. However, if the observations are in agreement, then hypothesis is not
rejected, but it is not necessarily accepted. Associated with the decision is alevel of significance α.

Procedure for testing hypotheses
The procedure for hypothesis testing involves the following six steps:
1. Declare a null hypothesis, H0. This is the hypothesis to be tested. For
example, H0: μ1-μ2 = 0, i.e., we hypothesize that the mean value of
population 1 and the mean value of population 2 are the same. If H0 istrue, any observed difference in means is attributed to errors in random
sampling.
2. Declare an alternate hypothesis, H1. For the example under consideration,
it could be H1: μ1-μ2 ≠ 0 [Note: this is what we really want to test.]
3. Determine or specify a test statistic, T. In the example under consideration, T
will be based on the difference of observed means, ⎯X1-⎯X2.
4. Use the known (or assumed) distribution of the test statistic, T.
5. Define a rejection region (the critical region, R) for the test statistic based ona pre-assigned significance level α.
6. Use observed data to determine whether the computed value of the test
statistic is within or outside the critical region. If the test statistic is within thecritical region, then we say that the quantity we are testing is significant at
the 100α percent level.

Page 18-35

Notes:1. For the example under consideration, the alternate hypothesis H1: μ1-μ2 ≠ 0
produces what is called a two-tailed test. If the alternate hypothesis is H1: μ1-μ2> 0 or H1: μ1-μ2 < 0, then we have a one-tailed test.
2. The probability of rejecting the null hypothesis is equal to the level ofsignificance, i.e., Pr[T∈R|H0]=α. The notation Pr[A|B] represents theconditional probability of event A given that event B occurs.

Errors in hypothesis testing
In hypothesis testing we use the terms errors of Type I and Type II to define thecases in which a true hypothesis is rejected or a false hypothesis is accepted(not rejected), respectively. Let T = value of test statistic, R = rejection region, A= acceptance region, thus, R∩A = ∅, and R∪A = Ω, where Ω = the parameter
space for T, and ∅ = the empty set. The probabilities of making an error ofType I or of Type II are as follows:
Rejecting a true hypothesis,
Pr[Type I error] = Pr[T∈R|H0] = α
Not rejecting a false hypothesis, Pr[Type II error] = Pr[T∈A|H1] = βNow, let's consider the cases in which we make the correct decision:
Not rejecting a true hypothesis, Pr[Not(Type I error)] = Pr[T∈A|H0] = 1 - α
Rejecting a false hypothesis,

Pr[Not(Type II error)] = Pr [T∈R|H1] = 1 - β

The complement of β is called the power of the test of the null hypothesis H0 vs.
the alternative H1. The power of a test is used, for example, to determine aminimum sample size to restrict errors.
Selecting values of α and β
A typical value of the level of significance (or probability of Type I error) is α =0.05, (i.e., incorrect rejection once in 20 times on the average). If theconsequences of a Type I error are more serious, choose smaller values of α,
say 0.01 or even 0.001.

Page 18-36

The value of β, i.e., the probability of making an error of Type II, depends on α,
the sample size n, and on the true value of the parameter tested. Thus, thevalue of β is determined after the hypothesis testing is performed. It is
customary to draw graphs showing β, or the power of the test (1- β), as afunction of the true value of the parameter tested. These graphs are called
operating characteristic curves or power function curves, respectively.

Inferences concerning one mean
Two-sided hypothesis
The problem consists in testing the null hypothesis Ho: μ = μo, against thealternative hypothesis, H1: μ≠ μο at a level of confidence (1-α)100%, or
significance level α, using a sample of size n with a mean ⎯x and a standard
deviation s. This test is referred to as a two-sided or two-tailed test. The
procedure for the test is as follows:First, we calculate the appropriate statistic for the test (to or zo) as follows:Θ

If n < 30 and the standard deviation of the population, σ, is known, use thezo =z-statistic:Θσ/ n

If n > 30, and σ is known, use zo as above. If σ is not known, replace s forσ in zo, i.e., useΘ

x − μozo =x − μos/ n

If n < 30, and σ is unknown, use the t-statistic to =x − μo, with ν = n - 1
s/ ndegrees of freedom.
Then, calculate the P-value (a probability) associated with either zο or tο , andcompare it to α to decide whether or not to reject the null hypothesis. The Pvalue for a two-sided test is defined as either
P-value = P(|z|>|zo|), or, P-value = P(|t|>|to|).

Page 18-37

The criteria to use for hypothesis testing is:Θ

Reject Ho if P-value < αΘDo not reject Ho if P-value > α.

The P-value for a two-sided test can be calculated using the probability functionsin the calculator as follows:Θ

If using z, P-value = 2⋅UTPN(0,1,|zo|)Θ

If using t, P-value = 2⋅UTPT(ν,|to|)

Example 1 -- Test the null hypothesis Ho: μ = 22.5 ( = μo), against thealternative hypothesis, H1: μ ≠22.5, at a level of confidence of 95% i.e., α =0.05, using a sample of size n = 25 with a mean ⎯x = 22.0 and a standard
deviation s = 3.5. We assume that we don't know the value of the population
standard deviation, therefore, we calculate a t statistic as follows:to =x − μ o 22.0 − 22.5=
= −0.7142
s/ n
3.5 / 25

The corresponding P-value, for n = 25 - 1 = 24 degrees of freedom is
P-value = 2⋅UTPT(24,-0.7142) = 2⋅0.7590 = 1.518,
since 1.518 > 0.05, i.e., P-value > α, we cannot reject the null hypothesis Ho: μ= 22.0.
One-sided hypothesis
The problem consists in testing the null hypothesis Ho: μ = μo, against thealternative hypothesis, H1: μ > μο or H1: μ < μο at a level of confidence (1α)100%, or significance level α, using a sample of size n with a mean ⎯x and astandard deviation s. This test is referred to as a one-sided or one-tailed test.
The procedure for performing a one-side test starts as in the two-tailed test by
calculating the appropriate statistic for the test (to or zo) as indicated above.

Page 18-38

Next, we use the P-value associated with either zο or tο , and compare it to α todecide whether or not to reject the null hypothesis. The P-value for a two-sided
test is defined as either
P-value = P(z > |zo|), or, P-value = P(t > |to|).
The criteria to use for hypothesis testing is:Θ

Reject Ho if P-value < αΘDo not reject Ho if P-value > α.

Notice that the criteria are exactly the same as in the two-sided test. The maindifference is the way that the P-value is calculated. The P-value for a one-sided
test can be calculated using the probability functions in the calculator as
follows:Θ

If using z, P-value = UTPN(0,1,zo)Θ

If using t, P-value = UTPT(ν,to)

Example 2 -- Test the null hypothesis Ho: μ = 22.0 ( = μo), against thealternative hypothesis, H1: μ >22.5 at a level of confidence of 95% i.e., α =0.05, using a sample of size n = 25 with a mean ⎯x = 22.0 and a standard
deviation s = 3.5. Again, we assume that we don't know the value of the
population standard deviation, therefore, the value of the t statistic is the sameas in the two-sided test case shown above, i.e., to = -0.7142, and P-value, for ν= 25 - 1 = 24 degrees of freedom is
P-value = UTPT(24, |-0.7142|) = UTPT(24,0.7142) = 0.2409,
since 0.2409 > 0.05, i.e., P-value > α, we cannot reject the null hypothesis Ho:
μ = 22.0.

Inferences concerning two means
The null hypothesis to be tested is Ho: μ1-μ2 = δ, at a level of confidence (1α)100%, or significance level α, using two samples of sizes, n1 and n2, mean

Page 18-39

values ⎯x1 and ⎯x2, and standard deviations s1 and s2. If the populations
standard deviations corresponding to the samples, σ1 and σ 2, are known, or if
n1 > 30 and n2 > 30 (large samples), the test statistic to be used iszo =( x1 − x2 ) − δ

σ 12
n1

+

σ 22
n2

If n1 < 30 or n2 < 30 (at least one small sample), use the following test statistic:t=( x1 − x 2 ) − δ21(n1 − 1) s + (n2 − 1) s2
2

n1n2 (n1 + n2 − 2)
n1 + n2

Two-sided hypothesis
If the alternative hypothesis is a two-sided hypothesis, i.e., H1: μ1-μ2 ≠ δ, The Pvalue for this test is calculated asΘIf using z,

P-value = 2⋅UTPN(0,1, |zo|)Θ

If using t,

P-value = 2⋅UTPT(ν,|to|)with the degrees of freedom for the t-distribution given by ν = n1 + n2 - 2. The
test criteria areΘ

Reject Ho if P-value < αΘDo not reject Ho if P-value > α.

One-sided hypothesis
If the alternative hypothesis is a two-sided hypothesis, i.e., H1: μ1-μ2 < δ, or,
H1: μ1-μ2 < δ,, the P-value for this test is calculated as:Θ

If using z,

P-value = UTPN(0,1, |zo|)Θ

If using t,

P-value = UTPT(ν,|to|)Page 18-40

The criteria to use for hypothesis testing is:Θ

Reject Ho if P-value < αΘDo not reject Ho if P-value > α.

Paired sample tests
When we deal with two samples of size n with paired data points, instead of
testing the null hypothesis, Ho: μ1-μ2 = δ, using the mean values and standard
deviations of the two samples, we need to treat the problem as a single sampleof the differences of the paired values. In other words, generate a new randomvariable X = X1-X2, and test Ho: μ = δ, where μ represents the mean of the
population for X. Therefore, you will need to obtain⎯x and s for the sample ofvalues of x. The test should then proceed as a one-sample test using themethods described earlier.

Inferences concerning one proportion
Suppose that we want to test the null hypothesis, H0: p = p0, where p represents
the probability of obtaining a successful outcome in any given repetition of a
Bernoulli trial. To test the hypothesis, we perform n repetitions of theexperiment, and find that k successful outcomes are recorded. Thus, anestimate of p is given by p’ = k/n.
The variance for the sample will be estimated as sp2 = p’(1-p’)/n = k⋅(n-k)/n3.
Assume that the Z score, Z = (p-p0)/sp, follows the standard normal distribution,i.e., Z ~ N(0,1). The particular value of the statistic to test is z0 = (p’-p0)/sp.
Instead of using the P-value as a criterion to accept or not accept the hypothesis,
we will use the comparison between the critical value of z0 and the value of z
corresponding to α or α/2.
Two-tailed test
If using a two-tailed test we will find the value of z α/2, from
Pr[Z> zα/2] = 1-Φ(zα/2) = α/2, or Φ(z α/2) = 1- α/2,

Page 18-41

where Φ(z) is the cumulative distribution function (CDF) of the standard normal
distribution (see Chapter 17).
Reject the null hypothesis, H0, if z0 >zα/2, or if z0 < - zα/2.
In other words, the rejection region is R = { |z0| > zα/2 }, while the acceptanceregion is A = {|z0| < zα/2 }.
One-tailed test
If using a one-tailed test we will find the value of S , from
Pr[Z> zα] = 1-Φ(zα) = α, or Φ(z α) = 1- α,
Reject the null hypothesis, H0, if z0 >zα, and H1: p>p0, or if z0 < - zα, and H1:
p<p0.

Testing the difference between two proportions
Suppose that we want to test the null hypothesis, H0: p1-p2 = p0, where the p's
represents the probability of obtaining a successful outcome in any given
repetition of a Bernoulli trial for two populations 1 and 2. To test the
hypothesis, we perform n1 repetitions of the experiment from population 1, andfind that k1 successful outcomes are recorded. Also, we find k2 successful
outcomes out of n2 trials in sample 2. Thus, estimates of p1 and p2 are given,
respectively, by p1’ = k1/n1, and p2’ = k2/n2.
The variances for the samples will be estimated, respectively, as
s12 = p1’(1-p1’)/n1 = k1⋅(n1-k1)/n13, and s22 = p2’(1-p2’)/n2 = k2⋅(n2-k2)/n23.
And the variance of the difference of proportions is estimated from: sp2 = s12 +s22 .
Assume that the Z score, Z = (p1-p2-p0)/sp, follows the standard normal
distribution, i.e., Z ~ N(0,1). The particular value of the statistic to test is z0 =(p1’-p2’-p0)/sp.

Page 18-42

Two-tailed test
If using a two-tailed test we will find the value of z α/2, from
Pr[Z> zα/2] = 1-Φ(zα/2) = α/2, or Φ(z α/2) = 1- α/2,
where Φ(z) is the cumulative distribution function (CDF) of the standard normal
distribution.
Reject the null hypothesis, H0, if z0 >zα/2, or if z0 < - zα/2.
In other words, the rejection region is R = { |z0| > zα/2 }, while the acceptanceregion is A = {|z0| < zα/2 }.
One-tailed test
If using a one-tailed test we will find the value of za, from
Pr[Z> zα] = 1-Φ(zα) = α, or Φ(z α) = 1- α,
Reject the null hypothesis, H0, if z0 >zα, and H1: p1-p2 > p0, or if z0 < - zα, andH1: p1-p2 <p0.

Hypothesis testing using pre-programmed features
The calculator provides with hypothesis testing procedures under application 5.
Hypoth. tests.. can be accessed by using ‚Ù—— @@@OK@@@.
As with the calculation of confidence intervals, discussed earlier, this program
offers the following 6 options:

These options are interpreted as in the confidence interval applications:Page 18-43

1. Z-Test: 1 μ.: Single sample hypothesis testing for the population mean, μ,with known population variance, or for large samples with unknown
population variance.
2. Z-Test: μ1−μ2.: Hypothesis testing for the difference of the populationmeans, μ1- μ2, with either known population variances, or for large
samples with unknown population variances.
3. Z-Test: 1 p.: Single sample hypothesis testing for the proportion, p, forlarge samples with unknown population variance.
4. Z-Test: p1− p2.: Hypothesis testing for the difference of two proportions, p1p2, for large samples with unknown population variances.
5. T-Test: 1 μ.: Single sample hypothesis testing for the population mean, μ,for small samples with unknown population variance.
6. T-Test: μ1−μ2.: Hypothesis testing for the difference of the populationmeans, μ1- μ2, for small samples with unknown population variances.
Try the following exercises:
Example 1 – For μ0 = 150, σ = 10, ⎯x = 158, n = 50, for α = 0.05, test the
hypothesis H0: μ = μ0, against the alternative hypothesis, H1: μ ≠ μ0.
Press ‚Ù—— @@@OK@@@ to access the hypothesis testing feature in thecalculator. Press @@@OK@@@ to select option 1. Z-Test: 1 μ.
Enter the following data and press @@@OK@@@:You are then asked to select the alternative hypothesis. Select μ ≠150, andpress @@OK@@. The result is:Page 18-44

Then, we reject H0: μ = 150, against H1: μ ≠ 150. The test z value is z0 =5.656854. The P-value is 1.54×10-8. The critical values of ±zα/2 =±1.959964, corresponding to critical ⎯x range of {147.2 152.8}.
This information can be observed graphically by pressing the soft-menu key@GRAPH:

Example 2 -- For μ0 = 150, ⎯x = 158, s = 10, n = 50, for α = 0.05, test the
hypothesis H0: μ = μ0, against the alternative hypothesis, H1: μ > μ0. The
population standard deviation, σ, is not known.
Press ‚Ù—— @@@OK@@@ to access the hypothesis testing feature in thecalculator. Press ——@@@OK@@@ to select option 5. T-Test: 1 μ.:Enter the following data and press @@@OK@@@:

Select the alternative hypothesis, H1: μ > 150, and press @@@OK@@@. The result is:Page 18-45

We reject the null hypothesis, H0: μ0 = 150, against the alternative hypothesis,
H1: μ > 150. The test t value is t0 = 5.656854, with a P-value =0.000000393525. The critical value of t is tα = 1.676551, corresponding to a
critical ⎯x = 152.371.
Press @GRAPH to see the results graphically as follows:

Example 3 – Data from two samples show that⎯x1 = 158, ⎯x1 = 160, s1 = 10,
s2 = 4.5, n1 = 50, and n2 = 55. For α = 0.05, and a “pooled” variance, test
the hypothesis H0: μ1−μ2 = 0, against the alternative hypothesis, H1: μ1−μ2 < 0.
Press ‚Ù—— @@@OK@@@ to access the hypothesis testing feature in thecalculator. Press —@@@OK@@@ to select option 6. T-Test: μ1−μ2.: Enter thefollowing data and press @@@OK@@@:

Select the alternative hypothesis μ1< μ2, and press @@@OK@@@. The result isPage 18-46

Thus, we accept (more accurately, we do not reject) the hypothesis: H0: μ1−μ2 =0, or H0: μ1=μ2, against the alternative hypothesis H1: μ1−μ2 < 0, or H1: μ1=μ2.
The test t value is t0 = -1.341776, with a P-value = 0.09130961, and critical t is–tα = -1.659782. The graphical results are:

These three examples should be enough to understand the operation of the
hypothesis testing pre-programmed feature in the calculator.

Inferences concerning one variance
The null hypothesis to be tested is , Ho: σ2 = σo2, at a level of confidence (1α)100%, or significance level α, using a sample of size n, and variance s2. The
test statistic to be used is a chi-squared test statistic defined asχ o2 =(n − 1) s 2

σ 02

Depending on the alternative hypothesis chosen, the P-value is calculated asfollows:
P-value = P(χ2<χo2) = 1-UTPC(ν,χo2)Θ H1: σ2 < σo2,Θ

H1: σ2 > σo2,

P-value = P(χ2>χo2) = UTPC(ν,χo2)Θ

H1: σ2 ≠ σo2,

P-value =2⋅min[P(χ2<χo2), P(χ2>χo2)] =2⋅min[1-UTPC(ν,χo2), UTPC(ν,χo2)]
where the function min[x,y] produces the minimum value of x or y (similarly,
max[x,y] produces the maximum value of x or y). UTPC(ν,x) represents thecalculator’s upper-tail probabilities for ν = n - 1 degrees of freedom.
Page 18-47

The test criteria are the same as in hypothesis testing of means, namely,Θ Reject Ho if P-value < αΘDo not reject Ho if P-value > α.

Please notice that this procedure is valid only if the population from which thesample was taken is a Normal population.
Example 1 -- Consider the case in which σo2 = 25, α=0.05, n = 25, and s2 =20, and the sample was drawn from a normal population. To test the
hypothesis, Ho: σ2 = σo2, against H1: σ2 < σo2, we first calculateWith ν = n - 1 = 25 - 1 = 24 degrees of freedom, we calculate the P-value as,
P-value = P(χ2<19.2) = 1-UTPC(24,19.2) = 0.2587…
Since, 0.2587… > 0.05, i.e., P-value > α, we cannot reject the null hypothesis,
Ho: σ2 =25(= σo2).

Inferences concerning two variances
The null hypothesis to be tested is , Ho: σ12 = σ22, at a level of confidence (1α)100%, or significance level α, using two samples of sizes, n1 and n2, andvariances s12 and s22. The test statistic to be used is an F test statistic defined
as

Fo =

s N2
sD2

where sN2 and sD2 represent the numerator and denominator of the F statistic,
respectively. Selection of the numerator and denominator depends on thealternative hypothesis being tested, as shown below. The corresponding F
distribution has degrees of freedom, νN = nN -1, and νD = nD-1, where nN andnD, are the sample sizes corresponding to the variances sN2 and sD2,
respectively.

Page 18-48

The following table shows how to select the numerator and denominator for Fo
depending on the alternative hypothesis chosen:____________________________________________________________________
Alternative

Test

Degrees

hypothesis

statisticof freedom____________________________________________________________________
Fo = s22/s12
νN = n2-1, νD = n1-1
H1: σ12 < σ22 (one-sided)
H1: σ12 > σ22 (one-sided)2

H1: σ1 ≠σ22

(two-sided)

Fo = s12/s22

νN = n1-1, νD = n2-1

Fo = sM2/sm2

νN = nM-1,νD = nm-1

sM2=max(s12,s22), sm2=min(s12,s22)___________________________________________________________________(*) nM is the value of n corresponding to the sM, and nm is the value of ncorresponding to sm.
____________________________________________________________________The P-value is calculated, in all cases, as: P-value = P(F>Fo) = UTPF(νN, νD,Fo)
The test criteria are:
Θ Reject Ho if P-value < αΘDo not reject Ho if P-value > α.

Example1 -- Consider two samples drawn from normal populations such that n1= 21, n2 = 31, s12 = 0.36, and s22 = 0.25. We test the null hypothesis, Ho:
σ12 = σ22, at a significance level α = 0.05, against the alternative hypothesis,
H1: σ12 ≠ σ22. For a two-sided hypothesis, we need to identify sM and sm, as
follows:
sM2=max(s12,s22) = max(0.36,0.25) = 0.36 = s12
sm2=min(s12,s22) = min (0.36,0.25) = 0.25 = s22
Also,nM = n1 = 21,
nm = n2 = 31,
νN = nM - 1= 21-1=20,
νD = nm -1 = 31-1 =30.

Page 18-49

Therefore, the F test statistics is Fo = sM2/sm2=0.36/0.25=1.44
The P-value is P-value = P(F>Fo) = P(F>1.44) = UTPF(νN, νD,Fo) =UTPF(20,30,1.44) = 0.1788…
Since 0.1788… > 0.05, i.e., P-value > α, therefore, we cannot reject the null
hypothesis that Ho: σ12 = σ22.

Additional notes on linear regression
In this section we elaborate the ideas of linear regression presented earlier inthe chapter and present a procedure for hypothesis testing of regression
parameters.

The method of least squares
Let x = independent, non-random variable, and Y = dependent, randomvariable. The regression curve of Y on x is defined as the relationship between
x and the mean of the corresponding distribution of the Y’s.
Assume that the regression curve of Y on x is linear, i.e., mean distribution of
Y’s is given by Α + Βx. Y differs from the mean (Α + Β⋅x) by a value ε, thusY = Α + Β⋅x + ε, where ε is a random variable.
To visually check whether the data follows a linear trend, draw a scattergram orscatter plot.
Suppose that we have n paired observations (xi, yi); we predict y by means of∧

y = a + b⋅x, where a and b are constant.

Define the prediction error as, ei = yi - ∧yi = yi - (a + b⋅xi).
The method of least squares requires us to choose a, b so as to minimize thesum of squared errors (SSE)
n

n

i =1

i =1

SSE = ∑ ei2 =∑ [ y i − (a + bxi )]2
the conditions∂( SSE ) = 0∂a∂( SSE ) = 0∂bPage 18-50

We get the, so-called, normal equations:
n

n

i =1

i =1

∑ y i = a ⋅ n + b ⋅ ∑ xinnn∑x ⋅ y = a⋅∑x +b⋅∑x
i =1

i

i

i =1

i

i =1

2
i

This is a system of linear equations with a and b as the unknowns, which canbe solved using the linear equation features of the calculator. There is,however, no need to bother with these calculations because you can use the 3.
Fit Data … option in the ‚Ù menu as presented earlier.
Notes:
Θ a,b are unbiased estimators of Α, Β.
Θ The Gauss-Markov theorem of probability indicates that among all
unbiased estimators for Α and Β, the least-square estimators (a,b) are themost efficient.

Additional equations for linear regression
The summary statistics such as Σx, Σx2, etc., can be used to define the following
quantities:nn
1⎛ n ⎞
2
S xx = ∑ ( xi − x ) 2 = (n − 1) ⋅ s x2 = ∑ xi − ⎜ ∑ xi ⎟n ⎝ i =1 ⎠
i =1
i =1

1⎛ n ⎞
S y = ∑ ( yi − y ) = (n − 1) ⋅ s = ∑ yi − ⎜ ∑ y i ⎟n ⎝ i =1 ⎠
i =1
i =1
n

2

2
y

n

2

2

n
n
1 ⎛ n ⎞⎛ n⎞
S xy = ∑ ( xi − x )( y i − y ) 2 = (n − 1) ⋅ s xy = ∑ xi y i − ⎜ ∑ xi ⎟⎜ ∑ y i ⎟n ⎝ i =1 ⎠⎝ i =1 ⎠
i =1
i =1

Page 18-51

From which it follows that the standard deviations of x and y, and thecovariance of x,y are given, respectively, by

sx =

S xx
sy =
n −1 ,S yyn − 1 , andAlso, the sample correlation coefficient is rxy =

sxy =
S xy

S xx ⋅ S yy

S yx
n −1
.

In terms of ⎯x, ⎯y, Sxx, Syy, and Sxy, the solution to the normal equations is:

a = y − bx ,

b=

S xy
S xx

=

s xy
s x2

Prediction error
The regression curve of Y on x is defined as Y = Α + Β⋅x + ε. If we have a setof n data points (xi, yi), then we can write Yi = Α + Β⋅xi + εI, (i = 1,2,…,n),where Yi = independent, normally distributed random variables with mean (Α +Β⋅xi) and the common variance σ2; εi = independent, normally distributed
random variables with mean zero and the common variance σ2.
Let yi = actual data value, ^yi = a + b⋅xi = least-square prediction of the data.
Then, the prediction error is: ei = yi - ^yi = yi - (a + b⋅xi).
An estimate of σ2 is the, so-called, standard error of the estimate,

S yy − ( S xy ) 2 / S xx n − 1 2
1 n2=⋅ s y ⋅ (1 − rxy2 )s =[ y i − (a + bxi )] =
∑
n−2
n−2
n − 2 i =12e

Confidence intervals and hypothesis testing in linear regression
Here are some concepts and equations related to statistical inference for linear
regression:

Page 18-52

ΘConfidence limits for regression coefficients:
For the slope (Β): b − (t n-2,α/2)⋅se/√Sxx < Β < b + (t n-2,α/2)⋅se/√Sxx,
For the intercept (Α):
a − (t n-2,α/2)⋅se⋅[(1/n)+⎯x2/Sxx]1/2 < Α < a + (t n-2,α/2)⋅se⋅[(1/n)+⎯x2/
Sxx]1/2, where t follows the Student’s t distribution with ν = n – 2, degrees
of freedom, and n represents the number of points in the sample.

ΘHypothesis testing on the slope, Β:Null hypothesis, H0: Β = Β0, tested against the alternative hypothesis, H1:Β ≠ Β0. The test statistic is t0 = (b -Β0)/(se/√Sxx), where t follows theStudent’s t distribution with ν = n – 2, degrees of freedom, and n represents
the number of points in the sample. The test is carried out as that of amean value hypothesis testing, i.e., given the level of significance, α,determine the critical value of t, tα/2, then, reject H0 if t0 > tα/2 or if t0 < tα/2.
If you test for the value Β0= 0, and it turns out that the test suggests that you
do not reject the null hypothesis, H0: Β = 0, then, the validity of a linear
regression is in doubt. In other words, the sample data does not support
the assertion that Β ≠ 0. Therefore, this is a test of the significance of theregression model.

ΘHypothesis testing on the intercept , Α:
Null hypothesis, H0: Α = Α0, tested against the alternative hypothesis, H1:Α ≠ Α0. The test statistic is t0 = (a-Α0)/[(1/n)+⎯x2/Sxx]1/2, where t follows
the Student’s t distribution with ν = n – 2, degrees of freedom, and n
represents the number of points in the sample. The test is carried out asthat of a mean value hypothesis testing, i.e., given the level of significance,
α, determine the critical value of t, tα/2, then, reject H0 if t0 > tα/2 or if t0 <- tα/2.

ΘConfidence interval for the mean value of Y at x = x0, i.e., α+βx0:
a+b⋅x−(t n-2,α/2)⋅se⋅[(1/n)+(x0 -⎯x)2/Sxx]1/2 < α+βx0 <a+b⋅x+(t n-2, α /2)⋅se⋅[(1/n)+(x0 -⎯x)2/Sxx]1/2.

ΘLimits of prediction: confidence interval for the predicted value Y0=Y(x0):a+b⋅x−(t n-2,α/2)⋅se⋅[1+(1/n)+(x0 -⎯x)2/Sxx]1/2 < Y0 <Page 18-53

a+b⋅x+(t n-2, α /2)⋅se⋅[1+(1/n)+(x0 -⎯x)2/Sxx]1/2.

Procedure for inference statistics for linear regression using the
calculator
1) Enter (x,y) as columns of data in the statistical matrix ΣDAT.
2) Produce a scatterplot for the appropriate columns of ΣDAT, and use
appropriate H- and V-VIEWS to check linear trend.
3) Use ‚Ù˜˜@@@OK@@@, to fit straight line, and get a, b, sxy(Covariance), and rxy (Correlation).
4) Use ‚Ù˜@@@OK@@@, to obtain ⎯x, ⎯y, sx, sy. Column 1 will show thestatistics for x while column 2 will show the statistics for y.
5) Calculate

S xx = (n − 1) ⋅ s x2

se2 =n −1 2⋅ s y ⋅ (1 − rxy2 )n−2,6) For either confidence intervals or two-tailed tests, obtain tα/2, with (1α)100% confidence, from t-distribution with ν = n -2.
7) For one- or two-tailed tests, find the value of t using the appropriate
equation for either Α or Β. Reject the null hypothesis if P-value < α.
8) For confidence intervals use the appropriate formulas as shown above.
Example 1 -- For the following (x,y) data, determine the 95% confidence
interval for the slope B and the intercept A
x
y

2.0
5.5

2.5
7.2

3.0
9.4

3.5
10.0

4.0
12.2

Enter the (x,y) data in columns 1 and 2 of ΣDAT, respectively. A scatterplot of
the data shows a good linear trend:

Use the Fit Data.. option in the ‚Ù menu, to get:
3: '-.86 + 3.24*X'
2: Correlation: 0.989720229749

Page 18-54

1: Covariance: 2.025

These results are interpreted as a = -0.86, b = 3.24, rxy = 0.989720229749,
and sxy = 2.025. The correlation coefficient is close enough to 1.0 to confirm
the linear trend observed in the graph.
From the Single-var… option of the ‚Ù menu we find: ⎯x = 3, sx =0.790569415042,⎯y = 8.86, sy = 2.58804945857.
Next, with n = 5, calculate

S xx = (n − 1) ⋅ s x2 = (5 − 1) ⋅ 0.790569415042 2 = 2.5

s e2 =

n −1 2⋅ s y ⋅ (1 − rxy2 ) =
n−2

5 −1
⋅ 2.5880...2 ⋅ (1 − 0.9897...2 ) = 0.1826...
5−2
Confidence intervals for the slope (Β) and intercept (A):ΘFirst, we obtain t n-2,α/2 = t3,0.025 = 3.18244630528 (See chapter 17 fora program to solve for tν,a):Θ

Next, we calculate the terms(t n-2,α/2)⋅se/√Sxx = 3.182…⋅(0.1826…/2.5)1/2 = 0.8602…
(t n-2,α/2)⋅se⋅[(1/n)+⎯x2/Sxx]1/2 =3.1824…⋅√0.1826…⋅[(1/5)+32/2.5] 1/2 = 2.65

ΘFinally, for the slope B, the 95% confidence interval is(-0.86-0.860242, -0.86+0.860242) = (-1.72, -0.00024217)
For the intercept A, the 95% confidence interval is (3.24-2.6514,
3.24+2.6514) = (0.58855,5.8914).

Page 18-55

Example 2 -- Suppose that the y-data used in Example 1 represent theelongation (in hundredths of an inch) of a metal wire when subjected to a force
x (in tens of pounds). The physical phenomenon is such that we expect theintercept, A, to be zero. To check if that should be the case, we test the null
hypothesis, H0: Α = 0, against the alternative hypothesis, H1: Α ≠ 0, at the levelof significance α = 0.05.
The test statistic is t0 = (a-0)/[(1/n)+⎯x2/Sxx]1/2 = (-0.86)/ [(1/5)+32/2.5] ½ =-0.44117. The critical value of t, for ν = n – 2 = 3, and α/2 = 0.025, can becalculated using the numerical solver for the equation α = UTPT(γ,t) developedin Chapter 17. In this program, γ represents the degrees of freedom (n-2), andα represents the probability of exceeding a certain value of t, i.e., Pr[ t>tα] = 1– α. For the present example, the value of the level of significance is α = 0.05,
g = 3, and tn-2,α/2 = t3,0.025. Also, for γ = 3 and α = 0.025, tn-2,α/2 = t3,0.025= 3.18244630528. Because t0 > - tn-2,α/2, we cannot reject the null
hypothesis, H0: Α = 0, against the alternative hypothesis, H1: Α ≠ 0, at the levelof significance α = 0.05.
This result suggests that taking A = 0 for this linear regression should be
acceptable. After all, the value we found for a, was –0.86, which is relatively
close to zero.
Example 3 – Test of significance for the linear regression. Test the null
hypothesis for the slope H0: Β = 0, against the alternative hypothesis, H1: Β ≠0, at the level of significance α = 0.05, for the linear fitting of Example 1.
The test statistic is t0 = (b -Β0)/(se/√Sxx) = (3.24-0)/(√0.18266666667/2.5) =18.95. The critical value of t, for ν = n – 2 = 3, and α/2 = 0.025, wasobtained in Example 2, as tn-2,α/2 = t3,0.025 = 3.18244630528. Because, t0 >tα/2, we must reject the null hypothesis H1: Β ≠ 0, at the level of significance α= 0.05, for the linear fitting of Example 1.

Page 18-56

Multiple linear fitting
Consider a data set of the form
x1

x2

x3

…

xn

y

x11

x21

x31

…

xn1

y1

x12

x22

x32

…

xn2

y2

x13

x32

x33

…

xn3

y3

.
.

.
.

.
.

.
.

x1,m-1x 2,m-1

x 3,m-1.
…

.
.
x n,m-1

ym-1

x1,m

x 2,m

x 3,m

…

x n,m

ym

Suppose that we search for a data fitting of the form y = b0 + b1⋅x1 + b2⋅x2 +b3⋅x3 + … + bn⋅xn. You can obtain the least-square approximation to thevalues of the coefficients b = [b0 b1 b2 b3 … bn], by putting together thematrix X:
_

_
1

x11

x21

x31

…

xn1

1

x12

x22

x32

…

xn2

1

x13

x32

x33

…

xn3

.
.
1

.
.
x1,m

.
.
x 2,m

.
.
x 3,m

.
…

.
.
x n,m

_

_

Then, the vector of coefficients is obtained from b = (XT⋅X) -1⋅XT⋅y, where y is
the vector y = [y1 y2 … ym]T.
For example, use the following data to obtain the multiple linear fitting
y = b0 + b1⋅x1 + b2⋅x2 + b3⋅x3,

Page 18-57

x1

x2

x3

y

1.20
2.50
3.50
4.00
6.00

3.10
3.10
4.50
4.50
5.00

2.00
2.50
2.50
3.00
3.50

5.70
8.20
5.00
8.20
9.50

With the calculator, in RPN mode, you can proceed as follows:First, within your HOME directory, create a sub-directory to be called MPFIT(Multiple linear and Polynomial data FITting) , and enter the MPFIT subdirectory. Within the sub-directory, type this program:«  X y « X TRAN X * INV X TRAN * y * » »and store it in a variable called MTREG (MulTiple REGression).
Next, enter the matrices X and b into the stack:[[1,1.2,3.1,2][1,2.5,3.1,2.5 ][1,3.5,4.5,2.5][1,4,4.5,3][1,6,5,3.5]]`` (keep an extra copy)[5.7,8.2,5.0,8.2,9.5] `Press J@MTREG. The result is: [-2.1649…,–0.7144…,-1.7850…,7.0941…],i.e.,y = -2.1649–0.7144⋅x1 -1.7850×10 -2⋅x2 + 7.0941⋅x3 .
You should have in your calculator’s stack the value of the matrix X and thevector b, the fitted values of y are obtained from y = X⋅b, thus, just press *to obtain: [5.63.., 8.25.., 5.03.., 8.22.., 9.45..].

Page 18-58

Compare these fitted values with the original data as shown in the table below:
x1

x2

x3

y

y-fitted

1.20
2.50
3.50
4.00
6.00

3.10
3.10
4.50
4.50
5.00

2.00
2.50
2.50
3.00
3.50

5.70
8.20
5.00
8.20
9.50

5.63
8.25
5.03
8.22
9.45

Polynomial fitting
Consider the x-y data set {(x1,y1), (x2,y2), …, (xn,yn)}. Suppose that we wantto fit a polynomial or order p to this data set. In other words, we seek a fittingof the form y = b0 + b1⋅x + b2⋅x2 + b3⋅x3 + … + bp⋅xp. You can obtain theleast-square approximation to the values of the coefficients b = [b0 b1 b2 b3… bp], by putting together the matrix X
_

_

1

x1

x12

x13

…

x1p-1

y1 p

1

x2

x22

x23

…

x2 p-1

y2 p

1

x3

x32

x33

…

x3 p-1

y3 p

.
.
1

.
.
xn

.
.

.
.

.
.

.
.

x n2

xn 3

x n p-1

yn p

.
…

_

_

Then, the vector of coefficients is obtained from b = (XT⋅X) -1⋅XT⋅y, where y is
the vector y = [y1 y2 … yn]T.
In Chapter 10, we defined the Vandermonde matrix corresponding to a vector
x = [x1 x2 … xm] . The Vandermonde matrix is similar to the matrix X ofinterest to the polynomial fitting, but having only n, rather than (p+1) columns.
We can take advantage of the VANDERMONDE function to create the matrix X
if we observe the following rules:
If p = n-1, X = Vn.
If p < n-1, then remove columns p+2, …, n-1, n from Vn to form X.

Page 18-59

If p > n-1, then add columns n+1, …, p-1, p+1, to Vn to form matrix X.
In step 3 from this list, we have to be aware that column i (i= n+1, n+2, …,
p+1) is the vector [x1i x2i … xni]. If we were to use a list of data values for x
rather than a vector, i.e., x = { x1 x2 … xn }, we can easily calculate thesequence { x1i x2i … xni }. Then, we can transform this list into a vector and use
the COL menu to add those columns to the matrix Vn until X is completed.
After X is ready, and having the vector y available, the calculation of thecoefficient vector b is the same as in multiple linear fitting (the previous matrix
application). Thus, we can write a program to calculate the polynomial fittingthat can take advantage of the program already developed for multiple linear
fitting. We need to add to this program the steps 1 through 3 listed above.
The algorithm for the program, therefore, can be written as follows:Enter vectors x and y, of the same dimension, as lists. (Note: since thefunction VANDERMONDE uses a list as input, it is more convenient to enter the(x,y) data as a list.) Also, enter the value of p.
Θ Determine n = size of vector x.
Θ Use the function VANDERMONDE to generate the Vandermondematrix Vn for the list x entered.
Θ

If p = n-1, then
X = Vn,Else If p < n-1
Remove columns p+2, …, n from Vn to form X(Use a FOR loop and COL-)
Else
Add columns n+1, …, p+1 to Vn to form X

ΘΘ(FOR loop, calculate xi, convert to vector, use COL+)
Convert y to vector
Calculate b using program MTREG (see example on multiple linear
fitting above)

Here is the translation of the algorithm to a program in User RPL language.
(See Chapter 21 for additional information on programming):

Page 18-60

«
xyp
«
x SIZE  n«
x VANDERMONDEIF ‘p<n-1’ THEN
n
p2+
FOR j
j COL− DROP
-1 STEP
ELSE
IF ‘p>n-1’ THEN
n1+
p1+
FOR j
x j ^
OBJ ARRY
j COL+NEXT
END
END
y OBJ ARRY
MTREG
NUM
»
»
»

Open programEnter lists x and y, and p (levels 3,2,1)
Open subprogram 1
Determine size of x list
Open subprogram 2
Place x in stack, obtain Vn
This IF implements step 3 in algorithm
Place n in stackCalculate p+1
Start loop j = n-1, n-2, …, p+1, step = -1
Remove column and drop it from stack
Close FOR-STEP loop

Calculate n+1
Calculate p+1
Start a loop with j = n, n+1, …, p+1.
Calculate xj, as a list
Convert list to array
Add column to matrix
Close FOR-NEXT loop
Ends second IF clause.
Ends first IF clause. Its result is X
Convert list y to an array
X and y used by program MTREG
Convert to decimal format
Close sub-program 2
Close sub-program 1
Close main program

Save it into a variable called POLY (POLYnomial fitting).
As an example, use the following data to obtain a polynomial fitting with p =2, 3, 4, 5, 6.

Page 18-61

x
2.30
3.20
4.50
1.65
9.32
1.18
6.24
3.45
9.89
1.22

y
179.72562.301969.1165.87
31220.89
32.81
6731.48737.4139248.46
33.45

Because we will be using the same x-y data for fitting polynomials of different
orders, it is advisable to save the lists of data values x and y into variables xx
and yy, respectively. This way, we will not have to type them all over again ineach application of the program POLY. Thus, proceed as follows:{ 2.3 3.2 4.5 1.65 9.32 1.18 6.24 3.45 9.89 1.22 } ` ‘xx’ K{179.72 562.30 1969.11 65.87 31220.89 32.81 6731.48 737.41 39248.46
33.45} ` ‘yy’ K
To fit the data to polynomials use the following:@@xx@@ @@yy@@ 2 @POLY, Result: [4527.73 -3958.52 742.23]
i.e.,y = 4527.73-3958.52x+742.23x2@@xx@@ @@yy@@ 3 @POLY, Result: [ –998.05 1303.21 -505.27 79.23]
i.e.,
y = -998.05+1303.21x-505.27x2+79.23x3@@xx@@ @@yy@@ 4 @POLY, Result: [20.92 –2.61 –1.52 6.05 3.51 ]i.e.,
y = 20.92-2.61x-1.52x2+6.05x3+3.51x4.
@@xx@@ @@yy@@ 5 @POLY, Result: [19.08 0.18 –2.94 6.36 3.48 0.00 ]i.e.,
y = 19.08+0.18x-2.94x2+6.36x3+3.48x4+0.0011x5@@xx@@ @@yy@@ 6 @POLY, Result: [-16.73 67.17 –48.69 21.11 1.07 0.19 0.00]
i.e.,

y = -16.72+67.17x-48.69x2+21.11x3+1.07x4+0.19x5-0.0058x6

Selecting the best fitting
As you can see from the results above, you can fit any polynomial to a set ofdata. The question arises, which is the best fitting for the data? To help one
decide on the best fitting we can use several criteria:

Page 18-62ΘΘΘThe correlation coefficient, r. This value is constrained to the range –1< r < 1. The closer r is to +1 or –1, the better the data fitting.
The sum of squared errors, SSE. This is the quantity that is to beminimized by least-square approach.
A plot of residuals. This is a plot of the error corresponding to each of
the original data points. If these errors are completely random, theresiduals plot should show no particular trend.

Before attempting to program these criteria, we present some definitions:
Given the vectors x and y of data to be fit to the polynomial equation, we form
the matrix X and use it to calculate a vector of polynomial coefficients b. We
can calculate a vector of fitted data, y’, by using y’ = X⋅b.
An error vector is calculated by e = y – y’.
The sum of square errors is equal to the square of the magnitude of the error
vector, i.e., SSE = |e|2 = e•e = Σ ei2 = Σ (yi-y’i)2.
To calculate the correlation coefficient we need to calculate first what is known
as the sum of squared totals, SST, defined as SST = Σ (yi-⎯y)2, where ⎯y is themean value of the original y values, i.e., ⎯y = (Σyi)/n.
In terms of SSE and SST, the correlation coefficient is defined byr = [1-(SSE/SST)] 1/2 .
Here is the new program including calculation of SSE and r (Once more,consult the last page of this chapter to see how to produce the variable andcommand names in the program):«xyp«
x SIZE  n«Open programEnter lists x and y, and number pOpen subprogram1
Determine size of x list
Open subprogram 2

Page 18-63

x VANDERMONDEIF ‘p<n-1’ THEN
n
p2+
FOR j
j COL− DROP
-1 STEP
ELSE
IF ‘p>n-1’ THEN
n1+
p1+
FOR j

Place x in stack, obtain Vn
This IF is step 3 in algorithm
Place n in stackCalculate p+1
Start loop, j = n-1 to p+1, step = -1
Remove column, drop from stack
Close FOR-STEP loop

x j ^OBJ ARRY
j COL+NEXT
END
END
y OBJ ARRY X yv«
X yv MTREG
NUM
b
«
b yv
Xb*
ABS SQ DUP
y ΣLIST n /n 1 LIST SWAP CON
yv − ABS SQ/

Calculate xj, as a list
Convert list to array
Add column to matrix
Close FOR-NEXT loop
Ends second IF clause.
Ends first IF clause. Produces X
Convert list y to an array
Enter matrix and array as X and yOpen subprogram 3
X and y used by program MTREG
If needed, converts to floating point
Resulting vector passed as b
Open subprogram 4
Place b and yv in stackCalculate X⋅b
Calculate e = y - X⋅b
Calculate SSE, make copy
Calculate ⎯yCreate vector of n values of ⎯yCalculate SST
Calculate SSE/SST

NEG 1 + √“r” TAG
SWAP

Calculate n+1
Calculate p+1
Start loop with j = n, n+1, …, p+1.

Calculate r = [1–SSE/SST ]1/2
Tag result as “r”
Exchange stack levels 1 and 2

Page 18-64

“SSE” TAG»

Tag result as SSE
Close sub-program 4
Close sub-program 3
Close sub-program 2
Close sub-program 1
Close main program

»
»
»
»

Save this program under the name POLYR, to emphasize calculation of thecorrelation coefficient r.
Using the POLYR program for values of p between 2 and 6 produce thefollowing table of values of the correlation coefficient, r, and the sum of squareerrors, SSE:
p
2
3
4
5
6

r
0.9971908
0.9999768
0.9999999
0.9999999
0.9999998

SSE
10731140.01
88619.36
7.48
8.92
432.60

While the correlation coefficient is very close to 1.0 for all values of p in thetable, the values of SSE vary widely. The smallest value of SSE corresponds to p
= 4. Thus, you could select the preferred polynomial data fitting for theoriginal x-y data as:
y = 20.92-2.61x-1.52x2+6.05x3+3.51x4.

Page 18-65

Chapter 19
Numbers in Different Bases
In this Chapter we present examples of calculations of number in bases otherthan the decimal basis.

Definitions
The number system used for everyday arithmetic is known as the decimal system
for it uses 10 (Latin, deca) digits, namely 0-9, to write out any real number.
Computers, on the other hand, use a system that is based on two possible
states, or binary system. These two states are represented by 0 and 1, ON
and OFF, or high-voltage and low-voltage. Computers also use number
systems based on eight digits (0-7) or octal system, and sixteen digits (0-9, A-F)
or hexadecimal. As in the decimal system, the relative position of digits
determines its value. In general, a number n in base b can be written as aseries of digits n = (a1a2 …an.c1c2 …cm)b. The “point” separates n “integer”
digits from m “decimal” digits. The value of the number, converted to ourcustomary decimal system, is calculated by using n = a1⋅bn-1 + a2⋅bn-2 + … +anb0 + c1⋅b-1 + c2⋅b-2 + … +cm⋅b-m. For example, (15.234)10 = 1⋅101 +5⋅100 + 2⋅10 -1 + 3⋅10 -2 + 4⋅10-3, and (101.111)2 = 1⋅22 + 0⋅21 + 1⋅20 +1⋅2-1 + 1⋅2-2 + 1⋅2-3

The BASE menu
While the calculator would typically be operated using the decimal system, you
can produce calculations using the binary, octal, or hexadecimal system.
Many of the functions for manipulating number systems other than the decimal
system are available in the BASE menu, accessible through ‚ã(the 3key). With system flag 117 set to CHOOSE boxes, the BASE menu shows thefollowing entries:

Page 19-1

With system flag 117 set to SOFT menus, the BASE menu shows the following:With this format, it is evident that the LOGIC, BIT, and BYTE entries within the
BASE menu are themselves sub-menus. These menus are discussed later in this
Chapter.

Functions HEX, DEC, OCT, and BIN
Numbers in non-decimal systems are written preceded by the # symbol in thecalculator. The symbol # is readily available as „â(the 3 key). To selectwhich number system (current base) will be used for numbers preceded by #,select one of the following functions in the first BASE menu, i.e., HEX(adecimal),DEC(imal), OCT(al), or BIN(ary). For example, if @HEX! is selected, any number
written in the calculator that starts with # will be a hexadecimal number. Thus,
you can write numbers such as #53, #A5B, etc. in this system. As different
systems are selected, the numbers will be automatically converted to the new
current base.
The following examples show the same three numbers written with the # symbolfor different current bases:
HEX

DEC

OCT

BIN

Page 19-2

As the decimal (DEC) system has 10 digits (0,1,2,3,4,5,6,7,8,9), thehexadecimal (HEX) system has 16 digits (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F), theoctal (OCT) system has 8 digits (0,1,2,3,4,5,6,7), and the binary (BIN) system
has only 2 digits (0,1).

Conversion between number systems
Whatever the number system selected, it is referred to as the binary system forthe purpose of using the functions RB and BR. For example, if @HEX! isselected, the function BR will convert any hexadecimal number (preceded by#) into a decimal number, while the function RB works in the opposite
direction. Try the following exercises, HEX is the current base:

The following examples show conversions when the base is the octal system:

We also present transformations using the binary system as the current base:

Notice that every time you enter a number starting with #, you get as the entry
the number you entered preceded by # and followed by the letter h, o, or b(hexadecimal, octal, or binary). The type of letter used as suffix depends onwhich non-decimal number system has been selected, i.e., HEX, OCT, or BIN.
To see what happens if you select the @DEC@ setting, try the following conversions:Page 19-3

The only effect of selecting the DECimal system is that decimal numbers, whenstarted with the symbol #, are written with the suffix d.

Wordsize
The wordsize is the number of bits in a binary object. By default, the wordsize
is 64 bites. Function RCWS (ReCall WordSize) shows the current wordsize.
Function STWS (SeT the WordSize) allows the user to reset the wordsize to any
number between 0 and 64.
Changing the wordsize will affect the way that binary integer operations are
performed. For example, if a binary integer exceeds the current wordsize, theleading bits will be dropped before any operation can be performed on such
number.

Operations with binary integers
The operations of addition, subtraction, change of sign, multiplication, anddivision are defined for binary integers. Some examples, of addition andsubtraction, are shown below, for different current bases:#A02h + #12Ah = #B2Ch#2562d + #298d = #2860d#5002o + #452o = #5454o#101000000010b + #100101010b = #101100101100b#A02h - #12Ah = #8D8h#2562d - #298d = #2264d#5002o - #452o = #4330o#101000000010b - #100101010b = #100011011000b

Page 19-4

The LOGIC menu
The LOGIC menu, available through the BASE (‚ã) provides the following
functions:

The functions AND, OR, XOR (exclusive OR), and NOT are logical functions.
The input to these functions are two values or expressions (one in the case of
NOT) that can be expressed as binary logical results, i.e., 0 or 1.
Comparisons of numbers through the comparison operators =, ≠, >, <, ≤, and≥, are logical statements that can be either true (1) or false (0). Some examples
of logical statements are shown below:

Functions AND, OR, XOR, and NOT can be applied to comparison statements
under the following rules:
1 AND 1 = 1

1 AND 0 = 0

0 AND 1 = 0

0 AND 0 = 0

1 OR 1 = 1

1 OR 0 = 1

0 OR 1 = 1

0 OR 0 = 0

1 XOR 1 = 0

1 XOR 0 = 1

0 XOR 1 = 1

0 XOR 0 = 0

NOT(1) = 0

NOT(0) = 1

These functions can be used to build logical statements for programming
purposes. In the context of this Chapter, they will by used to provide the resultof bit-by-bit operations along the lines of the rules provided above. In thefollowing examples, the base number system is indicated in parentheses:

Page 19-5

AND (BIN)

OR (BIN)XOR (BIN)

NOT (HEX)

The BIT menu
The BIT menu, available through the BASE (‚ã) provides the following
functions:

Functions RL, SL, ASR, SR, RR, contained in the BIT menu, are used tomanipulate bits in a binary integer. The definition of these functions are shown
below:
RL: Rotate Left one bit, e.g., #1100b  #11000b
SL: Shift Left one bit, e.g., #1101b  #11010b
ASR: Arithmetic Shift Right one bit, e.g., #1100010b  #110001b
SR: Shift Right one bit, e.g., #11011b #1101b
RR: Rotate Right one bit, e.g., #1101b #10000000000000000000000000000000000000000000000000
000000000001b

Page 19-6

The BYTE menu
The BYTE menu, available through the BASE (‚ã) provides the following
functions:

Functions RLB, SLB, SRB, RRB, contained in the BIT menu, are used tomanipulate bits in a binary integer. The definition of these functions are shown
below:RLB:

Rotate Left one byte, e.g., #1100b  #110000000000b

SLB:

Shift Left one byte, e.g., #1101b  #110100000000b

SRB: Shift Right one byte, e.g., #11011b #0b
RRB: Rotate Right one byte, e.g., #1101b #1101000000000000000000000000000000000000000000000
00000000000b

Hexadecimal numbers for pixel references
Many plot option specifications use pixel references as input, e.g., { #332h#A23h } #Ah 0. 360. ARC, to draw an arc of a circle. We use functionsCPX and PXC to convert quickly between user-unit coordinates and pixel
references. These functions can be found through the command catalog(‚N).
Some examples are shown below:

Page 19-7

Chapter 20
Customizing menus and keyboard
Through the use of the many calculator menus you have become familiar withthe operation of menus for a variety of applications. Also, you are familiar withthe many functions available by using the keys in the keyboard, whether
through their main function, or by combining them with the left-shift („), rightshift (‚) or ALPHA (~) keys. In this Chapter we provide examples ofcustomized menus and keyboard keys that you may find useful in your own
applications.

Customizing menus
A custom menu is a menu created by the user. The specifications for the menu
are stored into the reserved variables CST. Thus, to create a menu you must put
together this variable with the features that you want to display in your menu
and the actions required by the soft menu keys. To show examples ofcustomizing menus we need to set system flag 117 to SOFT menu. Make sure
you do this before continuing (See Chapter 2 for instructions on setting system
flags).

The PRG/MODES/MENU menu
Commands useful in customizing menus are provided by the MENU menu,
accessible through the PRG menu („°). Setting system flag 117 to SOFT
menu, the sequence „°L @)MODES @)MENU produces the following MENU
soft menu:

The functions available are:
MENU:

Activates a menu given its number

CST:

Reference to the CST variable, e.g., ‚@@CST@@ shows CST contents.

TMENU:

Use instead of MENU to create a temporary menu without
overwriting the contents of CST

RCLMENU:Returns menu number of current menu

Page 20-1

Menu numbers (RCLMENU and MENU functions)
Each pre-defined menu has a number attached to it. For example, suppose thatyou activate the MTH menu („´). Then, using the function catalog(‚N) find function RCLMENU and activate it. In ALG mode simple press` after RCLMENU() shows up in the screen. The result is the number 3.01.
Thus, you can activate the MTH menu by using MENU(3.01), in ALG, or
3.01 MENU, in RPN.
Most menus can be activated without knowing their numbers by using the
keyboard. There are, however, some menus not accessible through the
keyboard. For example, the soft menu STATS is only accessible by using
function MENU. Its number is 96.01. Use MENU(96.01) in ALG mode, or
96.01 MENU in RPN mode to obtain the STAT soft menu.
Note: The number 96.01 in this example means the first (01) sub-menu ofmenu 96.

Custom menus (MENU and TMENU functions)Suppose that you need to activate four functions for a particular application.
Say, that you need to be able to quickly access the functions EXP, LN, GAMMA
and ! (~‚2) and you want to place them in a soft menu that you willkeep active for a while. You could do this by creating a temporary menu withfunction TMENU, or a more permanent menu with function MENU. The maindifference is that function MENU creates variable CST, while TMENU does not.
With variable CST created permanently in your sub-directory you can always
reactivate the menu using the specifications in CST by pressing „£. With
TMENU the menu specifications are lost after you replace the temporary menu
with another one.
For example, in RPN mode, a menu is created by using:{EXP LN GAMMA !} ` TMENU `or{EXP LN GAMMA !} ` MENU `to produce the following menu:

Page 20-2

To activate any of those functions you simply need to enter the function
argument (a number), and then press the corresponding soft menu key.
In ALG mode, the list to be entered as argument of function TMENU or MENU is
more complicated:{{“exp”,”EXP(“},{“ln”,”LN(“},{“Gamma”,”GAMMA(“},{“!”,”!(“}}The reason for this is that, in RPN mode, the command names are both soft
menu labels and commands. In ALG mode, the command names will produce
no action since ALG functions must be followed by parentheses and arguments.
In the list shown above (for the ALG mode), within each sub-list you have a label
for the key, e.g., “exp”, followed by the way that the function will be entered in
the stack so that the argument to the function can be typed at the prompt, e.g.,“EXP(“. We need not worry about the closing parenthesis, because thecalculator will complete the parentheses before executing the function. The
implementation of function TMENU in ALG mode with the argument list shown
above is as follows. First, we enter the list, then we produce the temporarymenu (see menu key labels) by using function TMENU(ANS(1)). We also
show, in the left-hand side, the result of pressing the @@exp! soft menu key, i.e., theprompt EXP(. After typing 8` the result of the operation is shown in theright-hand side:

A simpler version of the menu can be defined by using
MENU({{”EXP(“,“LN(“,“GAMMA(“,”!(“}).
Enhanced RPN menu
The list presented above for the ALG mode, can be modified slightly to use in
the RPN mode. The modified list will look like this:{{“exp”,EXP},{“ln”,LN},{“Gamma”,GAMMA},{“!”,!}}

Page 20-3

You can try using this list with TMENU or MENU in RPN mode to verify that you
get the same menu as obtained earlier in ALG mode.

Menu specification and CST variable
From the two exercises shown above we notice that the most general menu
specification list include a number of sub-lists equal to the number of items to be
displayed in your custom menu. Each sub-list contains a label for the menu key
followed by a function, expression, label, or other object that constitutes theeffect of the menu key when pressed. Care must be exercised in specifying themenu list in ALG mode versus RPN mode. In RPN mode, the menu key action
can be simply a calculator command (e.g., EXP, LN, etc., as shown above),
while in ALG mode it has to be a string with the command prompt whose
argument needs to be provided by the user before pressing ` andcompleting the command. The examples above illustrate the difference.
The general form of the argument list for commands TMENU or MENU in ALG
mode is{“label1”,”function1(“,”ls1(“,”rs1(“}, {“label2”, “function2(“,”ls2(“,”rs2(“},…}
While, in RPN mode, the argument list has this format{“label1”, function1, ls1, rs1}, {“label2”, function2, ls2, rs2},…}In these specifications, function1, function 2, etc., represent the main operationof the key, while ls1, ls2, …, etc., represent the left-shift operation of the key.
Similarly, rs1, rs2, …, etc., represent the right-shift operation of the key. This list
will be stored in variable CST if command MENU is used. You can have a
different CST variable in each sub-directory, and you can always replace thecurrent contents of CST with those of other variables storing the properly
formatted list to produce another custom menu.
Note: You can use a 21x8 GROB (See Chapter 22) to produce an icon in thesoft menu keys. As an example, try, in RPN mode:{{GROB 21 8 00000EF908FFF900FFF9B3FFF9A2FFF9A3FFF9A0FFF388FF“hp” }}` MENUThis will place the hp logo on key A. Pressing A places the text ‘hp’ in thecommand line.

Page 20-4

Customizing the keyboard
Each key in the keyboard can be identified by two numbers representing their
row and column. For example, the VAR key (J) is located in row 3 ofcolumn 1, and will be referred to as key 31. Now, since each key has up to tenfunctions associated with it, each function is specified by decimal digits
between 0 and 1, according to the following specifications:.0 or 1, unshifted key

0.01 or 0.11, not applicable.2, key combined with „.21, key simultaneous with „.3, key combined with ‚.31, key simultaneous with ‚.4, key combined with ~.41, key combined with ~.5, key combined with ~„.51, ~ key simultaneous with „.6, key combined with ~‚.61, ~ key simultaneous with ‚Thus, the VAR function will be referred to as key 31.0 or 31.1, while the UPDIR
function will be key 31.2, the COPY function will be key 31.3, the upper-case J
is key 31.4, and lower case j is key 31.5. (Key 31.6 is not defined). In
general, a key will be described by the arrangement XY.Z, where X = row
number, Y = column number, Z = shifting.
We can combine a given key with the USER key (left-shift associated with the~ key, or „Ì) to create a customized key action. In principle, the entire
keyboard can be re-defined to perform a number of customized operations.

The PRG/MODES/KEYS sub-menu
Commands useful in customizing the keyboard are provided by the KEYS menu
accessible through the PRG menu („°). Setting system flag 117 to SOFT
menu, the sequence „ °L @)MODES @)KEYS
produces the following KEYS soft menu:

Page 20-5

The functions available are:ASN:
Assigns an object to a key specified by XY.Z
STOKEYS: Stores user-defined key list
RCLKEYS: Returns current user-defined key list
DELKEYS: Un-assigns one or more keys in the current user-defined key list, thearguments are either 0, to un-assign all user-defined keys, or XY.Z,
to un-assign key XY.Z.

Recall current user-defined key list
Use command RCLKEYS to see the current user-defined key list. Before any
user-defined key assignments, the result should be a list containing the letter S,
i.e., {S}.

Assign an object to a user-defined key
Suppose that you want to have access to the old-fashioned PLOT command first
introduced with the HP 48G series calculator, but currently not directly available
from the keyboard. The menu number for this menu is 81.01. You can see thismenu active by using
ALG mode: MENU(81.01)
RPN mode: 81.01 ` MENU `If you want to have a quick way to activate this menu from the keyboard, you
could assign this menu to the GRAPH key (C) whose reference number is
13.0, i.e., first row, third column, main function. To assign an object to a key
use function ASN, as follows:
ALG mode: ASN(<<MENU(81.01)>>,13.0)
RPN mode: << 18.01 MENU >> ` 13.0 ` ASN
Another useful menu is the original SOLVE menu (described at the end ofChapter 6 in this Guide), which can be activated by using ‚(hold) 7.

Page 20-6

Operating user-defined keys
To operate this user-defined key, enter „Ì before pressing the C key.
Notice that after pressing „Ì the screen shows the specification 1USR in
the second display line. Pressing for „Ì C for this example, you
should recover the PLOT menu as follows:

If you have more than one user-defined key and want to operate more than oneof them at a time, you can lock the keyboard in USER mode by entering„Ì„Ì before pressing the user-defined keys. With the keyboard
locked in USER mode, the specification USR will be shown in the second
display line. To unlock the keyboard press „Ì once more.

Un-assigning a user-defined key
To remove the assignment performed above, use function DELKEYS, as follows:
ALG mode:

DELKEYS(13.0)

RPN mode:

13.0 ` DELKEYS `Assigning multiple user-defined keys
The simplest way to assign several user-defined is to provide a list of commands
and key specifications. For example, suppose that we assign the threetrigonometric functions (SIN, COS, TAN) and the three hyperbolic functions(SINH, COSH, TANH) to keys A through F, respectively, as user-definedkeys. In RPN mode use:
{SINʳ11.0ʳCOSʳ12.0ʳT Nʳ13.0ʳSINHʳ14.0ʳCOSHʳ15.0ʳT NHʳ16.0} ` STOKEYS `In ALG mode use:
STOKEYS({"SIN(" , 11.0, "COS(", 12.0, "T N(", 13.0,"SINH(", 14.0, "COSH(", 15.0, "T NH(", 16.0}) `Operate these keys by using, for example, in RPN mode:5„ÌA 4„ÌB 6„ÌC
2 „ÌD 1„ÌE 2„ÌFPage 20-7

To un-assign all user-defined keys use:
ALG mode: DELKEYS(0)RPN mode: 0 DELKEYS

Check that the user-key definitions were removed by using function RCLKEYS.

Page 20-8

Chapter 21
Programming in User RPL language
User RPL language is the programming language most commonly used toprogram the calculator. The program components can be put together in theline editor by including them between program containers « » in theappropriate order. Because there is more experience among calculator users inprogramming in the RPN mode, most of the examples in this Chapter will bepresented in the RPN mode. Also, to facilitate entering programming
commands, we suggest you set system flag 117 to SOFT menus. The programs
work equally well in ALG mode once they have been debugged and tested in
RPN mode. If you prefer to work in the ALG mode, simply learn how to do theprogramming in RPN and then reset the operating mode to ALG to run the
programs. For a simple example of User RPL programming in ALG mode, referto the last page in this chapter.

An example of programming
Throughout the previous Chapters in this guide we have presented a number ofprograms that can be used for a variety of applications (e.g., programs CRMC
and CRMT, used to create a matrix out of a number of lists, were presented in
Chapter 10). In this section we present a simple program to introduce concepts
related to programming the calculator. The program we will write will be used
to define the function f(x) = sinh(x)/(1+x2), which accepts lists as argument(i.e., x can be a list of numbers, as described in Chapter 8). In Chapter 8 weindicated that the plus sign, , acts as a concatenation operator for lists and not
to produce a term-by-term sum. Instead, you need to use the ADD operator toachieve a term-by-term summation of lists. Thus, to define the function shown
above we will use the following program:«'x' STO x SINH 1 x SQ ADD / 'x' PURGE »To key in the program follow these instructions:
Keystroke sequence:

Produces:

Interpreted as:‚å«Start an RPL program[']~„x™K'x' STOStore level 1 into variable x~„x

x

Place x in level 1„´@)HYP @SINH

SINH

Calculate sinh of level 1

1#~„x „º

1 x SQEnter 1 and calculate x2

Page 21-1„´ @LIST @ADD@

ADD

Calculate (1+x2),/[']~„x™

/'x'then divide„°@)@MEM@@ @)@DIR@@ @PURGE

PURGE

Purge variable x`

Program in level 1______________________________________________________

To save the program use: [']~„gK
Press J to recover your variable menu, and evaluate g(3.5) by entering thevalue of the argument in level 1 (3.5`) and then pressing @@@g@@@.
The result is 1.2485…, i.e., g(3.5) = 1.2485. Try also obtaining g({1 2 3}), byentering the list in level 1 of the display: „ä1#2#3`
and pressing @@@g@@@. The result now is {SINH(1)/2 SINH(2)/5 SINH(3)/10}, ifyour CAS is set to EXACT mode. If your CAS is set to APPROXIMATE mode, theresult will be {0.5876.. 0.7253… 1.0017…}.

Global and local variables and subprograms
The program @@@g@@@, defined above, can be displayed as« 'x' STO x SINH 1 x SQ ADD / 'x' PURGE »by using ‚@@@g@@@.
Notice that the program uses the variable name x to store the value placed inlevel 1 of stack through the programming steps 'x' STO. The variable x, while
the program is executing, is stored in your variable menu as any other variable
you had previously stored. After calculating the function, the program purges(erases) the variable x so it will not show in your variable menu after finishingevaluating the program. If we were not to purge the variable x within the
program its value would be available to us after program execution. For thatreason, the variable x, as used in this program, is referred to as a global
variable. One implication of the use of x as a global variable is that, if we hada previously defined a variable with the name x, its value would be replaced by
the value that the program uses and then completely removed from yourvariable menu after program execution.
From the point of view of programming, therefore, a global variable is avariable that is accessible to the user after program execution. It is possible toPage 21-2

use a local variable within the program that is only defined for that program
and will not be available for use after program execution. The previous
program could be modified to read:« → x « x SINH 1 x SQ ADD / » »The arrow symbol (→) is obtained by combining the right-shift key ‚ with the
0 key, i.e., ‚é. Also, notice that there is an additional set ofprogramming symbols (« ») indicating the existence of a sub-program, namely «x SINH 1 x SQ ADD / », within the main program. The main program starts
with the combination → x, which represents assigning the value in level 1 ofstack to a local variable x. Then, programming flow continues within the subprogram by placing x in the stack, evaluating SINH(x), placing 1 in the stack,placing x in the stack, squaring x, adding 1 to x, and dividing stack level 2(SINH(x)) by stack level 1 (1+x2). The program control is then passed back to
the main program, but there are no more commands between the first set ofclosing programming symbols (») and the second one, therefore, the program
terminates. The last value in the stack, i.e., SINH(x)/ (1+x2), is returned as the
program output.
The variable x in the last version of the program never occupies a place among
the variables in your variable menu. It is operated upon within the calculator
memory without affecting any similarly named variable in your variable menu.
For that reason, the variable x in this case is referred to as a variable local tothe program, i.e., a local variable.
Note: To modify program @@@g@@@, place the program name in the stack(³@@@g@@@ `), then use „˜. Use the arrow keys (š™—˜) tomove about the program. Use the backspace/delete key, ƒ, to delete any
unwanted characters. To add program containers (i.e., « »), use ‚å,since these symbols come in pairs you will have to enter them at the start andend of the sub-program and delete one of its components with the delete key
ƒ to produce the required program, namely:

Page 21-3

« → x « x SINH 1 x SQ ADD / » ».
When done editing the program press ` . The modified program is stored
back into variable @@g@@.

Global Variable Scope
Any variable that you define in the HOME directory or any other directory or
sub-directory will be considered a global variable from the point of view ofprogram development. However, the scope of such variable, i.e., the locationin the directory tree where the variable is accessible, will depend on thelocation of the variable within the tree (see Chapter 2).
The rule to determine a variable’s scope is the following: a global variable isaccessible to the directory where it is defined and to any sub-directory attachedto that directory, unless a variable with the same name exists in the subdirectory under consideration. Consequences of this rule are the following:ΘΘΘ

A global variable defined in the HOME directory will be accessible fromany directory within HOME, unless redefined within a directory or subdirectory.
If you re-define the variable within a directory or sub-directory thisdefinition takes precedence over any other definition in directories above
the current one.
When running a program that references a given global variable, theprogram will use the value of the global variable in the directory fromwhich the program is invoked. If no variable with that name exist in the
invoking directory, the program will search the directories above the current
one, up to the HOME directory, and use the value corresponding to thevariable name under consideration in the closest directory above thecurrent one.

A program defined in a given directory can be accessed from that directory or
any of its sub-directories.

Page 21-4

All these rule may sound confusing for a new calculator user. They all can be
simplified to the following suggestion: Create directories and sub-directories
with meaningful names to organize your data, and make sure you have all the
global variables you need within the proper sub-directory.

Local Variable Scope
Local variables are active only within a program or sub-program. Therefore,
their scope is limited to the program or sub-program where they’re defined. An
example of a local variable is the index in a FOR loop (described later in thischapter), for example « → n x « 1 n FOR j x NEXT n LIST » »The PRG menu
In this section we present the contents of the PRG (programming) menu with thecalculator’s system flag 117 set to SOFT menus. With this flag setting submenus and commands in the PRG menu will be shown as soft menu labels. Thisfacilitates entering the programming commands in the line editor when you are
putting together a program.
To access the PRG menu use the keystroke combination „°. Within the
PRG menu we identify the following sub-menus (press L to move to the nextcollection of sub-menus in the PRG menu):

Here is a brief description of the contents of these sub-menus, and their submenus:
STACK: Functions for manipulating elements of the RPN stack
MEM:
Functions related to memory manipulation
DIR:
Functions related to manipulating directories
ARITH: Functions to manipulate indices stored in variables
BRCH: Collection of sub-menus with program branching and loop functions
IF:
IF-THEN-ELSE-END construct for branching
CASE: CASE-THEN-END construct for branching

Page 21-5

START: START-NEXT-STEP construct for branching
FOR:
FOR-NEXT-STEP construct for loops
DO:
DO-UNTIL-END construct for loops
WHILE: WHILE-REPEAT-END construct for loops
TEST:
Comparison operators, logical operators, flag testing functions
TYPE:
Functions for converting object types, splitting objects, etc.
LIST:
Functions related to list manipulation
ELEM:
Functions for manipulating elements of a list
PROC: Functions for applying procedures to lists
GROB: Functions for the manipulation of graphic objects
PICT:
Functions for drawing pictures in the graphics screen
CHARS: Functions for character string manipulation
MODES: Functions for modifying calculator modes
FMT:
To change number formats, comma format
ANGLE: To change angle measure and coordinate systems
FLAG:
To set and un-set flags and check their status
KEYS:
To define and activate user-defined keys (Chapter 20)
MENU: To define and activate custom menus (Chapter 20)
MISC:
Miscellaneous mode changes (beep, clock, etc.)
IN:
Functions for program input
OUT:
Functions for program output
TIME:
Time-related functions
ALRM: Alarm manipulation
ERROR: Functions for error handling
IFERR:IFERR-THEN-ELSE-END construct for error handling
RUN:
Functions for running and debugging programs

Navigating through RPN sub-menus
Start with the keystroke combination „°, then press the appropriate softmenu key (e.g., @)@MEM@@ ). If you want to access a sub-menu within this sub-menu(e.g., @)@DIR@@ within the @)@MEM@@ sub-menu), press the corresponding key. To move
up in a sub-menu, press the L key until you find either the reference to theupper sub-menu (e.g., @)@MEM@@ within the @)@DIR@@ sub-menu) or to the PRG menu
(i.e., @)@PRG@@ ).

Page 21-6

Functions listed by sub-menu
The following is a listing of the functions within the PRG sub-menus listed by submenu.
STACK
DUP
SWAP
DROP
OVER
ROT
UNROT
ROLL
ROLLD
PICK
UNPICK
PICK3
DEPTH
DUP2
DUPN
DROP2
DROPN
DUPDU
NIP
NDUPN
MEM
PURGE
MEM
BYTES
NEWOB
ARCHI
RESTO

MEM/DIR
PURGE
RCL
STO
PATH
CRDIR
PGDIR
VARS
TVARS
ORDER

BRCH/IF
IF
THEN
ELSE
END

BRCH/WHILE TYPE
WHILE
OBJ
REPEAT
ARRY
END
LIST
STR
TEST
TAG
BRCH/CASE ==
UNIT
≠
CASE
CR
THEN
<
RC
END
>
NUM
≤
CHR
MEM/ARITH BRCH/START ≥
DTAG
STO+
START
AND
EQ
STONEXT
OR
TYPE
STOx
STEP
XOR
VTYPE
STO/
NOT
BRCH/FOR
LIST
INCR
SAME
DECR
FOR
TYPE
OBJ
SINV
NEXT
SF
LIST
SNEG
STEP
CF
SUB
SCONJ
FS?
REPL
BRCH/DO
FC?
BRCH
DO
FS?C
IFT
UNTIL
FC?C
IFTE
END
LININ

Page 21-7

LIST/ELEM
GET
GETI
PUT
PUTI
SIZE
POS
HEAD
TAIL

GROB
GROB
BLANK
GOR
GXOR
SUB
REPL
LCD
LCD
SIZE
LIST/PROC ANIMATEDOLIST
PICT
DOSUB
NSUB
PICT
ENDSUB PDIMSTREAMLINEREVLIST
TLINE
SORT
BOX
SEQ
ARC
PIXON
PIXOF
PIX?
PVIEW
PXC
CPX

CHARS
SUB
REPL
POS
SIZE
NUM
CHR
OBJ
STR
HEAD
TAIL
SREPL
MODES/FMT
STD
FIX
SCI
ENG
FM,
ML

MODES/FLAG
SF
CF
FS?
FC?
FS?C
FS?C
FC?C
STOF
RCLF
RESET
MODES/KEYSASNSTOKEYSRECLKEYS
DELKEYS

MODES/MENU
MENU
CSTMODES/ANGLE TMENU
DEG
RCLMENU
RAD
GRAD
RECT
CYLIN
SPHERE

MODES/MISC
BEEP
CLK
SYM
STK
ARG
CMD
INFO
IN
INFORMNOVALCHOOSE
INPUT
KEY
WAIT
PROMPT
OUT
PVIEW
TEXT
CLLCD
DISP
FREEZEMSGBOXBEEP

Page 21-8

TIME
DATE
DATE
TIME
TIME
TICKS

ERROR
DOERR
ERRN
ERRM
ERR0
LASTARG

TIME/ALRM
ACK
ACKALARM
STOALARM
RCLALARM
DELALARM
FINDALARMERROR/IFERR
IFERR
THEN
ELSE
END

RUN
DBUG
SST
SST↓
NEXT
HALT
KILL
OFF

Shortcuts in the PRG menu
Many of the functions listed above for the PRG menu are readily available
through other means:
Θ
Θ
Θ
Θ
Θ
Θ

Comparison operators (≠, ≤, <, ≥, >) are available in the keyboard.
Many functions and settings in the MODES sub-menu can be activatedby using the input functions provided by the H key.
Functions from the TIME sub-menu can be accessed through the
keystroke combination ‚Ó.
Functions STO and RCL (in MEM/DIR sub-menu) are available in the
keyboard through the keys K and „©.
Functions RCL and PURGE (in MEM/DIR sub-menu) are available
through the TOOL menu (I).
Within the BRCH sub-menu, pressing the left-shift key („) or the rightshift key (‚) before pressing any of the sub-menu keys, will create
constructs related to the sub-menu key chosen. This only works with thecalculator in RPN mode. Examples are shown below:

Page 21-9„ @)@IF@@„@CASE@„ @)@IF@@„@CASE@„ @)START„@)@FOR@„ @)START„@)@FOR@„ @)@@DO@@„@WHILE

Notice that the insert prompt () is available after the key word for eachconstruct so you can start typing at the right location.

Keystroke sequence for commonly used commands
The following are keystroke sequences to access commonly used commands fornumerical programming within the PRG menu. The commands are first listed bymenu:

Page 21-10@)STACK

DUP
SWAP
DROP

„°@)STACK @@DUP@@„°@)STACK @SWAP@„°@)STACK @DROP@@)@MEM@@ @)@DIR@@
PURGE
ORDER

„°@)@MEM@@ @)@DIR@@ @PURGE„°@)@MEM@@ @)@DIR@@ @ORDER@)@BRCH@ @)@IF@@
IF
THEN
ELSE
END

„°@)@BRCH@ @)@IF@@ @@@IF@@@„°@)@BRCH@ @)@IF@@ @THEN@„°@)@BRCH@ @)@IF@@ @ELSE@„°@)@BRCH@ @)@IF@@ @@@END@@@)@BRCH@ @)CASE@
CASE
THEN
END

„°@)@BRCH@ @)CASE@ @CASE@„°@)@BRCH@ @)CASE@ @THEN@„°@)@BRCH@ @)CASE@ @@END@@)@BRCH@ @)START
START
NEXT
STEP

„°@)@BRCH@ @)START @START„°@)@BRCH@ @)START @NEXT„°@)@BRCH@ @)START @STEP@)@BRCH@ @)@FOR@
FOR
NEXT
STEP

„°@)@BRCH@ @)@FOR@ @@FOR@@„°@)@BRCH@ @)@FOR@ @@NEXT@„°@)@BRCH@ @)@FOR@ @@STEP@@)@BRCH@ @)@@DO@@
DO
UNTIL
END

„°@)@BRCH@ @)@@DO@@ @@@DO@@„°@)@BRCH@ @)@@DO@@ @UNTIL„°@)@BRCH@ @)@@DO@@ @@END@@

Page 21-11@)@BRCH@ @)WHILE@
WHILE
REPEAT
END@)TEST@@)TYPE@„°@)@BRCH@ @)WHILE@ @WHILE„°)@BRCH@ @)WHILE@ @REPEA„°)@BRCH@ @)WHILE@ @@END@

==
AND
OR
XOR
NOT
SAME
SF
CF
FS?
FC?
FS?C
FC?C

„° @)TEST@ @@@≠@@@„° @)TEST@ L @@AND@„° @)TEST@ L @@@OR@@„° @)TEST@ L @@XOR@„° @)TEST@ L @@NOT@„° @)TEST@ L @SAME„° @)TEST@ L L @@@SF@@„°@)TEST@ L L @@@CF@@„° @)TEST@ L L @@FS?@„° @)TEST@ L L @@FC?@„° @)TEST@ L L @FS?C„° @)TEST@ L L @FC?C

OBJ
ARRY
LIST
STR
TAG
NUM
CHR
TYPE

„°@)TYPE@ @OBJ @„°@)TYPE@ @ ARRY„°@)TYPE@ @ LIST„°@)TYPE@ @ STR„°@)TYPE@ @ TAG„°@)TYPE@ L @NUM@„°@)TYPE@ L @CHR@„°@)TYPE@ L @TYPE@@)LIST@ @)ELEM@
GET
GETI
PUT
PUTI
SIZE
HEAD
TAIL

„°@)LIST@ @)ELEM@ @@GET@@„°@)LIST@ @)ELEM@ @GETI@„°@)LIST@ @)ELEM@ @@PUT@„°@)LIST@ @)ELEM@ @PUTI@„°@)LIST@ @)ELEM@ @SIZE@„°@)LIST@ @)ELEM@ L @HEAD@„°@)LIST@ @)ELEM@ L @TAIL@

Page 21-12@)LIST@ @)PROC@REVLIST„°@)LIST@ @)PROC@ @REVLI@SORT„°@)LIST@ @)PROC@ L @SORT@SEQ„°@)LIST@ @)PROC@ L @@SEQ@@@)MODES @)ANGLE@
DEG„°L@)MODES @)ANGLE@ @@DEG@@

RAD„°L@)MODES @)ANGLE@ @@RAD@@@)MODES @)MENU@
CST„°L@)MODES @)MENU@ @@CST@@

MENU„°L@)MODES @)MENU@ @@MENU@

BEEP„°L@)MODES @)MISC@ @@BEEP@INFORM„°L@)@@IN@@ @INFOR@

INPUT„°L@)@@IN@@ @INPUT@

MSGBOX„°L@)@OUT@ @MSGBO@

PVIEW„°L@)@OUT@ @PVIEW@

DBUG„°LL @)@RUN@ @@DBG@

SST„°LL @)@RUN@ @@SST@

SST↓„°LL @)@RUN@ @SST↓@

HALT„°LL @)@RUN@ @HALT@KILL„°LL @)@RUN@ @KILL@)@@IN@@@)@RUN@

Programs for generating lists of numbers
Please notice that the functions in the PRG menu are not the only functions thatcan be used in programming. As a matter of fact, almost all functions in thecalculator can be included in a program. Thus, you can use, for example,

Page 21-13

functions from the MTH menu. Specifically, you can use functions for list
operations such as SORT, ΣLIST, etc., available through the MTH/LIST menu.
As additional programming exercises, and to try the keystroke sequences listed
above, we present herein three programs for creating or manipulating lists. The
program names and listings are as follows:
LISC:« → n x « 1 n FOR j x NEXT n LIST » »CRLST:« → st en df « st en FOR→LIST » »j j df STEP en st - df / FLOOR 1 +CLIST:« REVLIST DUP DUP SIZE 'n' STO ΣLIST SWAP TAIL DUP SIZE 1 - 1
SWAP FOR j DUP ΣLIST SWAP TAIL NEXT 1 GET n LIST REVLIST 'n'
PURGE »The operation of these programs is as follows:(1) LISC: creates a list of n elements all equals to a constant c.
Operation: enter n, enter c, press @LISC
Example: 5 ` 6.5 ` @LISC creates the list: {6.5 6.5 6.5 6.5 6.5}
(2) CRLST: creates a list of numbers from n1 to n2 with increment Δn, i.e.,{n1, n1+Δn, n1+2⋅Δn, … n1+N⋅Δn }, where N=floor((n2-n1)/Δn)+1.
Operation: enter n1, enter n2, enter Δn, press @CRLSTExample: .5 `3.5 `.5 ` @CRLST produces: {0.5 1 1.5 2 2.5 3 3.5}
(3) CLIST: creates a list with cumulative sums of the elements, i.e., if the originallist is {x1 x2 x3 … xN}, then CLIST creates the list:
N{x1 , x1 + x2 , x1 + x2 + x3 ,..., ∑ xi }i =1Operation: place the original list in level 1, press @CLIST.
Example: {1 2 3 4 5} `@CLIST produces {1 3 6 10 15}.

Page 21-14

Examples of sequential programming
In general, a program is any sequence of calculator instructions enclosed
between the program containersand ». Subprograms can be included aspart of a program. The examples presented previously in this guide (e.g., in
Chapters 3 and 8) 6 can be classified basically into two types: (a) programs
generated by defining a function; and, (b) programs that simulate a sequenceof stack operations. These two types of programs are described next. The
general form of these programs is inputprocessoutput, therefore, we refer tothem as sequential programs.

Programs generated by defining a function
These are programs generated by using function DEFINE („à) with anargument of the form:'function_name(x1, x2, …) = expression containing variables x1, x2, …'
The program is stored in a variable called function_name. When the
program is recalled to the stack, by using ‚function_name. The programshows up as follows:«  x1, x2, … 'expression containing variables x1, x2, …'».
To evaluate the function for a set of input variables x1, x2, …, in RPN mode,
enter the variables into the stack in the appropriate order (i.e., x1 first, followedby x2, then x3, etc.), and press the soft menu key labeled function_name. The
calculator will return the value of the function function_name(x1, x2, …).
Example: Manning’s equation for wide rectangular channel.
As an example, consider the following equation that calculates the unit
discharge (discharge per unit width), q, in a wide rectangular open channel
using Manning’s equation:q=

Cu 5 / 3y0
S0nPage 21-15

where Cu is a constant that depends on the system of units used [Cu = 1.0 for
units of the International System (S.I.), and Cu = 1.486 for units of the English
System (E.S.)], n is the Manning’s resistance coefficient, which depends on thetype of channel lining and other factors, y0 is the flow depth, and S0 is thechannel bed slope given as a dimensionless fraction.
Note: Values of the Manning’s coefficient, n, are available in tables as
dimensionless numbers, typically between 0.001 to 0.5. The value of Cu isalso used without dimensions. However, care should be taken to ensure that thevalue of y0 has the proper units, i.e., m in S.I. and ft in E.S. The result for q isreturned in the proper units of the corresponding system in use, i.e., m2/s in S.I.
and ft2/s in E.S. Manning’s equation is, therefore, not dimensionally consistent.
Suppose that we want to create a function q(Cu, n, y0, S0) to calculate the unit
discharge q for this case. Use the expression‘q(Cu,n,y0,S0)=Cu/n*y0^(5./3.)*√S0’,
as the argument of function DEFINE. Notice that the exponent 5./3., in theequation, represents a ratio of real numbers due to the decimal points. PressJ, if needed, to recover the variable list. At this point there will be avariable called @@@q@@@ in your soft menu key labels. To see the contents of q, use‚@@@q@@@. The program generated by defining the function q(Cu,n,y0,S0)isshown as:« → Cu n y0 S0 ‘Cu/n*y0^(5./3.)*√S0’ ».
This is to be interpreted as “enter Cu, n, y0, S0, in that order, then calculate theexpression between quotes.” For example, to calculate q for Cu = 1.0, n =0.012, y0 = 2 m, and S0 = 0.0001, use, in RPN mode:1 ` 0.012 ` 2 ` 0.0001 ` @@@q@@@
The result is 2.6456684 (or, q = 2.6456684 m2/s).

Page 21-16

You can also separate the input data with spaces in a single stack line rather
than using `.

Programs that simulate a sequence of stack operations
In this case, the terms to be involved in the sequence of operations are assumed
to be present in the stack. The program is typed in by first opening the program
containers with ‚å. Next, the sequence of operations to be performed isentered. When all the operations have been typed in, press ` to complete
the program. If this is to be a once-only program, you can at this point, press
μ to execute the program using the input data available. If it is to be apermanent program, it needs to be stored in a variable name.
The best way to describe this type of programs is with an example:
Example: Velocity head for a rectangular channel.
Suppose that we want to calculate the velocity head, hv, in a rectangularchannel of width b, with a flow depth y, that carries a discharge Q. The
specific energy is calculated as hv = Q2/(2g(by)2), where g is the accelerationof gravity (g = 9.806 m/s2 in S.I. units or g = 32.2 ft/s2 in E.S. units). If wewere to calculate hv for Q = 23 cfs (cubic feet per second = ft3/s), b = 3 ft, andy = 2 ft, we would use: hv = 232/(2⋅32.2⋅ (3⋅2)2). Using the RPN modethecalculator, interactively, we can calculate this quantity as:2`3*„º32.2*
2*23„º™/
Resulting in 0.228174, or hv = 0.228174.
To put this calculation together as a program we need to have the input data(Q, g, b, y) in the stack in the order in which they will be used in thecalculation. In terms of the variables Q, g, b, and y, the calculation just
performed is written as (do not type the following):y ` b *„º g *2* Q „º™/

Page 21-17

As you can see, y is used first, then we use b, g, and Q, in that order.
Therefore, for the purpose of this calculation we need to enter the variables in
the inverse order, i.e., (do not type the following):
Q ` g `b `y `For the specific values under consideration we use:
23 ` 32.2 ` 3 `2 `The program itself will contain only those keystrokes (or commands) that result
from removing the input values from the interactive calculation shown earlier,i.e., removing Q, g, b, and y from (do not type the following):y ` b *„º g *2* Q „º™/
and keeping only the operations shown below (do not type the following):` *„ *2* „º™/
Note: When entering the program do not use the keystroke ™, instead use
the keystroke sequence: „°@)STACK @SWAP@.
Unlike the interactive use of the calculator performed earlier, we need to dosome swapping of stack levels 1 and 2 within the program. To write theprogram, we use, therefore:
‚å
*
„º
*
2*
„°@)STACK @SWAP@„º„°@)STACK @SWAP@/`

Opens program symbols
Multiply y with b
Square (b⋅y)
Multiply (b⋅y)2 times gEnter a 2 and multiply it with g⋅ (b⋅y)2Swap Q with 2⋅g⋅ (b⋅y)2
Square Q
Swap 2⋅g⋅ (b⋅y)2 with Q2Divide Q2 by 2⋅g⋅ (b⋅y)2Enter the program

The resulting program looks like this:« * SQ * 2 * SWAP SQ SWAP / »Page 21-18

Note: SQ is the function that results from the keystroke sequence „º.
Save the program into a variable called hv:³~„h~„v K
A new variable @@@hv@@@ should be available in your soft key menu. (Press J to
see your variable list.) The program left in the stack can be evaluated by using
function EVAL. The result should be 0.228174…, as before. Also, the program
is available for future use in variable @@@hv@@@. For example, for Q = 0.5 m3/s, g= 9.806 m/s2, b = 1.5 m, and y = 0.5 m, use:
0.5 # 9.806 #1.5 # 0.5 @@@hv@@@
Note: #is used here as an alternative to ` for input data entry.
The result now is 2.26618623518E-2, i.e., hv = 2.26618623518×10-2 m.
Note: Since the equation programmed in @@@hv@@@ is dimensionally consistent,
we can use units in the input.
As mentioned earlier, the two types of programs presented in this section aresequential programs, in the sense that the program flow follows a single path,i.e., INPUT OPERATION OUTPUT. Branching of the program flow ispossible by using the commands in the menu „°@)@BRCH@ . More detail on
program branching is presented below.

Interactive input in programs
In the sequential program examples shown in the previous section it is notalways clear to the user the order in which the variables must be placed in thestack before program execution. For the case of the program @@@q@@@, written as« → Cu n y0 S0 ‘Cu/n*y0^(5/3)*√S0’ »,Page 21-19

it is always possible to recall the program definition into the stack (‚@@@q@@@) to
see the order in which the variables must be entered, namely, → Cu n y0 S0.
However, for the case of the program @@hv@@, its definition« * SQ * 2 * SWAP SQ SWAP / »does not provide a clue of the order in which the data must be entered, unless,of course, you are extremely experienced with RPN and the User RPL language.
One way to check the result of the program as a formula is to enter symbolic
variables, instead of numeric results, in the stack, and let the program operateon those variables. For this approach to be effective the calculator’s CAS(Calculator Algebraic System) must be set to symbolic and exact modes. Thisis accomplished by using H@)CAS@, and ensuring that the check marks in thePress @@OK@@ @@OK@ to return tooptions _Numeric and _Approx are removed.
normal calculator display. Press J to display your variables menu.
We will use this latter approach to check what formula results from using the
program @@hv@@ as follows: We know that there are four inputs to the program,thus, we use the symbolic variables S4, S3, S2, and S1 to indicate the stacklevels at input:~s4` ~s3`

~s2`

~s1`

Next, press @@hv@@. The resulting formula may look like this‘SQ(S4)/(S3*SQ(S2*S1)*2)’,

if your display is not set to textbook style, or like this,SQ ( S 4)
S 3 ⋅ SQ( S 2 ⋅ S1) ⋅ 2
if textbook style is selected. Since we know that the function SQ( ) stands for x2,
we interpret the latter result asPage 21-20

S 42,
2 ⋅ S 3 ⋅ ( S 2 ⋅ S1) 2
which indicates the position of the different stack input levels in the formula. By
comparing this result with the original formula that we programmed, i.e.,

hv =

Q2
,
2 g (by ) 2

we find that we must enter y in stack level 1 (S1), b in stack level 2 (S2), g instack level 3 (S3), and Q in stack level 4 (S4).

Prompt with an input string
These two approaches for identifying the order of the input data are not very
efficient. You can, however, help the user identify the variables to be used byprompting him or her with the name of the variables. From the various methods
provided by the User RPL language, the simplest is to use an input string and thefunction INPUT („°L@)@@IN@@ @INPUT@) to load your input data.
The following program prompts the user for the value of a variable a and places
the input in stack level 1:« “Enter a: “ {“:a: “ {2 0} V } INPUT OBJ→ »This program includes the symbol :: (tag) and  (return), available through the
keystroke combinations „ê and ‚ë, both associated with the .
key. The tag symbol (::) is used to label strings for input and output. The returnsymbol () is similar to a carriage return in a computer. The strings between
quotes (“ “) are typed directly from the alphanumeric keyboard.
Save the program in a variable called INPTa (for INPuT a).
Try running the program by pressing the soft menu key labeled @INPTa.

Page 21-21

The result is a stack prompting the user for the value of a and placing the cursor
right in front of the prompt :a: Enter a value for a, say 35, then press `.
The result is the input string :a:35 in stack level 1.

A function with an input string
If you were to use this piece of code to calculate the function, f(a) = 2*a^2+3,
you could modify the program to read as follows:« “Enter a: “ {“:a: “ {2 0} V }INPUT OBJ→ → a « ‘2*a^2+3‘ » »Save this new program under the name ‘FUNCa’ (FUNCtion of a):
Run the program by pressing @FUNCa. When prompted to enter the value of aenter, for example, 2, and press `. The result is simply the algebraic 2a2+3,
which is an incorrect result. The calculator provides functions for debugging
programs to identify logical errors during program execution as shown below.
Debugging the program
To figure out why it did not work we use the DBUG function in the calculator as
follows:³@FUNCa `Copies program name to stack level 1„°LL @)@RUN@ @@DBG@
Starts debugger
Step-by-step debugging, result: “Enter a:”@SST↓@
Result: {“  a:” {2 0} V}@SST↓@
Result: user is prompted to enter value of a
@SST↓@
2`Enter a value of 2 for a. Result: “:a:2”
Result: a:2@SST↓@

Page 21-22

@SST↓@
Result: empty stack, executing →aResult: empty stack, entering subprogram «@SST↓@@SST↓@
Result: ‘2*a^2+3’
Result: ‘2*a^2+3’, leaving subprogram »@SST↓@
Result: ‘2*a^2+3’, leaving main program»@SST↓@
Further pressing the @SST↓@ soft menu key produces no more output since wehave gone through the entire program, step by step. This run through the
debugger did not provide any information on why the program is not
calculating the value of 2a2+3 for a = 2. To see what is the value of a in the
sub-program, we need to run the debugger again and evaluate a within the
sub-program. Try the following:J³@FUNCa `„°LL @)@RUN@ @@DBG@@SST↓@@SST↓@@SST↓@
2`@SST↓@@SST↓@@SST↓@

Recovers variables menu
Copies program name to stack level 1
Starts debugger
Step-by-step debugging, result: “Enter a:”
Result: {“ a:” {2 0} V}
Result: user is prompted to enter value of aEnter a value of 2 for a. Result: “:a:2”
Result: a:2
Result: empty stack, executing →aResult: empty stack, entering subprogram «At this point we are within the subprogram « ‘2*a^2+3’ » which uses the local
variable a. To see the value of a use:~„aμThis indeed shows that the local variable a = 2

Let’s kill the debugger at this point since we already know the result we will get.
To kill the debugger press @KILL. You receive an <!> Interrupted message
acknowledging killing the debugger. Press $to recover normal calculator
display.
Note: In debugging mode, every time we press @SST↓@ the top left corner of thedisplay shows the program step being executed. A soft key function called@@SST@ is also available under the @)RUN sub-menu within the PRG menu. This canbe used to execute at once any sub-program called from within a main
program. Examples of the application of @@SST@ will be shown later.

Page 21-23

Fixing the program
The only possible explanation for the failure of the program to produce a
numerical result seems to be the lack of the command NUM after the
algebraic expression ‘2*a^2+3’. Let’s edit the program by adding the missing
EVAL function. The program, after editing, should read as follows:«“Enter a: “ {“:a: “ {2 0} V } INPUT
OBJ→ → a « ‘2*a^2+3‘ NUM » »Store it again in variable FUNCa, and run the program again with a = 2. Thistime, the result is 11, i.e., 2*22+3 = 11.

Input string for two or three input values
In this section we will create a sub-directory, within the directory HOME, to holdexamples of input strings for one, two, and three input data values. These will
be generic input strings that can be incorporated in any future program, taking
care of changing the variable names according to the needs of each program.
Let’s get started by creating a sub-directory called PTRICKS (Programming
TRICKS) to hold programming tidbits that we can later borrow from to use in
more complex programming exercises. To create the sub-directory, first makesure that you move to the HOME directory. Within the HOME directory, use thefollowing keystrokes to create the sub-directory PTRICKS:³~~ptricks`

Enter directory name ‘PTRICKS’„°@)@MEM@@ @)@DIR@@ @CRDIR

Create directory

J

Recover variable listing

A program may have more than 3 input data values. When using input strings
we want to limit the number of input data values to 5 at a time for the simple
reason that, in general, we have visible only 7 stack levels. If we use stack level
7 to give a title to the input string, and leave stack level 6 empty to facilitate
reading the display, we have only stack levels 1 through 5 to define input
variables.

Page 21-24

Input string program for two input values
The input string program for two input values, say a and b, looks as follows:« “Enter a and b: “ {“:a::b: “ {2 0} V } INPUT OBJ→ »This program can be easily created by modifying the contents of INPTa. Store
this program into variable INPT2.
Application: evaluating a function of two variables
Consider the ideal gas law, pV = nRT, where p = gas pressure (Pa), V = gas
volume(m3), n = number of moles (gmol), R = universal gas constant =8.31451_J/(gmol*K), and T = absolute temperature (K).
We can define the pressure p as a function of two variables, V and T, as p(V,T)= nRT/V for a given mass of gas since n will also remain constant. Assume
that n = 0.2 gmol, then the function to program isp (V , T ) = 8.31451 ⋅ 0.2 ⋅TJ T= (1.662902 _ ) ⋅V
K V

We can define the function by typing the following program« → V T ‘(1.662902_J/K)*(T/V)’ »and storing it into variable @@@p@@@.
The next step is to add the input string that will prompt the user for the values of
V and T. To create this input stream, modify the program in @@@p@@@ to read:«“Enter V and T: “ {“

:V:

:T: “ {2 0} V }INPUT OBJ→ → V T ‘(1.662902_J/K)*(T/V)’»

Store the new program back into variable @@@p@@@. Press @@@p@@@ to run the program.
Enter values of V = 0.01_m^3 and T = 300_K in the input string, then press

Page 21-25

`. The result is 49887.06_J/m^3. The units of J/m^3 are equivalent toPascals (Pa), the preferred pressure unit in the S.I. system.

Note: because we deliberately included units in the function definition, theinput values must have units attach to them in input to produce the proper result.
Input string program for three input values
The input string program for three input values, say a ,b, and c, looks asfollows:« “Enter a, b and c: “ {“ :a: :b: :c: “ {2 0} V } INPUT
OBJ→ »
This program can be easily created by modifying the contents of INPT2 to makeit look like shown immediately above. The resulting program can then be stored
in a variable called INPT3. With this program we complete the collection of
input string programs that will allow us to enter one, two, or three data values.
Keep these programs as a reference and copy and modify them to fulfill therequirements of new programs you write.

Application: evaluating a function of three variables
Suppose that we want to program the ideal gas law including the number ofmoles, n, as an additional variable, i.e., we want to define the functionp(V , T , n) = (8.31451 _J n ⋅T),
K V

and modify it to include the three-variable input string. The procedure to put
together this function is very similar to that used earlier in defining the functionp(V,T). The resulting program will look like this:«“Enter V, T, and n:“ {“  :V: :T: :n:“ {2 0} V } INPUT

OBJ→ → V T n‘(8.31451_J/(K*mol))*(n*T/V) ‘ »Store this result back into the variable @@@p@@@.To run the program, press @@@p@@@.

Page 21-26

Enter values of V = 0.01_m^3, T = 300_K, and n = 0.8_mol. Before pressing`, the stack will look like this:Press ` to get the result 199548.24_J/m^3, or 199548.24_Pa = 199.55
kPa.

Input through input forms
Function INFORM („°L@)@@IN@@ @INFOR@.) can be used to create detailed
input forms for a program. Function INFORM requires five arguments, in thisorder:
1. A title: a character string describing the input form
2. Field definitions: a list with one or more field definitions {s1 s2 … sn},where each field definition, si, can have one of two formats:a. A simple field label: a character stringb. A list of specifications of the form {“label” “helpInfo” type0
type1 … typen}. The “label” is a field label. The “helpInfo” isa character string describing the field label in detail, and thetype specifications is a list of types of variables allowed for thefield (see Chapter 24 for object types).
3. Field format information: a single number col or a list {col tabs}. In thisspecification, col is the number of columns in the input box, and tabs
(optional) specifies the number of tab stops between the labels and thefields in the form. The list could be an empty list. Default values are col= 1 and tabs = 3.

4. List of reset values: a list containing the values to reset the different
fields if the option @RESET is selected while using the input form.

5. List of initial values: a list containing the initial values of the fields.

Page 21-27

The lists in items 4 and 5 can be empty lists. Also, if no value is to be
selected for these options you can use the NOVAL command(„°L@)@@IN@@ @NOVAL@).
After function INFORM is activated you will get as a result either a zero, in casethe @CANCEL option is entered, or a list with the values entered in the fields in theorder specified and the number 1, i.e., in the RPN stack:2:
1:{v1 v2 … vn}
1

Thus, if the value in stack level 1 is zero, no input was performed, while it thisvalue is 1, the input values are available in stack level 2.
Example 1 - As an example, consider the following program, INFP1 (INput
Form Program 1) to calculate the discharge Q in an open channel throughChezy’s formula: Q = C⋅(R⋅S)1/2, where C is the Chezy coefficient, a functionof the channel surface’s roughness (typical values 80-150), R is the hydraulicradius of the channel (a length), and S is the channel bed’s slope (adimensionless numbers, typically 0.01 to 0.000001). The following program
defines an input form through function INFORM:« “ CHEZY’S EQN” { { “C:” “Chezy’s coefficient” 0} { “R:”
“Hydraulic radius” 0 } { “S:” “Channel bed slope” 0} } { } { 120
1 .0001} { 110 1.5 .00001 } INFORM »In the program we can identify the 5 components of the input as follows:
1. Title: “ CHEZY’S EQN”
2. Field definitions: there are three of them, with labels “C:”, “R:”, “S:”,info strings “Chezy coefficient”, “Hydraulic radius”, “Channel bed
slope”, and accepting only data type 0 (real numbers) for all of thethree fields:{ { “C:” “Chezy’s coefficient” 0} { “R:” “Hydraulicradius” 0 } { “S:” “Channel bed slope” 0} }Page 21-28

3. Field format information: { } (an empty list, thus, default values used)
4. List of reset values: { 120 1 .0001}
5. List of initial values: { 110 1.5 .00001}
Save the program into variable INFP1. Press @INFP1 to run the program. The
input form, with initial values loaded, is as follows:

To see the effect of resetting these values use L @RESET (select Reset all to reset
field values):

Now, enter different values for the three fields, say, C = 95, R = 2.5, and S =0.003, pressing @@@OK@@@ after entering each of these new values. After thesesubstitutions the input form will look like this:Now, to enter these values into the program press @@@OK@@@ once more. This
activates the function INFORM producing the following results in the stack:Page 21-29

Thus, we demonstrated the use of function INFORM. To see how to use these
input values in a calculation modify the program as follows:« “ CHEZY’S EQN” { { “C:” “Chezy’s coefficient” 0} { “R:”
“Hydraulic radius” 0 } { “S:” “Channel bed slope” 0} } { } { 120
1 .0001} { 110 1.5 .00001 } INFORM IF THEN OBJ DROP  C R S‘C*(R*S)’ NUM “Q” TAG ELSE “Operation cancelled” MSGBOXEND »The program steps shown above after the INFORM command include a
decision branching using the IF-THEN-ELSE-END construct (described in detailelsewhere in this Chapter). The program control can be sent to one of two
possibilities depending on the value in stack level 1. If this value is 1 thecontrol is passed to the commands:
OBJ DROP  C R S ‘C*√(R*S)’ NUM “Q” TAG
These commands will calculate the value of Q and put a tag (or label) to it. On
the other hand, if the value in stack level 1 is 0 (which happens when a @CANCEL
is entered while using the input box) , the program control is passed to thecommands:“Operation cancelled” MSGBOX
These commands will produce a message box indicating that the operation wascancelled.
Note: Function MSGBOX belongs to the collection of output functions under
the PRG/OUT sub-menu.

Commands IF, THEN, ELSE, END are available

under the PRG/BRCH/IF sub-menu. Functions OBJ, TAG are available
under the PRG/TYPE sub-menu. Function DROP is available under the PRG/
STACK menu. Functions  and NUM are available in the keyboard.
Example 2 – To illustrate the use of item 3 (Field format information) in thearguments of function INFORM, change the empty list used in program INFP1
to { 2 1 }, meaning 2, rather than the default 3, columns, and only one tab stop
between labels and values. Store this new program in variable INFP2:

Page 21-30

« “ CHEZY’S EQN” { { “C:” “Chezy’s coefficient” 0} { “R:”
“Hydraulic radius” 0 } { “S:” “Channel bed slope” 0} } {2 1 } { 120 1 .0001} { 110 1.5 .00001 } INFORM IF THEN
OBJ DROP  C R S ‘C*(R*S)’ NUM “Q” TAG ELSE

“Operation cancelled” MSGBOX END »Running program @INFP2 produces the following input form:

Example 3 – Change the field format information list to { 3 0 } and save themodified program into variable INFP3. Run this program to see the new input
form:

Creating a choose box
Function CHOOSE („°L@)@@IN@@ @CHOOS@) allows the user to create achoose box in a program. This function requires three arguments:
1. A prompt (a character string describing the choose box)
2. A list of choice definitions {c1 c2 … cn}. A choice definition ci can haveany of two formats:a. An object, e.g., a number, algebraic, etc., that will be
displayed in the choose box and will also be the result of the
choice.
b. A list {object_displayed object_result} so that object_displayed
is listed in the choose box, and object_result is selected as theresult if this choice is selected.
3. A number indicating the position in the list of choice definitions of thedefault choice. If this number is 0, no default choice is highlighted.

Page 21-31

Activation of the CHOOSE function will return either a zero, if a @CANCEL action
is used, or, if a choice is made, the choice selected (e.g., v) and the number 1,
i.e., in the RPN stack:
2:
1:

v
1

Example 1 – Manning’s equation for calculating the velocity in an open
channel flow includes a coefficient, Cu, which depends on the system of units
used. If using the S.I. (Systeme International), Cu = 1.0, while if using the E.S.
(English System), Cu = 1.486. The following program uses a choose box to let
the user select the value of Cu by selecting the system of units. Save it into
variable CHP1 (CHoose Program 1):«“Units coefficient” { { “S.I. units” 1}{ “E.S. units” 1.486}} 1 CHOOSE »Running this program (press @CHP1) shows the following choose box:

Depending on whether you select S.I. units or E.S. units, function
CHOOSE places either a value of 1 or a value of 1.486 in stack level 2 and a
1 in level 1. If you cancel the choose box, CHOICE returns a zero (0).
The values returned by function CHOOSE can be operated upon by otherprogram commands as shown in the modified program CHP2:« “Units coefficient” { { “S.I. units” 1} { “E.S. units”
1.486}} 1 CHOOSE IF THEN “Cu” TAG ELSE “Operation

cancelled” MSGBOX END »The commands after the CHOOSE function in this new program indicate adecision based on the value of stack level 1 through the IF-THEN-ELSE-END
construct. If the value in stack level 1 is 1, the commands “Cu” TAG willproduced a tagged result in the screen. If the value in stack level 1 is zero, thePage 21-32

commands “Operation cancelled” MSGBOX will show a message box
indicating that the operation was cancelled.

Identifying output in programs
The simplest way to identify numerical program output is to “tag” the program
results. A tag is simply a string attached to a number, or to any object. The
string will be the name associated with the object. For example, earlier on,
when debugging programs INPTa (or INPT1) and INPT2, we obtained as
results tagged numerical output such as :a:35.

Tagging a numerical result
To tag a numerical result you need to place the number in stack level 2 and thetagging string in stack level 2, then use the →TAG function („ ° @)TYPE@ @TAG) For example, to produce the tagged result B:5., use:5`‚Õ~b„ ° @)TYPE@ @ TAG

Decomposing a tagged numerical result into a number and a tag
To decompose a tagged result into its numerical value and its tag, simply use
function OBJ („°@)TYPE@ @OBJ @). The result of decomposing a tagged
number with →OBJ is to place the numerical value in stack level 2 and the tagin stack level 1. If you are interested in using the numerical value only, then
you will drop the tag by using the backspace key ƒ. For example,
decomposing the tagged quantity B:5 (see above), will produce:“De-tagging” a tagged quantity“De-tagging” means to extract the object out of a tagged quantity. Thisfunction is accessed through the keystroke combination: „ ° @)TYPE@ L@DTAG. For example, given the tagged quantity a:2, DTAG returns thenumerical value 2.

Page 21-33

Note: For mathematical operations with tagged quantities, the calculator will"detag" the quantity automatically before the operation. For example, the lefthand side figure below shows two tagged quantities before and after pressing
the * key in RPN mode:

Examples of tagged output
Example 1 – tagging output from function FUNCa
Let’s modify the function FUNCa, defined earlier, to produce a tagged output.
Use ‚ @FUNCa to recall the contents of FUNCa to the stack. The originalfunction program reads«“Enter a: “ {“:a: “ {2 0} V } INPUT OBJ→ → a « ‘2*a^2+3‘
NUM » »Modify it to read:« “Enter a: “ {“:a: “ {2 0} V } INPUT OBJ→ → a « ‘2*a^2+3‘
NUM ”F” →TAG » »Store the program back into FUNCa by using „ @FUNCa. Next, run the
program by pressing @FUNCa. Enter a value of 2 when prompted, and press`. The result is now the tagged result F:11.
Example 2 – tagging input and output from function FUNCa
In this example we modify the program FUNCa so that the output includes not
only the evaluated function, but also a copy of the input with a tag.
Use ‚ @FUNCa to recall the contents of FUNCa to the stack:«“Enter a: “ {“:a: “ {2 0} V } INPUT OBJ→ → a « ‘2*a^2+3‘
NUM ”F” →TAG » »Modify it to read:Page 21-34

«“Enter a: “ {“:a: “ {2 0} V } INPUT OBJ→ → a « ‘2*a^2+3‘
EVAL ”F” →TAG a SWAP» »(Recall that the function SWAP is available by using „°@)STACK @SWAP@).
Store the program back into FUNCa by using „ @FUNCa. Next, run the
program by pressing @FUNCa . Enter a value of 2 when prompted, and press`. The result is now two tagged numbers a:2. in stack level 2, and F:11.
in stack level 1.
Note: Because we use an input string to get the input data value, the local
variable a actually stores a tagged value ( :a:2, in the example above).
Therefore, we do not need to tag it in the output. All what we need to do isplace an a before the SWAP function in the subprogram above, and thetagged input is placed in the stack. It should be pointed out that, in
performing the calculation of the function, the tag of the tagged input a isdropped automatically, and only its numerical value is used in the calculation.
To see the operation of the function FUNCa, step by step, you could use the
DBUG function as follows:³ @FUNCa `„°LL @)@RUN@ @@DBG@@SST↓@@SST↓@@SST↓@
2`@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@

Copies program name to stack level 1
Starts debugger
Step-by-step debugging, result: “Enter a:”
Result: {“ a:” {2 0} V}
Result: user is prompted to enter value of aEnter a value of 2 for a. Result: “:a:2”
Result: a:2
Result: empty stack, executing →aResult: empty stack, entering subprogram «Result: ‘2*a^2+3’
Result: empty stack, calculating
Result: 11.,
Result: “F”
Result: F: 11.
Result: a:2.
Result: swap levels 1 and 2leaving subprogram »leaving main program »Page 21-35

Example 3 – tagging input and output from function p(V,T)
In this example we modify the program @@@p@@@ so that the output tagged input
values and tagged result. Use ‚@@@p@@@ to recall the contents of the program tothe stack:« “EnterV, T, and n:“ {“  :V: :T: :n:“ {2 0} V } INPUT

OBJ→ → V T n‘(8.31451_J/(K*mol))*(n*T/V)‘ »Modify it to read:« “EnterV, T and n: “ {“ :V: :T: :n:“{2 0} V } INPUT

OBJ→ → V T n « V T n ‘(8.31451_J/(K*mol))*(n*T/V)‘ EVAL “p”→TAG » »Note: Notice that we have placed the calculation and tagging of the functionp(V,T,n), preceded by a recall of the input variables V T n, into a sub-program[the sequence of instructions contained within the inner set of program symbols« » ]. This is necessary because without the program symbol separating thetwo listings of input variables (V T N « V T n), the program will assume thatthe input command→V T N V T nrequires six input values, while only three are available. The result would havebeen the generation of an error message and the interruption of the program
execution.
To include the subprogram mentioned above in the modified definition ofprogram @@@p@@@, will require you to use ‚å at the beginning and end of the
sub-program. Because the program symbols occur in pairs, whenever ‚å
is invoked, you will need to erase the closing program symbol (») at the
beginning, and the opening program symbol («) at the end, of the sub-program.

To erase any character while editing the program, place the cursor to the rightof the character to be erased and use the backspace key ƒ.

Page 21-36

Store the program back into variable p by using „@@@p@@@. Next, run the
program by pressing @@@p@@@. Enter values of V = 0.01_m^3, T = 300_K, and n =0.8_mol, when prompted. Before pressing ` for input, the stack will look likethis:

After execution of the program, the stack will look like this:In summary: The common thread in the three examples shown here is theuse of tags to identify input and output variables. If we use an input string to
get our input values, those values are already pre-tagged and can be easily
recall into the stack for output.

Use of the →TAG command allows us to

identify the output from a program.

Using a message box
A message box is a fancier way to present output from a program. The
message box command in the calculator is obtained by using„°L@)@OUT@ @MSGBO@. The message box command requires that the output
string to be placed in the box be available in stack level 1. To see theoperation of the MSGBOX command try the following exercise:‚Õ~‚t~„ê1.2‚Ý ~„r~„a~„d„°L@)@OUT@ @MSGBO@

Page 21-37

The result is the following message box:

Press @@@OK@@@ to cancel the message box.
You could use a message box for output from a program by using a tagged
output, converted to a string, as the output string for MSGBOX. To convert any
tagged result, or any algebraic or non-tagged value, to a string, use thefunction →STR available at „°@)TYPE@ @ STR.
Using a message box for program output
The function @@@p@@@ , from the last example, can be modified to read:«“Enter V, T and n: “ {“ :V: :T: :n: “ {2 0} V } INPUT

OBJ→ → V T n « V T n ‘(8.31451_J/(K*mol))*(n*T/V)‘ EVAL “p”→TAG →STR MSGBOX » »Store the program back into variable p by using „@@@p@@@. Run the program bypressing @@@p@@@. Enter values of V = 0.01_m^3, T = 300_K, and n = 0.8_mol,when prompted.
As in the earlier version of @@@p@@@, before pressing ` for input, the stack will
look like this:The first program output is a message box containing the string:

Page 21-38

Press @@@OK@@@ to cancel message box output. The stack will now look like this:Including input and output in a message box
We could modify the program so that not only the output, but also the input, is
included in a message box. For the case of program @@@p@@@, the modified
program will look like:«“Enter V, T and n: “ {“OBJ→ → V T n « V →STR “

:V:

:T:

:n: “ {2 0} V } INPUT” + T →STR “” + n →STR “”+‘(8.31451_J/(K*mol))*(n*T/V)‘ EVAL “p” →TAG →STR + + +MSGBOX » »Notice that you need to add the following piece of code after each of thevariable names V, T, and n, within the sub-program:→STR “”+To get this piece of code typed in the first time use:„°@)TYPE@ @ STR ‚Õ ‚ë ™+
Because the functions for the TYPE menu remain available in the soft menu keys,
for the second and third occurrences of the piece of code (→STR “ ” + )within the sub-program (i.e., after variables T and n, respectively), all you need
to use is:@ STR ‚Õ ‚ë ™+

Page 21-39

You will notice that after typing the keystroke sequence ‚ë a new line is
generated in the stack.
The last modification that needs to be included is to type in the plus sign threetimes after the call to the function at the very end of the sub-program.
Note: The plus sign (+) in this program is used to concatenate strings.
Concatenation is simply the operation of joining individual character strings.
To see the program operating:ΘΘΘStore the program back into variable p by using „@@@p@@@.
Run the program by pressing @@@p@@@.
Enter values of V = 0.01_m^3, T = 300_K, and n = 0.8_mol, when
prompted.

As in the earlier version of [ p ], before pressing [ENTER] for input, the stack
will look like this:The first program output is a message box containing the string:

Press @@@OK@@@ to cancel message box output.

Page 21-40

Incorporating units within a program
As you have been able to observe from all the examples for the different
versions of program @@@p@@@ presented in this chapter, attaching units to input
values may be a tedious process. You could have the program itself attach
those units to the input and output values. We will illustrate these options bymodifying yet once more the program @@@p@@@, as follows.
Recall the contents of program @@@p@@@ to the stack by using ‚@@@p@@@, and modify
them to look like this:Note: I’ve separated the program arbitrarily into several lines for easy
reading. This is not necessarily the way that the program shows up in thecalculator’s stack. The sequence of commands is correct, however. Also,
recall that the character  does not show in the stack, instead it produces a
new line.
« “Enter V,T,n [S.I.]: “ {“

:V:

:T:

:n: “ {2 0} V }INPUT OBJ→ → V T n« V ‘1_m^3’ *T ‘1_K’ *n ‘1_mol’ * → V T n« V “V” →TAG →STR “ ” + T “T” →TAG →STR “ ” + n “n” →TAG
→STR “”+‘(8.31451_J/(K*mol))*(n*T/V)‘ EVAL “p” →TAG →STR + + +MSGBOX » » »This new version of the program includes an additional level of subprogramming (i.e., a third level of program symbols « », and some steps using
lists, i.e.,V ‘1_m^3’ * { } + T ‘1_K’ * + n ‘1_mol’ * + EVAL → V T n
The interpretation of this piece of code is as follows. (We use input string values
of :V:0.01, :T:300, and :n:0.8):
1. V: The value of V, as a tagged input (e.g., V:0.01) is
placed in the stack.

Page 21-41

2. ‘1_m^3’: The S.I. units corresponding to V are then placed instack level 1, the tagged input for V is moved tostack level 2.

3. *: By multiplying the contents of stack levels 1 and 2,
we generate a number with units (e.g., 0.01_m^3),
but the tag is lost.

4. T ‘1_K’ *:Calculating value of T including S.I. units

5. n ‘1_mol’ *: Calculating value of n including units

6. → V T n: The values of V, T, and n, located respectively in stacklevels 3, 2, and 1, are passed on to the next level of
sub-programming.

To see this version of the program in action do the following:ΘΘΘStore the program back into variable p by using [][ p ].
Run the program by pressing [ p ].
Enter values of V = 0.01, T = 300, and n = 0.8, when prompted (no units
required now).

Before pressing ` for input, the stack will look like this:Press ` to run the program. The output is a message box containing thestring:Page 21-42

Press @@@OK@@@ to cancel message box output.
Message box output without units
Let’s modify the program @@@p@@@ once more to eliminate the use of units
throughout it. The unit-less program will look like this:«“Enter V,T,n [S.I.]: “ {“

:V:

:T:

:n: “ {2 0} V }INPUT OBJ→ → V T n
« V

DTAG

« “V=”“

T DTAGn DTAG → V T n

V →STR + “”+ “T=” T →STR + “

” + “n=”n →STR +”+‘8.31451*n*T/V‘ EVAL →STR “p=” SWAP + + + + MSGBOX » » »And when run with the input data V = 0.01, T = 300, and n = 0.8, produces
the message box output:

Press @@@OK@@@ to cancel the message box output.

Relational and logical operators
So far we have worked mainly with sequential programs. The User RPL
language provides statements that allow branching and looping of the program
flow. Many of these make decisions based on whether a logical statement istrue or not. In this section we present some of the elements used to construct
such logical statements, namely, relational and logical operators.

Relational operators
Relational operators are those operators used to compare the relative positionof two objects. For example, dealing with real numbers only, relational

Page 21-43

operators are used to make a statement regarding the relative position of two or
more real numbers. Depending on the actual numbers used, such a statement
can be true (represented by the numerical value of 1. in the calculator), or false(represented by the numerical value of 0. in the calculator).
The relational operators available for programming the calculator are:____________________________________________________
Operator

Meaning

Example____________________________________________________
ːːʳ“is equal to”‘x==2’≠“is not equal to”‘3 ≠ 2’ˏ“is less than”

‘m<n’

>

“is greater than”‘10>a’≥“is greater than or equal to”‘p ≥ q’≤“is less than or equal to”‘7≤12’_____________________________________________________All of the operators, except == (which can be created by typing ‚Å‚Å ), are available in the keyboard. They are also available in „°@)TEST@.
Two numbers, variables, or algebraics connected by a relational operator forma logical expression that can take value of true (1.), false (0.), or could simply
not be evaluated. To determine whether a logical statement is true or not,place the statement in stack level 1, and press EVAL (μ). Examples:‘2<10’ μ, result: 1. (true)‘2>10’ μ, result: 0. (false)
In the next example it is assumed that the variable m is not initialized (it has notbeen given a numerical value):‘2==m’ μ, result: ‘2==m’
The fact that the result from evaluating the statement is the same originalstatement indicates that the statement cannot be evaluated uniquely.

Page 21-44

Logical operators
Logical operators are logical particles that are used to join or modify simple
logical statements. The logical operators available in the calculator can beeasily accessed through the keystroke sequence: „° @)TEST@ L.
The available logical operators are: AND, OR, XOR (exclusive or), NOT, andSAME. The operators will produce results that are true or false, depending on
the truth-value of the logical statements affected. The operator NOT (negation)
applies to a single logical statements. All of the others apply to two logicalstatements.
Tabulating all possible combinations of one or two statements together with theresulting value of applying a certain logical operator produces what is called
the truth table of the operator. The following are truth tables of each of thestandard logical operators available in the calculator:

p
1
0

NOT p
0
1

p
1
1
0
0

q
1
0
1
0

p AND q
1
0
0
0

p
1
1
0
0

q
1
0
1
0

p OR q1
1
1
0

Page 21-45

p
1
1
0
0

q
1
0
1
0

p XOR q0
1
1
0

The calculator includes also the logical operator SAME. This is a non-standard
logical operator used to determine if two objects are identical. If they are
identical, a value of 1 (true) is returned, if not, a value of 0 (false) is returned.
For example, the following exercise, in RPN mode, returns a value of 0:‘SQ(2)’ ` 4 ` SAME
Please notice that the use of SAME implies a very strict interpretation of theword “identical.” For that reason, SQ(2) is not identical to 4, although theyboth evaluate, numerically, to 4.

Program branching
Branching of a program flow implies that the program makes a decision among
two or more possible flow paths. The User RPL language provides a number ofcommands that can be used for program branching. The menus containing
these commands are accessed through the keystroke sequence:„°@)@BRCH@
This menu shows sub-menus for the program constructs

The program constructs IF…THEN..ELSE…END, and CASE…THEN…END will
be referred to as program branching constructs. The remaining constructs,
namely, START, FOR, DO, and WHILE, are appropriate for controlling repetitive
processing within a program and will be referred to as program loop
constructs. The latter types of program constructs are presented in more detailin a later section.

Page 21-46

Branching with IF
In this section we presents examples using the constructs IF…THEN…END and
IF…THEN…ELSE…END.

The IF…THEN…END construct
The IF…THEN…END is the simplest of the IF program constructs. The generalformat of this construct is:
IF logical_statement THEN program_statements END.
The operation of this construct is as follows:
1. Evaluate logical_statement.
2. If logical_statement is true, perform program _statements and continue
program flow after the END statement.
3. If logical_statement is false, skip program_statements and continue
program flow after the END statement.
To type in the particles IF, THEN, ELSE, and END, use:„°@)@BRCH@ @)@IF@@
The functions @@@IF@@ @@THEN @@ELSE@ @@ END@@ are available in that menu to be typed
selectively by the user. Alternatively, to produce an IF…THEN…END constructdirectly on the stack, use:„°@)@BRCH@ „ @)@IF@@
This will create the following input in the stack:Page 21-47

With the cursor  in front of the IF statement prompting the user for the logicalstatement that will activate the IF construct when the program is executed.
Example: Type in the following program:«→ x«

IF ‘x<3’ THEN ‘x^2‘ EVAL END ”Done” MSGBOX » »and save it under the name ‘f1’. Press J and verify that variable @@@f1@@@ isindeed available in your variable menu. Verify the following results:0@@@f1@@@ Result: 0

1.2 @@@f1@@@ Result: 1.44

3.5 @@@f1@@@ Result: no action

10 @@@f1@@@ Result: no action

These results confirm the correct operation of the IF…THEN…END construct.
The program, as written, calculates the function f1(x) = x2, if x < 3 (and not
output otherwise).
The IF…THEN…ELSE…END construct
The IF…THEN…ELSE…END construct permits two alternative program flow
paths based on the truth value of the logical_statement. The general format ofthis construct is:
IF logical_statement THEN program_statements_if_true ELSE
program_statements_if_false END.
The operation of this construct is as follows:
1. Evaluate logical_statement.
2. If logical_statement is true, perform program statements_if_true andcontinue program flow after the END statement.
3. If logical_statement is false, perform program statements_if_false andcontinue program flow after the END statement.
To produce an IF…THEN…ELSE…END construct directly on the stack, use:„°@)@BRCH@ ‚ @)@IF@@
This will create the following input in the stack:Page 21-48

Example: Type in the following program:« → x « IF ‘x<3’ THEN ‘x^2‘ ELSE ‘1-x’ END EVAL ”Done” MSGBOX » »and save it under the name ‘f2’. Press J and verify that variable @@@f2@@@ isindeed available in your variable menu. Verify the following results:
0 @@@f2@@@ Result: 0

1.2 @@@f2@@@ Result: 1.44

3.5 @@@f2@@@ Result: -2.5
10 @@@f2@@@ Result: -9
These results confirm the correct operation of the IF…THEN…ELSE…END
construct. The program, as written, calculates the function⎧ x 2 , if x < 3
f 2 ( x) = ⎨⎩1 − x, otherwise
Note: For this particular case, a valid alternative would have been to use an
IFTE function of the form: ‘f2(x) = IFTE(x<3,x^2,1-x)’
Nested IF…THEN…ELSE…END constructs
In most computer programming languages where the IF…THEN…ELSE…END
construct is available, the general format used for program presentation is thefollowing:
IF logical_statement THEN
program_statements_if_true
ELSE
program_statements_if_false
END
In designing a calculator program that includes IF constructs, you could start by
writing by hand the pseudo-code for the IF constructs as shown above. For
example, for program @@@f2@@@, you could write

Page 21-49

IF x<3 THEN
x2
ELSE
1-x
END
While this simple construct works fine when your function has only two
branches, you may need to nest IF…THEN…ELSE…END constructs to deal withfunction with three or more branches. For example, consider the function⎧
x 2 , if x < 3⎪⎪⎪ 1 − x, if 3 ≤ x < 5
f 3 ( x) = ⎨ sin( x), if 5 ≤ x < 3π
⎪exp( x), if 3π ≤ x < 15⎪⎪⎩ − 2, elsewhere
Here is a possible way to evaluate this function using IF… THEN … ELSE …
END constructs:
IF x<3 THENx2
ELSE
IF x<5 THEN
1-x
ELSE
IF x<3πTHEN
sin(x)ELSE
IF x<15 THEN
exp(x)
ELSE
-2
END
END
END
END

Page 21-50

A complex IF construct like this is called a set of nested IF … THEN … ELSE …
END constructs.
A possible way to evaluate f3(x), based on the nested IF construct shown
above, is to write the program:«→x«

IF ‘x<3‘ THEN ‘x^2‘ ELSE IF ‘x<5‘ THEN ‘1-x‘ ELSE IF‘x<3*π‘ THEN ‘SIN(x)‘ ELSE IF ‘x<15‘ THEN ‘EXP(x)‘ ELSE –2 END
END END END EVAL » »Store the program in variable @@@f3@@@ and try the following evaluations:
1.5 @@f3@@@

Result: 2.25 (i.e., x2)

2.5 @@@f3@@@

Result: 6.25 (i.e., x2)

4.2 @@@f3@@@

Result: -3.2 (i.e., 1-x)

5.6 @@@f3@@@

Result12 @@@f3@@@

Result: 162754.791419 (i.e., exp(x))

23 @@@f3@@@

Result: -2. (i.e., -2)-0.631266… (i.e., sin(x), with x in radians)

The CASE construct
The CASE construct can be used to code several possible program flux paths,
as in the case of the nested IF constructs presented earlier. The general formatof this construct is as follows:
CASE
Logical_statement1 THEN program_statements1 END
Logical_statement2 THEN program_statements2 END.
.
.
Logical_statement THEN program_statements END
Default_program_statements (optional)
END
When evaluating this construct, the program tests each of the logical_statements
until it finds one that is true. The program executes the corresponding

Page 21-51

program_statements, and passes program flow to the statement following the
END statement.
The CASE, THEN, and END statements are available for selective typing byusing „°@)@BRCH@ @)CASE@ .
If you are in the BRCH menu, i.e., („°@)@BRCH@ ) you can use the following
shortcuts to type in your CASE construct (The location of the cursor is indicatedby the symbol  ):
Θ„@)CASE@: Starts the case construct providing the prompts: CASE  THEN
END END

Θ‚@)CASE@: Completes a CASE line by adding the particles THEN  END

Example – program f3(x) using the CASE statement
The function is defined by the following 5 expressions:⎧x 2 , if x < 3⎪⎪⎪ 1 − x, if 3 ≤ x < 5
f 3 ( x) = ⎨ sin( x), if 5 ≤ x < 3π
⎪exp( x), if 3π ≤ x < 15⎪⎪⎩ − 2, elsewhere
Using the CASE statement in User RPL language we can code this function as:«→x«

CASE ‘x<3‘ THEN ‘x^2‘ END ‘x<5‘ THEN ‘1-x‘ END ‘x<3*π‘

THEN ‘SIN(x)‘ END ‘x<15‘ THEN ‘EXP(x)‘ END –2 END EVAL » »Store the program into a variable called @@f3c@. Then, try the following exercises:
1.5@@f3c@

Result: 2.25 (i.e., x2)

2.5@@f3c@

Result: 6.25 (i.e., x2)

4.2@@f3c@

Result: -3.2 (i.e., 1-x)

Page 21-52

5.6@@f3c@

Result: -0.631266… (i.e., sin(x), with x in radians)12@@f3c@

Result: 162754.791419 (i.e., exp(x))

23@@f3c@

Result-2. (i.e., -2)

As you can see, f3c produces exactly the same results as f3. The only
difference in the programs is the branching constructs used. For the case offunction f3(x), which requires five expressions for its definition, the CASE
construct may be easier to code than a number of nested IF … THEN … ELSE
… END constructs.

Program loops
Program loops are constructs that permit the program the execution of a numberof statements repeatedly. For example, suppose that you want to calculate thesummation of the square of the integer numbers from 0 to n, i.e.,nS = ∑k2
k =0

To calculate this summation all that you have to do is use the ‚½ key
within the equation editor and load the limits and expression for the summation(examples of summations are presented in Chapters 2 and 13). However, inorder to illustrate the use of programming loops, we will calculate thissummation with our own User RPL codes. There are four different commands
that can be used to code a program loop in User RPL, these are START, FOR,DO, and WHILE. The commands START and FOR use an index or counter todetermine how many times the loop is executed. The commands DO andWHILE rely on a logical statement to decide when to terminate a loop
execution. Operation of the loop commands is described in detail in thefollowing sections.

The START construct
The START construct uses two values of an index to execute a number ofstatements repeatedly. There are two versions of the START construct:
START…NEXT and START … STEP. The START…NEXT version is used when theindex increment is equal to 1, and the START…STEP version is used when theindex increment is determined by the user.

Page 21-53

Commands involved in the START construct are available through:„°@)@BRCH@ @)START @START
Within the BRCH menu („°@)@BRCH@) the following keystrokes are available
to generate START constructs (the symbol indicates cursor position):Θ„ @START: Starts the START…NEXT construct: START  NEXTΘ

‚ @START: Starts the START…STEP construct: START  STEPThe START…NEXT construct
The general form of this statement is:start_value end_value START program_statements NEXT
Because for this case the increment is 1, in order for the loop to end you should
ensure that start_value < end_value. Otherwise you will produce what
is called an infinite (never-ending) loop.
Example – calculating of the summation S defined above
The START…NEXT construct contains an index whose value is inaccessible tothe user. Since for the calculation of the sum the index itself (k, in this case) isneeded, we must create our own index, k, that we will increment within the loop
each time the loop is executed. A possible implementation for the calculation of
S is the program:«

0. DUP → n S k « 0. n START k SQ S + 1. ‘k‘ STO+ ‘S‘ STO

NEXT S “S” →TAG » »Type the program in, and save it in a variable called @@@S1@@@.
Here is a brief explanation of how the program works:

Page 21-54

1. This program needs an integer number as input. Thus, before execution,that number (n) is in stack level 1. The program is then executed.
2. A zero is entered, moving n to stack level 2.
3. The command DUP, which can be typed in as ~~dup~, copies
the contents of stack level 1, moves all the stack levels upwards, and places
the copy just made in stack level 1. Thus, after DUP is executed, n is instack level 3, and zeroes fill stack levels 1 and 2.
4. The piece of code → n S k stores the values of n, 0, and 0, respectively
into local variables n, S, k. We say that the variables n, S, and k havebeen initialized (S and k to zero, n to whatever value the user chooses).
5. The piece of code 0. n START identifies a START loop whose index willtake values of 0, 1, 2, …, n
6. The sum S is incremented by k2 in the piece of code that reads: k SQ S +7.

The index k is incremented by 1 in the piece of code that reads: 1. k +8. At this point, the updated values of S and k are available in stack levels 2
and 1, respectively. The piece of code ‘k‘ STO stores the value from stacklevel 1 into local variable k. The updated value of S now occupies stacklevel 1.
9. The piece of code ‘S‘ STO stores the value from stack level 1 into local
variable k. The stack is now empty.
10. The particle NEXT increases the index by one and sends the control to thebeginning of the loop (step 6).
11. The loop is repeated until the loop index reaches the maximum value, n.
12. The last part of the program recalls the last value of S (the summation), tags
it, and places it in stack level 1 to be viewed by the user as the program
output.
To see the program in action, step by step, you can use the debugger as follows(use n = 2). Let SL1 mean stack level 1:
J2[‘] @@@S1@@ `Place a 2 in level 2, and theprogram name, ‘S1’, in level 1

Page 21-55

„°LL @)@RUN@ @@DBG@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@Start the debugger. SL1 = 2.
SL1 = 0., SL2 = 2.
SL1 = 0., SL2 = 0., SL3 = 2. (DUP)
Empty stack (-> n S k)
Empty stack (« - start subprogram)
SL1 = 0., (start value of loop index)
SL1 = 2.(n), SL2 = 0. (end value of loop
index)
Empty stack (START – beginning of loop)--- loop execution number 1 for k = 0@SST↓@
SL1 = 0. (k)@SST↓@
SL1 = 0. (SQ(k) = k2)@SST↓@
SL1 = 0.(S), SL2 = 0. (k2)
@SST↓@
SL1 = 0. (S + k2)@SST↓@
SL1 = 1., SL2 = 0. (S + k2)@SST↓@
SL1 = 0.(k), SL2 = 1., SL3 = 0. (S + k2)@SST↓@
SL1 = 1.(k+1), SL2 = 0. (S + k2)@SST↓@
SL1 = ‘k’, SL2 = 1., SL3 = 0. (S + k2)@SST↓@
SL1 = 0. (S + k2) [Stores value of SL2 = 1, into
SL1 = ‘k’]
@SST↓@
SL1 = ‘S’, SL2 = 0. (S + k2)@SST↓@
Empty stack [Stores value of SL2 = 0, into SL1= ‘S’]@SST↓@
Empty stack (NEXT – end of loop)--- loop execution number 2 for k = 1@SST↓@
SL1 = 1. (k)@SST↓@
SL1 = 1. (SQ(k) = k2)@SST↓@
SL1 = 0.(S), SL2 = 1. (k2)
@SST↓@
SL1 = 1. (S + k2)@SST↓@
SL1 = 1., SL2 = 1. (S + k2)@SST↓@
SL1 = 1.(k), SL2 = 1., SL3 = 1. (S + k2)@SST↓@
SL1 = 2.(k+1), SL2 = 1. (S + k2)@SST↓@
SL1 = ‘k’, SL2 = 2., SL3 = 1. (S + k2)

Page 21-56

@SST↓@@SST↓@@SST↓@@SST↓@

SL1 = 1. (S + k2) [Stores value of SL2 = 2, into
SL1 = ‘k’]
SL1 = ‘S’, SL2 = 1. (S + k2)
Empty stack [Stores value of SL2 = 1, into SL1= ‘S’]
Empty stack (NEXT – end of loop)--- loop execution number 3 for k = 2@SST↓@
SL1 = 2. (k)@SST↓@
SL1 = 4. (SQ(k) = k2)@SST↓@
SL1 = 1.(S), SL2 = 4. (k2)
@SST↓@
SL1 = 5. (S + k2)@SST↓@
SL1 = 1., SL2 = 5. (S + k2)@SST↓@
SL1 = 2.(k), SL2 = 1., SL3 = 5. (S + k2)@SST↓@
SL1 = 3.(k+1), SL2 = 5. (S + k2)@SST↓@
SL1 = ‘k’, SL2 = 3., SL3 = 5. (S + k2)@SST↓@
SL1 = 5. (S + k2) [Stores value of SL2 = 3, into
SL1 = ‘k’]
@SST↓@
SL1 = ‘S’, SL2 = 5. (S + k2)@SST↓@
Empty stack [Stores value of SL2 = 0, into SL1= ‘S’]@SST↓@
Empty stack (NEXT – end of loop)--- for n = 2, the loop index is exhausted and control is passed to the statement
following NEXT
@SST↓@@SST↓@@SST↓@@SST↓@@SST↓@

SL1 = 5 (S is recalled to the stack)SL1 = “S”, SL2 = 5 (“S” is placed in the stack)SL1 = S:5 (tagging output value)
SL1 = S:5 (leaving sub-program »)SL1 = S:5 (leaving main program »)The step-by-step listing is finished. The result of running program @@@S1@@ with n =2, is S:5.
Check also the following results: J

Page 21-57

3 @@@S1@@
5 @@@S1@@
10 @@@S1@@
30 @@@S1@@

Result: S:14
Result: S:55
Result: S:385
Result: S:9455

4 @@@S1@@
8 @@@S1@@
20 @@@S1@@
100 @@@S1@@

Result: S:30
Result: S:204
Result: S:2870
Result: S:338350

The START…STEP construct
The general form of this statement is:start_value end_value START program_statements increment
NEXT
The start_value, end_value, and increment of the loop index can be positiveor negative quantities. For increment > 0, execution occurs as long as theindex is less than or equal to end_value. For increment < 0, execution
occurs as long as the index is greater than or equal to end_value.
Example – generating a list of values
Suppose that you want to generate a list of values of x from x = 0.5 to x = 6.5
in increments of 0.5. You can write the following program:« → xs xe dx « xs DUP xe START DUP dx + dx STEP DROP xe xs– dx / ABS 1 + →LIST » »and store it in variable @GLIST.
In this program , xs = starting value of the loop, xe = ending value of the loop,
dx = increment value for loop. The program places values of xs, xs+dx,
xs+2⋅dx, xs+3⋅dx, … in the stack. Then, it calculates the number of elements
generated using the piece of code:xe xs – dx / ABS 1. +Finally, the program puts together a list with the elements placed in the stack.
ΘΘ

Check out that the program call 0.5 ` 2.5 ` 0.5 ` @GLIST
produces the list {0.5 1. 1.5 2. 2.5}.
To see step-by-step operation use the program DBUG for a short list, forexample:Page 21-58

J1 # 1.5 # 0.5 `Enter parameters 1 1.5 0.5[ ‘ ] @GLIST `Enter the program name in level 1„°LL @)@RUN@ @@DBG@

Start the debugger.

Use @SST↓@ to step into the program and see the detailed operation of eachcommand.

The FOR construct
As in the case of the START command, the FOR command has two variations:
the FOR…NEXT construct, for loop index increments of 1, and the FOR…STEP
construct, for loop index increments selected by the user. Unlike the START
command, however, the FOR command does require that we provide a namefor the loop index (e.g., j, k, n). We need not to worry about incrementing theindex ourselves, as done in the examples using START. The value
corresponding to the index is available for calculations.
Commands involved in the FOR construct are available through:„°@)@BRCH@ @)@FOR
Within the BRCH menu („°@)@BRCH@) the following keystrokes are available
to generate FOR constructs (the symbol  indicates cursor position):Θ„ @)@FOR: Starts the FOR…NEXT construct: FOR  NEXTΘ‚ @)@FOR: Starts the FOR…STEP construct: FOR  STEPThe FOR…NEXT construct
The general form of this statement is:start_value end_value FOR loop_index program_statements
NEXT

Page 21-59

To avoid an infinite loop, make sure that start_value < end_value.
Example – calculate the summation S using a FOR…NEXT construct
The following program calculates the summationn

S = ∑k2
k =0

Using a FOR…NEXT loop:«

0 → n S « 0 n FOR k k SQ S + ‘S‘ STO NEXT S “S” →TAG » »Store this program in a variable @@S2@@. Verify the following exercises: J
3 @@@S2@@
5 @@@S2@@
10 @@@S2@@
30 @@@S2@@

Result: S:14
Result: S:55
Result: S:385
Result: S:9455

4 @@@S2@@
8 @@@S2@@
20 @@@S2@@
100 @@@S2@@

Result: S:30
Result: S:204
Result: S:2870
Result: S:338350

You may have noticed that the program is much simpler than the one stored in@@@S1@@. There is no need to initialize k, or to increment k within the program. The
program itself takes care of producing such increments.
The FOR…STEP construct
The general form of this statement is:start_value end_value FOR loop_index program_statements
increment STEP
The start_value, end_value, and increment of the loop index can be positiveor negative quantities. For increment > 0, execution occurs as long as theindex is less than or equal to end_value. For increment < 0, execution
occurs as long as the index is greater than or equal to end_value. Program
statements are executed at least once (e.g., 1 0 START 1 1 STEP returns 1)

Page 21-60

Example – generate a list of numbers using a FOR…STEP construct
Type in the program:«→ xs xe dx « xe xs – dx / ABS 1. + → n « xs xe FOR x x

dx STEP n →LIST » » »and store it in variable @GLIS2.
ΘΘ

Check out that the program call 0.5 ` 2.5 ` 0.5 ` @GLIS2
produces the list {0.5 1. 1.5 2. 2.5}.
To see step-by-step operation use the program DBUG for a short list, forexample:J1 # 1.5 # 0.5 `Enter parameters 1 1.5 0.5[‘] @GLIS2 `Enter the program name in level 1„°LL @)@RUN@ @@DBG@

Start the debugger.

Use @SST↓@ to step into the program and see the detailed operation of eachcommand.

The DO construct
The general structure of this command is:
DO program_statements UNTIL logical_statement END
The DO command starts an indefinite loop executing the program_statements
until the logical_statement returns FALSE (0). The logical_statement must
contain the value of an index whose value is changed in the
program_statements.
Example 1 - This program produces a counter in the upper left corner of thescreen that adds 1 in an indefinite loop until a keystroke (press any key) stops
the counter: « 0 DO DUP 1 DISP 1 + UNTIL KEY END DROP »Command KEY evaluates to TRUE when a keystroke occurs.
Example 2 – calculate the summation S using a DO…UNTIL…END construct

Page 21-61

The following program calculates the summationn

S = ∑k2
k =0

Using a DO…UNTIL…END loop:« 0. →n S « DO n SQ S + ‘S‘ STO n 1 – ‘n‘ STO UNTIL ‘n<0‘ END

S “S” →TAG » »Store this program in a variable @@S3@@. Verify the following exercises: J
3 @@@S3@@
Result: S:14
4 @@@S3@@ Result: S:30
5 @@@S3@@
Result: S:55
8 @@@S3@@ Result: S:204
10 @@@S3@@
Result: S:385
20 @@@S3@@ Result: S:2870
30 @@@S3@@
Result: S:9455
100 @@@S3@@ Result: S:338350
Example 3 – generate a list using a DO…UNTIL…END construct
Type in the following program«→ xs xe dx « xe xs – dx / ABS 1. + xs → n x « xs DO‘x+dx’ EVAL DUP ‘x’ STO UNTIL ‘x≥xe’ END n →LIST » » »and store it in variable @GLIS3.
ΘΘ

Check out that the program call 0.5 ` 2.5 ` 0.5 ` @GLIS3
produces the list {0.5 1. 1.5 2. 2.5}.
To see step-by-step operation use the program DBUG for a short list, forexample:J1 # 1.5 # 0.5 `Enter parameters 1 1.5 0.5[‘] @GLIS3 `Enter the program name in level 1„°LL @)@RUN@ @@DBG@

Start the debugger.

Use @SST↓@ to step into the program and see the detailed operation of eachcommand.

Page 21-62

The WHILE construct
The general structure of this command is:
WHILE logical_statement REPEAT program_statements END
The WHILE statement will repeat the program_statements while
logical_statement is true (non zero). If not, program control is passed tothe statement right after END. The program_statements must include aloop index that gets modified before the logical_statement is checked at
the beginning of the next repetition. Unlike the DO command, if the firstevaluation of logical_statement is false, the loop is never executed.
Example 1 – calculate the summation S using a WHILE…REPEAT…END
construct
The following program calculates the summationn

S = ∑k2
k =0

Using a WHILE…REPEAT…END loop:« 0. → n S « WHILE ‘n≥0‘ REPEAT n SQ S + ‘S‘ STO n 1 – ‘n‘ STO

END S “S” →TAG » »Store this program in a variable @@S4@@. Verify the following exercises: J
3 @@@S4@@5 @@@S4@@
10 @@@S4@@30 @@@S4@@

Result: S:14
Result: S:55
Result: S:385
Result: S:9455

4 @@@S4@@
8 @@@S4@@
20 @@@S4@@
100 @@@S4@@

Result: S:30
Result: S:204
Result: S:2870
Result: S:338350

Example 2 – generate a list using a WHILE…REPEAT…END construct
Type in the following program«→ xs xe dx « xe xs – dx / ABS 1. + xs → n x « xs WHILE‘x<xe‘ REPEAT ‘x+dx‘ EVAL DUP ‘x‘ STO END n →LIST » » »Page 21-63

and store it in variable @GLIS4.
ΘΘ

Check out that the program call 0.5 ` 2.5 ` 0.5 ` @GLIS4
produces the list {0.5 1. 1.5 2. 2.5}.
To see step-by-step operation use the program DBUG for a short list, forexample:J1 # 1.5 # 0.5 `Enter parameters 1 1.5 0.5[‘] @GLIS4 `Enter the program name in level 1„°LL @)@RUN@ @@DBG@

Start the debugger.

Use @SST↓@ to step into the program and see the detailed operation of eachcommand.

Errors and error trapping
The functions of the PRG/ERROR sub-menu provide ways to manipulate errors in
the calculator, and trap errors in programs. The PRG/ERROR sub-menu,
available through „°LL@)ERROR@ , contains the following functions
and sub-menus:

DOERR
This function executes an user-define error, thus causing the calculator to behave
as if that particular error has occurred. The function can take as argument
either an integer number, a binary integer number, an error message, or thenumber zero (0). For example, in RPN mode, entering 5` @DOERR,
produces the following error message: Error: Memory Clear
If you enter #11h ` @DOERR, produces the following message: Error:
Undefined FPTR Name

Page 21-64

If you enter “TRY AGAIN” ` @DOERR, produces the following message: TRY
AGAIN
Finally, 0` @DOERR, produces the message: Interrupted

ERRN
This function returns a number representing the most recent error. For example,
if you try 0Y$@ERRN, you get the number #305h. This is the binary
integer representing the error: Infinite Result

ERRM
This function returns a character string representing the error message of themost recent error. For example, in Approx mode, if you try 0Y$@ERRM,
you get the following string: “Infinite Result”

ERR0
This function clears the last error number, so that, executing ERRN afterwards, inApprox mode, will return # 0h. For example, if you try 0Y$@ERR0 @ERRN,
you get # 0h. Also, if you try 0Y$@ERR0 @ERRM, you get the empty string“ “.

LASTARG
This function returns copies of the arguments of the command or function
executed most recently. For example, in RPN mode, if you use: 3/2`, and then use function LASTARG (@LASTA), you will get the values 3 and2 listed in the stack. Another example, in RPN mode, is the following:
5U`. Using LASTARG after these entries produces a 5.

Sub-menu IFERR
The @)IFERR sub-menu provides the following functions:Page 21-65

These are the components of the IFERR … THEN … END construct or of the
IFERR … THEN … ELSE … END construct. Both logical constructs are used fortrapping errors during program execution. Within the @)ERROR sub-menu,
entering „@)IFERR, or ‚@)IFERR, will place the IFERR structure components inthe stack, ready for the user to fill the missing terms, i.e.,

The general form of the two error-trapping constructs is as follows:
IF trap-clause THEN error-clause END
IF trap-clause THEN error-clause ELSE normal-clause END
The operation of these logical constructs is similar to that of the IF … THEN …
END and of the IF … THEN … ELSE … END constructs. If an error is detectedduring the execution of the trap-clause, then the error-clause is executed.
Otherwise, the normal-clause is executed.
As an example, consider the following program (@ERR1) that takes as input two
matrices, A and b, and checks if there is an error in the trap clause: A b / (RPN
mode, i.e., A/b). If there is an error, then the program calls function LSQ (Least
SQuares, see Chapter 11) to solve the system of equations:«  A b « IFERR A b / THEN LSQ END » »Try it with the arguments A = [ [ 2, 3, 5 ] , [1, 2, 1 ] ] and b = [ [ 5 ] , [ 6 ] ].
A simple division of these two arguments produces an error: /Error: Invalid
Dimension.
However, with the error-trapping construct of the program, @ERR1, with the same
arguments produces: [0.262295…, 0.442622…].

Page 21-66

User RPL programming in algebraic mode
While all the programs presented earlier are produced and run in RPN mode,
you can always type a program in User RPL when in algebraic mode by using
function RPL>. This function is available through the command catalog. As an
example, try creating the following program in algebraic mode, and store it into
« → X ‘2.5-3*X^2’ »variable P2:First, activate the RPL> function from the command catalog (‚N). All
functions activated in ALG mode have a pair of parentheses attached to theirname. The RPL> function is not exception, except that the parentheses must be
removed before we type a program in the screen. Use the arrow keys (š™)
and the delete key (ƒ) to eliminate the parentheses from the RPL>() statement.
At this point you will be ready to type the RPL program. The following figures
show the RPL> command with the program before and after pressing the `key.

To store the program use the STO command as follows:„îK~p2`

An evaluation of program P2 for the argument X = 5 is shown in the nextscreen:While you can write programs in algebraic mode, without using the function
RPL>, some of the RPL constructs will produce an error message when you press`, for example:

Page 21-67

Whereas, using RPL, there is no problem when loading this program in
algebraic mode:

Page 21-68

Chapter 22
Programs for graphics manipulation
This chapter includes a number of examples showing how to use the calculator’sfunctions for manipulating graphics interactively or through the use of programs.
As in Chapter 21 we recommend using RPN mode and setting system flag 117
to SOFT menu labels. « »We introduce a variety of calculator graphic applications in Chapter 12. The
examples of Chapter 12 represent interactive production of graphics using the
calculator’s pre-programmed input forms. It is also possible to use graphs inyour programs, for example, to complement numerical results with graphics. To
accomplish such tasks, we first introduce function in the PLOT menu.

The PLOT menu
Commands for setting up and producing plots are available through the PLOT
menu. You can access the PLOT menu by using: 81.01„°L@)MODES @)MENU@ @@MENU@.

The menu thus produced provides the user access to a variety of graphics
functions. For application in subsequent examples, let’s user-define the C(GRAPH) key to provide access to this menu as described below.

User-defined key for the PLOT menuEnter the following keystrokes to determine whether you have any user-definedkeys already stored in your calculator: „°L@)MODES @)@KEYS@ @@RCLKE@.
Unless you have user-defined some keys, you should get in return a list
containing an S, i.e., {S}. This indicates that the Standard keyboard is the only
key definition stored in your calculator.

Page 22-1

To user-define a key you need to add to this list a command or program
followed by a reference to the key (see details in Chapter 20). Type the list
{ S << 81.01 MENU >> 13.0 } in the stack and use function STOKEYS(„°L@)MODES @)@KEYS@ @@STOK@) to user-define key C as the access to the
PLOT menu. Verify that such list was stored in the calculator by using„°L@)MODES @)@KEYS@ @@RCLK@.
Note: We will not work any exercise while presenting the PLOT menu, its
functions or sub-menus. This section will be more like a tour of the contents of
PLOT as they relate to the different type of graphs available in the calculator.
To activate a user defined key you need to press „Ì (same as the ~key) before pressing the key or keystroke combination of interest. To activate the
PLOT menu, with the key definition used above, press: „Ì C. You will
get the following menu (press L to move to second menu)

Description of the PLOT menu
The following diagram shows the menus in PLOT. The number accompanying
the different menus and functions in the diagram are used as reference in thesubsequent description of those objects.

The soft menu key labeled 3D, STAT, FLAG, PTYPE, and PPAR, produce
additional menus, which will be presented in more detail later. At this point wedescribe the functions directly accessible through soft menu keys for menu
number 81.02. These are:Page 22-2

LABEL (10)The function LABEL is used to label the axes in a plot including the variablenames and minimum and maximum values of the axes. The variable names are
selected from information contained in the variable PPAR.
AUTO (11)The function AUTO (AUTOscale) calculates a display range for the y-axis or forboth the x- and y-axes in two-dimensional plots according to the type of plot
defined in PPAR. For any of the three-dimensional graphs the function AUTO
produces no action. For two-dimensional plots, the following actions are
performed by AUTO:
Θ
Θ
Θ
Θ
Θ
Θ

Θ
Θ

FUNCTION: based on the plotting range of x, it samples the function in EQ
and determines the minimum and maximum values of y.
CONIC: sets the y-axis scale equal to the x-axis scale
POLAR: based on the values of the independent variable (typically θ), it
samples the function in EQ and determines minimum and maximum valuesof both x and y.
PARAMETRIC: produces a similar result as POLAR based on the values ofthe parameter defining the equations for x and y.
TRUTH: produces no action.
BAR: the x-axis range is set from 0 to n+1 where n is the number of
elements in ΣDAT. The range of values of y is based on the contents of
ΣDAT. The minimum and maximum values of y are determined so that thex-axis is always included in the graph.
HISTOGRAM: similar to BAR.
SCATTER: sets x- and y-axis range based on the contents of the
independent and dependent variables from ΣDAT.

INFO (12)The function INFO is interactive only (i.e., it cannot be programmed). Whenthe corresponding soft menu key is pressed it provides information about thecurrent plot parameters.

Page 22-3

EQ (3)The variable name EQ is reserved by the calculator to store the current equationin plots or solution to equations (see chapter …). The soft menu key labeled EQ
in this menu can be used as it would be if you have your variable menu
available, e.g., if you press [ EQ ] it will list the current contents of that variable.

ERASE (4)The function ERASE erases the current contents of the graphics window. In
programming, it can be used to ensure that the graphics window is cleared
before plotting a new graph.
DRAX (5)The function DRAX draws the axes in the current plot, if any is visible.
DRAW (6)The function DRAW draws the plot defined in PPAR.
The PTYPE menu under PLOT (1)The PTYPE menu lists the name of all two-dimensional plot types preprogrammed in the calculator. The menu contains the following menu keys:

These keys correspond to the plot types Function, Conic, Polar, Parametric, Truth,and Diff Eq, presented earlier. Pressing one of these soft menu keys, while
typing a program, will place the corresponding function call in the program.
Press L )@PLOT to get back to the main PLOT menu.
The PPAR menu (2)The PPAR menu lists the different options for the PPAR variable as given by thefollowing soft menu key labels. Press L to move to next menus:

Page 22-4

Note: the SCALE commands shown here actually represent SCALE, SCALEW,SCALEH, in that order.
The following diagram illustrates the functions available in the PPAR menu. The
letters attached to each function in the diagram are used for reference purposesin the description of the functions shown below.

INFO (n) and PPAR (m)If you press @INFO, or enter ‚ @PPAR, while in this menu, you will get a listing of
the current PPAR settings, for example:

This information indicates that X is the independent variable (Indep), Y is thedependent variable (Depnd), the x-axis range goes from –6.5 to 6.5 (Xrng), they-axis range goes from –3.1 to 3.2 (Yrng). The last piece of information in thescreen, the value of Res (resolution) determines the interval of the independent
variable used for generating the plot.
The soft menu key labels included in the PPAR(2) menu represent commands
that can be used in programs. These commands include:

Page 22-5

INDEP (a)The command INDEP specifies the independent variable and its plotting range.
These specifications are stored as the third parameter in the variable PPAR. The
default value is 'X'. The values that can be assigned to the independent
variable specification are:
Θ
Θ
Θ
Θ
Θ

A variable name, e.g., 'Vel'
A variable name in a list, e.g., { Vel }A variable name and a range in a list, e.g., { Vel 0 20 }A range without a variable name, e.g., { 0 20 }Two values representing a range, e.g., 0 20

In a program, any of these specifications will be followed by the command
INDEP.
DEPND (b)The command DEPND specifies the name of the dependent variable. For thecase of TRUTH plots it also specifies the plotting range. The default value is Y.
The type of specifications for the DEPND variable are the same as those for the
INDEP variable.
XRNG (c) and YRNG (d)The command XRNG specifies the plotting range for the x-axis, while thecommand YRNG specifies the plotting range for the y-axis. The input for any ofthese commands is two numbers representing the minimum and maximum
values of x or y. The values of the x- and y-axis ranges are stored as theordered pairs (xmin, ymin) and (xmax, ymax) in the two first elements of thevariable PPAR. Default values for xmin and xmax are -6.5 and 6.5, respectively.
Default values for xmin and xmax are –3.1 and 3.2, respectively.
RES (e)The RES (RESolution) command specifies the interval between values of the
independent variable when producing a specific plot. The resolution can be
expressed in terms of user units as a real number, or in terms of pixels as abinary integer (numbers starting with #, e.g., #10). The resolution is stored as
the fourth item in the PPAR variable.

Page 22-6

CENTR (g)The command CENTR takes as argument an ordered pair (x,y) or a value x,
and adjusts the first two elements in the variable PPAR, i.e., (xmin, ymin) and(xmax, ymax), so that the center of the plot is (x,y) or (x,0), respectively.
SCALE (h)The SCALE command determines the plotting scale represented by the numberof user units per tick mark. The default scale is 1 user-unit per tick mark. Whenthe command SCALE is used, it takes as arguments two numbers, xscale andyscale, representing the new horizontal and vertical scales. The effect of the
SCALE command is to adjust the parameters (xmin, ymin) and (xmax, ymax) in
PPAR to accommodate the desired scale. The center of the plot is preserved.
SCALEW (i)Given a factor xfactor, the command SCALEW multiplies the horizontal scale bythat factor. The W in SCALEW stands for 'width.' The execution of SCALEW
changes the values of xmin and xmax in PPAR.
SCALEH (j)Given a factor yfactor, the command SCALEH multiplies the vertical scale by thatfactor. The H in SCALEH stands for 'height.' The execution of SCALEW
changes the values of ymin and ymax in PPAR.
Note: Changes introduced by using SCALE, SCALEW, or SCALEH, can beused to zoom in or zoom out in a plot.
ATICK (l)The command ATICK (Axes TICK mark) is used to set the tick-mark annotations
for the axes. The input value for the ATICK command can be one of thefollowing:ΘΘΘ

A real value x : sets both the x- and y-axis tick annotations to x units
A list of two real values { x y }: sets the tick annotations in the x- and y-axes
to x and y units, respectively.
A binary integer #n: sets both the x- and y-axis tick annotations to #n pixels

Page 22-7

A list of two binary integers {#n #m}: sets the tick annotations in the x- and yaxes to #n and #m pixels, respectively.
AXES (k)The input value for the axes command consists of either an ordered pair (x,y) ora list {(x,y) atick "x-axis label" "y-axis label"}. The parameter atick stands forthe specification of the tick marking annotations as described above for thecommand ATICK. The ordered pair represents the center of the plot. If only anordered pair is given as input to AXES, only the axes origin is altered. The
argument to the command AXES, whether an ordered pair or a list of values, isstored as the fifth parameter in PPAR.
To return to the PLOT menu, press @)PLOT.
Press L to reach the second menu of the PLOT menu set.
RESET (f)This button will reset the plot parameters to default values.
The 3D menu within PLOT (7)The 3D menu contains two sub-menus, PTYPE and VPAR, and one variable, EQ.
We are familiar already with the meaning of EQ, therefore, we will concentrateon the contents of the PTYPE and VPAR menus. The diagram below shows thebranching of the 3D menu.

Page 22-8

The PTYPE menu within 3D (IV)The PTYPE menu under 3D contains the following functions:

These functions correspond to the graphics options Slopefield, Wireframe, YSlice, Ps-Contour, Gridmap and Pr-Surface presented earlier in this chapter.
Pressing one of these soft menu keys, while typing a program, will place thecorresponding function call in the program. Press L@)@3D@@ to get back to themain 3D menu.
The VPAR menu within 3D (V)The variable VPAR stands for Volume PARameters, referring to a parallelepipedin space within which the three-dimensional graph of interest is constructed.
When press [VPAR] in the 3D menu, you will get the following functions. Press
L to move to the next menu:

Next, we describe the meaning of these functions:
INFO (S) and VPAR (W)When you press @INFO (S) you get the information shown in the left-hand side
screen shot above. The ranges in Xvol, Yvol, and Zvol describe the extent of theparallelepiped in space where the graph will be generated. Xrng and Yrng
describe the range of values of x and y, respectively, as independent variablesin the x-y plane that will be used to generate functions of the form z = f(x,y).
Press L and @INFO (Y) to obtain the information in the right-hand side screen
shot above. These are the value of the location of the viewpoint for the threedimensional graph (Xeye, Yeye, Zeye), and of the number of steps in x and y to
generate a grid for surface plots.

Page 22-9

XVOL (N), YVOL (O), and ZVOL (P)These functions take as input a minimum and maximum value and are used to
specify the extent of the parallelepiped where the graph will be generated (theviewing parallelepiped). These values are stored in the variable VPAR. The
default values for the ranges XVOL, YVOL, and ZVOL are –1 to 1.
XXRNG (Q) and YYRNG (R)These functions take as input a minimum and maximum value and are used to
specify the ranges of the variables x and y to generate functions z = f(x,y). The
default value of the ranges XXRNG and YYRNG will be the same as those of
XVOL and YVOL.
EYEPT (T)The function EYEPT takes as input real values x, y, and z representing thelocation of the viewpoint for a three-dimensional graph. The viewpoint is apoint in space from which the three-dimensional graph is observed. Changing
the viewpoint will produce different views of the graph. The figure below
illustrates the idea of the viewpoint with respect to the actual graphic space andits projection in the plane of the screen.
NUMX(U) and NUMY (V)The functions NUMX and NUMY are used to specify the number of points or
steps along each direction to be used in the generation of the base grid fromwhich to obtain values of z = f(x,y).
VPAR (W)This is just a reference to the variable VPAR.
RESET (X)
Resets parameters in screen to their default values.
Press L@)@3D@@ to return to the 3D menu.
Press @)PLOT to return to the PLOT menu.

Page 22-10

The STAT menu within PLOTThe STAT menu provides access to plots related to statistical analysis. Within
this menu we find the following menus:

The diagram below shows the branching of the STAT menu within PLOT. The
numbers and letters accompanying each function or menu are used forreference in the descriptions that follow the figure.

Page 22-11

The PTYPE menu within STAT (I)The PTYPE menu provides the following functions:

These keys correspond to the plot types Bar (A), Histogram (B), and Scatter(C),presented earlier. Pressing one of these soft menu keys, while typing a
program, will place the corresponding function call in the program. Press @)STAT
to get back to the STAT menu.
The DATA menu within STAT (II)The DATA menu provides the following functions:

The functions listed in this menu are used to manipulate the ΣDAT statisticalmatrix. The functions Σ+ (D) and Σ- (E), add or remove data rows from thematrix ΣDAT. CLΣ (F) clears the ΣDAT (G) matrix, and the soft menu key
labeled ΣDAT is just used as a reference for interactive applications. Moredetails on the use of these functions are presented in a later chapter on
statistical applications. Press @)STAT to return to the STAT menu.
The ΣPAR menu within STAT (III)The ΣPAR menu provides the following functions:

INFO (M) and ΣPAR (K)The key INFO in ΣPAR provides the information shown in the screen shot above.
The information listed in the screen is contained in the variable ΣPAR. The
values shown are the default values for the x-column, y-column, intercept andslope of a data fitting model, and the type of model to be fit to the data inΣDAT.

Page 22-12

XCOL (H)The command XCOL is used to indicate which of the columns of ΣDAT, if morethan one, will be the x- column or independent variable column.
YCOL (I)The command YCOL is used to indicate which of the columns of ΣDAT, if morethan one, will be the y- column or dependent variable column.
MODL (J)The command MODL refers to the model to be selected to fit the data in ΣDAT,
if a data fitting is implemented. To see which options are available, press @!MODL.
You will get the following menu:

These functions correspond to Linear Fit, Logarithmic Fit, Exponential Fit, Power
Fit, or Best Fit. Data fitting is described in more detail in a later chapter. Press)£@PAR to return to the ΣPAR menu.
ΣPAR (K)ΣPAR is just a reference to the variable ΣPAR for interactive use.
RESET (L)This function resets the contents of ΣPAR to its default values.
Press L @)STAT to return to the STAT menu. Press [PLOT] to return to the main
PLOT menu.
The FLAG menu within PLOTThe FLAG menu is actually interactive, so that you can select any of thefollowing options:Θ AXES: when selected, axes are shown if visible within the plot area orvolume.
Θ CNCT: when selected the plot is produced so that individual points areconnected.

Page 22-13

Θ SIMU: when selected, and if more than one graph is to be plotted in thesame set of axes, plots all the graphs simultaneously.
Press @)PLOT to return to the PLOT menu.

Generating plots with programs
Depending on whether we are dealing with a two-dimensional graph definedby a function, by data from ΣDAT, or by a three-dimensional function, you needto set up the variables PPAR, ΣPAR, and /or VPAR before generating a plot in a
program. The commands shown in the previous section help you in setting upsuch variables.
Following we describe the general format for the variables necessary to
produce the different types of plots available in the calculator.

Two-dimensional graphics
The two-dimensional graphics generated by functions, namely, Function, Conic,
Parametric, Polar, Truth and Differential Equation, use PPAR with the format:{ (xmin, ymin) (xmax, ymax) indep res axes ptype depend }The two-dimensional graphics generated from data in the statistical matrix
ΣDAT, namely, Bar, Histogram, and Scatter, use the ΣPAR variable with thefollowing format:{ x-column y-column slope intercept model }while at the same time using PPAR with the format shown above.
The meaning of the different parameters in PPAR and ΣPAR were presented in
the previous section.

Page 22-14

Three-dimensional graphics
The three-dimensional graphics available, namely, options Slopefield,
Wireframe, Y-Slice, Ps-Contour, Gridmap and Pr-Surface, use the VPAR variablewith the following format:{xleft, xright, ynear, yfar, zlow, zhigh, xmin, xmax, ymin, ymax,
xeye, yeye, zeye, xstep, ystep}
These pairs of values of x, y, and z, represent the following:Θ Dimensions of the view parallelepiped (xleft, xright, ynear, yfar,
zlow, zhigh)Θ

Range of x and y independent variables (xmin, xmax, ymin, ymax)

Θ

Location of viewpoint (xeye, yeye, zeye)ΘNumber of steps in the x- and y-directions (xstep, ystep)Three-dimensional graphics also require the PPAR variable with the parameters
shown above.

The variable EQ
All plots, except those based on ΣDAT, also require that you define the function
or functions to be plotted by storing the expressions or references to thosefunctions in the variable EQ.
In summary, to produce a plot in a program you need to load EQ, if required.
Then load PPAR, PPAR and ΣPAR, or PPAR and VPAR. Finally, use the name ofthe proper plot type: FUNCTION, CONIC, POLAR, PARAMETRIC, TRUTH,
DIFFEQ, BAR, HISTOGRAM, SCATTER, SLOPE, WIREFRAME, YSLICE,
PCONTOUR, GRIDMAP, or PARSURFACE, to produce your plot.

Examples of interactive plots using the PLOT menu
To better understand the way a program works with the PLOT commands andvariables, try the following examples of interactive plots using the PLOT menu.
Example 1 – A function plot:„ÌC

Get PLOT menu (*)@)PTYPE @FUNCT

Select FUNCTION as the plot type‘√r’ `„ @@EQ@@Store function ‘√r’ into EQ

Page 22-15@)PPAR~„r` @INDEP~„s` @DEPND
1 \# 10 @XRNG
1 \# 5 @YRNG L{ (0,0) {.4 .2} “Rs” “Sr”} `@AXESL @)PLOT@ERASE @DRAX L @LABEL
L @DRAW@)EDIT L@MENU
LL@)PICT @CANCLShow plot parameters
Define ‘r’ as the indep. variable
Define ‘s’ as the dependent variable
Define (-1, 10) as the x-range
Define (-1, 5) as the y-range
Axes definition list
Define axes center, ticks, labels
Return to PLOT menu
Erase picture, draw axes, labels
Draw function and show picture
Removes menu labels
Returns to normal calculator display(*) PLOT menu available through user-defined key C as shown earlier in this
Chapter.

Example 2 – A parametric plot (Use RAD as angles):„ÌC
Get PLOT menu@)PTYPE @PARAM
Select PARAMETRIC as the plot type{ ‘SIN(t)+i*SIN(2*t)’ } `Define complex function X+iY
„ @@EQ@@Store complex function into EQ@)PPAR
Show plot parameters{t 0 6.29} ` @INDEP
Define ‘t’ as the indep.variable~y` @DEPND
Define ‘Y’ as the dependent variable
2.2 \# 2.2 @XRNG
Define (-2.2,2.2) as the x-range
1.1 \# 1.1 @YRNG L
Define (-1.1,1.1) as the y-range{ (0,0) {.4 .2} “X(t)” “Y(t)”} `Axes definition list
@AXES
Define axes center, ticks, labels
L @)PLOT
Return to PLOT menu
@ERASE @DRAX L @LABEL
Erase picture, draw axes, labels
L @DRAW
Draw function and show picture@)EDIT L@MENU LL@)PICT @CANCL
Finish plot
Example 3 – A polar plot:„ÌC@)PTYPE @POLAR

Get PLOT menu
Select POLAR as the plot type

‘1+SIN(θ)’ ` „ @@EQ@@Store complex funct. r = f(θ) into EQ

Page 22-16@)PPAR{ θ 0 6.29} ` @INDEP~y` @DEPND
3 \# 3 @XRNG
0.5 \# 2.5 @YRNG L{ (0,0) {.5 .5} “x” “y”} `@AXESL @)PLOT@ERASE @DRAX L @LABEL
L @DRAW@)EDIT L@MENU
LL@)PICT @CANCLShow plot parameters
Define ‘θ’ as the indep. Variable
Define ‘Y’ as the dependent variable
Define (-3,3) as the x-range
Define (-0.5,2.5) as the y-range
Axes definition list
Define axes center, ticks, labels
Return to PLOT menu
Erase picture, draw axes, labels
Draw function and show picture
Remove menu labels
Return to normal calculator display

From these examples we see a pattern for the interactive generation of a twodimensional graph through the PLOT menu:
1 – Select PTYPE.
2 – Store function to plot in variable EQ (using the proper format, e.g.,‘X(t)+iY(t)’ for PARAMETRIC).
3 – Enter name (and range, if necessary) of independent and dependent
variables
4 – Enter axes specifications as a list { center atick x-label y-label }5 – Use ERASE, DRAX, LABEL, DRAW to produce a fully labeled graph with
axes
This same approach can be used to produce plots with a program, except thatin a program you need to add the command PICTURE after the DRAW function
is called to recall the graphics screen to the stack.

Examples of program-generated plots
In this section we show how to implement with programs the generation of thelast three examples.

Activate the PLOT menu before you start typing the

program to facilitate entering graphing commands („ÌC, see above).

Example 1 – A function plot. Enter the following program:

Page 22-17

«{PPAR EQ} PURGE‘√r’ STEQ‘r’ INDEP‘s’ DEPND
FUNCTION{ (0.,0.) {.4 .2}“Rs” “Sr” } AXES
–1. 5. XRNG
–1. 5. YRNGERASE DRAW DRAX LABELPICTURE »Start program
Purge current PPAR and EQStore ‘√r’ into EQ
Set independent variable to ‘r’
Set dependent variable to ‘s’
Select FUNCTION as the plot typeSet axes information
Set x range
Set y range
Erase & draw plot, axes, and labels
Recall graphics screen to stack

Store the program in variable PLOT1. To run it, press J, if needed, thenpress @PLOT1.
Example 2 – A parametric plot. Enter the following program:«Start program
RAD {PPAR EQ} PURGE
Change to radians, purge vars.
‘SIN(t)+i*SIN(2*t)’ STEQStore ‘X(t)+iY(t)’ into EQ{ t 0. 6.29} INDEP
Set indep. variable to ‘r’, with range‘Y’ DEPND
Set dependent variable to ‘Y’
PARAMETRIC
Select PARAMETRIC as the plot type
{ (0.,0.) {.5 .5} “X(t)”“Y(t)” } AXES
Set axes information–2.2 2.2 XRNG
Set x range–1.1 1.1 YRNG
Set y range
ERASE DRAW DRAX LABEL
Erase & draw plot, axes, and labels
PICTURE
Recall graphics screen to stack»
End program
Store the program in variable PLOT2. To run it, press J, if needed, thenpress @PLOT2.

Page 22-18

Example 3 – A polar plot. Enter the following program:«Start program
RAD {PPAR EQ} PURGE
Change to radians, purge vars.
‘1+SIN(θ)’ STEQStore ‘f(θ)’ into EQ{ θ 0. 6.29} INDEP
Set indep. variable to ‘θ’, with range‘Y’ DEPND
Set dependent variable to ‘Y’
POLAR
Select POLAR as the plot type
{ (0.,0.) {.5 .5}“x” “y”} AXES
Set axes information–3. 3. XRNG
Set x range–.5 2.5 YRNG
Set y range
ERASE DRAW DRAX LABEL
Erase & draw plot, axes, and labels
PICTURE
Recall graphics screen to stack»
End program
Store the program in variable PLOT3. To run it, press J, if needed, thenpress @PLOT3.
These exercises illustrate the use of PLOT commands in programs. They justscratch the surface of programming applications of plots. I invite the reader totry their own exercises on programming plots.

Drawing commands for use in programming
You can draw figures in the graphics window directly from a program by usingcommands such as those contained in the PICT menu, accessible by„°L@PICT@. The functions available in this menu are the following.
Press L to move to next menu:

Obviously, the commands LINE, TLINE, and BOX, perform the same operations
as their interactive counterpart, given the appropriate input. These and theother functions in the PICT menu refer to the graphics windows whose x- and yranges are determined in the variable PPAR, as demonstrated above fordifferent graph types. The functions in the PICT command are described next:

Page 22-19

PICT
This soft key refers to a variable called PICT that stores the current contents ofthe graphics window. This variable name, however, cannot be placed withinquotes, and can only store graphics objects. In that sense, PICT is like no othercalculator variables.

PDIM
The function PDIM takes as input either two ordered pairs (xmin,ymin) (xmax,ymax)
or two binary integers #w and #h. The effect of PDIM is to replace the current
contents of PICT with an empty screen. When the argument is (xmin,ymin)(xmax,ymax), these values become the range of the user-defined coordinates in
PPAR. When the argument is #w and #h, the ranges of the user-definedcoordinates in PPAR remain unchanged, but the size of the graph changes to #h
× #v pixels.
PICT and the graphics screen
PICT, the storage area for the current graph, can be thought of as a twodimensional graph with a minimum size of 131 pixels wide by 64 pixels high.
The maximum width of PICT is 2048 pixels, with no restriction on the maximum
height. A pixel is each one of the dots in the calculator’s screen that can beturned on (dark) or off (clear) to produce text or graphs. The calculator screen
has 131 pixels by 64 pixels, i.e., the minimum size for PICT. If your PICT islarger than the screen, then the PICT graph can be thought of as a twodimensional domain that can be scrolled through the calculator’s screen, as
illustrated in the diagram shown next.

LINE
This command takes as input two ordered pairs (x1,y1) (x2, y2), or two pairs of
pixel coordinates {#n1 #m1} {#n2 #m2}. It draws the line between thosecoordinates.

TLINE
This command (Toggle LINE) takes as input two ordered pairs (x1,y1) (x2, y2),or two pairs of pixel coordinates {#n1 #m1} {#n2 #m2}. It draws the line
between those coordinates, turning off pixels that are on in the line path andvice versa.

Page 22-20

BOXThis command takes as input two ordered pairs (x1,y1) (x2, y2), or two pairs of
pixel coordinates {#n1 #m1} {#n2 #m2}. It draws the box whose diagonals are
represented by the two pairs of coordinates in the input.

ARC
This command is used to draw an arc. ARC takes as input the following
objects:ΘΘΘCoordinates of the center of the arc as (x,y) in user coordinates or {#n, #m}in pixels.
Radius of arc as r (user coordinates) or #k (pixels).
Initial angle θ1 and final angle θ2.

PIX?, PIXON, and PIXOFF
These functions take as input the coordinates of point in user coordinates, (x,y),or in pixels {#n, #m}.

Page 22-21

ΘΘΘPIX? Checks if pixel at location (x,y) or {#n, #m} is on.
PIXOFF turns off pixel at location (x,y) or {#n, #m}.
PIXON turns on pixel at location (x,y) or {#n, #m}.

PVIEWThis command takes as input the coordinates of a point as user coordinates(x,y) or pixels {#n, #m}, and places the contents of PICT with the upper left
corner at the location of the point specified. You can also use an empty list asargument, in which case the picture is centered in the screen. PVIEW does not
activate the graphics cursor or the picture menu. To activate any of thosefeatures use PICTURE.

PXC
The function PXC converts pixel coordinates {#n #m} to user-unit coordinates(x,y).

CPX
The function CPX converts user-unit coordinates (x,y) to pixel coordinates {#n#m}.

Programming examples using drawing functions
In this section we use the commands described above to produce graphics with
programs. Program listing are provided in the attached diskette or CD ROM.
Example 1 - A program that uses drawing commands
The following program produces a drawing in the graphics screen. (Thisprogram has no other purpose than to show how to use calculator commands to
produce drawings in the display.)«DEG
0. 100. XRNG
0. 50. YRNG
ERASE
(5., 2.5) (95., 47.5) BOX

Start program
Select degrees for angular measures
Set x range
Set y range
Erase picture
Draw box from (5,5) to (95,95)(50., 50.) 10. 0. 360. ARC

Draw a circle center (50,50), r =10.

Page 22-22

(50., 50.) 12. –180. 180. ARC

Draw a circle center (50,50), r= 12.

1 8 FOR j

Draw 8 lines within the circle(50., 50.) DUP

Lines are centered as (50,50)‘12*COS(45*(j-1))’ NUM

Calculate x, other end at 50 + x‘12*SIN(45*(j-1))’ NUM

Calculates y, other end at 50 + y

RCConvert x y to (x,y), complex num.

+

Add (50,50) to (x,y)

LINE

Draw the lineNEXT

End of FOR loop

{ } PVIEWShow picture»
Example 2 - A program to plot a natural river cross-section
This application may be useful for determining area and wetted perimeters ofnatural river cross-sections. Typically, a natural river cross section is surveyed
and a series of points, representing coordinates x and y with respect to anarbitrary set of coordinates axes. These points can be plotted and a sketch of
the cross section produced for a given water surface elevation. The figure
below illustrate the terms presented in this paragraph.
The program, available in the diskette or CD ROM that comes with yourcalculator, utilizes four sub-programs FRAME, DXBED, GTIFS, and INTRP. The
main program, called XSECT, takes as input a matrix of values of x and y, andthe elevation of the water surface Y (see figure above), in that order. The
program produces a graph of the cross section indicating the input data withpoints in the graph, and shows the free surface in the cross-section.

Page 22-23

It is suggested that you create a separate sub-directory to store the programs.
You could call the sub-directory RIVER, since we are dealing with irregular open
channel cross-sections, typical of rivers.
To see the program XSECT in action, use the following data sets. Enter them as
matrices of two columns, the first column being x and the second one y. Storethe matrices in variables with names such as XYD1 (X-Y Data set 1) and XYD2
(X-Y Data set 2). To run the program place one of the data sets in the stack,e.g., J @XYD1!, then type in a water surface elevation, say 4.0, and press@XSECT. The calculator will show an sketch of the cross-section with thecorresponding water surface. To exit the graph display, press $.
Try the following examples:@XYD1! 2 @XSECT@XYD1! 3 @XSECT@XYD1! 4 @XSECT@XYD1! 6 @XSECT
Please be patient when running program XSECT. Due to the relatively large
number of graphics functions used, not counting the numerical iterations, it may
take some time to produce the graph (about 1 minute).

Page 22-24

Data set 1
x
0.4
1.0
2.0
3.4
4.0
5.8
7.2
7.8
9.0

y
6.3
4.9
4.3
3.0
1.2
2.0
3.8
5.3
7.2

Data set 2
x
0.7
1.0
1.5
2.2
3.5
4.5
5.0
6.0
7.1
8.0
9.0
10.0
10.5
11.0

y
4.8
3.0
2.0
0.9
0.4
1.0
2.0
2.5
2.0
0.7
0.0
1.5
3.4
5.0

Note: The program FRAME, as originally programmed (see diskette or CDROM), does not maintain the proper scaling of the graph. If you want tomaintain proper scaling, replace FRAME with the following program:« STOΣ MINΣ MAXΣ 2 COL DUP COL DROP – AXL ABS AXL 20 /DUP NEG SWAP 2 COL + ROW DROP SWAP  yR xR « 131 DUP
RB SWAP yR OBJ DROP – xR OBJ DROP - / * FLOOR RB
PDIM yR OBJ DROP YRNG xR OBJ DROP XRNG ERASE » »This program keeps the width of the PICT variable at 131 pixels – the minimum
pixel size for the horizontal axis – and adjusts the number of pixels in thevertical axes so that a 1:1 scale is maintained between the vertical andhorizontal axes.

Pixel coordinates
The figure below shows the graphic coordinates for the typical (minimum)
screen of 131×64 pixels. Pixels coordinates are measured from the top left
corner of the screen {# 0h # 0h}, which corresponds to user-defined coordinates

Page 22-25

(xmin, ymax). The maximum coordinates in terms of pixels correspond to thelower right corner of the screen {# 82h #3Fh}, which in user-coordinates is thepoint (xmax, ymin). The coordinates of the two other corners both in pixel as wellas in user-defined coordinates are shown in the figure.

Animating graphics
Herein we present a way to produce animation by using the Y-Slice plot type.
Suppose that you want to animate the traveling wave, f(X,Y) = 2.5 sin(X-Y). We
can treat the X as time in the animation producing plots of f(X,Y) vs. Y for
different values of X. To produce this graph use the following:Θ„ô simultaneously. Select Y-Slice for TYPE. ‘2.5*SIN(X-Y)’ for
EQ. ‘X’ for INDEP. Press L@@@OK@@@.

Θ„ò, simultaneously (in RPN mode). Use the following values:

ΘPress @ERASE @DRAW. Allow some time for the calculator to generate all theneeded graphics. When ready, it will show a traveling sinusoidal
wave in your screen.

Page 22-26

Animating a collection of graphics
The calculator provides the function ANIMATE to animate a number of graphics
that have been placed in the stack. You can generate a graph in the graphics
screen by using the commands in the PLOT and PICT menus. To place thegenerated graph in the stack, use PICT RCL. When you have n graphs in levels
n through 1 of the stack, you can simply use the command n ANIMATE to
produce an animation made of the graphs you placed in the stack.
Example 1 – Animating a ripple in a water surface
As an example, type in the following program that generates 11 graphics
showing a circle centered in the middle of the graphics screen and whose
radius increase by a constant value in each subsequent graph.
«RAD
131 RB 64 RB PDIM
0 100 XRNG 0 100 YRNG
1 11 FOR j
ERASE(50., 50.) ‘5*(j-1)’ NUM
0 ‘2*π’ NUM ARC
PICT RCLNEXT
11 ANIMATE»

Begin program
Set angle units to radians
Set PICT to 131×64 pixels
Set x- and y-ranges to 0-100
Start loop with j = 1 .. 11
Erase current PICT
Centers of circles (50,50)
Draw circle center r = 5(j-1)
Place current PICT on stack
End FOR-NEXT loop
AnimateEnd program

Store this program in a variable called PANIM (Plot ANIMation). To run the
program press J (if needed) @PANIM. It takes the calculator more than one
minute to generate the graphs and get the animation going. Therefore, bereally patient here. You will see the hourglass symbol up in the screen for what
seems a long time before the animation, resembling the ripples produced by apebble dropped on the surface of a body of quiescent water, appears in thescreen. To stop the animation, press $.
The 11 graphics generated by the program are still available in the stack. If
you want to re-start the animation, simply use: 11 ANIMATE. (Function

Page 22-27

ANIMATE is available by using „°L@)GROB L @ANIMA). The animation
will be re-started. Press $ to stop the animation once more. Notice that the
number 11 will still be listed in stack level 1. Press ƒ to drop it from thestack.
Suppose that you want to keep the figures that compose this animation in avariable. You can create a list of these figures, let’s call it WLIST, by using:11 „°@)TYPE@ @ LIST ³ ~~wlist~ K
Press J to recover your list of variables. The variable @WLIST should now belisted in your soft-menu keys.

To re-animate this list of variables you could use

the following program:«Start program

WLIST

Place list WLIST in stack

OBJ

Decompose list, stack level 1 = 11

ANIMATE

Start animation»

End program

Save this program in a variable called RANIM (Re-ANIMate). To run it, press@RANIM.
The following program will animate the graphics in WLIST forward andbackwards:«

Start program

WLIST DUP

Place list WLIST in stack, make extra copy

REVLIST +Reverse order, concatenate 2 lists

OBJ

Decompose list in elements, level 1 = 22

ANIMATE

Start animation»
End program
Save this program in a variable called RANI2 (Re-ANImate version 2). To run
it, press @RANI2. The animation now simulates a ripple in the surface ofotherwise quiescent water that gets reflected from the walls of a circular tankback towards the center. Press $ to stop the animation.

Page 22-28

Example 2 - Animating the plotting of different power functions
Suppose that you want to animate the plotting of the functions f(x) = xn, n = 0,
1, 2, 3, 4, in the same set of axes. You could use the following program:«
Begin programRAD
Set angle units to radians
131 RB 64 RB PDIM
Set PICT screen to 131×64 pixels
0 2 XRNG 0 20 YRNG
Set x- and y-ranges
0 4 FOR j
Start loop with j = 0,1,…,4‘X^j’ STEQStore ‘X^j’ in variable EQ
ERASE
Erase current PICTDRAX LABEL DRAW
Draw axes, labels, function
PICT RCL
Place current PICT on stackNEXT
End FOR-NEXT loop
5 ANIMATE
Animate»Store this program in a variable called PWAN (PoWer function ANimation).
To run the program press J (if needed) @PWAN. You will see the calculator
drawing each individual power function before starting the animation in which
the five functions will be plotted quickly one after the other. To stop theanimation, press $.

More information on the ANIMATE function
The ANIMATE function as used in the two previous examples utilized as input
the graphics to be animated and their number. You can use additional
information to produce the animation, such as the time interval between
graphics and the number of repetitions of the graphics. The general format of
the ANIMATE function in such cases is the following:n-graphs{ n {#X #Y} delay rep } ANIMATEn represents the number of graphics, {#X #Y} stand for the pixel coordinatesof the lower right corner of the area to be plotted (see figure below), delay is
the number of seconds allowed between consecutive graphics in the animation,and rep is the number of repetitions of the animation.

Graphic objects (GROBs)
The word GROB stands for GRaphics OBjects and is used in the calculator’s
environment to represent a pixel-by-pixel description of an image that has been

Page 22-29

produced in the calculator’s screen. Therefore, when an image is converted
into a GROB, it becomes a sequence of binary digits (binary digits = bits), i.e.,
0’s and 1’s. To illustrate GROBs and conversion of images to GROBS consider
the following exercise.
When we produce a graph in the calculator, the graph become the contents ofa special variable called PICT. Thus, to see the last contents of PICT, you could
use: PICT RCL(„°L@)PICT @PICT „©).
The display shows in stack level 1 the line Graphic 131×80 (if using thestandard screen size) followed by a sketch of the top part of the graph. For
example,If you press ˜ then the graph contained in level 1 is shown in the calculator’s
graphics display. Press @CANCL to return to normal calculator display.
The graph in level 1 is still not in GROB format, although it is, by definition, agraphics object. To convert a graph in the stack into a GROB, use: 3`„°L@)GROB @GROB . Now we have the following information in level 1:

The first part of the description is similar to what we had originally, namely,
Graphic 131×64, but now it is expressed as Graphic 13128 × 8.
However, the graphic display is now replaced by a sequence of zeroes andones representing the pixels of the original graph. Thus, the original graph as
now been converted to its equivalent representation in bits.
You can also convert equations into GROBs.

For example, using the equation

writer type in the equation ‘X^2+3’ into stack level 1, and then press

Page 22-30

1` „°L@)GROB @GROB . You will now have in level 1 the GROB
described as:

As a graphic object this equation can now be placed in the graphics display.
To recover the graphics display press š. Then, move the cursor to an empty
sector in the graph, and press @)EDIT LL@REPL. The equation ‘X^2-5’ isplaced in the graph, for example:

Thus, GROBs can be used to document graphics by placing equations, or text,
in the graphics display.

The GROB menu
The GROB menu, accessible through „°L@)GROB @GROB, contains thefollowing functions. Press L to move to the next menu:

GROB
Of these functions we have already used SUB, REPL, (from the graphics EDITmenu), ANIMATE [ANIMA], and GROB. ([ PRG ] is simply a way to returnto the programming menu.) While using GROB in the two previous examples
you may have noticed that I used a 3 while converting the graph into a GROB,
while I used a 1 when I converted the equation into a GROB. This parameter ofthe function GROB indicates the size of the object that is being converted intoa GROB as 0 or 1 – for a small object, 2 – medium, and 3 – large. The otherfunctions in the GROB menu are described following.

Page 22-31

BLANKThe function BLANK, with arguments #n and #m, creates a blank graphics
object of width and height specified by the values #n and #m, respectively. Thisis similar to the function PDIM in the GRAPH menu.
GOR
The function GOR (Graphics OR) takes as input grob2 (a target GROB), a set ofcoordinates, and grob1, and produces the superposition of grob1 onto grob2(or PICT) starting at the specified coordinates. The coordinates can be specified
as user-defined coordinates (x,y), or pixels {#n #m}. GOR uses the OR function
to determine the status of each pixel (i.e., on or off) in the overlapping region
between grob1 and grob2.
GXOR
The function GXOR (Graphics XOR) performs the same operation as GOR, butusing XOR to determine the final status of pixels in the overlapping area
between graphic objects grob1 and grob2.
Note:

In both GOR and GXOR, when grob2 is replaced by PICT, thesefunctions produce no output. To see the output you need to recall PICT to thestack by using either PICT RCL or PICTURE.
LCD
Takes a specified GROB and displays it in the calculator's display starting at theupper left corner.
LCD
Copies the contents of the stack and menu display into a 131 x 64 pixels
GROB.
SIZE
The function SIZE, when applied to a GROB, shows the GROB’s size in the formof two numbers. The first number, shown in stack level 2, represents the width of
the graphics object, and the second one, in stack level 1, shows its height.

Page 22-32

An example of a program using GROB
The following program produces the graph of the sine function including aframe – drawn with the function BOX – and a GROB to label the graph. Hereis the listing of the program:«RAD
131 RB 64 RB PDIM
-6.28 6.28 XRNG –2. 2. YRNG
FUNCTION‘SIN(X)’ STEQERASE DRAX LABEL DRAW(-6.28,-2.) (6.28,2.) BOX
PICT RCL“SINE FUNCTION”
1 GROB(-6., 1.5) SWAP
GOR
PICT STO{ } PVIEW»

Begin program
Set angle units to radians
Set PICT screen to 131×64 pixels
Set x- and y-ranges
Select FUNCTION type for graphs
Store the function sine into EQ
Clear, draw axes, labels, graph
Draw a frame around the graphPlace contents of PICT on stack
Place graph label string in stack
Convert string into a small GROB
Coordinates to place label GROB
Combine PICT with the label GROB
Save combined GROB into PICT
Bring PICT to the stack
End program

Save the program under the name GRPR (GROB PRogram).

Press @GRPR to run

the program. The output will look like this:A program with plotting and drawing functions
In this section we develop a program to produce, draw and label Mohr’s circle
for a given condition of two-dimensional stress. The left-hand side figure below
shows the given state of stress in two-dimensions, with σxx and σyy being
normal stresses, and τxy = τyx being shear stresses. The right-hand side figure

Page 22-33

shows the state of stresses when the element is rotated by an angle φ. In thiscase, the normal stresses are σ’xx and σ’yy, while the shear stresses are τ’xy andτ’yx.

The relationship between the original state of stresses (σxx, σyy, τxy, τyx) and thestate of stress when the axes are rotated counterclockwise by f (σ’xx, σ’yy, τ’xy,τ’yx), can be represented graphically by the construct shown in the figure below.
To construct Mohr’s circle we use a Cartesian coordinate system with the x-axis
corresponding to the normal stresses (σ), and the y-axis corresponding to theshear stresses (τ). Locate the points A(σxx,τxy) and B (σyy, τxy), and draw thesegment AB. The point C where the segment AB crosses the σn axis will be thecenter of the circle. Notice that the coordinates of point C are (½⋅(σyy + σxy),0). When constructing the circle by hand, you can use a compass to trace thecircle since you know the location of the center C and of two points, A and B.
Let the segment AC represent the x-axis in the original state of stress. If you
want to determine the state of stress for a set of axes x’-y’, rotatedcounterclockwise by an angle φ with respect to the original set of axes x-y, draw
segment A’B’, centered at C and rotated clockwise by and angle 2φ with respect
to segment AB. The coordinates of point A’ will give the values (σ’xx,τ’xy), while
those of B’ will give the values (σ’yy,τ’xy).

Page 22-34

The stress condition for which the shear stress, τ’xy, is zero, indicated bysegment D’E’, produces the so-called principal stresses, σPxx (at point D’) andσPyy (at point E’). To obtain the principal stresses you need to rotate thecoordinate system x’-y’ by an angle φn, counterclockwise, with respect to thesystem x-y. In Mohr’s circle, the angle between segments AC and D’C
measures 2φn.
The stress condition for which the shear stress, τ’xy, is a maximum, is given by
segment F’G’. Under such conditions both normal stresses, σ’xx = σ’yy , areequal. The angle corresponding to this rotation is φs. The angle between
segment AC and segment F’C in the figure represents 2φs.

Modular programming
To develop the program that will plot Mohr’s circle given a state of stress, wewill use modular programming. Basically, this approach consists indecomposing the program into a number of sub-programs that are created asPage 22-35

separate variables in the calculator. These sub-programs are then linked by amain program, that we will call MOHRCIRCL. We will first create a subdirectory called MOHRC within the HOME directory, and move into that
directory to type the programs.
The next step is to create the main program and sub-programs within the subdirectory.
The main program MOHRCIRCL uses the following sub-programs:
Θ INDAT: Requests input of σx, σy, τxy from user, produces a list σL ={σx, σy, τxy} as output.
Θ CC&r: Uses σL as input, produces σc = ½(σx+σy), r = radius of
Mohr’s circle, φn = angle for principal stresses, as output.
Θ DAXES: Uses σc and r as input, determines axes ranges and draws
axes for the Mohr’s circle construct
Θ PCIRC: Uses σc, r, and φn as input, draw’s Mohr’s circle by producing
a PARAMETRIC plot
Θ DDIAM: Uses σL as input, draws the segment AB (see Mohr’s circle
figure above), joining the input data points in the Mohr’s circle
Θ σLBL: Uses σL as input, places labels to identify points A and B withlabels “σx” and “σy”.
Θ σAXS: Places the labels “σ” and “τ” in the x- and y-axes, respectively.
Θ PTTL: Places the title “Mohr’s circle” in the figure.

Running the program
If you typed the programs in the order shown above, you will have in your subdirectory MOHRC the following variables: PTTL, σAXS, PLPNT, σLBL, PPTS,DDIAM. Pressing L you find also: PCIRC, DAXES, ATN2, CC&r, INDAT,
MOHRC. Before re-ordering the variables, run the program once by pressing
the soft-key labeled @MOHRC. Use the following:@MOHRC

Launches the main program MOHRCIRCL

25˜Enter σx = 25

75˜Enter σy = 75

50`Enter τxy = 50, and finish data entry.

Page 22-36

At this point the program MOHRCIRCL starts calling the sub-programs to
produce the figure. Be patient. The resulting Mohr’s circle will look as in the
picture to the left.

Because this view of PICT is invoked through the function PVIEW, we cannot get
any other information out of the plot besides the figure itself. To obtain
additional information out of the Mohr’s circle, end the program by pressing$. Then, press š to recover the contents of PICT in the graphics
environment. The Mohr’s circle now looks like the picture to the right (seeabove).
Press the soft-menu keys @TRACE and @(x,y)@. At the bottom of the screen you willfind the value of φ corresponding to the point A(σx, τxy), i.e., φ = 0,(2.50E1, 5.00E1).

Press the right-arrow key (™) to increment the value of φ and see thecorresponding value of (σ’xx, τ’xy). For example, for φ = 45o, we have thevalues (σ’xx, τ’xy) = (1.00E2, 2.50E1) = (100, 25). The value of σ’yy will befound at an angle 90o ahead, i.e., where φ = 45 + 90 = 135o. Press the ™
key until reaching that value of φ, we find (σ’yy, τ’xy) = (-1.00E-10,-2.5E1) = (0,25).
To find the principal normal values press š until the cursor returns to theintersection of the circle with the positive section of the σ-axis. The values foundat that point are φ = 59o, and (σ’xx, τ’xy) = (1.06E2,-1.40E0) = (106, -1.40).
Now, we expected the value of τ’xy = 0 at the location of the principal axes.
What happens is that, because we have limited the resolution on the
independent variable to be Δφ = 1o, we miss the actual point where the shear
stresses become zero. If you press š once more, you find values of are φ =58o, and (σ’xx, τ’xy) = (1.06E2,5.51E-1) = (106, 0.551). What thisPage 22-37

information tell us is that somewhere between φ = 58o and φ = 59o, the shear
stress, τ’xy, becomes zero.
To find the actual value of φn, press $. Then type the list corresponding to
the values {σx σy τxy}, for this case, it will be { 25 75 50 } [ENTER]
Then, press @CC&r. The last result in the output, 58.2825255885o, is the actual
value of φn.

A program to calculate principal stresses

The procedure followed above to calculate φn, can be programmed as follows:
Program PRNST:
«
INDAT
CC&r
“φn” TAG
3 ROLLDRC DUPCR + “σPx” TAG
SWAP CR - “σPy” TAG»

Start program PRNST (PRiNcipal STresses)
Enter data as in program MOHRCIRC
Calculate σc, r, and fn, as in MOHRCIRC
Tag angle for principal stresses
Move tagged angle to level 3
Convert σc and r to (σc, r), duplicate
Calculate principal stress σPx, tag it
Swap,calculate stress σPy, tag it.
End program PRNST

To run the program use:
J@PRNST
25˜
75˜
50`

Start program PRNSTEnter σx = 25
Enter σy = 75
Enter τxy = 50, and finish data entry.

The result is:Ordering the variables in the sub-directory
Running the program MOHRCIRCL for the first time produced a couple of newvariables, PPAR and EQ. These are the Plot PARameter and EQuation variables

Page 22-38

necessary to plot the circle. It is suggest that we re-order the variables in the
sub-directory, so that the programs @MOHRC and @PRNST are the two first variablesin the soft-menu key labels. This can be accomplished by creating the list {MOHRCIRCL PRNST } using: J„ä@MOHRC @PRNST `And then, ordering the list by using:„°@)@MEM@@ @)@DIR@@ @ORDER.

After this call to the function ORDER is performed, press J. You will now seethat we have the programs MOHRCIRCL and PRNST being the first twovariables in the menu, as we expected.

A second example of Mohr’s circle calculations
Determine the principal stresses for the stress state defined by σxx = 12.5 kPa,σyy = -6.25 kPa, and τxy = - 5.0 kPa. Draw Mohr’s circle, and determine fromthe figure the values of σ’xx, σ’yy, and τ’xy if the angle φ = 35o.
To determine the principal stresses use the program @PRNST, as follows:
J@PRNST

Start program PRNST

12.5˜

Enter σx = 12.5

6.25\˜Enter σy = -6.25

5\`Enter τxy = -5, and finish data entry.

The result is:

To draw Mohr’s circle, use the program @MOHRC, as follows:
J@MOHRC

Start program PRNST

12.5˜

Enter σx = 12.5

6.25\˜Enter σy = -6.25

5\`Enter τxy = -5, and finish data entry.

The result is:Page 22-39

To find the values of the stresses corresponding to a rotation of 35o in the angleof the stressed particle, we use:$š

Clear screen, show PICT in graphics screen@TRACE @(x,y)@.

To move cursor over the circle showing φ and (x,y)

Next, press ™ until you read φ = 35. The corresponding coordinates are(1.63E0, -1.05E1), i.e., at φ = 35o, σ’xx = 1.63 kPa, and σ’yy = -10.5kPa.

An input form for the Mohr’s circle program
For a fancier way to input data, we can replace sub-program INDAT, with thefollowing program that activates an input form:« “MOHR’S CIRCLE” { { “σx:” “Normal stress in x” 0 } {“σy:” “Normal stress in y” 0 } { “τxy:” “Shear stress” 0}}{ } { 1 1 1 } { 1 1 1 } INFORM DROP »With this program substitution, running @MOHRC will produce an input form asshown next:

Press @@@OK@@@ to continue program execution. The result is the following figure:

Page 22-40

Since program INDAT is used also for program @PRNST (PRiNcipal STresses),running that particular program will now use an input form, for example,

The result, after pressing @@@OK@@@, is the following:

Page 22-41

Chapter 23
Character strings
Character strings are calculator objects enclosed between double quotes. They
are treated as text by the calculator. For example, the string “SINE
FUNCTION”, can be transformed into a GROB (Graphics Object), to label agraph, or can be used as output in a program. Sets of characters typed by theuser as input to a program are treated as strings. Also, many objects inprogram output are also strings.

String-related functions in the TYPE sub-menu
The TYPE sub-menu is accessible through the PRG (programming) menu, i.e.,„°. The functions provided in the TYPE sub-menu are also shown below.

Among the functions in the TYPE menu that are useful for manipulating strings
we have:
OBJ: Converts string to the object it represents
STR: Converts an object to its string representation
TAG: Tags a quantity
DTAG: Removes the tag from a tagged quantity (de-tags)
CHR: Creates a one-character string corresponding to the number used asargument
NUM: Returns the code for first character in a string
Examples of application of these functions to strings are shown next:

Page 23-1

String concatenation
Strings can be concatenated (joined together) by using the plus sign +, forexample:Concatenating strings is a practical way to create output in programs. For
example, concatenating "YOU ARE " AGE + " YEAR OLD" creates the string"YOU ARE 25 YEAR OLD", where 25 is stored in the variable called AGE.

The CHARS menu
The CHARS sub-menu is accessible through the PRG (programming) menu, i.e.,„°.

The functions provided by the CHARS sub-menu are the following:

Page 23-2

The operation of NUM, CHR, OBJ, and STR was presented earlier in this
Chapter. We have also seen the functions SUB and REPL in relation to graphics
earlier in this chapter. Functions SUB, REPL, POS, SIZE, HEAD, and TAIL have
similar effects as in lists, namely:
SIZE: number of a sub-string in a string (including spaces)
POS: position of first occurrence of a character in a string
HEAD: extracts first character in a string
TAIL: removes first character in a string
SUB: extract sub-string given starting and ending position
REPL: replace characters in a string with a sub-string starting at given position
SREPL: replaces a sub-string by another sub-string in a string
To see those effects on action try the following exercises: Store the string “MYNAME IS CYRILLE” into variable S1. We’ll use this string to show examples ofthe functions in the CHARS menu:

The characters list
The entire collection of characters available in the calculator is accessible
through the keystroke sequence ‚± When you highlight any character,say they line feed character  , you will see at the left side of the bottom of the

Page 23-3

screen the keystroke sequence to get such character (. for this case) and thenumerical code corresponding to the character (10 in this case).
Characters that are not defined appear as a dark square in the characters list() and show (None) at the bottom of the display, even though a numerical code
exists for all of them. Numerical characters show the corresponding number atthe bottom of the display.
Letters show the code α (i.e., ~) followed by the corresponding letter, forexample, when you highlight M, you will see αM displayed at the lower left sideof the screen, indicating the use of ~m. On the other hand, m shows the
keystroke combination αM, or ~„m.
Greek characters, such as σ, will show the code αS, or ~‚s. Somecharacters, like ρ, do not have a keystroke sequence associated with them.
Therefore, the only way to obtain such characters is through the character list byhighlighting the desired character and pressing @ECHO1@ or @ECHO@.
Use @ECHO1@ to copy one character to the stack and return immediately to normal
calculator display. Use @ECHO@ to copy a series of characters to the stack. To
return to normal calculator display use $.
See Appendix D for more details on the use of special characters. Also,
Appendix G shows shortcuts for producing special characters.

Page 23-4

Chapter 24
Calculator objects and flags
Numbers, lists, vectors, matrices, algebraics, etc., are calculator objects. They
are classified according to its nature into 30 different types, which aredescribed below. Flags are variables that can be used to control the calculator
properties. Flags were introduced in Chapter 2.

Description of calculator objects
The calculator recognizes the following object types:_________________________________________________________________
NumberType

Example_________________________________________________________________
0
Real Number-1.23E-5
1Complex Number(-1.2,2.3)
2String"Hello, world "3
Real Array[[1 2][3 4]]4Complex Array[[(1 2) (3 4)][(5 6) (7 8)]
5
List{3 1 'PI'}
6
Global Name
X
7
Local Namey8
Program<<  a 'a^2' >>9Algebraic object'a^2+b^2'
10Binary Integer# 2F1E h
11
Graphic Object
Graphic 131×64
12
Tagged Object
R: 43.5
13
Unit Object
3_m^2/s
14
XLIB NameXLIB 342 8
15
Directory
DIR É END
16
Library
Library 1230"...
17
Backup Object
Backup MYDIR
18
Built-in Function
COS
19
Built-in Command
CLE R

Page 24-1

NumberType

Example____________________________________________________________________
21
Extended Real Number
Long Real22
Extended Complex Number
Long Complex
23
Linked Array
Linked rray
24
Character Object
Character25
Code Object
Code26
Library Data
Library Data
27
External Object
External
28
Integer
342314229
External Object
External
30
External Object
External____________________________________________________________________

Function TYPE
This function, available in the PRG/TYPE () sub-menu, or through the command
catalog, is used to determine the type of an object. The function argument is
the object of interest. The function returns the object type as indicated by the
numbers specified above.

Function VTYPE
This function operates similar to function TYPE, but it applies to a variable name,returning the type of object stored in the variable.

Page 24-2

Calculator flags
A flag is a variable that can either be set or unset. The status of a flag affects
the behavior of the calculator, if the flag is a system flag, or of a program, if it isa user flag. They are described in more detail next.

System flags
System flags can be accessed by using H @)FLAGS!. Press the down arrow key
to see a listing of all the system flags with their number and brief description.
The first two screens with system flags are shown below:

You will recognize many of these flags because they are set or unset in the
MODES menu (e.g., flag 95 for Algebraic mode, 103 for Complex mode, etc.).
Throughout this user’s manual we have emphasized the differences between
CHOOSE boxes and SOFT menus, which are selected by setting or un-setting
system flag 117. Another example of system flag setting is that of system flags
60 and 61 that relate to the constant library (CONLIB, see Chapter 3). These
flags operate in the following manner:ΘΘuser flag 60: clear (default):SI units, set: ENGL units
user flag 61: clear (default):use units, set: value only

Functions for setting and changing flags
These functions can be used to set, un-set, or check on the status of user flags orsystem flags. When used with these functions system flags are referred to withnegative integer numbers. Thus, system flag 117 will be referred to as flag 117. On the other hand, user flags will be referred to as positive integer
numbers when applying these functions. It is important to understand that user
flags have applications only in programming to help control the program flow.
Functions for manipulating calculator flags are available in the PRG/MODES/FLAG menu. The PRG menu is activated with „°. The following screens(with system flag 117 set to CHOOSE boxes) show the sequence of screens to
get to the FLAG menu:

Page 24-3

The functions contained within the FLAG menu are the following:

The operation of these functions is as follows:SF

Set a flag

CF

Clear a flag

FS?

Returns 1 if flag is set, 0 if not set

FC?

Returns 1 if flag is clear (not set), 0 if flag is set

FS?C

Tests flag as FS does, then clears it

FC?C

Tests flag as FC does, then clears it

STOF

Stores new system flag settings

RCLF

Recalls existing flag settings

RESET Resets current field values (could be used to reset a flag)

User flags
For programming purposes, flags 1 through 256 are available to the user. They
have no meaning to the calculator operation.

Page 24-4

Chapter 25
Date and Time Functions
In this Chapter we demonstrate some of the functions and calculations using
times and dates.

The TIME menu
The TIME menu, available through the keystroke sequence ‚Ó (the 9 key)
provides the following functions, which are described next:

Setting an alarm
Option 2. Set alarm.. provides an input form to let the user set an alarm. The
input form looks like in the following figure:

The Message: input field allows you to enter a character string identifying thealarm. The Time: field lets you enter the time for activating the alarm. The Date:
field is used to set the date for the alarm (or for the first time of activation, if
repetition is required). For example, you could set the following alarm. The lefthand side figure shows the alarm with no repetition. The right-hand figure
shows the options for repetition after pressing @CHOOS. After pressing @@@OK@@@ thealarm will be set.

Page 25-1

Browsing alarms
Option 1. Browse alarms... in the TIME menu lets you review your current
alarms. For example, after entering the alarm used in the example above, thisoption will show the following screen:This screen provides four soft menu key labels:
EDIT: For editing the selected alarm, providing an alarm set input form
NEW: For programming a new alarm
PURG: For deleting an alarm
OK : Returns to normal display

Setting time and date
Option 3. Set time, date… provides the following input form that let’s the user
set the current time and date. Details were provided in Chapter 1.

TIME Tools
Option 4. Tools… provides a number of functions useful for clock operation,and calculations with times and dates. The following figure shows the functions
available under TIME Tools:

Page 25-2

The application of these functions is demonstrated below.
DATE:
DATE:
TIME:
TIME:TICKS:

Places current date in the stackSet system date to specified value
Places current time in 24-hr HH.MMSS format
Set system time to specified value in 24-hr HH.MM.SS format
Provides system time as binary integer in units of clock ticks with 1tick = 1/8192 sec
ALRM..:
Sub-menu with alarm manipulation functions (described later)
DATE+:
Adds or subtract a number of days to a date
DDAYS(x,y): Returns number of days between dates x and yHMS:
Converts time from decimal to HH.MMSS
HMS:Converts time from HH.MMSS to decimalHMS+:
Add two times in HH.MMSS format
HMS-:
Subtract two times in HH.MMSS format
TSTR(time, date): Converts time, date to string format
CLKADJ(x): Adds x ticks to system time (1 tick = 1/8192 sec )Functions DATE, TIME, CLKADJ are used to adjust date and time. There are
no examples provided here for these functions.
Here are examples of functions DATE, TIME, and TSTR:

Calculations with dates
For calculations with dates, use functions DATE+, DDAYS. Here is an example
of application of these functions, together with an example of function TICKS:

Page 25-3

Calculating with times
The functions HMS, HMS, HMS+, and HMS- are used to manipulate values
in the HH.MMSS format. This is the same format used to calculate with angle
measures in degrees, minutes, and seconds. Thus, these operations are useful
not only for time calculations, but also for angular calculations. Examples areprovided next:

Alarm functions
The sub-menu TIME/Tools…/ALRM… provides the following functions:

The operation of these functions is provided next:
ACK:
Acknowledges past due alarm
ACKALL:Acknowledges all past due alarms
STOALARM(x): Stores alarm (x) into system alarm list
RCLALARM(x): Recalls specified alarm (x) from system alarm list
DELALARM(x): Deletes alarm x from system alarm list
FINDALARM(x): Returns first alarm due after specified time
The argument x in function STOALARM is a list containing a date reference(mm.ddyyy), time of day in 24 hr format (hh.mm), a string containing the text of
the alarm, and the number of repetitions of the alarm. For example,
STO L RM({6.092003,18.25,"Test",0}. The argument x in all
the other alarm functions is a positive integer number indicating the number of
the alarm to be recalled, deleted, or found.
Since the handling of alarms can be easily done with the TIME menu (seeabove), the alarm-related functions in this section are more likely to be used forprogramming purposes.
Page 25-4

Chapter 26
Managing memory
In Chapter 2 we introduced the basic concepts of, and operations for, creating
and managing variables and directories. In this Chapter we discuss the
management of the calculator’s memory, including the partition of memory andtechniques for backing up data.

Memory Structure
The calculator contains a total of 2.5 MB of memory, out of which 1 MB is used
to store the operating system (system memory), and 1.5 MB is used for
calculator operation and data storage (user’s memory). Users do not haveaccess to the system memory component. To see the way in which the user’s
memory is partitioned, use the FILES function („¡). A possible result isshown below:

This screen indicates the existence of three memory ports, besides the memory
corresponding to the HOME directory (see Chapter 2 in this guide). The
memory ports available are:ΘΘΘPort 0, labeled IRAMPort 1, labeled ERAMPort 2, labeled FLASHPort 0 and the HOME directory share the same area of memory, so that themore data stored in the HOME directory, for example, the less memory isavailable for Port 0 storage. The total size of memory for the Port 0/HOME
directory memory area is 241 KB.

Page 26-1

Port 1 (ERAM) can contain up to 128 KB of data. Port 1, together with Port 0
and the HOME directory, constitute the calculator’s RAM (Random Access
Memory) segment of calculator’s memory. The RAM memory segment requires
continuous electric power supply from the calculator batteries to operate. To
avoid loss of the RAM memory contents, a CR2032 backup battery is included.
See additional details at the end of this chapter.
Port 2 belongs to the calculator’s Flash ROM (Read-Only Memory) segment,
which does not require a power supply. Therefore, removing the batteries of thecalculators will not affect the calculator’s Flash ROM segment. Port 2 can store
up to 1085 KB of data.
A fourth port, Port 3, is available for use with an SD flash memory card. An
example is shown below.

The port appears in File Manager only when an SD card is inserted.

The HOME directory
When using the calculator you may be creating variables to store intermediate
and final results. Some calculator operations, such as graphics and statisticaloperations, create their own variables for storing data. These variables will be
stored in the HOME directory or one of its directories. Details on the
manipulation of variables and directories are presented in Chapter 2.

Port memory
Unlike the HOME directory, the memory in ports 0, 1 and 2 cannot be subdivided into directories, and it can only contain backup objects or libraryobjects. These object types are described below.

Page 26-2

Checking objects in memory
To see the objects stored in memory you can use the FILES function („¡).
The screen below shows the HOME directory with five directories, namely,
TRIANG, MATRX , MPFIT, GRPHS, and CASDIR.

Additional directories can be viewed by moving the cursor downwards in the
directory tree. Or you can move the cursor upwards to select a memory port.
When a given directory, sub-directory or port is selected, press @@@OK@@@ to see thecontents of the selected object.
Another way to access port memory is by using the LIB menu (‚á,
associated with the 2 key). This action produces the following screen:

If you have any library active in your calculator it will be shown in this screen.
One such library is the @)HP49D (demo) library shown in the screen above.
Pressing the corresponding soft-menu key (A) will activate this library.
Pressing the port soft menu keys will open that memory port. Additional
information on libraries is presented below.

Page 26-3

Backup objects
Backup objects are used to copy data from your home directory into a memory
port. The purpose of backing up objects in memory port is to preserve thecontents of the objects for future usage. Backup objects have the following
characteristics:
Θ

Backup objects can only exist in port memory (i.e., you cannot back up
an object in the HOME directory, although you can make as many
copies of it as you want)ΘYou cannot modify the contents of a backup object (you can, however,copy it back to a directory in the HOME directory, modify it there, andback it up again modified)Θ

You can store either a single object or an entire directory as a single
backup object. You cannot, however, create a backup object out of anumber of selected objects in a directory.

When you create a backup object in port memory, the calculator obtains acyclic redundancy check (CRC) or checksum value based on the binary datacontained in the object. This value is stored with the backup object, and isused by the calculator to monitor the integrity of the backup object. When you
restore a backup object into the HOME directory, the calculator recalculates the
CRC value and compares it to the original value. If a discrepancy is noticed,
the calculator warns the user that the restored data may be corrupted.

Backing up objects in port memory
The operation of backing up an object from user memory into one of thememory ports is similar to the operation of copying a variable from one subdirectory to another (see details in Chapter 2). You can, for example, use theFile Manager („¡) to copy and delete backup objects as you would dowith normal calculator objects. In addition, there are specific commands for
manipulating back up objects, as described next.

Page 26-4

Backing up and restoring HOME
You can back up the contents of the current HOME directory in a single back up
object. This object will contain all variables, key assignments, and alarms
currently defined in the HOME directory. You can also restore the contents ofyour HOME directory from a back up object previously stored in port memory.
The instructions for these operations follow.
Backing up the HOME directory
To back up the current HOME directory using algebraic mode, enter thecommand:
ARCHIVE(:Port_Number: Backup_Name)
Here, Port_Number is 0, 1, 2 (or 3, if an SD memory card is available -- see
below), and Backup_Name is the name of the backup object that will store thecontents of HOME. The : : container is entered by using the keystroke sequence„ê. For example, to back up HOME into HOME1 in Port 1, use:

To back up the HOME directory in RPN mode, use the command:: Port_Number : Backup_Name ` ARCHIVE
Restoring the HOME directory
To restore the Home directory in algebraic mode use the command:
RESTORE(: Port_Number : Backup_Name)
For example, to restore the HOME directory out of backup object HOME1, use:
RESTORE(:1:HOME1)In RPN mode use:
: Port_Number : Backup_Name ` RESTORE

Page 26-5

Note: When you restore a HOME directory backup two things happen:Θ The backup directory overwrites the current HOME directory. Thus, any
data not backed up in the current HOME directory will be lost.
Θ The calculator restarts. The contents of history or stack are lost.

Storing, deleting, and restoring backup objects
To create a backup object use one of the following approaches:Θ Use the File Manager („¡) to copy the object to port. Using thisapproach, the backup object will have the same name as the original
object.
Θ Use the STO command to copy the object to a port. For example, in
algebraic mode, to back up variable A into a backup object named AA in
port 1, use the keystroke sequence:Θ@@@A@@@ K „ê1™~a~a`
Use the ARCHIVE command to create a backup of the HOME directory (seeabove).

To delete a backup object from a port:
Θ Use the File Manager („¡) to delete the object as you would avariable in the HOME directory (see Chapter 2).
Θ Use the PURGE command as follows:
In algebraic mode, use:

PURGE(: Port_Number : Backup_Name)In RPN mode, use:

: Port_Number : Backup_Name PURGE

To restore a backup object:
Θ Use the File Manager („¡) to copy the backup object from Port
memory to the HOME directory.
Θ When a backup object is restored, the calculator performs an integrity
check on the restored object by calculating its CRC value.
Any
discrepancy between the calculated and the stored CRC values result in anerror message indicating a corrupted data.

Page 26-6

Using data in backup objects
Although you cannot directly modify the contents of backup objects, you can
use those contents in calculator operations. For example, you can run programs
stored as backup objects or use data from backup objects to run programs. To
run backup-object programs or use data from backup objects you can use theFile Manager („¡) to copy backup object contents to the screen.
Alternatively, you can use function EVAL to run a program stored in a backup
object, or function RCL to recover data from a backup object as follows:Θ In algebraic mode:To evaluate a back up object, enter:
EVAL(argument(s), : Port_Number : Backup_Name )To recall a backup object to the command line, enter:
RCL(: Port_Number : Backup_Name)ΘIn RPN mode:To evaluate a back up object, enter:Argument(s) ` : Port_Number : Backup_Name EVAL

To recall a backup object to the command line, enter:: Port_Number : Backup_Name ` RCL

Using SD cards
The calculator has a memory card port into which you can insert an SD flashcard for backing up calculator objects, or for downloading objects from othersources. The SD card in the calculator will appear as port number 3.

Inserting and removing an SD card
The SD slot is located on the bottom edge of the calculator, just below thenumber keys. SD cards must be inserted facing down. Most cards have a label
on what would usually be considered the top of the card. If you are holding the
HP 50g with the keyboard facing up, then this side of the SD card should facedown or away from you when being inserted into the HP 50g. The card will
go into the slot without resistance for most of its length and then it will requireslightly more force to fully insert it. A fully inserted card is almost flush with thecase, leaving only the top edge of the card visible.

Page 26-7

To remove an SD card, turn off the HP 50g, press gently on the exposed edgeof the card and push in. The card should spring out of the slot a small distance,
allowing it now to be easily removed from the calculator.

Formatting an SD card
Most SD cards will already be formatted, but they may be formatted with a filesystem that is incompatible with the HP 50g. The HP 50g will only workwith cards in the FAT16 or FAT32 format.
You can format an SD card from a PC, or from the calculator. If you do it fromthe calculator (using the method described below), make sure that yourcalculator has fresh or fairly new batteries.
Note: formatting an SD card deletes all the data that is currently on it.
1. Insert the SD card into the card slot (as explained in the previous section).
2. Hold down the ‡ key and then press the D key. Release the D key
and then release the ‡ key. The system menu is displayed with several
choices.
3. Press 0 for FORMAT. The formatting process begins.
4. When the formatting is finished, the HP 50g displays the message"FORMAT FINISHED. PRESS ANY KEY TO EXIT". To exit the system menu,
hold down the ‡ key, press and release the C key and then releasethe ‡ key.
The SD card is now ready for use. It will have been formatted in FAT32 format.
Alternative method
When an SD card is inserted, !FORMA! appears an additional menu item in FileManager. Selecting this option reformats the card, a process which also deletes
every object on the card.

Page 26-8

Accessing objects on an SD card
Accessing an object from the SD card is similar to when an object is located in
ports 0, 1, or 2. However, Port 3 will not appear in the menu when using the
LIB function (‚á). The SD files can only be managed using the Filer, orFile Manager („¡). When starting the Filer, the Tree view will appear as
follows if you have an SD card inserted:

Long names of files on an SD card are supported in the Filer, but are displayed
as 8.3 characters, as in DOS, i.e., displayed names will have a maximum of 8
characters with 3 characters in the suffix. The type of each object will be
displayed, unless it is a PC object or an object of unknown type. (In these cases,
its type is listed as String.)
In addition to using the File Manager operations, you can use functions STO
and RCL to store objects on, and recall objects from, the SD card, as shown
below. You can also use the PURGE command to erase backup objects in the
SD card. Long names can be used with these commands (namely, STO, RCL,
and PURGE).

Storing objects on an SD card
To store an object, use function STO as follows:Θ In algebraic mode:Enter object, press K, type the name of the stored object using port 3
Θ(e.g., :3:V R1), press `.
In RPN mode:Enter object, type the name of the stored object using port 3 (e.g.,:3:V R1), press K.

Page 26-9

Note that if the name of the object you intend to store on an SD card is longer
than eight characters, it will appear in 8.3 DOS format in port 3 in the Filer
once it is stored on the card.

Recalling an object from an SD card
To recall an object from the SD card onto the screen, use function RCL, asfollows:
Θ In algebraic mode:
Press „©, type the name of the stored object using port 3 (e.g.,:3:V R1), press `.
Θ In RPN mode:
Type the name of the stored object using port 3 (e.g., :3:V R1), press„©.
With the RCL command, it is possible to recall variables by specifying a path in
the command, e.g., in RPN mode: :3: {path} ` RCL. The path, like ina DOS drive, is a series of directory names that together specify the position of
the variable within a directory tree. However, some variables stored within abackup object cannot be recalled by specifying a path. In this case, the fullbackup object (e.g., a directory) will have to be recalled, and the individual
variables then accessed in the screen.
Note that in the case of objects with long files names, you can specify the fullname of the object, or its truncated 8.3 name, when issuing an RCL command.

Evaluating an object on an SD card
To evaluate an object on an SD card, insert the card and then:
1. Press !ê. This puts a double colon on the edit line with the cursor
blinking between the colons. This is the way the HP 50g addresses items
stored in its various ports. Port 3 is the SD card port.
2. Press 3™³~~ [name of the object] `. This will place thename and path of the object to be evaluated on the stack.
3. To evaluate the object, press μ.

Page 26-10

Note that in the case of objects with long files names, you can specify the fullname of the object, or its truncated 8.3 name, when evaluating an object on an
SD card.

Purging an object from the SD card
To purge an object from the SD card onto the screen, use function PURGE, asfollows:
Θ In algebraic mode:
Press I @PURGE, type the name of the stored object using port 3 (e.g.,:3:V R1), press `.
Θ In RPN mode:
Type the name of the stored object using port 3 (e.g., :3:V R1), press
I @PURGE.
Note that in the case of objects with long files names, you can specify the fullname of the object, or its truncated 8.3 name, when issuing a PURGE
command.

Purging all objects on the SD card (by reformatting)
You can purge all objects from the SD card by reformatting it. When an SD
card is inserted, FORMA appears an additional menu item in File Manager.
Selecting this option reformats the entire card, a process which also deletes
every object on the card.

Specifying a directory on an SD card
You can store, recall, evaluate and purge objects that are in directories on an
SD card. Note that to work with an object at the root level of an SD card, the³ key is used. But when working with an object in a subdirectory, the namecontaining the directory path must be enclosed using the …Õ keys.
For example, suppose you want to store an object called PROG1 into a
directory called PROGS on an SD card. With this object still on the first level ofthe stack, press:!ê3™…Õ~~progs…/prog1`K

Page 26-11

This will store the object previously on the stack onto the SD card into thedirectory named PROGS into an object named PROG1. Note: If PROGS does
not exist, the directory will be automatically created.
You can specify any number of nested subdirectories. For example, to refer toan object in a third-level subdirectory, your syntax would be::3:”DIR1/DIR2/DIR3/NAME”
Note that pressing ~ …/ produces the forward slash character.

Using libraries
Libraries are user-created binary-language programs that can be loaded into
the calculator and made available for use from within any sub-directory of the
HOME directory. In addition, the calculator is shipped with two libraries thattogether provide all the functionality of the Equation Library.
Libraries can be downloaded into the calculator as a regular variable, and,then, installed and attached to the HOME directory.

Installing and attaching a library
To install a library, list the library contents in the stack (use ‚ variable softmenu key, or function RCL) and store it into port 0 or 1. For example, to installa library variable into a port use:ΘΘ

In algebraic mode:STO(Library_variable, port_number)
In RPN mode: Library_variable ` port_number K

After installing the library contents in port memory you need to attach thelibrary to the HOME directory. This can be accomplished by rebooting the
calculator (turning the calculator off and back on), or by pressing,simultaneously, $C. At this point the library should be available for use.
To see the library activation menu use the LIB menu (‚á). The libraryname will be listed in this menu.

Page 26-12

Library numbers
If you use the LIB menu (‚á) and press the soft menu key corresponding toport 0, 1 or 2, you will see library numbers listed in the soft menu key labels.
Each library has a three or four-digit number associated with it. (For example,
the two libraries that make up the Equation Library are in port 2 and arenumbered 226 and 227.) These numbers are assigned by the library creator,
and are used for deleting a library.

Deleting a library
To delete a library from a port, use:ΘΘ

In algebraic mode:PURGE(:port_number: lib_number)
In RPN mode: : port_number : lib_number PURGE

Where lib_number is the library number described above.
WARNING: Libraries 226 and 227 in port 2 constitute the Equation Library.
You can delete these libraries just as you can a user-created library. However, if
you are thinking of deleting these libraries but there is some likelihood that you
will need to use the Equation Library in the future, you should copy them to aPC, using the HP 48/50 Calculator Connectivity Kit, before deleting them on
the calculator. You will then be able to re-install the libraries later when you
need to use the Equation Library.

Creating libraries
A library can be written in Assembler language, in System RPL language, or byusing a library-creating library such as LBMKR. The latter program is available
online (see for example, http://www.hpcalc.org). The details of programming
the calculator in Assembler language or in System RPL language are beyond
the scope of this document. The user is invited to find additional information on
the subject online.

Backup battery
A CR2032 back up battery is included in the calculator to provide power
backup to volatile memory when changing the main batteries. It is
recommended that you replace this battery every 5 years. A screen message

Page 26-13

will indicate when this battery needs replacement. The diagram below shows
the location of the backup battery in the top compartment at the back of thecalculator.

Page 26-14

Chapter 27
The Equation Library
The Equation Library is a collection of equations and commands that enable
you to solve simple science and engineering problems. The library consists ofmore than 300 equations grouped into 15 technical subjects containing morethan 100 problem titles. Each problem title contains one or more equations that
help you solve that type of problem. Appendix M contains a table of the groups
and problem titles available in the Equation Library.
Note: the examples in this chapter assume that the operating mode is RPN andthat flag –117 is set. (Flag –117 should be set whenever you use the numeric
solver to solve equations in the equations library.)
WARNING: You can delete the Equation Library if you need more room on
your calculator. Libraries 226 and 227 in port 2 constitute the Equation Library,
and they can be deleted just like any user-created library. However, if you arethinking of deleting these libraries but there is some likelihood that you willneed to use the Equation Library in the future, you should copy them to a PC,
using the HP 48/49 Calculator Connectivity Kit, before deleting them on thecalculator. You will then be able to re-install the libraries later when you need touse the Equation Library. (Deleting a library is explained in chapter 26.)

Solving a Problem with the Equation Library
Follow these steps for solving an equation using the Equation Library.
1. Press G—` EQLIB EQNLI to start the Equation Library.
2. Set the unit options you want by pressing the ##SI##, #ENGL#, and UNITS menu
keys.
3. Highlight the subject you want (for example, Fluids) and press `.
4. Highlight the title you want (for example, Pressure at Depth) and press `.
5. The first equation is displayed. Press #NXEQ# to display subsequent equations.
6. Press #SOLV# to start the Solver.

Page 27-1

7.

For each known variable, type its value and press the corresponding menu
key. If a variable is not shown, press L to display further variables.

8. Optional: supply a guess for an unknown variable. This can speed up thesolution process or help to focus on one of several solutions. Enter a guess
just as you would the value of a known variable.
9. Press ! followed by the menu key of the variable for which you aresolving. If you want to solve all the equations in the selected title, press !
##ALL#. The Solver then calculates values for all the variables not previously
defined by you.

Using the Solver
When you select a subject and a title in the Equation Library, you specify a set
or one or more equations. Then, when you press #SOLV# , you leave the Equation
Library catalogs and start solving the equations you’ve selected.
When you press #SOLV# in the Equation Library, the application does thefollowing:The set of equations is stored in the appropriate variable: EQ for one
equation, EQ and Mpar for more than one equation. (Mpar is a reserved
variable used by the Multiple-Equation Solver.) Note: because EQ and
Mpar are variables, you can have a different EQ and Mpar for eachdirectory in memory.

Each variable is created and set to zero unless it already exists. (If thevariable name has been used by the solver before, then it is a global
variable and therefore already exists: until you purge it.)

Each variable’s units are set to the conditions you specified: SI or English,
and units used or not used—unless the variable already exists and has units
dimensionally consistent with what you specified. (To change from English
to SI units or vice versa, you must first purge the existing variables or
explicitly enter the units with the values.)The appropriate solver is started: the SOLVR for one equation, the MultipleEquation Solver for more than one equation.

Page 27-2

Using the menu keys
The actions of the unshifted and shifted variable menu keys for both solvers are
identical. Notice that the Multiple Equation Solver uses two forms of menu
labels: black and white. The L key displays additional menu labels, if
required. In addition, each solver has special menu keys, which are describedin the following table. You can tell which solver is started by looking at the
special menu labels.
Actions for Solver Menu Keys

Operation

Store value
Solve for value

SOLVE application

Multiple-Equation Solver!!!!!!!!!X!!!!!!!!!

!!!!!!!!!X!!!!!!!!!

! !!!!!!!!!X!!!!!!!!!

! !!!!!!!!!X!!!!!!!!!
! #%X%#

Recall value… !!!!!!!!!X!!!!!!!!!

… !!!!!!!!!X!!!!!!!!!
… #%X%#

Evaluate equation# EXPR=

Next equation (if#NXEQ#

applicable)
Undefine all##ALL#

Solve for all!##ALL#

Progress catalog… ##ALL#

Set states!MUSER! !MCALC!

Page 27-3

Browsing in the Equation Library
When you select a subject and title in the Equation Library, you specify a set ofone or more equations. You can get the following information about theequation set from the Equation Library catalogs:
The equations themselves and the number of equations.



The variables used and their units. (You can also change the units.)



A picture of the physical system (for most equation sets).

Viewing equations
All equations have a display form and some applications also have acalculation form. The display form gives the equation in its basic form, the form
you would see in books. The calculation form includes computational
refinements. If an equation has a computational form, an * appears in theupper left corner of the equation display.
Operations for viewing Equations and Pictures
Key

ActionExample#EQN# #NXEQ#

Shows the display form of
current or next equation in
EquationWriter format.

`

Shows the display form of
current or next equation as analgebraic object. ` or ˜shows the next equation, —shows the previous.

'B=(μ0*μr*I)/(2*à*r)'Shows calculation form byputting a list containing thecurrent set of equations on thestack.

{'B=IFTE(r<rw,CO
NST(μ0)*μr*I*r/(2*à*rw^2),CONST(μ0)*μr*I/(2*à*r))' }B=

μ0 ⋅ μr ⋅ I
2 ⋅π ⋅ r

Page 27-4

Viewing variables and selecting units
After you select a subject and title, you can view the catalog of names,
descriptions, and units for the variables in the equation set by pressing #VARS#.
The table below summarizes the operations available to you in the Variable
catalogs.
Operations in Variable catalogs
Key

L

ActionToggles between the catalog of descriptions and the catalog
of units.

#!#SI##@ENGL#

Makes SI or English units active, unless this conflicts with theunits already defined for an existing (global) variable. Purge
existing variables (or enter the specific units) to eliminate
conflicts.

!UNITS

Toggles between units used and units not used.
Creates or changes all equation variables to have indicatedunit type and usage.

#PURG#

Purges all equation variables for this title in the current
directory. This also eliminates SI vs. English units conflicts.

Viewing the picture
After you select a subject and title, you can view the picture of the problem (ifthe title has a picture).
To see the picture, press @#PIC#@. While the picture is displayed, you can:Page 27-5



Press
to store the picture in PICT, the graphics memory. Then you
can use © PICT (or © PICTURE) to view the picture again after you
have quit the Equation Library.



Press a menu key or to view other equation information.

Using the Multiple-Equation Solver
The Equation Library starts the Multiple-Equation Solver automatically if theequation set contains more than one equation. However, you can also start it up
explicitly using your own set of equations (see “Defining a set of equations” onpage 27-8).
When the Equation Library starts the Multiple-Equation Solver, it first stores theequation set in EQ and stores a copy of the equation set, the list of variables,
and additional information in Mpar. Mpar is then used to set up the Solver
menu for the current equation set. (Note that although you can view and edit
EQ directly like any other variable, Mpar can only be edited indirectly (byexecuting commands that modify it) as it is structured as library data dedicatedto the Multiple-Equation Solver application.)
The following table summarizes the actions for the solver menu keys. The L
key shows additional menu labels.
Solver Menu Keys
Operation

Store value

Solve for value

Recall value

Key

Action!!!!!!!!!X!!!!!!!!!
%%X$$

Creates a variable if necessary, andmakes it user-defined. If the value has
no units, the units of the previous value
are appended, if any.

! !!!!!!!!!X!!!!!!!!!
! %%X$$Creates a variable if necessary, solves
for its value, and makes it not userdefined.

… !!!!!!!!!X!!!!!!!!!

Recalls value of variable to the stack.

… %%X$$

Page 27-6

Undefined all%ALL%

Makes all variables not user-defined,
but does not specify their values.

Solve for all!%ALL%Creates variables if necessary andsolves for all that are not user-defined(or as many as possible).

Progress catalog… %ALL%Shows information about the last
solution.

User-defined

MUSER

Sets states to user-defined for variable
or list of variables on the stack.

Calculated

MCALC

Sets states to not user-defined(calculated result) for variable or list ofvariables on the stack

The menu labels for the variable keys are white at first, but change during thesolution process as described below.
Because a solution involves many equations and many variables, the MultipleEquation Solver must keep track of variables that are user-defined and not
defined—those it can’t change and those it can. In addition, it keeps track ofvariables that it used or found during the last solution process.
The menu labels indicate the states of variables. They are automaticallyadjusted as you store variables and solve for variables. You can check thatvariables have proper states when you supply guesses and find solutions.
Notice that marks the variables that were used in the last solution—theirvalues are compatible with each other. Other variables may not havecompatible values because they aren’t involved in the solution.

Page 27-7

Meanings of Menu Labels
Label

Meaning!!!!!!!!!X0!!!!!!!!!

Value x0 is not defined by you and not used in the last solution.
It can change with the next solution.

!!!!!!!X0!!ëëëë!!!

Value x0 is not defined by you, but it was found in the last
solution. It can change in the next solution.

$$X0$$

Value x0 is defined by you and not used in the last solution. It
cannot change in the next solution (unless you solve only for thisvariable).

$#X0#qqqq!

Value x0 is defined by you and used in the last solution. It
cannot change in the next solution (unless you solve only for thisvariable).

Defining a set of equations
When you design a set of equations, you should do it with an understanding of
how the Multiple-Equation Solver uses the equations to solve problems.
The Multiple-Equation Solver uses the same process you’d use to solve for an
unknown variable (assuming that you were not allowed to create additionalvariables). You’d look through the set of equations for one that has only one
variable that you didn’t know. You’d then use the root-finder to find its value.
Then you would do this again until you’ve found the variable you want.
You should choose your equations to allow likely unknown variables to occur
individually in equations. You must avoid having two or more unknown
variables in all equations. You can also specify equations in an order that’s bestfor your problems.

Page 27-8

For example, the following three equations define initial velocity andacceleration based on two observed distances and times. The first two
equations alone are mathematically sufficient for solving the problem, but eachequation contains two unknown variables. Adding the third equation allows asuccessful solution because it contains only one of the unknown variables.

x1 = v 0 + a ⋅ t 1
x2 = v0 + a ⋅ t 2( x 2 − x 1) = a ⋅ (t 2 − t 1)
To create more robust equations, you can include functions that ensure properand faster calculations—for example, CONST and TDELTA, UBASE, EXP, andIFTE.
If your equations use any of the following functions, their variables won’t
necessarily be detected by the Multiple-Equation Solver: Σ, ∫, ∂, |, QUOTE,APPLY, TVROOT, and CONST.
The list of equations in EQ may contain menu definitions, but those definitions
are ignored by MINIT when it creates Mpar. However, you can reorder themenu labels using MITM (described below).
To create a set of equations for the Multiple-Equation Solver
1. Enter each equation in the set onto the stack.
2. Press — to begin the Interactive Stack and then move the cursor up to thelevel containing the first equation you entered.
3. Pressto combine them into a list.

4. Press ³ ~ e ~ q K to store the list into the EQ variable.
5. Press G—`EQLIB EQLIB $MES# !MINIT! to create Mpar and prepare theequation set for use with the Multiple-Equation Solver.

Page 27-9

6. Press !MSOLV! to launch the solver with the new set of equations.
To change the title and menu for a set of equations
1. Make sure that the set of equations is the current set (as they are used when
the Multiple-Equation Solver is launched).
2. Enter a text string containing the new title onto the stack.
3. Enter a list containing the variable names in the order you want them toappear on the menu. Use a "" to insert a blank label. You must include all
variables in the original menu and no others, and you must match
uppercase and lowercase characters.
4. Press G—`EQLIB EQLIB $MES# !MINIT!.

Interpreting results from the Multiple-Equation Solver
The Multiple-Equation Solver solves for variables by repeatedly looking throughthe set of equations for one that contains only one variable that’s unknown (notuser-defined and not found by the solver during this solution). It then uses the
root-finder to find that value. It continues eliminating unknown variables until it
solves for the variable you specified (or until it can’t solve for any morevariables). Each time the Multiple-Equation Solver starts solving for a variable,
only the variables with black menu labels are known.
During the solution process, the Multiple-Equation Solver shows the variable it iscurrently solving for. It also shows the type of root found (zero, sign-reversal, or
extremum) or the problem if no root is found (bad guesses or constant).
The following messages indicate errors in the problem setup:

Bad Guess(es). Units may be missing or inconsistent for a variable.
For a list of guesses, at least one of the list elements must have consistentunits.



Too Many Unknowns. The solver eventually encountered only
equations having at least two unknowns. Either enter other known values,
or change the set of equations.

Page 27-10

Constant? The initial value of a variable may be leading the rootfinder in the wrong direction. Supply a guess in the opposite direction froma critical value. (If negative values are valid, try one.)

Checking solutions
The variables having a šmark in their menu labels are related for the mostrecent solution. They form a compatible set of values satisfying the equations
used. The values of any variables without marks may not satisfy the equations
because those variables were not involved in the solution process.
If any solutions seem improper, check for the following problems:

Wrong units. A known or found variable may have units different fromthose you assumed. These are global variables. If the variable existed
before this calculation, then its unit system (SI or English) takes priority. To
correct the units, either purge the variables before solving the equation, or
enter the specific units you want.

No units. If you are not using variables, your implied units may not becompatible among your variables or with the implied units of constants orfunctions. The current angle mode sets the implied units for angles.

Multiple roots. An equation may have multiple roots, and the solver may
have found an inappropriate one. Supple a guess for the variable to focus
the search in the appropriate range.

Wrong variable states. A known or unknown variable may not have theappropriate state. A known variable should have a black menu label, andan unknown variable should have a white label.



Inconsistent conditions. If you enter values that are mathematicallyinconsistent for the equations, the application may give results that satisfy
some equations but not all. This includes over-specifying the problem,
where you enter values for more variables than are needed to define aphysically realizable problem—the extra values may create an impossible
or illogical problem. ( The solutions satisfy the equations the solver used,
but the solver doesn’t try to verify that the solution satisfies all of theequations.)

Page 27-11



Not related. A variable may not be involved in the solution (no mark in
the label), so it is not compatible with the variables that were involved.

Wrong direction. The initial value of a variable may be leading the rootfinder in the wrong direction. Supply a guess in the opposite direction froma critical value. (If negative values are valid, try one.)

Page 27-12

Appendix A
Using input forms
This example of setting time and date illustrates the use of input forms in thecalculator. Some general rules:
Θ Use the arrow keys (š™˜—) to move from one field to the next
in the input form.
Θ Use any the @CHOOS soft menu key to see the options available for any
given field in the input form.
Θ Use the arrow keys (š™˜—) to select the preferred option for agiven field, and press the !!@@OK#@ (F) soft menu key to make theselection.
Θ In some instances, a check mark is required to select an option in an
input form. In such case use the @@CHK@@ soft menu key to toggle thecheck mark on and off.
Θ Press the @CANCL soft menu key to close an input form and return to thestack display. You can also press the ` key or the ‡ key to close
the input form.

Example - Using input forms in the NUM.SLV menu
Before discussing these items in detail we will present some of the characteristicsof the input forms by using input forms from the financial calculation applicationin the numerical solver. Launch the numerical solver by using‚Ï(associated with the 7 key). This produces a choose box that
includes the following options:

To get started with financial calculations use the down arrow key (˜) to selectitem 5. Solve finance. Press @@OK@@, to launch the application. The resulting
screen is an input form with input fields for a number of variables (n, I%YR, PV,
PMT, FV).

Page A-1

In this particular case we can give values to all but one of the variables, say, n= 10, I%YR = 8.5, PV = 10000, FV = 1000, and solve for variable PMT (themeaning of these variables will be presented later). Try the following:
10 @@OK@@Enter n = 10

8.5 @@OK@@

Enter I%YR = 8.5

10000 @@OK@@

Enter PV = 10000

˜1000 @@OK@@

Enter FV = 1000

— š @SOLVE!

Select and solve for PMT

The resulting screen is:

In this input form you will notice the following soft menu key labels:@EDIT

Press to edit highlighted field!)AMOR

Amortization menu - option specific to this application@SOLVE

Press to solve for highlighted field

Pressing L we see the following soft menu key labels:!RESET

Reset fields to default values
Page A-2

!CALC

Press to access the stack for calculations!TYPES

Press to determine the type of object in highlighted field!CANCL

Cancel operation@@OK@@

Accept entry

If you press !RESET you will be asked to select between the two options:If you select Reset value only the highlighted value will be reset to the default
value. If, instead, you select Rest all, all the fields will be reset to their default
values (typically, 0). At this point you can accept your choice (press @@OK@@), or
cancel the operation (press !CANCL). Press !CANCL in this instance. Press !CALC toaccess the stack. The resulting screen is the following:

At this point, you have access to the stack, and the value last highlighted in the
input form is provided for you. Suppose that you want to halve this value. The
following screen follows in ALG mode after entering
1136.22/2:

Page A-3

(In RPN mode, we would have used 1136.22 ` 2 `/).
Press @@OK@@ to enter this new value. The input form will now look like this:Press !TYPES to see the type of data in the PMT field (the highlighted field). As aresult, you get the following specification:

This indicates that the value in the PMT field must be a real number. Press @@OK@@
to return to the input form, and press L to recover the first menu. Next, press the` key or the $ key to return to the stack. In this instance, the following
values will be shown:

The top result is the value that was solved for PMT in the first part of theexercise. The second value is the calculation we made to redefine the value of
PMT.

Page A-4

Appendix B
The calculator’s keyboard
The figure below shows a diagram of the calculator’s keyboard with thenumbering of its rows and columns.

The figure shows 10 rows of keys combined with 3, 5, or 6 columns. Row 1
has 6 keys, rows 2 and 3 have 3 keys each, and rows 4 through 10 have 5
keys each. There are 4 arrow keys located on the right-hand side of the
keyboard in the space occupied by rows 2 and 3. Each key has three, four, orPage B-1

five functions. The main key functions are shown in the figure below. To
operate this main key functions simply press the corresponding key. We willrefer to the keys by the row and column where they are located in the sketch
above, thus, key (10,1) is the ON key.

Main key functions in the calculator’s keyboard

Page B-2

Main key functions
Keys A through F keys are associated with the soft menu options thatappear at the bottom of the calculator’s display. Thus, these keys will activate avariety of functions that change according to the active menu.
 The arrow keys, —˜š™, are used to move one character at a timein the direction of the key pressed (i.e., up, down, left, or right).
 The APPS function activates the applications menu.
 The MODE function activates the calculator’s modes menu.
 The TOOL function activates a menu of tools useful for handling variables
and getting help on the calculator.
 The VAR function shows the variables stored in the active directory, the STO
function is used to store contents in variables.
 The NXT function is used to see additional soft menu options or variables ina directory.
 The HIST function allows you access to the algebraic-mode history, i.e., thecollection of recent command entries in that mode.
 The EVAL key is used to evaluate algebraic and numeric expressions, theapostrophe key [ ‘ ] is used to enter a set of apostrophes for algebraic
expressions.
 The SYMB activates the symbolic operations menu.
 The delete key ƒ is used to delete characters in a line.
The yx key calculates the x power of y.



The



The SIN, COS, and TAN keys calculate the sine, cosine, and tangent,respectively, of a number.



The EEX key is used to enter power of tens (e.g., 5×103, is entered as
5V3, which is shown as 5E3).
The +/- key changes the sign of an entry, the X key enters the character X(upper case).
The 1/x key calculates the inverse of a number, the keys +, −, ×, and ÷, areused for the fundamental arithmetic operations (addition, subtraction,
multiplication, and division, respectively).
The ALPHA key is combined with other keys to enter alphabetic characters.



x key calculates the square root of a number.

Page B-3








The left-shift key „ and the right-shift key … are combined with otherkeys to activate menus, enter characters, or calculate functions as described
elsewhere.
The numerical keys (0 to 9) are used to enter the digits of the decimal
number system.
There is a decimal point key (.) and a space key (SPC).
The ENTER key is used to enter a number, expression, or function in thedisplay or stack, and
The ON key is used to turn the calculator on.

Alternate key functions
The left-shift key, key (8,1), the right-shift key, key (9,1), and the ALPHA key, key(7,1), can be combined with some of the other keys to activate the alternative
functions shown in the keyboard. For example, the P key, key(4,4), has thefollowing six functions associated with it:
P

Main function, to activate the SYMBolic menu„´Left-shift function, to activate the MTH (Math) menu

…N

Right-shift function, to activate the CATalog function~p

ALPHA function, to enter the upper-case letter P~„p

ALPHA-Left-Shift function, to enter the lower-case letter p~…p

ALPHA-Right-Shift function, to enter the symbol P

Of the six functions associated with the key only the first four are shown in the
keyboard itself. This is the way that the key looks in the keyboard:

Notice that the color and the position of the labels in the key, namely, SYMB,
MTH, CAT and P, indicate which is the main function (SYMB), and which ofPage B-4

the other three functions is associated with the left-shift „(MTH), right-shift… (CAT ) , and ~ (P) keys.
Diagrams showing the function or character resulting from combining the
calculator keys with the left-shift „, right-shift …, ALPHA ~, ALPHA-leftshift ~„, and ALPHA-right-shift ~…, are presented next. In these
diagrams, the resulting character or function for each key combination is shownin white background. If the left-shift, right-shift or ALPHA keys are activated they
are shown in a shaded background. Keys that do not get activated are shownin black background.

Left-shift functions
The following sketch shows the functions, characters, or menus associated withthe different calculator keys when the left-shift key „ is activated.
The six left-shift functions associated with the A through F keys areassociated with the setting up and production of graphics and tables.
When using these functions in the calculator’s Algebraic mode ofoperation, press the left-shift key „ first, and then any of the keys in Row
1. When using these functions in the calculator’s RPN mode, you need topress the left-shift key „simultaneously with the key in Row 1 of yourchoice. Function Y= is used to enter functions of the form y=f(x) for plotting,function WIN is used to set parameters of the plot window, function GRAPH
is used to produce a graph, function 2D/3D is used to select the type ofgraph to be produced, function TBLSET is used to set parameters for atable of values of a function, function TABLE is used to generate a table ofvalues of a function,
Function FILE activates the file browser in the calculator’s memory.
The CUSTOM function activates the custom menu options, the i key is used
to enter the unit imaginary number i into the stack ( i 2 = −1 ).

The UPDIR function moves the memory location one level up in thecalculator’s file tree.
The RCL function is used to recall values of variables.
The PREV function shows the previous set of six menu options associatedwith the soft menu keys.

Page B-5



The CMD function shows the most recent commands, the PRG function
activates the programming menus, the MTRW function activates the Matrix
Writer,Left-shift „ functions of the calculator’s keyboard






The CMD function shows the most recent commands.
The PRG function activates the programming menus.
The MTRW function activates the Matrix Writer.
The MTH function activates a menu of mathematical function.
The DEL key is used to delete variables.

Page B-6

The ex key calculates the exponential function of x.

The x2 key calculates the square of x (this is referred to as the SQ
function).
The ASIN, ACOS, and ATAN functions calculate the arcsine, arccosine,and arctangent functions, respectively.



The 10x function calculates the anti-logarithm of x.



The keys ≠, ≤, and ≥, are used for comparing real numbers.
The ABS function calculates the absolute value of a real number, or themagnitude of a complex number or of a vector.
The USER function activates the user-defined keyboard menu.
The S.SLV function activates the symbolic solver menu.
The EXP&LN function activates the menu for substituting expressions interms of the exponential and natural logarithm functions.
The FINANCE function activates a menu for financial calculations.
The CALC function activates a menu of calculus functions.
The MATRICES function activates a menu for creating and manipulationof matrices.
The CONVERT function activates a menu for conversion of units andother expressions.
The ARITH function activates a menu of arithmetic functions.
The DEF key is used to define a simple function as a variable in thecalculator menu.
The CONT key is used to continue a calculator operation.
The ANS key recalls the last result when the calculator is in Algebraic
operation mode.
The [ ], ( ), and { } keys are used to enter brackets, parentheses, orbraces.
The # key is used to enter numbers in other than the active number
base.
The infinity key ∞ is used to enter the infinite symbol in an expression.
The pi key π is used to enter the value or symbol for π (the ratio of thelength of a circumference to its diameter).
The arrow keys, when combined with the left-shift key, move the cursor
to the first character in the direction of the key pressed.


















Page B-7

Right-shift … functions of the calculator’s keyboard

Right-shift functions
The sketch above shows the functions, characters, or menus associated with thedifferent calculator keys when the right-shift key … is activated.
 The functions BEGIN, END, COPY, CUT and PASTE are used for editing
purposes.
 The UNDO key is used to undo the last calculator operation.
 The CHARS function activates the special characters menu.
 The EQW function is used to start the Equation Writer.

Page B-8The CAT function is used to activate the command catalog.
The CLEAR function clears the screen.
The LN function calculates the natural logarithm.



The x y function calculates the x – th root of y.







The Σ function is used to enter summations (or the upper case Greek lettersigma).
The ∂ function is used to calculate derivatives.
The ∫ function is used to calculate integrals.
The LOG function calculates the logarithm of base 10.
The ARG function calculates the argument of a complex number.
The ENTRY function is used to change entry mode in editing.
The NUM.SLV function launches the NUMerical SOLver menu.
The TRIG function activates the trigonometric substitution menu.
The TIME function activates the time menu.
The ALG function activates the algebra menu.
The STAT function activates the statistical operations menu.
The UNITS function activates the menu for units of measurement.
The CMPLX function activates the complex number functions menu.
The LIB function activates the library functions.
The BASE function activates the numeric base conversion menu.
The OFF key turns the calculator off, the NUM key produces a numeric(or floating-point) value of an expression.
The “ “ key enters a set of double-quotes used for entering text strings.
The __ key enters an underscore.
The << >> key enters the symbol for a program.

The  key enters an arrow representing an input in a program.

The  key enters a return character in programs or text strings.
The comma (,) key enters a comma.
The arrow keys, when combined with the right-shift key, move the cursor to
the farthest character in the direction of the key pressed.

















ALPHA characters
The following sketch shows the characters associated with the different
calculator keys when the ALPHA ~ is activated. Notice that the ~ function

Page B-9

is used mainly to enter the upper-case letters of the English alphabet (A throughZ). The numbers, mathematical symbols (-, +), decimal point (.), and the space(SPC) are the same as the main functions of these keys. The ~ function
produces an asterisk (*) when combined with the times key, i.e., ~*.

Alpha ~ functions of the calculator’s keyboard

Alpha-left-shift characters
The following sketch shows the characters associated with the different
calculator keys when the ALPHA ~ is combined with the left-shift key „.

Page B-10

Notice that the ~„ combination is used mainly to enter the lower-caseletters of the English alphabet (A through Z). The numbers, mathematicalsymbols (-, +, ×), decimal point (.), and the space (SPC) are the same as themain functions of these keys. The ENTER and CONT keys also work as theirmain function even when the ~„ combination is used.

Alpha ~„ functions of the calculator’s keyboard

Page B-11

Alpha-right-shift characters
The following sketch shows the characters associated with the different
calculator keys when the ALPHA ~ is combined with the right-shift key ….

Alpha ~… functions of the calculator’s keyboard
Notice that the ~… combination is used mainly to enter a number of
special characters from into the calculator stack. The CLEAR, OFF,  ,  ,comma (,), key enters and OFF keys also work as their main function even whenthe ~… combination is used. The special characters generated by the

Page B-12

~… combination include Greek letters (α, β, Δ, δ, ε, ρ, μ, λ, σ, θ, τ, ω, andΠ), other characters generated by the ~… combination are |, ‘, ^, =, <,>, /, “, \, __, ~, !, ?, <<>>, and @.

Page B-13

Appendix C
CAS settings
CAS stands for Computer Algebraic System. This is the mathematical core of
the calculator where the symbolic mathematical operations and functions areprogrammed. The CAS offers a number of settings can be adjusted according
to the type of operation of interest. To see the optional CAS settings use thefollowing:Θ Press the H button to activate the CALCULATOR MODES input form.

At the bottom of the display you will find the following soft menu key
options:)@FLAGS@CHOOS)@@ CAS@@)@@DISP@!!CANCL@@@OK@@@@

Provides menus for manipulating calculator flags (*)
Lets the user chose options in the different fields in the form
Provides an input form to change CAS settings
Provides an input form to change display settings
Closes this input form and returns to normal display
Use this key to accept settings(*) Flags are variables in the calculator, referred to by numbers, which canbe “set” and “unset” to change certain calculator operating options.
Pressing the L key shows the remaining options in the CALCULATOR
MODES input form:@RESET!!CANCL@@@OK@@@@

Allows the user to reset a highlighted option
Closes this input form and returns to normal display
Use this key to accept settings

Page C-1

Θ

To recover the original menu in the CALCULATOR MODES input box, press
the L key. Of interest at this point is the changing of the CAS settings.
This is accomplished by pressing the @@ CAS@@ soft menu key. The default
values of the CAS setting are shown below:ΘTo navigate through the many options in the CAS MODES input form, use
the arrow keys: š™˜—.

Θ

To select or deselect any of the settings shown above, select the underline
before the option of interest, and toggle the @@CHK@@ soft menu key until theright setting is achieved. When an option is selected, a check mark will beshown in the underline (e.g., the Rigorous and Simp Non-Rational options
above). Unselected options will show no check mark in the underline
preceding the option of interest (e.g., the _Numeric, _Approx, _Complex,_Verbose, _Step/Step, _Incr Pow options above).

Θ

After having selected and unselected all the options that you want in the
CAS MODES input form, press the @@@OK@@@ soft menu key. This will take you
back to the CALCULATOR MODES input form. To return to normal
calculator display at this point, press the @@@OK@@@ soft menu key once more.

Selecting the independent variable
Many of the functions provided by the CAS use a pre-determined independent
variable. By default, such variable is chosen to be the letter X (upper case) as
shown in the CAS MODES input box above. However, the user can change
this variable to any other letter or combination of letters and numbers (avariable name must start with a letter) by editing the Indep var field in the CAS
MODES input box.

Page C-2

A variable called VX exists in the calculator’s {HOME CASDIR} directory thattakes, by default, the value of ‘X’. This is the name of the preferred
independent variable for algebraic and calculus applications. For that reason,
most examples in this Chapter use X as the unknown variable. If you use otherindependent variable names, for example, with function HORNER, the CAS will
not work properly.
The variable VX is a permanent inhabitant of the {HOME CASDIR} directory.
There are other CAS variables in the {HOME CASDIR}, e.g., REALASSUME(@REALA), MODULO (@MODUL), CASINFO (@CASIN), etc.
You can change the value of VX by storing a new algebraic name in it, e.g., ‘x’,‘y’, ‘m’, etc. Preferably, keep ‘X’ as your VX variable for the examples in thismanual.
Also, avoid using the variable VX in your programs or equations, so as to not
get it confused with the CAS’ VX. If you need to refer to the x-component ofvelocity, for example, you can use vx or Vx.

Selecting the modulus
The Modulo option of the CAS MODES input box represents a number (default
value = 13) used in modular arithmetic. More details about modular
arithmetic are presented elsewhere.

Numeric vs. symbolic CAS mode
When the Numeric CAS mode is selected, certain constants pre-defined in thecalculator are displayed in their full floating-point value. By default, the_Numeric option is unselected, meaning that those pre-defined constants will be
displayed as their symbol, rather than their value, in the calculator display.
The following screen shows the values of the constant π (the ratio of the lengthof the circumference to its diameter) in symbolic format followed by the numeric,or floating-point, format. This example corresponds to the Algebraic operating
mode.

Page C-3

The same example, corresponding to the RPN operating mode, is shown next:

Approximate vs. Exact CAS mode
When the _Approx is selected, symbolic operations (e.g., definite integrals,square roots, etc.), will be calculated numerically. When the _Approx is
unselected (Exact mode is active), symbolic operations will be calculated as
closed-form algebraic expressions, whenever possible.
The following screen shows a couple of symbolic expressions entered with anactive exact mode in Algebraic operating mode:

In Algebraic mode, the object entered by the user is shown in the left-hand sideof the screen, followed immediately by a result in the right-hand side of thescreen. The results shown above show the symbolic expressions for ln(2), i.e.,
the natural logarithm of 2, and

5 , i.e., the square root of 5. If the _Numeric

CAS option is selected, the corresponding results for these operations are as
follows:

Page C-4

The keystrokes necessary for entering these values in Algebraic mode are thefollowing:…¹2` R5`

The same calculations can be produced in RPN mode. Stack levels 3: and 4:
show the case of Exact CAS setting (i.e., the _Numeric CAS option isunselected), while stack levels 1: and 2: show the case in which the Numeric
CAS option is selected.

The required keystrokes are: 2…¹ 5R
A keyboard short cut to toggle between APPROX and EXACT mode is byholding the right-shift key and pressing the ENTER key simultaneously, i.e.,‚ (hold) `.

Real numbers vs. integer numbers
CAS operations utilize integer numbers in order to keep full precision in thecalculations. Real numbers are stored in the form of a mantissa and an
exponent, and have limited precision. In APPROX mode, however, whenever
you enter an integer number, it is automatically transformed into a real number,
as illustrated next:

Whenever the calculator lists an integer value followed by a decimal dot, it isindicating that the integer number has been converted to a real representation.
This will indicate that the number was entered while the CAS was set to
APPROX mode.

Page C-5

It is recommended that you select EXACT mode as default CAS mode, andchange to APPROX mode if requested by the calculator in the performance ofan operation.
For additional information on real and integer numbers, as well as othercalculator’s objects, refer to Chapter 2.

Complex vs. Real CAS mode
A complex number is a number of the form a+bi, where i, defined by i 2 = −1 isthe unit imaginary number (electrical engineers prefer to use the symbol j), anda and b are real numbers. For example, the number 2 + 3i is a complex
number. Additional information on operations with complex numbers arepresented in Chapter 4 of this guide.
When the _Complex CAS option is selected, if an operation results in acomplex number, then the result will be shown in the form a+bi or in the form ofan ordered pair (a,b). On the other hand, if the _Complex CAS option is unset(i.e., the Real CAS option is active), and an operation results in a complex
number, you will be asked to switch to Complex mode. If you decline, thecalculator will report an error.
Please notice that, in COMPLEX mode the CAS is able to perform a wider range
of operations than in REAL mode, but it will also be considerably slower. Thus,
it is recommended that you use the REAL mode as default mode and switch to
COMPLEX if requested by the calculator in the performance of an operation.
The following example shows the calculation of the quantity

5 2 − 8 2 using

the Algebraic operating mode, first with the Real CAS option selected. In thiscase, you are asked if you want to change the mode to Complex:

Page C-6

If you press the OK soft menu key (), then the _Complex option is forced, andthe result is the following:

The keystrokes used above are the following:R„Ü5„Q2+ 8„Q2`
When asked to change to COMPLEX mode, use:F. If you decide not to
accept the change to COMPLEX mode, you get the following error message:

Verbose vs. non-verbose CAS mode
When the _Verbose CAS option is selected, certain calculus applications areprovided with comment lines in the main display. If the _Verbose CAS option is
not selected, then those calculus applications will show no comment lines. The
comment lines will appear momentarily in the top lines of the display while theoperation is being calculated.

Step-by-step CAS mode
When the _Step/step CAS option is selected, certain operations will be shown
step at a time in the display. If the _Step/step CAS option is not selected, thenintermediate steps will not be shown.

Page C-7

For example, having selected the Step/step option, the following screens show
the step-by-step division of two polynomials, namely, (X3-5X2+3X-2)/(X-2). Thisis accomplished by using function DIV2 as shown below. Press ` to show
the first step:

The screen inform us that the calculator is operating a division of polynomials
A/B, so that A = BQ + R, where Q = quotient, and R = remainder. For thecase under consideration, A = X3-5X2+3X-2, and B = X-2. These polynomials
are represented in the screen by lists of their coefficients. For example, theexpression A: {1,-5,3,-2} represents the polynomial A = X3-5X2+3X-2, B:{1,-2}
represents the polynomial B = X-2, Q: {1} represents the polynomial Q = X, andR:{-3,3,-2} represents the polynomial R = -3X2+3X-2.
At this point, press, for example, the ` key. Continue pressing ` the key toproduce additional steps:

Thus, the intermediate steps shown represent the coefficients of the quotient andresidual of the step-by-step synthetic division as would have been performed byhand, i.e.,

X 3 − 5X 2 + 3X − 2− 3X 2 + 3X − 2= X2 +=X −2
X −2

Page C-8

X 2 − 3X +8
− 3X − 2= X 2 − 3X − 3X −
X −2
X −2.

Increasing-power CAS mode
When the _Incr pow CAS option is selected, polynomials will be listed so thatthe terms will have increasing powers of the independent variable. If the _Incr
pow CAS option is not selected (default value) then polynomials will be listed sothat the terms will have decreasing powers of the independent variable. An
example is shown next in Algebraic mode:

In the first case, the polynomial (X+3)5 is expanded in increasing order of thepowers of X, while in the second case, the polynomial shows decreasing orderof the powers of X. The keystrokes in both cases are the following:„Üx+3™Q5`
In the first case the _Incr pow option was selected, while in the second it was
not selected. The same example, in RPN notation, is shown below:

The same keystroke sequence was used to produce each of these results:³„Üx+3™Q5`μPage C-9

Rigorous CAS setting
When the _Rigorous CAS option is selected, the algebraic expression |X|, i.e.,
the absolute value, is not simplified to X. If the _Rigorous CAS option is notselected, the algebraic expression |X| is simplified to X.
The CAS can solve a larger variety of problems if the rigorous mode is not set.
However, the result, or the domain in which the result are applicable, might bemore limited.

Simplify non-rational CAS setting
When the _Simp Non-Rational CAS option is selected, non-rational expressions
will be automatically simplified. On the other hand, if the _Simp Non-Rational
CAS option is not selected, non-rational expressions will not be automaticallysimplified.

Using the CAS HELP facility
Turn on the calculator, and press the I key to activate the TOOL menu.
Next, press the Bsoft menu key, followed by the ` key (the key in thelowest right corner of the keyboard), to activate the HELP facility. The display
will look as follows:

At this point you will be provided with a list of all CAS commands inalphabetical order. You can use the down arrow key, ˜, to navigate throughthe list. To move upwards in the list use the up arrow key, — . The arrow keys
are located on the right-hand side of the keyboard between the first and fourthrows of keys.
Suppose that you want to find information on the command ATAN2S(ArcTANgent-to-Sine function). Press the down arrow key, ˜, until thecommand ATAN2S is highlighted in the list:

Page C-10

Notice that, in this instance, soft menu keys E and F are the only one withassociated commands, namely:!!CANCLE

CANCeL the help facility!!@@OK#@F

OK to activate help facility for the selected command

If you press the !!CANCL E key, the HELP facility is skipped, and the calculator
returns to normal display.
To see the effect of using !!@@OK#@ in the HELP facility, let’s repeat the steps used
above from to the selection of the command ATAN2S in the list of CAS
commands:@HELP B` ˜ ˜ …(10 times)
Then, press the !!@@OK#@ F key to obtain information about the command
ATAN2S.
The help facility indicates that the command, or function, ATAN2S replaces thevalue of atan(x), the arc tangent of a value x, by its equivalent in terms of thefunction asin (arcsine), i.e.,
The fourth and fifth lines in the display provide an example of application of thefunction ATAN2S. Line four, namely, ATAN2S(ATAN(X)), is the statement of theoperation to be performed, while line five, namely, ASIN(X/√(X^2+1)), is theresult.
The bottom line in the display, starting with the particle See:, is a reference line
listing other CAS commands related to the command ATAN2S.

Page C-11

Notice that there are six commands associated with the soft menu keys in thiscase (you can check that there are only six commands because pressing the
L produces no additional menu items). The soft menu key commands are
the following:
@EXIT
@ECHO
@@ SEE1@@@@SEE2@!@@SEE3@@!MAIN

A
B
C
D
E
F

EXIT the help facility
Copy the example command to the stack and exit
See the first link (if any) in the list of references
See the second link (if any) of the list of references
See the third link (if any) of the list of references
Return to the MAIN command list in the help facility

In this case we want to ECHO the example into the stack by pressing @ECHO
B. The resulting display is the following:

There are now four lines of the display occupied with output. The first two lines
from the top correspond to the first exercise with the HELP facility in which wecancel the request for help. The third line from the top shows the most recent
call to the HELP facility, while the last line shows the ECHO of the example
command. To activate the command press the ` key. The result is:

Notice that, as new lines of output are produced, the display (or stack) pushes
the existing lines upwards and fills the bottom of the screen with more output.
The HELP facility, described in this section, will be very useful to refer to thedefinition of the many CAS commands available in the calculator. Each entry
in the CAS help facility, whenever appropriate, will have an example ofapplication of the command, as well as references as shown in this example.

Page C-12

To navigate quickly to a particular command in the help facility list without
having to use the arrow keys all the time, we can use a shortcut consisting oftyping the first letter in the command’s name. Suppose that we want to findinformation on the command IBP (Integration By Parts), once the help facility list
is available, use the ~ key (first key in the fourth row from the bottom of the
keyboard) followed by the key for the letter i (the same as the key I) , i.e.,~i. This will take you automatically to the first command that starts with ani, namely, IBASIS. Then, you can use the down arrow key ˜ , twice, to findthe command IBP. Pressing the !!@@OK#@ F key, we activate the help facility forthis command. Press @!MAIN F to recover the main list of commands, or @EXIT
A to exit the facility.

References for non-CAS commands
The help facility contains entries for all the commands developed for the CAS(Computer Algebraic System). There is a large number of other functions andcommands that were originally developed for the HP 48G series calculatorsthat are not included in the help facility. Good references for those commands
are the HP 48G Series User’s Guide (HP Part No. 00048-90126) and the HP
48G Series Advanced User’s Reference Manual (HP Part No. 00048-90136)
both published by Hewlett-Packard Company, Corvallis, Oregon, in 1993.

CAS End User Term and Conditions
Use of the CAS Software requires from the user an appropriate mathematicalknowledge. There is no warranty for the CAS Software, to the extent permitted
by applicable law. Except when otherwise stated in writing the copyright holder
provides the CAS Software "As Is" without warranty of any kind, either
expressed or implied, including, but not limited to, the implied warranties ofmerchantability and fitness for a particular purpose. The entire risk as to thequality and performance of the CAS Software is with you. Should the CAS
Software prove defective, you assume the cost of all necessary servicing, repair
or correction.

Page C-13

In no event unless required by applicable law will any copyright holder beliable to you for damages, including any general, special, incidental orconsequential damages arising out of the use or inability to use the
CAS Software (including but not limited to loss of data or data being rendered
inaccurate or losses sustained by you or third parties or a failure of the CAS
Software to operate with any other programs), even if such holder or otherparty has been advised of the possibility of such damages. If required byapplicable law the maximum amount payable for damages by the copyrightholder shall not exceed the royalty amount paid by Hewlett-Packard to the
copyright holder for the CAS Software.

Page C-14

Appendix D
Additional character set
While you can use any of the upper-case and lower-case English letter from the
keyboard, there are 255 characters usable in the calculator. Including special
characters like θ, λ, etc., that that can be used in algebraic expressions. To
access these characters we use the keystroke combination …± (associatedwith the EVAL key). The result is the following screen:

By using the arrow keys, š™˜—, we can navigate through thecollection of characters. For example, moving downwards in the screen
produces more characters in the display:

Moving farther down, we see these characters:

There will be one character highlighted at all times. The lower line in thedisplay will show the short cut for the highlighted character, as well as the ASCII
character code (e.g., see the screen above: the short cut is αDα9, i.e.,~„d~…9, and the code is 240). The display also shows three

Page D-1

functions associated with the soft menu keys, f4, f5, and f6. These functions
are:@MODIF: Opens a graphics screen where the user can modify highlighted
character. Use this option carefully, since it will alter the modified character up
to the next reset of the calculator. (Imagine the effect of changing the graphic of
the character 1 to look like a 2!).
@ECHO1: Copies the highlighted character to the command line or equation writer(EQW) and exits the character set screen (i.e., echoes a single character to thestack).
@ECHO: Copies the highlighted character to the command line or equation writer(EQW), but the cursor remains in the character set screen to allow the user toselect additional characters (i.e., echoes a string of characters to the stack). To
exit the character set screen press `.
For example, suppose you have to type the expression:

λ2 + 2μ + 5

Here is a suggested approach, using the stack in either Algebraic or RPN
mode:
Use the keystrokes: ³…±to get to the characters screen. Next, use thearrow keys to highlight the character λ. Press @ECHO1 (i.e., the E key), andcontinue with the keystrokes: + 2 *…±. Next, use the arrow keys
to highlight the character μ. Press @ECHO1 (i.e., the E key), and finish theexpression with the keystrokes: +5`. Here is the result of this exercise
in Algebraic and RPN modes, respectively:

Following, we list some of the most common ~‚keystroke combinations:Page D-2

Greek lettersα(alpha)~‚aβ(beta)~‚bδ(delta)~‚dε(epsilon)~‚eθ(theta)~‚t

λ(lambda)

~‚n

μ

(mu)

~‚m

ρ

(rho)

~‚f

σ

(sigma)

~‚s

τ

(tau)

~‚u

ω

(omega)~‚v

Δ(upper-case delta)~‚cΠ(upper-case pi)~‚pOther characters~(tilde)~‚1!

(factorial)~‚2?

(question mark) )~‚3\(backward slash)~‚5(angle symbol)

~‚6

(at)

~‚`

@

Some characters commonly used that do not have simple keystroke shortcuts
are: ⎯x (x bar), γ (gamma), η (eta), Ω (upper-case omega). These characters
can be “echoed” from the CHARS screen: …±.

Page D-3

Appendix E
The Selection Tree in the Equation Writer
The expression tree is a diagram showing how the Equation Writer interprets an
expression. The form of the expression tree is determined by a number of rules
known as the hierarchy of operation. The rules are as follows:
1. Operations in parentheses are executed first, from the innermost to theoutermost parentheses, and from left to right in the expression.
2. Arguments of functions are executed next, from left to right.
3. Functions are executed next, from left to right.
4. Powers of numbers are executed next, from left to right.
5. Multiplications and divisions are executed next, from left to right.
6. Additions and subtraction are executed last, from left to right.
Execution from left to right means that, if two operations of the same hierarchy,
say two multiplications, exist in an expression, the first multiplication to the left
will be executed before the second, and so on.
Consider, for example, the expression shown below in the equation writer:

The insertion cursor () at this point is located to the right of the 2 in theargument of the SIN function in the denominator. Press the down arrow key
˜to trigger the clear, editing cursor () around the 2 in the denominator.
Next, press the left arrow key š, continuously, until the clear, editing cursor isaround the y in the first factor in the denominator. Then, press the upper-arrow
key to activate the selection cursor () around the y. By pressing the upper
arrow key —, continuously, we can follow the expression tree that will takeuse from the y to the completion of the expression. Here is the sequence of
operations highlighted by the upper arrow key—:

Page E-1

Step A1

Step A2

Step A3

Step A4

Step A5

Step A6

We notice the application of the hierarchy-of-operation rules in this selection.
First the y (Step A1). Then, y-3 (Step A2, parentheses). Then, (y-3)x (Step A3,
multiplication). Then (y-3)x+5, (Step A4, addition). Then, ((y-3)x+5)(x2+4)(Step A5, multiplication), and finally, ((y-3)x+5)(x2+4)/SIN(4x-2) (Step A6,
division). It is important to point out that the multiplication in Step A5 includes
the first term, ((y-3)x+5) with a second term (x2+4), which is already calculated.
To see the steps in calculating these second term, press the down arrow key
˜, continuously, until the clear, editing cursor is triggered around the y, once
more. Then, press the right arrow key until these cursor is over the x in thesecond term in the numerator. Then, press the upper-arrow key to select this x.
The steps in the evaluation of the expression, starting from this point, are shown
below:

Page E-2

Step B1

Step B2

Step B3

Step B4 = Step A5

Step B5 = Step A6

We can also follow the evaluation of the expression starting from the 4 in theargument of the SIN function in the denominator. Press the down arrow key
˜, continuously, until the clear, editing cursor is triggered around the y, once
more. Then, press the right arrow key until these cursor is over the 4 in the
denominator. Then, press the upper-arrow key —to select this 4. The steps in
the evaluation of the expression, starting from this point, are shown below:
Step C1

Step C2

Page E-3

Step C3

Step C4

Step C5 = Step B5 = Step A6

The expression tree for the expression presented above is shown next:

The steps in the evaluation of the three terms (A1 through A6, B1 through B5,
and C1 through C5) are shown next to the circle containing numbers, variables,or operators.

Page E-4

Appendix F
The Applications (APPS) menu
The Applications (APPS) menu is available through the G key (first key insecond row from the keyboard’s top). The G key shows the following
applications:

The different applications are described next.

Plot functions..
Selecting option 1. Plot functions.. in the APPS will produce the following menu
list of graph-related options:

The six options shown are equivalent to the keystroke sequences listed below:
Equation entry…

„ñ

Plot window..

„òGraph display..

„ó

Plot setup..

„ô

Table setup..

„õ

Table display..

„ö

These applications are presented in detail in Chapter 12.

Page F-1

I/O functions..
Selecting option 2. I/O functions.. in the APPS menu will produce the following
menu list of input/output functions

These applications are described next:
Send to Calculator

Send data to another calculator (or to a PC with an
infrared port)

Get from Calculator

Receive data from another calculator (or to a PC withan infrared port)

Print display

Send screen to printerPrint..

Print selected object from calculator

Transfer..

Transfer data to other device

Start Server..

Calculator set as a server for communication withcomputers

You can connect to another calculator or to a PC via infrared or via a cable. A
USB cable is provided with the calculator for a USB connection. You can also
use a serial cable to connect to the RS232 port on the calculator. (This cable isavailable as a separate accessory.)

Constants lib..
Selecting option 3. Constants lib.. in the APPS menu opens the Constant Library
application that provides values of standard physical constants:

Page F-2

The Constants Library is discussed in detail in Chapter 3.

Numeric solver..
Selecting option 3. Constants lib.. in the APPS menu produces the numericalsolver menu:

This operation is equivalent to the keystroke sequence ‚Ï. The numericalsolver menu is presented in detail in Chapters 6 and 7.

Time & date..
Selecting option 5.Time & date.. in the APPS menu produces the time and datemenu:This operation is equivalent to the keystroke sequence ‚Ó. The time anddate menu is presented in detail in Chapter 26.

Page F-3

Equation writer..
Selecting option 6.Equation writer.. in the APPS menu opens the equation
writer:This operation is equivalent to the keystroke sequence ‚O. The equation
writer is introduced in detail in Chapter 2. Examples that use the equation
writer are available throughout this guide.

File manager..
Selecting option 7.File manager.. in the APPS menu launches the file manager
application:

This operation is equivalent to the keystroke sequence „¡.The file
manager is introduced in Chapter 2.

Page F-4

Matrix Writer..
Selecting option 8.Matrix Writer.. in the APPS menu launches the matrix writer:

This operation is equivalent to the keystroke sequence „².The Matrix
Writer is presented in detail in Chapter 10.

Text editor..
Selecting option 9.Text editor.. in the APPS menu launches the line text editor:

The text editor can be started in many cases by pressing the down-arrow key
˜. If the object in the display is an algebraic object, pressing ˜ will most
likely start the Equation Writer. The text editor is introduced in Chapter 2, andpresented in detail in Appendix L.

Math menu ..
Selecting option 10.Math menu.. in the APPS menu produces the MTH(mathematics) menu:

Page F-5

This operation is equivalent to the keystroke sequence „´. The MTH
menu is introduced in Chapter 3 (real numbers). Other functions from the MTH
menu are presented in Chapters 4 (complex numbers), 8 (lists), 9 (vectors), 10(matrix creation), 11 (matrix operation), 16 (fast Fourier transforms), 17(probability applications), and 19 (numbers in different bases).

CAS menu..
Selecting option 11.CAS menu.. in the APPS menu produces the CAS or
SYMBOLIC menu:

This operation is also available by pressing the Pkey. The CAS or
SYMBOLIC menu is introduced in Chapter 5 (algebraic and arithmetic
operations). Other functions from the CAS menu are presented in Chapters 4(complex numbers), 6 (equations solutions), 10 (matrix creation), 11 (matrix
operation), 13 (calculus), 14 (multivariate calculus), and 15 (vector analysis).

Equation Library
Selecting option 12.Equation Library in the APPS men displays the EQ LIBRARY
MENU. From here you can press !EQLIB! and then !EQNLI! to open the Equation
Library:

Page F-6

Note that flag –117 should be set if you are going to use the Equation Library.
Note too that the Equation Library will only appear on the APPS menu if the two
Equation Library files are stored on the calculator.
The Equation Library is explained in detail in chapter 27.

Page F-7

Appendix G
Useful shortcuts
Presented herein are a number of keyboard shortcuts commonly used in thecalculator:ΘAdjust display contrast: $ (hold) +, or $ (hold) -ΘToggle between RPN and ALG modes: H\@@@OK@@ or H\`.

Θ

Set/clear system flag 95 (ALG vs. RPN operating mode)
H @)FLAGS —„—„—„ — @@CHK@Θ

In ALG mode,
CF(-95) selects RPN modeΘIn RPN mode,
95 \` SF selects ALG modeΘA keyboard short cut to toggle between APPROX and EXACT mode is
by holding the right-shift key and pressing the ENTER key
simultaneously, i.e.,‚ (hold) `.

ΘSet/clear system flag 105 (EXACT vs. APPROX CAS mode)
H @)FLAGS —„—„— —— @@CHK@Θ

In ALG mode,
SF(-105) selects APPROX CAS mode
CF(-105) selects EXACT CAS modeΘIn RPN mode,
105 \` SF selects APPROX CAS mode
105 \` CF selects EXACT CAS mode

Page G-1

Θ

Θ

Θ

Θ

Θ

Set/clear system flag 117 (CHOOSE boxes vs. SOFT menus):
H @)FLAGS —„ —˜ @@CHK@Θ

In ALG mode,
SF(-117) selects SOFT menus
CF(-117) selects CHOOSE BOXES.

ΘIn RPN mode,
117 \` SF selects SOFT menus
117 \` CF selects SOFT menus

Change angular measure:o

To degrees: ~~deg`oTo radian: ~~rad`Special characters:oAngle symbol (∠):

oFactorial symbol (!): ~‚2oDegree symbol (o):~‚6~‚(hold)6

Lock/unlock alpha keyboard:oLock alpha keyboard (upper case): ~~o

Unlock alpha keyboard (upper case): ~oLock alpha keyboard (lower case): ~~„~oUnlock alpha keyboard (lower case): „~~Greek letters:
Alpha (α):~‚aBeta (β):~‚b

DELTA (Δ):~‚c

Delta (d):~‚dEpsilon (ε):~‚eRho (ρ):~‚fMu (μ):~‚m

Lambda (λ):~‚nPI (Π):~‚p

Sigma (σ):~‚sTheta (θ):~‚t

Tau (t):~‚uOmega (ω):~‚v

Page G-2

ΘΘ

System-level operation (Hold $, release it after entering second or
third key):o$ (hold) AF: “Cold” restart - all memory erasedo$ (hold) B: Cancels keystrokeo$ (hold) C: “Warm” restart - memory preservedo$ (hold) D: Starts interactive self-testo$ (hold) E: Starts continuous self-testo$ (hold) #: Deep-sleep shutdown - timer offo$ (hold) A: Performs display screen dumpo$ (hold) D: Cancels next repeating alarm

Menus not accessible through keyboard: In RPN, enter menu_number,
type MENU. In ALG mode, type MENU(menu_number).
Menu_number is one of the following:
o
o
o
o

Θ

Θ

STAT soft menu:
PLOT soft menu:
SOLVE soft menu:
UTILITY soft menu:

96
81
74, or use ‚(hold) 7
113

Other menus:o

MATHS menu: ~~maths`o

MAIN menu:~~main`Other keyboard short cuts:
o
o
o
o
o
o
o
o

‚(hold) 7„ (hold) H„ (hold) ˜„ (hold) §„ (hold) «‚ (hold) ˜‚(hold) ±~‚Í: SOLVE menu (menu 74): PRG/MODES menu (Chapter 21): Starts text editor (Appendix L): HOME(), go to HOME directory: Recover last active menu
: List contents of variables or menu entries: PRG/CHAR menu (Chapter 21): Changes insertion mode

Page G-3

Appendix H
The CAS help facility
The CAS help facility is available through the keystroke sequence I
L@HELP `. The following screen shots show the first menu page in thelisting of the CAS help facility.

The commands are listed in alphabetical order. Using the vertical arrow keys
—˜ one can navigate through the help facility list. Some useful hints onnavigating through this facility are shown next:ΘYou can hold down the down arrow key ˜ and watch the screen until
the command you’re looking for shows up in the screen. At this point,
you can release the down arrow key. Most likely the command ofinterest will not be selected at this point (you may overshoot orundershoot it). However, you can use the vertical keys —˜, one
stroke at a time, to locate the command you want, and then press @@OK@@.

ΘIf, while holding down the down arrow key ˜ you overshoot thecommand of interest, you can hold down the up arrow key — tomove back towards that command. Refine the selection with thevertical keys —˜, one stroke at a time.
You can type the first letter of the command of interest, and then use thedown arrow key ˜ to locate that particular command. For example,
if you’re looking for the command DERIV. After activating the help
facility (I L@HELP `), type ~d. This will select the first of
the commands that start with D, i.e., DEGREE. To find DERIV, press
˜, twice. To activate the command, press @@OK@@.

ΘPage H-1

ΘYou can type two or more letters of the command of interest, by locking
the alphabetic keyboard. This will take you to the command of interest,or to its neighborhood. Afterwards, you need to unlock the alphakeyboard, and use the vertical arrow keys —˜ to locate thecommand, if needed. Press @@OK@@ to locate the to activate thecommand. For example, to locate the command PROPFRAC, you canuse, one of the following keystroke sequences:
I L@HELP ` ~~pr ~ ˜˜@@OK@@
I L@HELP ` ~~pro ~ ˜@@OK@@
I L@HELP ` ~~prop ~ @@OK@@

See Appendix C for more information on the CAS (Computer Algebraic
System). Appendix C includes other examples of application of the CAS help
facility.

Page H-2

Appendix I
Command catalog list
This is a list of all commands in the command catalog (‚N). Thosecommands that belong to the CAS (Computer Algebraic System) are listed alsoin Appendix H. CAS help facility entries are available for a given command if
the soft menu key @HELP shows up when you highlight that particular command.
Press this soft menu key to get the CAS help facility entry for the command. The
first few screens of the catalog are shown below:

User-installed library commands would also appear on the command
catalog list, using italic font. If the library includes a help item, then the soft
menu key @HELP shows up when you highlight those user-created commands.

Page I-1

Appendix J
The MATHS menu
The MATHS menu, accessible through the command MATHS (available in the
catalog N), contains the following sub-menus:

The CMPLX sub-menu
The CMPLX sub-menu contains functions pertinent to operations with complex
numbers:

These functions are described in Chapter 4.

The CONSTANTS sub-menu
The CONSTANTS sub-menu provides access to the calculator mathematicalconstants. These are described in Chapter 3:

Page J-1

The HYPERBOLIC sub-menu
The HYPERBOLIC sub-menu contains the hyperbolic functions and their inverses.
These functions are described in Chapter 3.

The INTEGER sub-menu
The INTEGER sub-menu provides functions for manipulating integer numbers
and some polynomials. These functions are presented in Chapter 5:

The MODULAR sub-menu
The MODULAR sub-menu provides functions for modular arithmetic withnumbers and polynomials. These functions are presented in Chapter 5:

Page J-2

The POLYNOMIAL sub-menu
The POLYNOMIAL sub-menu includes functions for generating andmanipulating polynomials. These functions are presented in Chapter 5:

The TESTS sub-menu
The TESTS sub-menu includes relational operators (e.g., ==, <, etc.), logicaloperators (e.g., AND, OR, etc.), the IFTE function, and the ASSUME andUNASSUME commands.

Relational and logical operators are presented in Chapter 21 in the context ofprogramming the calculator in User RPL language. The IFTE function is
introduced in Chapter 3. Functions ASSUME and UNASSUME are presented
next, using their CAS help facility entries (see Appendix C).

ASSUMEUNASSUME

Page J-3

Appendix K
The MAIN menu
The MAIN menu is available in the command catalog. This menu include thefollowing sub-menus:

The CASCFG command
This is the first entry in the MAIN menu. This command configures the CAS.
For CAS configuration information see Appendix C.

The ALGB sub-menu
The ALGB sub-menu includes the following commands:

These functions, except for 0.MAIN MENU and 11.UNASSIGN are available
in the ALG keyboard menu (‚×). Detailed explanation of these functions
can be found in Chapter 5. Function UNASSIGN is described in the following
entry from the CAS menu:

Page K-1

The DIFF sub-menu
The DIFF sub-menu contains the following functions:

These functions are also available through the CALC/DIFF sub-menu (start with
„Ö). These functions are described in Chapters 13, 14, and 15, except
for function TRUNC, which is described next using its CAS help facility entry:

The MATHS sub-menu
The MATHS menu is described in detail in Appendix J.

The TRIGO sub-menu
The TRIGO menu contains the following functions:Page K-2

These functions are also available in the TRIG menu (‚Ñ). Description ofthese functions is included in Chapter 5.

The SOLVER sub-menu
The SOLVER menu includes the following functions:

These functions are available in the CALC/SOLVE menu (start with „Ö).
The functions are described in Chapters 6, 11, and 16.

The CMPLX sub-menu
The CMPLX menu includes the following functions:

The CMPLX menu is also available in the keyboard (‚ß). Some of thefunctions in CMPLX are also available in the MTH/COMPLEX menu (start with„´). Complex number functions are presented in Chapter 4.

The ARIT sub-menu
The ARIT menu includes the following sub-menus:

Page K-3

The sub-menus INTEGER, MODULAR, and POLYNOMIAL are presented indetail in Appendix J.

The EXP&LN sub-menu
The EXP&LN menu contains the following functions:This menu is also accessible through the keyboard by using „Ð. The
functions in this menu are presented in Chapter 5.

The MATR sub-menu
The MATR menu contains the following functions:

These functions are also available through the MATRICES menu in the keyboard(„Ø). The functions are described in Chapters 10 and 11.

The REWRITE sub-menu
The REWRITE menu contains the following functions:Page K-4

These functions are available through the CONVERT/REWRITE menu (start with
„Ú). The functions are presented in Chapter 5, except for functions
XNUM and XQ, which are described next using the corresponding entries in
the CAS help facility (IL@HELP ):

XNUM

XQ

Page K-5

Appendix L
Line editor commands
When you trigger the line editor by using „˜ in the RPN stack or in ALG
mode, the following soft menu functions are provided (press L to see theremaining functions):

The functions are briefly described as follows:
SKIP: Skips characters to beginning of word.
SKIP: Skips characters to end of word.
DEL: Delete characters to beginning of word.
DEL: Delete characters to end of word.
DEL L: Delete characters in line.
INS:

When selected inserts characters at cursor location. If not selected, thecursor replaces characters (overwrites) instead of inserting characters.

EDIT:

Edits selection.

BEG: Move to beginning of word.
END: Mark end of selection.
INFO: Provides information on Command Line editor, e.g.,

Page L-1

The items show in this screen are self-explanatory. For example, X and Y
positions mean the position on a line (X) and the line number (Y). Stk Sizemeans the number of objects in the ALG mode history or in the RPN stack.
Mem(KB) means the amount of free memory. Clip Size is the number ofcharacters in the clipboard. Sel Size is the number of characters in the current
selection.
EXEC: Execute command selected.
HALT: Stop command execution.
The line editor also provide the following sub-menus:
SEARCH: Search characters or words in the command line. It includes thefollowing functions:

GOTO: Move to a desired location in the command line. It includes thefollowing functions:

Style: Text styles that can be used in the command line:

Page L-2

The SEARCH sub-menu
The functions of the SEARCH sub-menu are:Find : Use this function to find a string in the command line. The input form
provided with this command is shown next:

Replace: Use this command to find and replace a string. The input form
provided for this command is:Find next..: Finds the next search pattern as defined in Find
Replace Selection: Replace selection with replacement pattern defined with
Replace command.
Replace/Find Next: Replace a pattern and search for another occurrence. The
pattern is defined in Replace.
Replace All: Replace all occurrence of a certain pattern. This command asks
for confirmation from the user before replacing pattern.
Fast Replace All: Replace all occurrences of a certain pattern without checking
with the user.

Page L-3

The GOTO sub-menu
The functions in the GOTO sub-menu are the following:
Goto Line: to move to a specified line. The input form provided with thiscommand is:Goto Position: move to a specified position in the command line. The input
form provided for this command is:Labels: move to a specified label in the command line.

The Style sub-menu
The Style sub-menu includes the following styles:
BOL: Bold
ITALI: Italics
UNDE: Underline: Inverse
The command FONT allow the user to select the font for the command editor.
Examples of the different styles are shown below:

Page L-4

Page L-5

Appendix M
Table of Built-In Equations
The Equation Library consists of 15 subjects corresponding to the sections in thetable below) and more than 100 titles. The numbers in parentheses below
indicate the number of equations in the set and the number of variables in theset. There are 315 equations in total using 396 variable.
Subjects and Titles
1: Columns and Beams (14, 20)
1: Elastic Buckling (4, 8)

6: Simple Sheer (1, 7)

2: Eccentric Columns (2, 11)

7: Cantilever Deflection (1, 10)

3: Simple Deflection (1, 9)

8: Cantilever Slope (1, 10)

4: Simple Slope (1, 10)

9: Cantilever Moment (1, 8)

5: Simple Moment (1, 8)

10: Cantilever Shear (1, 6)

2: Electricity (42, 56)
1: Coulomb’s Law (1, 5)

13: Capacitor Charge (1, 3)

2: Ohm’s Law and Power (4, 4)

14: DC Inductor Voltage (3, 8)

3: Voltage Divider (1, 4)

15: RC transient (1, 6)

4: Current Divider (1, 4)

16: RL transient (1, 6)

5: Wire Resistance (1, 4)

17: Resonant Frequency (4, 7)

6: Series and Parallel R (2, 4)

18: Plate Capacitor (1, 4)

7: Series and Parallel C (2, 4)

19: Cylindrical Capacitor (1, 5)

8: Series and Parallel L (2, 4)

20: Solenoid Inductance (1, 5)

9: Capacitance Energy (1, 3)

21: Toroid Inductance (1, 6)

10: Inductive Energy (1, 3)

22: Sinusoidal Voltage (2, 6)

11: RLC Current Delay (5, 9)

23: Sinusoidal Current (2, 6)

12: DC Capacitor Current (3, 8)

Page M-1

3: Fluids (29, 29)
1: Pressure at Depth (1, 4)

3: Flow with Losses (10, 17)

2: Bernoulli Equation (10, 15)

4: Flow in Full Pipes (8, 19)

4: Forces and Energy (31, 36)
1: Linear Mechanics (8, 11)

5: ID Elastic Collisions (2, 5)

2: Angular Mechanics (12, 15)

6: Drag Force (1, 5)

3: Centripetal Force (4, 7)

7: Law of Gravitation (1, 4)

4: Hooke’s Law (2, 4)

8: Mass–Energy Relation (4, 9)

5: Gases (18, 26)
1: Ideal Gas Law (2, 6)

5: Isentropic Flow (4, 10)

2: Ideal Gas State Change (1, 6)

6: Real Gas Law (2, 8)

3: Isothermal Expansion (2, 7)

7: Real Gas State Change (1, 8)

4: Polytropic Processes (2, 7)

8: Kinetic Theory (4, 9)

6: Heat Transfer (17, 31)
1: Heat Capacity (2, 6)
2: Thermal Expansion (2, 6)
3: Conduction (2, 7)

5: Conduction andConvection (4, 14))
6: Black Body Radiation (5, 9)

4: Convection (2, 6)
7: Magnetism (4, 14)
1: Straight Wire (1,5)

3: B Field in Solenoid (1, 4)

2: Force Between Wires (1, 6)

4: Field in Toroid (1, 6)

8: Motion (22, 24)
1: Linear Motion (4, 6)

5: Circular Motion (3, 5)

2: Object in Free Fall (4, 5)

6: Terminal Velocity (1, 5)

3: Projectile Motion (5, 10)

7: Escape Velocity (1, 14)

4: Angular Motion (4, 6)

Page M-2

9: Optics (11, 14)
1: Law of Refraction (1, 4)

4: Spherical Reflection (3, 5)

2: Critical Angle (1, 3)

5: Spherical Refraction (1, 5)

3: Brewster’s Law (2, 4)

6: Thin Lens (3, 7)

10: Oscillations (17, 17)
1: Mass–Spring System (1, 4)

4: Torsional Pendulum (3, 7)

2: Simple Pendulum (3, 4)

5: Simple Harmonic (4, 8)

3: Conical Pendulum (4, 6)
11: Plane Geometry (31, 21)
1: Circle (5, 7)

4: Regular Polygon (6, 8)

2: Ellipse (5, 8)

5: Circular Ring (4,7)

3: Rectangle (5, 8)

6: Triangle (6, 107)

12: Solid Geometry (18, 12)
1: Cone (5, 9)

3: Parallelepiped (4, 9)

2: Cylinder (5, 9)

4: Sphere (4, 7)

13: Solid State Devices (33, 53)
1: PN Step Junctions (8, 19)

3: Bipolar Transistors (8, 14)

2: NMOS Transistors (10, 23)

4: JFETs (7, 15)

14: Stress Analysis (16, 28)
1: Normal Stress (3, 7)

3: Stress on an Element (3, 7)

2: Shear Stress (3, 8)

4: Mohr’s Circle (7, 10)

15: Waves (12, 15)
1: transverse Waves (4, 9)

3: Sound Waves (4,8)

2: Longitudinal Waves (4, 9)

Page M-3

Appendix N
IndexA
ABCUV 5-10
ABS 3-4, 4-6, 11-8
ACK 25-4
ACKALL 25-4
ACOS 3-6
ADD 8-9, 12-20
Additional character set D-1
ADDTMOD 5-11
Alarm functions 25-4
Alarms 25-2
ALG menu 5-3
Algebraic objects 5-1
ALOG 3-5
ALPHA characters B-9
ALPHA keyboard lock-unlock G-2
Alpha-left-shift characters B-10
Alpha-right-shift characters B-12
ALRM menu 25-3
AMORT 6-31
AMORTIZATION 6-10
AND 19-5
Angle between vectors 9-15
Angle Measure 1-23
Angle symbol (∠) G-2
Angle units 22-27, 22-29, 22-33
Angular measure G-2
ANIMATE 22-27
Animating graphics 22-26

Animation 22-26
Anti-derivatives 13-14
Approximate CAS mode C-4
Approximate vs. Exact CAS mode C4
APPS menu F-1
ARC 22-21
AREA in plots 12-6
Area units 3-19
ARG 4-6
ARITHMETIC menu 5-9
ASIN 3-6
ASINH 3-9
ASN 20-6
ASR 19-6
ASSUME J-3
ATAN 3-6
ATANH 3-9
ATICK 22-7
Augmented matrix 11-32
AUTO 22-3
AXES 22-8, 22-13
AXL 9-24
AXM 11-16
AXQ 11-53

B
BR 19-3

Page N-1

Bar plots 12-29
BASE menu 19-1
Base units 3-22
Beep 1-25
BEG 6-31
BEGIN 2-27
Bessel’s equation 16-52
Bessel’s functions 16-53
Best data fitting 18-13, 18-62
Best polynomial fitting 18-62
Beta distribution 17-7
BIG 12-18
BIN 3-2Binary numbers 19-1
Binary system 19-3
Binomial distribution 17-4
BIT menu 19-6
BLANK 22-32
BOL L-4
BOX 12-43, 12-45
BOXZ 12-48
Building a vector 9-12
BYTE menu 19-7

C
CPX 19-7
CR 4-6
CALC/DIFF menu 16-3
Calculation with dates 25-3
Calculations with times 25-4
Calculator constants 3-16
CALCULATOR MODES input form
C-1
Calculator restart G-3

Calculus 13-1
Cancel next repeating alarm G-3
Cartesian representation 4-1
CAS help facility listing H-1
CAS HELP facility C-10
CAS independent variable C-2
CAS menu.. F-6
CAS modulus C-3
CAS settings 1-26, C-1
CASDIR 2-35
CASE construct 21-51
CASINFO 2-37
Cauchy equation 16-51
CEIL 3-14
CENTR 22-7
Chain rule 13-6
Change sign 4-6
Character set D-1
Character strings 23-1
Characteristic polynomial 11-45
Characters list 23-3
CHARS menu 23-2
Chebyshev polynomials 16-55
CHINREM 5-10, 5-17
Chi-square distribution 17-11
CHOOSE 21-31
Choose box 21-31
CHOOSE boxes 1-4
CHR 23-1
CIRCL 12-45
Class boundaries 18-6
Class marks 18-5
Classes 18-5
CLKADJ 25-3

Page N-2

Clock display 1-30
CMD 2-62
CMDS 2-25
CMPLX menus 4-5
CNCT 22-13
CNTR 12-48
Coefficient of variation 18-5
COL+ 10-19
COL 10-19"Cold" calculator restart G-3
COLLECT 5-4
Column norm 11-7
Column vectors 9-18
COL- 10-20
COMB 17-2
Combinations 17-1
Command catalog list I-1
Complex CAS mode C-6
Complex Fourier series 16-26
COMPLEX mode 4-1
Complex numbers 2-2, 4-1
Complex vs. Real CAS mode C-6
Composing lists 8-2
CON 10-8
Concatenation operator 8-4
COND 11-10
Condition number 11-10
Confidence intervals for the variance
18-33
Confidence intervals in linear regression 18-52
Confidence intervals 18-22
Conic curves 12-20
CONJ 4-6

CONLIB 3-29
Constants lib F-2
Continuous self-test G-3
CONVERT 3-27
CONVERT Menu 5-26
Convolution 16-47
Coordinate System 1-24
Coordinate transformation 14-9
COPY 2-27
Correlation coefficient 18-11
COS 3-7
COSH 3-9
Covariance 18-11
CRDIR 2-41
Creating subdirectories 2-39
CROSS 9-11
Cross product 9-11
CST 20-1
CSWP 10-20
Cumulative distribution function 17-4
Cumulative frequency 18-8
Curl 15-5
CURS 2-20
CUT 2-27
CYCLOTOMIC 5-10
CYLIN 4-3

DDR 3-14
DARCY 3-32
DATE 25-3
Date functions 25-1
Date setting 1-7
DATE+ 25-3

Page N-3

Dates calculations 25-4
DBUG 21-35
DDAYS 25-3
Debugging programs 21-22
DEC 19-2
Decimal comma 1-22
Decimal numbers 19-4
decimal point 1-22
Decomposing a vector 9-11
Decomposing lists 8-2
Deep-sleep shutdown G-3
DEFINE 3-36
Definite integrals 13-15
DEFN 12-18
DEG 3-1
Degrees 1-23
DEL 12-46
DEL L L-1
DEL L-1
DELALARM 25-4
Deleting subdirectories 2-43
DELKEYS 20-6
Delta function (Dirac’s) 16-15
DEPND 22-6
DERIV 13-3
DERIV&INTEG menu 13-4
Derivative directional 15-1
Derivatives 13-1, 13-3
Derivatives extrema 13-12
Derivatives higher order 13-13
Derivatives implicit 13-7
Derivatives of equations 13-7
Derivatives partial 14-1
Derivatives step-by-step 13-16

Derivatives with ∂ 13-4
DERVX 13-3
DESOLVE 16-7
DET 11-12De-tagging 21-33
Determinants 11-13, 11-40
DIAG 10-13
Diagonal matrix 10-13
DIFF menu 16-3
DIFFE sub-menu 6-29
Differential equation graph 12-26
Differential equations 16-1
differential equations 12-26
Differential equations, Fourier series
16-40
Differential equations, graphical solutions 16-57
Differential equations, Laplace transform 16-16
Differential equations, linear 16-4
Differential equations, non-linear 164
Differential equations, numerical solutions 16-57
Differential equations, slope fields 163
Differential equations, solutions 16-2
Differential, total 14-5
Differentials 13-19
Dirac’s delta function 16-15
Directional derivative 15-1
Display adjustment 1-2
Display font 1-27
Display modes 1-27
Display screen dump G-3

Page N-4

DISTRIB 5-28
DIV 15-4
DIV2 5-10
DIV2MOD 5-11, 5-14
Divergence 15-4
DIVIS 5-9
DIVMOD 5-11, 5-14
DO construct 21-61
DOERR 21-64
DOLIST 8-11
DOMAIN 13-9
DOSUBS 8-11
DOT 9-11
Dot product 9-11
DOT+ DOT- 12-44
Double integrals 14-8
DRAW 12-20, 22-4
DRAW3DMATRIX 12-52
Drawing functions programs 22-22
DRAX 22-4
DROITE 4-9
DROP 9-20
DTAG 23-1

E
e 3-16EDIT L-1
Editor commands L-1
EGCD 5-18
EGDC 5-10
EGV 11-46
EGVL 11-46
Eigenvalues 11-45
eigenvalues 11-10

Eigenvectors 11-45
eigenvectors 11-10
Electric units 3-20
END 2-27
ENDSUB 8-11
Energy units 3-20
Engineering format 1-21
ENGL 3-30
Entering vectors 9-2
EPS 2-37
EPSX0 5-22
EQ 6-26
Equation Library F-6, M-1
Equation Library 27-1
Equation Writer (EQW) 2-10
Equation writer properties 1-29
Equation Writer, Selection Tree E-1
Equations, linear systems 11-17
Equations, solving 27-1
EQW
BIG 2-11
CMDS 2-11
CURS 2-11
Derivatives 2-30
EDIT 2-11
EVAL 2-11
FACTOR 2-11
HELP 2-11
Integrals 2-32
SIMPLIFY 2-11
Summations 2-29
ERASE 12-20, 22-4
ERR0 21-65
ERRM 21-65

Page N-5

ERRN 21-65
Error trapping in programming 21-64
Errors in hypothesis testing 18-36
Errors in programming 21-64
EULER 5-10
Euler constant 16-54
Euler equation 16-51
Euler formula 4-1
EVAL 2-5
Exact CAS mode C-4
EXEC L-2
EXP 3-6
EXP2POW 5-28
EXPAND 5-4
EXPANDMOD 5-11
EXPLN 5-8, 5-28
EXPM 3-9
Exponential distribution 17-6
Extrema 13-12
Extreme points 13-12
EYEPT 22-10

FF distribution 17-12
FACTOR 2-11
Factorial 3-15
Factorial symbol (!) G-2
Factoring an expression 2-24
FACTORMOD 5-11
FACTORS 5-9
FANNING 3-32
Fast 3D plots 12-34
Fast Fourier transform 16-47
Fast Replace All L-3

FCOEF 5-11
FDISTRIB 5-28
FFT 16-47
Fields 15-1
File manager.. menu F-4
Financial calculations 6-9
Find next.. L-3
Finite arithmetic ring 5-13
Finite population 18-3
Fitting data 18-10
Fixed format 1-19
Flags 24-1
FLOOR 3-14
FOR construct 21-59
Force units 3-20
Format SD card 26-10
FOURIER 16-26
Fourier series 16-26
Fourier series and ODEs 16-41
Fourier series for square wave 16-38
Fourier series for triangular wave
16-34
Fourier series, complex 16-26
Fourier transforms 16-42
Fourier transforms, convolution 16-47
Fourier transforms, definitions 16-45
FP 3-14Fractions 5-23
Frequency distribution 18-5
FROOTS 5-11, 5-24
Full pivoting 11-35
Function plot 12-2
FUNCTION plot operation 12-13
FUNCTION plots 12-5

Page N-6

Function, table of values 12-17,
12-25
Functions, multi-variate 14-1
Fundamental theorem of algebra 6-7

G
GAMMA 3-15
Gamma distribution 17-6
GAUSS 11-54
Gaussian elimination 11-14, 11-29
Gauss-Jordan elimination 11-33,
11-38, 11-40, 11-43
GCD 5-11, 5-18
GCDMOD 5-11
Geometric mean 8-16, 18-3
GET 10-6
GETI 8-11
Global variable 21-2
Global variable scope 21-4
GOR 22-32
Goto Line L-4
GOTO menu L-2, L-4
Goto Position L-4
Grades 1-23
Gradient 15-1
Graphic objects 22-29
Graphical solution of ODEs 16-57
Graphics animation 22-26
Graphics options 12-1
Graphics programming 22-1
Graphs 12-1
Graphs bar plots 12-29
Graphs conic curves 12-20
Graphs differential equations 12-26

Graphs Fast 3D plots 12-34
Graphs Gridmap plots 12-40
Graphs histograms 12-29
Graphs parametric 12-22
Graphs polar 12-18
Graphs Pr-Surface plots 12-41
Graphs saving 12-7
Graphs scatterplots 12-31
Graphs slope fields 12-33
Graphs SYMBOLIC menu 12-49
Graphs truth plots 12-28
Graphs wireframe plots 12-36
Graphs Y-Slice plots 12-39
Graphs Zooming 12-47
GRD 3-1
Greek letters G-2
Greek letters D-3
Gridmap plots 12-40
GROB 22-29
GROB menu 22-31
GROB programming 22-33
GROBADD 12-50
Grouped data 8-18
Grouped data statistics 8-18
Grouped data variance 8-19
GXOR 22-32

H
HADAMARD 11-5
HALT L-2
Harmonic mean 8-15
HEAD 8-11
Header size 1-30
Heaviside’s step function 16-15

Page N-7

HELP 2-26
HERMITE 5-11, 5-18
HESS 15-2
Hessian matrix 15-2
HEX 3-2, 19-2
Hexadecimal numbers 19-7
Higher-order derivatives 13-13
Higher-order partial derivatives 14-3
HILBERT 10-14
Histograms 12-29
HMS- 25-3
HMS+ 25-3
HMS 25-3
HORNER 5-11, 5-19
H-VIEW 12-19
Hyperbolic functions graphs 12-16
Hypothesis testing 18-35
Hypothesis testing errors 18-36
Hypothesis testing in linear regression
18-52
Hypothesis testing in the calculator
18-43
HZIN 12-48
HZOUT 12-48

Ii 3-16I/O functions menu F-2
IR 5-27
IABCUV 5-10
IBERNOULLI 5-10
ICHINREM 5-10
Identity matrix 11-6
identity matrix 10-1

IDIV2 5-10
IDN 10-9
IEGCD 5-10
IF...THEN..ELSE...END 21-48
IF...THEN..END 21-47
IFERR sub-menu 21-65
IFTE 3-36
ILAP 16-11
Illumination units 3-21
IM 4-6IMAGE 11-55
Imaginary part 4-1
Improper integrals 13-20
Increasing-power CAS mode C-9
INDEP 22-6
Independent variable in CAS C-2Infinite series 13-20
Infinite series 13-22
INFO 22-3
INPUT 21-22
Input forms programming 21-21
Input forms use of A-1
Input string prompt programming
21-21
Input-output functions menu F-2
INS L-1
INT 13-14
Integer numbers C-5
Integers 2-1
Integrals 13-14
Integrals definite 13-15
Integrals double 14-8
Integrals improper 13-20
Integrals multiple 14-8

Page N-8

Integrals step-by-step 13-16
Integration by partial fractions 13-20
Integration by parts 13-19
Integration change of variable 13-19
Integration substitution 13-18
Integration techniques 13-18
Interactive drawing 12-43
Interactive input programming 21-19
Interactive plots with PLOT menu
22-15Interactive self-test G-3
INTVX 13-14
INV 4-5, L-4
Inverse cdf’s 17-13
Inverse cumulative distribution functions 17-13
Inverse function graph 12-11
Inverse Laplace transforms 16-10
Inverse matrix 11-6
INVMOD 5-11
IP 3-14IQUOT 5-10
IREMAINDER 5-10
Irrotational fields 15-5
ISECT in plots 12-6
ISOL 6-1
ISOM 11-55
ISPRIME? 5-10
ITALI L-4

J
Jacobian 14-9
JORDAN 11-47

K
KER 11-56
Key Click 1-25
Keyboard B-1
Keyboard ALPHA characters B-9
Keyboard ALPHA-left-shift characters
B-10
Keyboard ALPHA-right-shift characters B-12
Keyboard alternate key functions B-4
Keyboard left-shift functions B-5
Keyboard main key functions B-2
Keyboard right-shift functions B-8
Kronecker’s delta 10-1

L
LABEL 12-45
Labels L-4
LAGRANGE 5-11, 5-19
Laguerre’s equation 16-56
LAP 16-11
LAPL 15-4
Laplace transforms 16-10
Laplace transforms and ODEs 16-17
Laplace transforms inverse 16-10
Laplace transforms theorems 16-12
Laplace’s equation 15-4
Laplacian 15-4
Last Stack 1-25
LCM 5-11, 5-20
LCXM 11-16
LDEC 16-4
Least-square function 11-22, 11-24
Least-square method 18-50

Page N-9

Left-shift functions B-5
LEGENDRE 5-11, 5-20
Legendre’s equation 16-51
Length units 3-19
LGCD 5-10
lim 13-2
Limits 13-1
LIN 5-5LINE 12-44
Line editor commands L-1
Line editor properties 1-28
Linear Algebra 11-1
Linear Applications 11-54
Linear differential equations 16-4
Linear regression additional notes 1850
Linear regression confidence intervals
18-52
Linear regression hypothesis testing
18-52
Linear regression prediction error
18-52
Linear system of equations 11-18
Linearized relationships 18-12
LINSOLVE 11-41
LIST 2-34
LIST menu 8-8
List of CAS help facility H-1
List of command catalog I-1
Lists 8-1
LN 3-6
Ln(X) graph 12-8
LNCOLLECT 5-5
LNP1 3-9

Local variables 21-2
LOG 3-5
LOGIC menu 19-5
Logical operators 21-43
Lower-triangular matrix 11-50
LQ 11-49, 11-51
LQ decomposition 11-49
LSQ 11-24
LU 11-49
LU decomposition 11-49
LVARI 7-11

M
Maclaurin series 13-23
MAD 11-48
Main diagonal 10-1
MAIN menu G-3
MAIN menu K-1
MAIN/ALGB menu K-1
MAIN/ARIT menu K-3
MAIN/CASCFG command K-1
MAIN/CMPLX menu K-3
MAIN/DIFF menu K-2
MAIN/EXP&LN menu K-4
MAIN/MATHS menu (MATHS menu)
J-1
MAIN/MATR menu K-4
MAIN/REWRITE menu K-4
MAIN/SOLVER menu K-3
MAIN/TRIGO menu K-2
Manning’s equation 21-15
MANT 3-14
MAP 8-12
MARK 12-44

Page N-10

Mass units 3-20
Math menu.. F-5
MATHS menu G-3, J-1
MATHS/CMPLX menu J-1
MATHS/CONSTANTS menu J-1
MATHS/HYPERBOLIC menu J-2
MATHS/INTEGER menu J-2
MATHS/MODULAR menu J-2
MATHS/POLYNOMIAL menu J-3
MATHS/TESTS menu J-3
matrices 10-1
Matrix "division" 11-27
Matrix augmented 11-32
Matrix factorization 11-49
Matrix Jordan-cycle decomposition
11-47
MATRIX menu 10-3
Matrix multiplication 11-2
Matrix operations 11-1
Matrix Quadratic Forms 11-52
Matrix raised to a power 11-5
Matrix term-by-term multiplication
11-4
Matrix transpose 10-1
Matrix writer 9-3
Matrix Writer 10-2
MATRIX/MAKE menu 10-3
Matrix-vector multiplication 11-2
MAX 3-13
Maximum 13-12, 14-5
MAXR 3-16
Mean 18-3
Measures of central tendency 18-3
Measures of spreading 18-3

Median 18-3
Memory 26-1 to 26-10
MENU 12-46
Menu numbers 20-2
Menus 1-3
Menus not accessible through keyboard G-3
MES 7-9
Message box programming 21-37
Method of least squares 18-50
MIN 3-13
Minimum 13-12, 14-5
MINIT 7-12
MINR 3-16
MITM 7-11
MKISOM 11-56
MOD 3-13
Mode 18-4
MODL 22-13
MODSTO 5-11
Modular arithmetic 5-12
Modular inverse 5-16
Modular programming 22-35
MODULO 2-37
Modulus in CAS C-3
Moment of a force 9-16
MSGBOX 21-31
MSLV 7-4
MSOLVR 7-12
MTH menu 3-7
MTH/LIST menu 8-8
MTH/PROBABILITY menu 17-1
MTH/VECTOR menu 9-10
MTRW 9-3

Page N-11

Multiple integrals 14-8
Multiple linear fitting 18-57
Multiple-Equation Solver 27-6
Multi-variate calculus 14-1
MULTMOD 5-11

N
NDIST 17-10
NEG 4-6
Nested IF...THEN..ELSE..END 21-49
NEW 2-34
NEXTPRIME 5-10
Non-CAS commands C-13
Non-linear differential equations 16-4
Non-verbose CAS mode C-7
NORM menu 11-7
Normal distribution 17-10
Normal distribution cdf 17-10
Normal distribution standard 17-17
NOT 19-5
NSUB 8-11
NUM 23-1
NUM.SLV input forms A-1
NUM.SLV 6-13
Number Format 1-17
Number in bases 19-1
Numeric CAS mode C-3
Numeric solver menu F-3
Numeric vs. symbolic CAS mode C-3
Numerical solution of ODEs 16-57
Numerical solution to stiff ODEs 1665
Numerical solver 6-5
NUMX 22-10

NUMY 22-10

O
OBJ 9-19
Objects 2-1, 24-1
OCT 19-2
Octal numbers 3-2
ODEs (ordinary differential equations) 16-1
ODEs Graphical solution 16-57
ODEs Laplace transform applications
16-17
ODEs Numerical solution 16-57
ODETYPE 16-8
OFF 1-2
ON 1-2
OPER menu 11-15
Operations with units 3-25
Operators 3-7
OR 19-5
ORDER 2-34
Organizing data 2-33
Orthogonal matrices 11-50
Other characters D-3
Output tagging 21-33

P
PA2B2 5-10
Paired sample tests 18-41
Parametric plots 12-22
PARTFRAC 5-5
Partial derivatives 14-1
Partial derivatives chain rule 14-4
Partial derivatives higher-order 14-3

Page N-12

Partial fractions integration 13-20
Partial pivoting 11-34
PASTE 2-27
PCAR 11-45
PCOEF 5-11, 5-21
PDIM 22-20
Percentiles 18-14
PERIOD 2-37, 16-34
PERM 17-2
Permutation matrix 11-50, 11-51
Permutations 17-1
PEVAL 5-22
PGDIR 2-44
Physical constants 3-29
PICT 12-8
Pivoting 11-34
PIX? 22-22
Pixel coordinates 22-25
Pixel references 19-7
PIXOFF 22-22
PIXON 22-22
Plane in space 9-17
PLOT 12-50
PLOT environment 12-3
Plot functions menu F-1
PLOT menu (menu 81) G-3
PLOT menu interactive plots 22-15
PLOT menu 22-1
PLOT operations 12-5
Plot setup 12-50
PLOT SETUP environment 12-3
PLOT WINDOW environment 12-4
PLOT/FLAG menu 22-13
PLOT/STAT menu 22-11

PLOT/STAT/DATA menu 22-12
PLOTADD 12-50
Plots program-generated 22-17
Poisson distribution 17-5
Polar coordinate plot 12-18
Polar coordinates double integrals
14-9
Polar plot 12-18
Polar representation 4-1, 4-3
POLY sub-menu 6-29
Polynomial Equations 6-6
Polynomial fitting 18-59
Polynomials 5-17
Population 18-3
POS 8-11
POTENTIAL 15-3
Potential function 15-3, 15-6
Potential of a gradient 15-3
Power units 3-20
POWEREXPAND 5-29
POWMOD 5-11
PPAR 12-3, 12-11
Prediction error linear regression
18-52
Pressure units 3-20
PREVPRIME 5-10
PRG menu shortcuts 21-9
PRG menu 21-5
PRG/MODES/KEYS sub-menu 20-5
PRG/MODES/MENU menu 20-1
PRIMIT 2-37
Probability 17-1
Probability density function 17-6
Probability distributions continuous

Page N-13

17-6
Probability distributions discrete 17-4
Probability distributions for statisticalinference 17-9
Probability mass function 17-4
Program branching 21-46
Program loops 21-53
Program-generated plots 22-17
Programming 21-1
Programming choose box 21-31
Programming debugging 21-22
Programming drawing commands
22-19
Programming drawing functions
22-24
Programming error trapping 21-64
Programming graphics 22-1
Programming input forms 21-27
Programming input string prompt
21-21
Programming interactive input 21-19
Programming message box 21-37
Programming modular 22-35
Programming output 21-33
Programming plots 22-14
Programming sequential 21-19
Programming tagged output 21-34
Programming using units 21-37
Programming with GROBs 22-33
Programs with drawing functions
22-24
PROOT 5-21
PROPFRAC 5-10, 5-23
Pr-Surface plots 12-41
Ps-Contour plots 12-38

PSI 3-15
PTAYL 5-11, 5-21
PTYPE 22-4
Purging from SD card 26-11
PUT 8-10
PUTI 10-6
PVIEW 22-22
PXC 19-7

Q
QR 11-52
QR decomposition 11-52
QUADF 11-52
Quadratic form diagonal representation 11-53
QUOT 5-11, 5-21
QXA 11-53

R
RB 19-3
RC 4-6
RD 3-14
RI 5-27
RAD 3-1
Radians 1-23
Radiation units 3-21
RAND 17-2
Random numbers 17-2
RANK 11-11
Rank of a matrix 11-9, 11-11
RANM 10-11
RCI 10-25
RCIJ 10-25
RCLKEYS 20-6

Page N-14

RCLMENU 20-1
RCWS 19-4
RDM 10-9
RDZ 17-3
RE 4-6
Real CAS mode C-6
Real numbers C-6
Real numbers vs. Integer numbers C-5
Real objects 2-1
Real part 4-1
RECT 4-3
REF. RREF, rref 11-43
Relational operators 21-43
REMAINDER 5-11, 5-21
RENAM 2-34
REPL 10-12
Replace L-3
Replace All L-3
Replace Selection L-3
Replace/Find Next L-3
RES 22-6
RESET 22-8
Restart calculator G-3
RESULTANT 5-11
Resultant of forces 9-15
REVLIST 8-9
REWRITE menu 5-27
Right-shift functions B-8
Rigorous CAS mode C-10
RISCH 13-14
RKF 16-67
RKFERR 16-71
RKFSTEP 16-69
RL 19-6

RLB 19-7
RND 3-14
RNRM 11-9
ROOT 6-26
ROOT in plots 12-5
ROOT sub-menu 6-26
Row norm 11-9
Row vectors 9-18
ROW+ 10-23
ROW 10-23
ROW- 10-24
RR 19-6
RRB 19-7
RRK 16-68
RSBERR 16-71
RSD 11-44
RSWP 10-24
R∠Z 3-2

S
Saddle point 14-5
Sample correlation coefficient 18-11
Sample covariance 18-11
Sample vs. population 18-5
Saving a graph 12-7
Scalar field 15-1
SCALE 22-7
SCALEH 22-7
SCALEW 22-7
Scatterplots 12-31
Scientific format 1-20
Scope global variable 21-4
SD cards 26-7 to 26-11

Page N-15

SEARCH menu L-2
Selection tree in Equation Writer E-1
SEND 2-34
SEQ 8-11
Sequential programming 21-15
Series Fourier 16-26
Series Maclaurin 13-23
Series Taylor 13-23
Setting time and date 25-2
SHADE in plots 12-6
Shortcuts G-1
SI 3-30SIGMA 13-14
SIGMAVX 13-14
SIGN 3-14, 4-6
SIGNTAB 12-50, 13-10
SIMP2 5-10, 5-23
SIMPLIFY 5-29
Simplify non-rational CAS setting
C-10
Simplifying an expression 2-24
SIN 3-7
Single-variable statistics 18-2
Singular value decomposition 11-9,
11-50
SINH 3-9
SIZE 8-10, 10-7
SKIP L-1
SL 19-6
SLB 19-7
Slope fields 12-33
Slope fields for differential equations
16-3
SLOPE in plots 12-6

SNRM 11-8
SOFT menus 1-4
SOLVE 5-5, 6-2, 7-1, 27-1
SOLVE menu 6-26
SOLVE menu (menu 74) G-3
SOLVE/DIFF menu 16-67
SOLVEVX 6-3
SOLVR menu 6-26
SORT 2-34
Special characters G-2
Speed units 3-20
SPHERE 9-15
SQ 3-5
Square root 3-5
Square wave Fourier series 16-38
SR 19-6
SRAD 11-10
SRB 19-7
SREPL 23-3
SST 21-35
Stack properties 1-28
Standard deviation 18-4
Standard format 1-17
START ..STEP construct 21-58
START...NEXT construct 21-54
STAT menu 18-15
STAT menu (menu 96) G-3
Statistical inference probability distributions 17-9
Statistics 18-1
Step function (Heaviside’s) 16-15
Step-by-step CAS mode C-7
Step-by-step integrals 13-16
STEQ 6-14

Page N-16

Stiff differential equations 16-67
Stiff ODE 16-66
Stiff ODEs numerical solution 16-67
STOALARM 25-4
STOKEYS 20-6
STREAM 8-11
String 23-1
String concatenation 23-2
Student t distribution 17-11
STURM 5-11
STURMAB 5-11
STWS 19-4
Style menu L-4
SUB 10-11
Subdirectories creating 2-39
Subdirectories deleting 2-43
SUBST 5-5
SUBTMOD 5-11, 5-15
Sum of squared errors (SSE) 18-63
Sum of squared totals (SST) 18-63
Summary statistics 18-13
SVD 11-50
SVL 11-51
SYLVESTER 11-54
SYMB/GRAPH menu 12-50
Symbolic CAS mode C-3
SYMBOLIC menu 12-49
Synthetic division 5-25
SYST2MAT 11-43
System flag (EXACT/APPROX) G-1
System flag 117 (CHOOSE/SOFT) 15, G-2
System flag 95 (ALG/RPN) G-1
System flags 24-3

System of equations 11-18
System-level operation G-3

T
Table 12-17, 12-25
TABVAL 12-50, 13-9
TABVAR 12-50, 13-10
Tagged output programming 21-34
TAIL 8-11
TAN 3-7
TANH 3-9Taylor polynomial 13-23
Taylor series 13-23
TAYLR 13-24
TAYLR0 13-24
TCHEBYCHEFF 5-22
Tchebycheff polynomials 16-55
TDELTA 3-33
Techniques of integration 13-18
Temperature units 3-20
TEXPAND 5-5
Text editor.. menu F-5
Three-dimensional plot programs 2215
Three-dimensional vector 9-12
TICKS 25-3
TIME 25-3
Time & date... menu F-3
Time functions 25-1
TIME menu 25-1
Time setting 1-7, 25-2
TIME tools 25-2
Time units 3-19
Times calculations 25-4

Page N-17

TINC 3-34
TITLE 7-14
TLINE 12-45, 22-20
TMENU 20-1
TOOL menu
CASCMD 1-7
CLEAR 1-7
EDIT 1-7
HELP 1-7
PURGE 1-7
RCL 1-7
VIEW 1-7
TOOL menu 1-7
Total differential 14-5
TPAR 12-17
TRACE 11-14
TRAN 11-15
Transforms Laplace 16-10
Transpose 10-1
Triangle solution 7-9
Triangular wave Fourier series 16-34
TRIG menu 5-8
Trigonometric functions graphs 12-16
TRN 10-7
TRNC 3-14
Truth plots 12-28
TSTR 25-3
TVM menu 6-30
TVMROOT 6-31
Two-dimensional plot programs
22-14
Two-dimensional vector 9-12
TYPE 24-2

U
UBASE 3-22
UFACT 3-28
UNASSIGN K-1
UNASSUME J-3
UNDE L-4
UNDO 2-62
UNIT 3-30
Unit prefixes 3-24
Units 3-17
Units in programming 21-37
Upper-triangular matrix 11-29, 11-33
USB port P-2
User RPL language 21-1
User-defined keys 20-6
Using input forms A-1
UTILITY menu (menu 113) G-3
UTPC 17-12
UTPF 17-13
UTPN 17-10
UTPT 17-11
UVAL 3-27

VV 9-11
VALUE 3-30
VANDERMONDE 10-13
Variable scope 21-4
Variables 26-1
Variance 18-4
Variance confidence intervals 18-33
Variance inferences 18-47
Vector analysis 15-1
Vector building 9-11

Page N-18

Vector elements 9-7
Vector fields 15-1
Vector fields curl 15-5
Vector fields divergence 15-4
VECTOR menu 9-10
Vector potential 15-6
Vectors 9-1
Verbose CAS mode C-7
Verbose vs. non-verbose CAS mode
C-7
VIEW in plots 12-6
Viscosity 3-21
Volume units 3-19
VPAR 12-42, 22-10
VPOTENTIAL 15-6
VTYPE 24-2
V-VIEW 12-19
VX 2-37, 5-19
VZIN 12-48

W"Warm" calculator restart G-3
Weber’s equation 16-57
Weibull distribution 17-7
Weighted average 8-17
WHILE construct 21-63
Wireframe plots 12-36
Wordsize 19-4

X
XCOL 22-13
XNUM K-5
XOR 19-5
XPON 3-14

XQ K-5XRNG 22-6
XROOT 3-5
XSEND 2-34
XVOL 22-10
XXRNG 22-10
XYZ 3-2Y
YCOL 22-13
YRNG 22-6
Y-Slice plots 12-39
YVOL 22-10
YYRNG 22-10

Z
ZAUTO 12-48
ZDECI 12-48
ZDFLT 12-48
ZEROS 6-4
ZFACT 12-47
ZFACTOR 3-32
ZIN 12-47
ZINTG 12-48
ZLAST 12-47
ZOOM 12-18, 12-47
ZOUT 12-48
ZSQR 12-49
ZTRIG 12-49
ZVOL 22-10

SymbolsDEL L-1

Page N-19

! 17-2% 3-12%CH 3-12%T 3-12ARRY 9-6, 9-20
BEG L-1
COL 10-18
DATE 25-3
DIAG 10-12
END L-1
GROB 22-31
HMS 25-3
LCD 22-32
LIST 9-20
ROW 10-22
STK 3-30
STR 23-1
TAG 21-33, 23-1
TIME 25-3
UNIT 3-28
V2 9-12
V3 9-12
ΣDAT 18-7
ΔDLIST 8-9
ΣPAR 22-13
ΠPLIST 8-9
ΣSLIST 8-9

Page N-20

Limited Warranty
HP 50g graphing calculator; Warranty period: 12 months
1. HP warrants to you, the end-user customer, that HP hardware,accessories and supplies will be free from defects in materials andworkmanship after the date of purchase, for the period specified above.
If HP receives notice of such defects during the warranty period, HP will,at its option, either repair or replace products which prove to be
defective. Replacement products may be either new or like-new.
2.

HP warrants to you that HP software will not fail to execute its
programming instructions after the date of purchase, for the period
specified above, due to defects in material and workmanship whenproperly installed and used. If HP receives notice of such defects during
the warranty period, HP will replace software media which does not
execute its programming instructions due to such defects.

3.

HP does not warrant that the operation of HP products will beuninterrupted or error free. If HP is unable, within a reasonable time, torepair or replace any product to a condition as warranted, you will beentitled to a refund of the purchase price upon prompt return of the
product with proof of purchase.

4.

HP products may contain remanufactured parts equivalent to new in
performance or may have been subject to incidental use.

5. Warranty does not apply to defects resulting from (a) improper orinadequate maintenance or calibration, (b) software, interfacing, parts
or supplies not supplied by HP, (c) unauthorized modification or misuse,(d) operation outside of the published environmental specifications forthe product, or (e) improper site preparation or maintenance.
6. HP MAKES NO OTHER EXPRESS WARRANTY OR CONDITIONWHETHER WRITTEN OR ORAL. TO THE EXTENT ALLOWED BY LOCALLAW,ANYIMPLIEDWARRANTYOR
CONDITIONOF
MERCHANTABILITY, SATISFACTORY QUALITY, OR FITNESS FOR A
PARTICULAR PURPOSE IS LIMITED TO THE DURATION OF THE EXPRESSWARRANTY SET FORTH ABOVE. Some countries, states or provinces do
not allow limitations on the duration of an implied warranty, so theabove limitation or exclusion might not apply to you. This warranty gives
you specific legal rights and you might also have other rights that varyfrom country to country, state to state, or province to province.
7.

TO THE EXTENT ALLOWED BY LOCAL LAW, THE REMEDIES IN THIS

Page LW-1

WARRANTY STATEMENT ARE YOUR SOLE AND EXCLUSIVE REMEDIES.
EXCEPT AS INDICATED ABOVE, IN NO EVENT WILL HP OR ITS
SUPPLIERS BE LIABLE FOR LOSS OF DATA OR FOR DIRECT, SPECIAL,INCIDENTAL, CONSEQUENTIAL (INCLUDING LOST PROFIT OR DATA),OR OTHER DAMAGE, WHETHER BASED IN CONTRACT, TORT, OR
OTHERWISE. Some countries, States or provinces do not allow theexclusion or limitation of incidental or consequential damages, so theabove limitation or exclusion may not apply to you.
8. The only warranties for HP products and services are set forth in theexpress warranty statements accompanying such products and services.
HP shall not be liable for technical or editorial errors or omissions
contained herein.
FOR CONSUMER TRANSACTIONS IN AUSTRALIA AND NEW ZEALAND: THE
WARRANTY TERMS CONTAINED IN THIS STATEMENT, EXCEPT TO THE EXTENTLAWFULLY PERMITTED, DO NOT EXCLUDE, RESTRICT OR MODIFY AND ARE IN
ADDITION TO THE MANDATORY STATUTORY RIGHTS APPLICABLE TO THE SALE
OF THIS PRODUCT TO YOU.

Service
EuropeCountry :Telephone numbers

Austria
Belgium
Denmark
Eastern Europe countries
FinlandFranceGermany
GreeceHolland
Italy
Norway+43-1-3602771203+32-2-7126219+45-8-2332844+420-5-41422523+358-9-640009+33-1-49939006+49-69-95307103+420-5-41422523+31-2-06545301+39-02-75419782+47-63849309

Portugal+351-229570200

Spain+34-915-642095

Sweden+46-851992065

Page LW-2

Switzerland
TurkeyUK
Czech RepublicSouth Africa
Luxembourg
Other European
countries
Asia PacificL.America+420-5-41422523

Country :Telephone numbers

Australia
Singapore+61-3-9841-5211+61-3-9841-5211

Country :Telephone numbers

Argentina

0-810-555-5520
Sao Paulo 3747-7799; ROTC 0800-157751
Mx City 5258-9922; ROTC 01800-472-6684
0800-4746-8368
800-360999
9-800-114726
0-800-10111

BrazilMexicoN.America+41-1-4395358 (German)+41-22-8278780 (French)+39-02-75419782 (Italian)+420-5-41422523+44-207-4580161+420-5-41422523+27-11-2376200+32-2-7126219

Venezuela
Chile
Columbia
Peru
Central America &Caribbean
GuatemalaPuerto Rico
Costa Rica

1-800-999-5105
1-877-232-0589
0-800-011-0524

Country :Telephone numbers

1-800-711-2884

U.S.

1800-HP INVENT(905) 206-4663 or 800- HP
CanadaINVENT
ROTC = Rest of the country
Please logon to http://www.hp.com for the latest service and support
information.

Page LW-3

Regulatory information
Federal Communications Commission NoticeThis equipment has been tested and found to comply with the limits for a Class
B digital device, pursuant to Part 15 of the FCC Rules. These limits are designed
to provide reasonable protection against harmful interference in a residential
installation. This equipment generates, uses, and can radiate radio frequency
energy and, if not installed and used in accordance with the instructions, maycause harmful interference to radio communications. However, there is no
guarantee that interference will not occur in a particular installation. If thisequipment does cause harmful interference to radio or television reception,
which can be determined by turning the equipment off and on, the user is
encouraged to try to correct the interference by one or more of the following
measures:• Reorient or relocate the receiving antenna.
• Increase the separation between the equipment and the receiver.
• Connect the equipment into an outlet on a circuit different from that towhich the receiver is connected.
• Consult the dealer or an experienced radio or television technician for
help.
Modifications
The FCC requires the user to be notified that any changes or modifications
made to this device that are not expressly approved by Hewlett-Packard
Company may void the user’s authority to operate the equipment.
CablesConnections to this device must be made with shielded cables with metallic RFI/
EMI connector hoods to maintain compliance with FCC rules and regulations.
Declaration of Conformity
for Products Marked with FCC Logo,
United States Only

Page LW-4

This device complies with Part 15 of the FCC Rules. Operation is subject to thefollowing two conditions: (1) this device may not cause harmful interference,and (2) this device must accept any interference received, including interference
that may cause undesired operation.
For questions regarding your product, contact:
Hewlett-Packard Company
P. O. Box 692000, Mail Stop 530113
Houston, Texas 77269-2000
Or, call
1-800-474-6836
For questions regarding this FCC declaration, contact:
Hewlett-Packard Company
P. O. Box 692000, Mail Stop 510101
Houston, Texas 77269-2000
Or, call
1-281-514-3333
To identify this product, refer to the part, series, or model number
found on the product.
Canadian NoticeThis Class B digital apparatus meets all requirements of the CanadianInterference-Causing Equipment Regulations.
Avis Canadien
Cet appareil numérique de la classe B respecte toutes les exigences duRèglement sur le matériel brouilleur du Canada.
European Union Regulatory NoticeThis product complies with the following EU Directives:•

Low Voltage Directive 73/23/EEC•

EMC Directive 89/336/EEC

Compliance with these directives implies conformity to applicable harmonizedEuropean standards (European Norms) which are listed on the EU Declarationof Conformity issued by Hewlett-Packard for this product or product family.

Page LW-5

This compliance is indicated by the following conformity marking placed on
the product:

xxxx*
This marking is valid for non-Telecom prodcts
and EU harmonized Telecom products (e.g.
Bluetooth).

This marking is valid for EU non-harmonized Telecom products.
*Notified body number (used only if applicable - refer to the productlabel)

Japanese Notice䈖 䈱ⵝ⟎䈲䇮 ᖱႎಣℂⵝ⟎╬㔚ᵄ㓚ኂ⥄ਥⷙ೙ද⼏ળ (VCCI) 䈱ၮḰ䈮ၮ䈨 䈒 ╙ੑᖱႎᛛⴚⵝ⟎䈪䈜䇯 䈖 䈱ⵝ⟎䈲䇮 ኅᐸⅣႺ䈪૶↪䈜䉎 䈖 䈫 䉕⋡⊛ 䈫 䈚 䈩䈇䉁䈜䈏䇮 䈖 䈱ⵝ⟎䈏 䊤 䉳䉥䉇䊁 䊧 䊎 䉳 䊢 䊮ฃାᯏ䈮ㄭធ 䈚 䈩૶↪
䈘 䉏䉎 䈫 䇮 ฃା㓚ኂ䉕ᒁ䈐⿠ 䈖 䈜 䈖 䈫 䈏䈅 䉍 䉁䈜䇯㩷㩷ขᛒ⺑᣿ᦠ䈮ᓥ 䈦 䈩ᱜ 䈚 䈇ข 䉍 ᛒ䈇 䉕 䈚 䈩 䈒 䈣 䈘 䈇䇯
Korean Notice

Disposal of Waste Equipment by Users in Private Household in the European
Union
This symbol on the product or on its packaging indicates that thisproduct must not be disposed of with your other household waste.
Instead, it is your responsibility to dispose of your waste equipmentby handing it over to a designated collection point for the recyclingof waste electrical and electronic equipment. The separate
collection and recycling of your waste equipment at the time ofdisposal will help to conserve natural resources and ensure that it is recycled ina manner that protects human health and the environment. For more information
about where you can drop off your waste equipment for recycling, pleasecontact your local city office, your household waste disposal service or the shopwhere you purchased the product.

Page LW-6