L028 Multivariate and Complex Fuctions
L028 Multivariate and Complex Fuctions
similar to the procedure we learned for functions of one real variable in Lesson 2. Suppose we wish to define the x2 y2 . Enter the Equation Writer and type function F ( x, y ) = 2 x + y2 +1 AS F LS () X SPC Notice that when you type the SPC the calculator puts in a comma. It is important NOT to type the comma as the calculator will behave as if you are trying to define the function of a complex number. If you do that you will get an error message when you try LS DEF. Now continue with AS Y RA RS = X Yx 2 RA - AS Y Yx 2 RA RA RA X Yx 2 RA + AS Y Yx 2 RA + 1 ENTER The function is now on the stack and can be defined as before with LS DEF. To evaluate the function at some point (X, Y), put X on level 2 of the stack, Y on level 1 of the stack and press the soft menu key for the function. The same procedure would work for a function of three variables. Suppose we would like to define the function G ( x, y, z ) = x 2 + y 2 + z 2 . Enter the Equation Writer and type
AS G LS () X SPC AS Y SPC AS Z RA RS = X Yx 2 RA + AS Y Yx 2 RA + AS Z Yx 2 ENTER This function can now be defined with LS DEF and evaluated by placing X on level 3, Y on level 2, Z on level 1 and pressing the soft menu key for the function. As indicated above, the DEF command will not allow us to define a function of a complex number; however, it is easy enough to convince the calculator to do what we want it to do. The calculator can display complex numbers in the form a+bi or (a, b). You must use only the (a, b) form for the following to work. You must also have the calculator set to complex mode. To get everything set up go to MODE F3-CAS and make sure that Complex is checked and press F6-OK. Now press F1-Flags, use DA to scroll down to flag 27 and make sure that it is not checked, then press F6-OK and F6-OK The enunciator R on the top line of the screen will change to C to indicate that the calculator is now in complex mode. Now suppose we would like to define a function H(x+yi) = y-xi. Enter the Equation Writer and type
AS H LS () X SPC AS Y RA RS = LS () AS Y RS , AS X ENTER Now LS DEF will define the function, but it is a multivariate function of X and Y that produces the complex number (Y, -X) as output. We want the input to be the complex number (X, Y). To do this press F1-H ENTER LS DA LA MTH NXT F3-CMPLX F3-CR ENTER The command CR that we have inserted at the beginning of the program separates the complex number (x, y) into its real part x on level 2 and imaginary part y on level 1. If we now put the complex number (1, 2) on the stack and press F1-H, we will get the result (2, -1) as desired. WARNING: With system flag 27 unchecked as we set it above, entering a complex number as a+bi will cause it to be displayed as (a, b), however something strange is going on. Try typing 1 + 2 AS LS i ENTER. The display will show (1., 2.) the same as if you had typed LS () 1 SPC 2 ENTER, but now the H function will give an error message. Why the CR doesnt work when the complex number is converted from a plus b i form to parenthetical form, but does work if it is entered in parenthetical form in the first place is a total mystery to your author and to the folks at the HP customer service desk. Return to List of Lessons