{VERSION 5 0 "IBM INTEL NT" "5.0" }
{USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0
1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0
0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }
{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1
257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0
0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0
0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }
{CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1
262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0
0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0
0 0 0 1 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }
{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1
267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0
0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Tim
es" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }
{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1
2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Title" -1 18 1
{CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12
12 1 0 1 0 2 2 19 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times
" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }}
{SECT 0 {PARA 18 "" 0 "" {TEXT -1 20 "Programming in Maple" }}{PARA
256 "" 0 "" {TEXT -1 97 "Roger Kraft\nDepartment of Mathematics, Compu
ter Science, and Statistics\nPurdue University Calumet" }}{PARA 256 "
" 0 "" {TEXT -1 24 "roger@calumet.purdue.edu" }}{PARA 0 "" 0 "" {TEXT
-1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 23 "1.3. Functions in Maple
" }}{PARA 0 "" 0 "" {TEXT -1 369 "There are two ways to represent math
ematical functions in Maple, as Maple expressions and as Maple functio
ns. These two ways of representing mathematical functions are not equi
valent. Each way has it advantages and disadvantages. In this section \+
we review these two representations and in the next section we look at
some examples that show how they are not equivalent." }}{PARA 0 "" 0
"" {TEXT -1 699 "The differences between these two representations can
be subtle and non-obvious. To fully understand the differences betwee
n these two representations we need to learn about several topics from
Maple programming. In particular, a full explanation of the differenc
es between expressions and Maple functions requires an understanding o
f evaluation rules, data structures, procedures, local, global and lex
ical variables, parameter passing, remember tables, and several other \+
ideas. Another way to think about this is that learning about Maple pr
ogramming will not only allow you to do more with Maple but it will al
so give you a deeper understanding of very basic Maple ideas like defi
ning a function." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 272 "Let us f
irst look at mathematical functions represented as Maple expressions. \+
We define an expression in Maple as just about any mathematical formul
a that you can write down that does not have an equal sign or any ineq
ualities in it. Here are some examples of expressions." }}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "3*x^2 - 5*x + 17;" }}}{EXCHG {PARA
0 "> " 0 "" {MPLTEXT 1 0 23 "sin( (x+1)^b ) + ln(y);" }}}{EXCHG {PARA
0 "> " 0 "" {MPLTEXT 1 0 16 "exp(x+y)/sec(x);" }}}{EXCHG {PARA 0 "> "
0 "" {MPLTEXT 1 0 17 "n! + sum(n^2, n);" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 16 "a*x + b*y + c*z;" }}}{PARA 0 "" 0 "" {TEXT -1 237 "No
tice that some of these are expressions in one variable, others are ex
pressions in two or more variables. (How many variables are in the las
t expression?) Also notice that calls to Maple procedures are allowed
as parts of expressions." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 216 "These expressions look a lot like the definitions
of mathematical functions, which is why they can be used to represent
mathematical functions in Maple. But expressions are not what Maple r
efers to as \"functions\". A " }{TEXT 257 14 "Maple function" }{TEXT
-1 28 " is something defined using " }{TEXT 259 14 "arrow notation" }
{TEXT -1 47 ". Here are several examples of Maple functions." }}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "x -> x^2;" }}}{EXCHG {PARA 0
"> " 0 "" {MPLTEXT 1 0 21 "x -> a*x^2 + b*x + c;" }}}{EXCHG {PARA 0 ">
" 0 "" {MPLTEXT 1 0 19 "(x,y) -> x^2 + y^2;" }}}{EXCHG {PARA 0 "> "
0 "" {MPLTEXT 1 0 23 "z -> sin(z) + exp(z^2);" }}}{PARA 0 "" 0 ""
{TEXT -1 68 "Look at the first example. We read this as \"the function
that sends " }{XPPEDIT 18 0 "x;" "6#%\"xG" }{TEXT -1 4 " to " }
{XPPEDIT 18 0 "x;" "6#%\"xG" }{TEXT -1 125 " squared\" (the arrow repr
esents the verb \"sends\"). Another common way to read this arrow nota
tion is \"the function that maps " }{XPPEDIT 18 0 "x;" "6#%\"xG" }
{TEXT -1 4 " to " }{XPPEDIT 18 0 "x;" "6#%\"xG" }{TEXT -1 535 " square
d\". On the left of the arrow are variables that represent the input t
o the function. On the right hand side of the arrow there is an expres
sion that represents the rule of the function. (The arrow, by the way,
is made up of a minus sign and a greater than sign. There should not \+
be a space between them.) Notice that Maple functions are not really m
athematical functions since there is no mention of a domain or a codom
ain. But Maple functions are clearly meant to define a rule showing ho
w an output is computed from an input. " }}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 ""
{TEXT -1 3 "So " }{TEXT 256 0 "" }{TEXT -1 247 "both Maple expressions
and Maple functions can be used in Maple to represent mathematical fu
nctions. To see how Maple functions can differ from Maple expressions \+
when used to represent mathematical functions, consider the following \+
three examples." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "a*x^2;" }}
}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "x -> a*x^2;" }}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "(x,a) -> a*x^2;" }}}{PARA 0 "" 0 "
" {TEXT -1 145 "In the first example the expression is defining a func
tion of two variables since there is really no way in Maple to give ei
ther of the unknowns " }{TEXT 0 1 "x" }{TEXT -1 4 " or " }{TEXT 0 1 "a
" }{TEXT -1 114 " any more importance than the other. But in the secon
d example the arrow notation clearly singles out the unknown " }{TEXT
0 1 "x" }{TEXT -1 74 " as the input so this defines a function of one \+
variable, and the unknown " }{TEXT 0 1 "a" }{TEXT -1 179 " is to be th
ought of as a constant (or a \"parameter\"). In the third example the \+
arrow notation clearly defines a function of two variables. What does \+
the following command define?" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1
0 11 "a -> a*x^2;" }}}{PARA 0 "" 0 "" {TEXT -1 191 "Notice how these l
ast examples demonstrate a difference between Maple and standard mathe
matical notation. For example, when one writes a formula for the gener
al quadratic, one usually writes " }{XPPEDIT 18 0 "a*x^2+b*x+c;" "6#,(
*&%\"aG\"\"\"*$%\"xG\"\"#F&F&*&%\"bGF&F(F&F&%\"cGF&" }{TEXT -1 73 ", a
nd it is understood that this defines a function of one variable (the \+
" }{XPPEDIT 18 0 "x;" "6#%\"xG" }{TEXT -1 45 ") and the function has t
hree parameters (the " }{XPPEDIT 18 0 "a;" "6#%\"aG" }{TEXT -1 2 ", "
}{XPPEDIT 18 0 "b;" "6#%\"bG" }{TEXT -1 6 ", and " }{XPPEDIT 18 0 "c;
" "6#%\"cG" }{TEXT -1 29 "). This is because we have a " }{TEXT 258
10 "convention" }{TEXT -1 295 " in mathematics to treat some letters a
s variables (for example x, y, and z) and some other letters as consta
nts or parameters (for example a, b, and c). Maple does not have any k
nowledge of this convention so in an expression Maple treats all unass
igned names (i.e., all unknowns) as variables." }}{PARA 0 "" 0 ""
{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 313 "In all of the examples o
f expressions and Maple functions given above, we never gave any of th
em a name. But we can always use the assignment operator to give an ex
pression or function a name, and this makes working with expressions a
nd functions much more convenient. So for example, here is an expressi
on named " }{TEXT 0 1 "f" }{TEXT -1 28 " and a Maple function named "
}{TEXT 0 1 "g" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1
0 13 "f := x^2 - 1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "g :=
x -> x^2 - 1;" }}}{PARA 0 "" 0 "" {TEXT -1 354 "Notice that the last \+
command does two distinct things. It defines a Maple function and it a
ssigns the function a name. When you define a Maple function using the
arrow notation and give it a name at the same time using the assignme
nt operator, you get a Maple command that can look quite strange at fi
rst, but you need to get very used to this notation. " }}{EXCHG {PARA
0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}
{PARA 0 "" 0 "" {TEXT 264 8 "Exercise" }{TEXT -1 234 ": Use the arrow \+
notation to define a function that takes two numbers as input and then
squares the first number minus the second number and subtracts from t
hat the quotient of the first number squared with one minus the second
number." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 ""
0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 265 8 "Exercise" }{TEXT -1
120 ": Use the arrow notation to define a function that takes one numb
er as input and then returns three times the cosine of " }{XPPEDIT 18
0 "Pi;" "6#%#PiG" }{TEXT -1 29 " times the cube of the input." }}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT
-1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 133 "Let us compare Maple's notatio
n with the standard mathematical notation for defining and naming a fu
nction. The mathematical notation" }}{PARA 256 "" 0 "" {XPPEDIT 18 0 "
g(x) = x^2-1;" "6#/-%\"gG6#%\"xG,&*$F'\"\"#\"\"\"F+!\"\"" }}{PARA 0 "
" 0 "" {TEXT -1 87 "defines a mathematical function named g that is eq
uivalent to the Maple function named " }{TEXT 0 1 "g" }{TEXT -1 29 " d
efined by the Maple command" }}{PARA 256 "" 0 "" {TEXT 0 17 "g := x ->
x^2 - 1" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 662 "When we comp
are these two notations we notice a major difference right away. The M
aple notation clearly separates the defining of the function (the arro
w operation) from the naming of the function (the assignment operation
) but the mathematical notation combines these two operations into one
use of the equal sign. The mathematical notation has one clear advant
age over the Maple notation. The mathematical notation is more compac
t. But the mathematical notation has the disadvantage of being somewha
t ambiguous. Here is an example of how an ambiguity can arise. The fol
lowing mathematical formula can be interpreted as the definition and n
aming of a function " }{XPPEDIT 18 0 "g(x);" "6#-%\"gG6#%\"xG" }{TEXT
-1 1 "." }}{PARA 256 "" 0 "" {XPPEDIT 18 0 "g(x) = 3*x^2-x+5;" "6#/-%
\"gG6#%\"xG,(*&\"\"$\"\"\"*$F'\"\"#F+F+F'!\"\"\"\"&F+" }}{PARA 0 "" 0
"" {TEXT -1 62 "Now suppose that we follow this formula with the next \+
formula." }}{PARA 256 "" 0 "" {XPPEDIT 18 0 "g(x) = x^2-1;" "6#/-%\"gG
6#%\"xG,&*$F'\"\"#\"\"\"F+!\"\"" }}{PARA 0 "" 0 "" {TEXT -1 82 "How sh
ould we interpret this second formula? Is it a redefinition of the fun
ction " }{XPPEDIT 18 0 "g(x);" "6#-%\"gG6#%\"xG" }{TEXT -1 59 ", or is
it a short hand formula for the following equation?" }}{PARA 256 ""
0 "" {XPPEDIT 18 0 "3*x^2-x+5 = x^2-1;" "6#/,(*&\"\"$\"\"\"*$%\"xG\"\"
#F'F'F)!\"\"\"\"&F',&*$F)F*F'F'F+" }{TEXT -1 0 "" }}{PARA 0 "" 0 ""
{TEXT -1 347 "There is really no way to tell from the second formula i
tself which interpretation is correct. The cause of this ambiguity is \+
that in standard mathematical notation, the equal sign has two distinc
t uses, as either part of an assignment statement or as part of an equ
ation. If the second formula above is meant to be a redefinition of th
e function " }{XPPEDIT 18 0 "g(x);" "6#-%\"gG6#%\"xG" }{TEXT -1 416 ",
then the equal sign in that formula is acting as part of an assignmen
t statement. If on the other hand the second formula is meant to be a \+
short hand for the third formula, then the equal sign in the second fo
rmula is acting as part of an equation. Let us translate these formula
s into Maple and see what the two interpretations lead to. We translat
e the first mathematical formula as the definition of a function " }
{TEXT 0 1 "g" }{TEXT -1 33 " represented as a Maple function." }}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "g := x -> 3*x^2-x+5;" }}}
{PARA 0 "" 0 "" {TEXT -1 87 "Notice that since this was a definition, \+
we used the assignment operator, colon equal (" }{TEXT 0 2 ":=" }
{TEXT -1 223 "). Now suppose that the second mathematical formula is t
o be interpreted as a short hand for the third formula. In this case t
he second formula is an equation, so it is translated into a Maple equ
ation using an equal sign (" }{TEXT 0 1 "=" }{TEXT -1 2 ")." }}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "g(x) = x^2-1;" }}}{PARA 0 "" 0 ""
{TEXT -1 148 "We see right away that Maple interpreted this equation a
s a short hand for the third mathematical formula above. Notice that t
he last Maple command " }{TEXT 261 7 "did not" }{TEXT -1 26 " change t
he definition of " }{TEXT 0 1 "g" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 5 "g(x);" }}}{PARA 0 "" 0 "" {TEXT -1 104 "Now sup
pose that the second mathematical formula is to be interpreted as a re
definition of the function " }{XPPEDIT 18 0 "g(x);" "6#-%\"gG6#%\"xG"
}{TEXT -1 98 ". In this case we translate the second mathematical form
ula into a Maple statement that redefines " }{TEXT 0 1 "g" }{TEXT -1
34 " by using the assignment operator." }}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 16 "g := x -> x^2-1;" }}}{PARA 0 "" 0 "" {TEXT -1 4 "Now \+
" }{TEXT 0 1 "g" }{TEXT -1 22 " has a new definition." }}{EXCHG {PARA
0 "> " 0 "" {MPLTEXT 1 0 5 "g(x);" }}}{PARA 0 "" 0 "" {TEXT -1 327 "No
tice that in Maple, the two possible interpretations of the second mat
hematical formula translate into two distinctly different commands, on
e using an equal sign and the other using colon equal. Maple makes a c
lear distinction between an equation and an assignment but, unfortunat
ely, standard mathematical notation does not." }}{EXCHG {PARA 0 "> "
0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 ""
0 "" {TEXT 262 8 "Warning:" }{TEXT -1 67 " Interpreting the second mat
hematical formula as a redefinition of " }{XPPEDIT 18 0 "g(x);" "6#-%
\"gG6#%\"xG" }{TEXT -1 51 " might lead one to use the following Maple \+
command." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "g(x) := x^2-1;"
}}}{PARA 0 "" 0 "" {TEXT -1 80 "Unfortunately, this (reasonable lookin
g) command does not redefine the function " }{XPPEDIT 18 0 "g(x);" "6#
-%\"gG6#%\"xG" }{TEXT -1 109 ". Just what it does is a bit confusing. \+
Here is an example that shows that it does not redefine the function \+
" }{XPPEDIT 18 0 "g(x);" "6#-%\"gG6#%\"xG" }{TEXT -1 24 ". Let us try \+
redefining " }{XPPEDIT 18 0 "g(x);" "6#-%\"gG6#%\"xG" }{TEXT -1 7 " ag
ain." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "g(x) := 100*x+2;" }}
}{PARA 0 "" 0 "" {TEXT -1 26 "Now evaluate the function " }{TEXT 0 1 "
g" }{TEXT -1 12 " at a point." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1
0 5 "g(2);" }}}{PARA 0 "" 0 "" {TEXT -1 70 "That is not what we might \+
have expected. Let us check the formula for " }{TEXT 0 1 "g" }{TEXT
-1 1 "." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "g(x);" }}}{PARA 0
"" 0 "" {TEXT -1 81 "That looks correct. Let us try something differen
t. Let us check the formula for " }{TEXT 0 1 "g" }{TEXT -1 20 " in a d
ifferent way." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "g(t);" }}}
{PARA 0 "" 0 "" {TEXT -1 151 "Exactly what is going on here is a bit h
ard to explain. We will return to this odd situation later (in Section
4.11). For now, remember not to use the " }{TEXT 0 4 "g(x)" }{TEXT
-1 134 " notation on the left hand of an assignment operator when you \+
define a Maple function, even though the mathematical notation does us
e " }{XPPEDIT 18 0 "g(x);" "6#-%\"gG6#%\"xG" }{TEXT -1 66 " on the lef
t hand side of the equal sign when defining a function." }}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }
}{PARA 0 "" 0 "" {TEXT -1 240 "So far, we have been defining Maple fun
ctions by using the arrow notation. It is possible to define a Maple f
unction without using the arrow operator if we build the function up o
ut of predefined Maple functions. For example, the functions " }{TEXT
0 3 "cos" }{TEXT -1 5 " and " }{TEXT 0 2 "ln" }{TEXT -1 67 " are prede
fined in Maple. Here is a definition of a Maple function " }{TEXT 0 1
"g" }{TEXT -1 17 " built up out of " }{TEXT 0 3 "cos" }{TEXT -1 5 " an
d " }{TEXT 0 2 "ln" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 14 "g := cos + ln;" }}}{PARA 0 "" 0 "" {TEXT -1 16 "We ha
ve defined " }{TEXT 0 1 "g" }{TEXT -1 36 " to be the sum of the two fu
nctions " }{TEXT 0 3 "cos" }{TEXT -1 5 " and " }{TEXT 0 2 "ln" }{TEXT
-1 137 ". Notice how we only needed to tell Maple the names of the fun
ctions involved. We did not need to use any variables in the definitio
n of " }{TEXT 0 1 "g" }{TEXT -1 8 ". Since " }{TEXT 0 1 "g" }{TEXT -1
38 " is a Maple function, we can evaluate " }{TEXT 0 1 "g" }{TEXT -1
45 " at an input using regular function notation." }}{EXCHG {PARA 0 ">
" 0 "" {MPLTEXT 1 0 6 "g(Pi);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT
1 0 5 "g(a);" }}}{PARA 0 "" 0 "" {TEXT -1 30 "Here is a more subtle ex
ample." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "h := cos + (x -> 3
*x-1);" }}}{PARA 0 "" 0 "" {TEXT -1 16 "We have defined " }{TEXT 0 1 "
h" }{TEXT -1 71 " as the sum of two predefined functions, the predefin
ed function named " }{TEXT 0 3 "cos" }{TEXT -1 18 " and the function \+
" }{TEXT 0 8 "x->3*x-1" }{TEXT -1 114 ". The later function can be con
sidered as \"predefined\" in this example because Maple must evaluate \+
the definition " }{TEXT 0 8 "x->3*x-1" }{TEXT -1 50 " before it can ev
aluate the addition that defines " }{TEXT 0 1 "h" }{TEXT -1 1 "." }}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "h(z);" }}}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT -1 175 "We end this section with some more examples of us
ing the arrow notation. These examples are purposely a bit confusing i
n order to make you think about this important notation." }}{PARA 0 "
" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 25 "Here is a function
named " }{TEXT 0 1 "f" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 24 "f := x -> (1 + x^2)/x^3;" }}}{PARA 0 "" 0 "" {TEXT
-1 48 "Here is another way to define the same function " }{TEXT 0 1 "f
" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "f := (1 \+
+ (x -> x^2))/(x -> x^3);" }}}{PARA 0 "" 0 "" {TEXT -1 111 "Why did th
is define the same function as the first definition? Here is a third d
efinition of the same function " }{TEXT 0 1 "f" }{TEXT -1 1 "." }}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "f := (1 + (z -> z^2))/(y -> \+
y^3);" }}}{PARA 0 "" 0 "" {TEXT -1 44 "How does this definition handle
an input to " }{TEXT 0 1 "f" }{TEXT -1 1 "?" }}{EXCHG {PARA 0 "> " 0
"" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "
" {TEXT -1 25 "Here is a function named " }{TEXT 0 1 "g" }{TEXT -1 1 "
." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "g := x -> (1 + exp(x))/
x^3;" }}}{PARA 0 "" 0 "" {TEXT -1 48 "Here is another way to define th
e same function " }{TEXT 0 1 "g" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 26 "g := (1 + exp)/(x -> x^3);" }}}{PARA 0 "" 0 "
" {TEXT -1 44 "How does this definition handle an input to " }{TEXT 0
1 "g" }{TEXT -1 1 "?" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 28 "Here is a
n expression named " }{TEXT 0 1 "f" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "
> " 0 "" {MPLTEXT 1 0 9 "f := x^2;" }}}{PARA 0 "" 0 "" {TEXT -1 25 "He
re is a function named " }{TEXT 0 1 "g" }{TEXT -1 15 " defined using \+
" }{TEXT 0 1 "f" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT
1 0 22 "g := x -> 2 * x^3 * f;" }}}{PARA 0 "" 0 "" {TEXT -1 8 "What is
" }{TEXT 0 4 "g(x)" }{TEXT -1 10 " equal to?" }}{EXCHG {PARA 0 "> "
0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 ""
0 "" {TEXT -1 24 "Here are two functions, " }{TEXT 0 1 "f" }{TEXT -1
5 " and " }{TEXT 0 1 "g" }{TEXT -1 8 ", where " }{TEXT 0 1 "g" }{TEXT
-1 18 " is defined using " }{TEXT 0 1 "f" }{TEXT -1 1 "." }}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "f := x -> x^2;" }}}{EXCHG {PARA 0 "
> " 0 "" {MPLTEXT 1 0 24 "g := 2 * (x -> x^3) * f;" }}}{PARA 0 "" 0 "
" {TEXT -1 8 "What is " }{TEXT 0 4 "g(x)" }{TEXT -1 10 " equal to?" }}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT
-1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 30 "Here is another way to define \+
" }{TEXT 0 1 "g" }{TEXT -1 20 " using the function " }{TEXT 0 1 "f" }
{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "g := x -> 2
* x^3 * f(x);" }}}{PARA 0 "" 0 "" {TEXT -1 49 "Be sure to examine the
last three definitions of " }{TEXT 0 1 "g" }{TEXT -1 128 " carefully.
They all define the same function. How does each of them make use of \+
functions, expressions, and the arrow notation?" }}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "
" 0 "" {TEXT 260 8 "Exercise" }{TEXT -1 46 ": Explain the result of th
e following command." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "(x -
> x + x^(-1))(w);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}
{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 263 8 "Exercise
" }{TEXT -1 73 ": Give a simplified definition for each of the followi
ng Maple functions." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "f := \+
((x,y)->x^2) + ((x,y)->y^2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1
0 33 "g := ((x,y)->x^2) + ((y,x)->y^2);" }}}{EXCHG {PARA 0 "> " 0 ""
{MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 ""
{TEXT 268 8 "Exercise" }{TEXT -1 94 ": Explain in detail the steps tha
t Maple uses to automatically simplify the following command." }}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "f := ((x,y)->((x,y)->x*y)(x,
x)+((u,v)->u+v)(3,y))(s,t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0
0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 140 "
Maple has many built in functions that have already been assigned name
s. Here is an example that uses a couple of these built in functions. \+
" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "h := 2*sin - 9/exp;" }}}
{PARA 0 "" 0 "" {TEXT 0 1 "h" }{TEXT -1 16 " is a function, " }{TEXT
266 3 "not" }{TEXT -1 64 " an expression. Here is another way to defin
e the same function " }{TEXT 0 1 "h" }{TEXT -1 1 "." }}{EXCHG {PARA 0
"> " 0 "" {MPLTEXT 1 0 30 "h := x -> 2*sin(x) - 9/exp(x);" }}}{EXCHG
{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }
}{PARA 0 "" 0 "" {TEXT 267 8 "Exercise" }{TEXT -1 6 ": The " }{TEXT 0
1 "2" }{TEXT -1 32 " in the following definition of " }{TEXT 0 1 "h" }
{TEXT -1 39 " does not have the same meaning as the " }{TEXT 0 1 "2" }
{TEXT -1 32 " in the following definition of " }{TEXT 0 1 "f" }{TEXT
-1 46 ". Explain the different meanings of these two " }{TEXT 0 1 "2"
}{TEXT -1 3 "'s." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "h := 2 +
exp;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "f := x -> 2 + exp(
x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 ""
{TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK
"4 3 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33
1 1 }