The wrong number of parameters When you call a function, it is important that there be the same number of actual parameters in the function call as there are formal parameters in the function definition. Otherwise, Maple will not be able to match each actual to a formal prior to doing the substitution. Nevertheless, you should always supply exactly the right number of parameters to a function. Magic invocations For some reason, many beginning students appear to expect that the actual parameters will get to the function by magic. And when you are using a function, it doesn't matter at all what the formal parameters are called-that is pertinent only within the implementation of the function.
Free Variables Let's experiment with a different programmer-defined function now.
This is because it appears in the body of the function definition but is NOT a parameter. As a result, it appears in the substituted body. This will be more evident if we trace the evaluation of the function call. You should now experiment with defining some functions of your own. Implement the following functions.