You can assign a value to a variable with Define + New Definition. There are two options for the behavior of the defined variable. The default behavior is ``deferred evaluation,'' meaning the definition is stored exactly as you make it. The alternate behavior is ``full evaluation,'' meaning the definition that is stored takes into account earlier definitions in force that might affect it. See the section full evaluationFull evaluation for a discussion of this option.
To assign the value 25 to z
Thereafter, until you exit the documentor undefine the variable, the system recognizes z as 25. For example, evaluating the expression `` + z'' returns ``= 28.''
Another way to describe this operation is to say that an expression such as x2 + sin x can be given a name. Enter y = x2 + sin x, leave the insertion point anywhere in the expression, and then from the Define submenuchoose New Definition. Now, whenever you operate on an expression containing y, every occurrence of y is replaced by the expression x2 + sin x. For example, Evaluate applied to y2 + x3 produces
The value assigned can be any mathematical expression. For example, you could define a variable to be
You will find this feature useful for a variety of purposes.
Note The symbol p defined previously represents the expression x3 - 5x + 1. It is not a function, so, for example, p(2) is not the polynomial evaluated at 2, but rather is p(2) = 2p = 2x3 - 10x + 2.