Evaluating functions

First, define the function:

[Graphics:../Images/index_gr_68.gif]

Notice the underscore (_) after the independent variables on the left. These tell Mathematica that anything can be substituted in place of them on the right (no underscores on the right).  Notice how I use descriptive variable names in the definition; it makes it a bit longer, but it makes it easier later to be clear what the function actually does. (You could add some parenthesis if the long variable names bother you.)

Now, you can call this function:

[Graphics:../Images/index_gr_69.gif]
[Graphics:../Images/index_gr_70.gif]

By putting a decimal point on one or both of these numbers, you can tell Mathematica to use decimal approximations:

[Graphics:../Images/index_gr_71.gif]
[Graphics:../Images/index_gr_72.gif]

It also works symbolically:

[Graphics:../Images/index_gr_73.gif]
[Graphics:../Images/index_gr_74.gif]

Or you can plot it:

[Graphics:../Images/index_gr_75.gif]

[Graphics:../Images/index_gr_76.gif]

[Graphics:../Images/index_gr_77.gif]
[Graphics:../Images/index_gr_78.gif]

[Graphics:../Images/index_gr_79.gif]

[Graphics:../Images/index_gr_80.gif]

You can also use it in other commands:

[Graphics:../Images/index_gr_81.gif]
[Graphics:../Images/index_gr_82.gif]
[Graphics:../Images/index_gr_83.gif]
[Graphics:../Images/index_gr_84.gif]

However, be careful of the following:

[Graphics:../Images/index_gr_85.gif]
[Graphics:../Images/index_gr_86.gif]

This just took the derivative of a constant function [Graphics:../Images/index_gr_87.gif]rather than first taking the derivative and then evaluating it at (2,4).  To do the latter, try:

[Graphics:../Images/index_gr_88.gif]
[Graphics:../Images/index_gr_89.gif]


Converted by Mathematica      September 13, 2000