Next: Functions Up: Algebra Previous: Fractions

### Substitutions

We can always substitute  values for x and y in

using ev in Maxima, eval in Maple, and ReplaceAll in Mathematica. Here is the Maxima example:

You can also use a Maxima function at in this context, which works much like the Maple function eval discussed below:

Function at takes only one argument after the expression to be evaluated. If you want to evalute a multivariable expression at some multidimensional point, you have to give its coordinates as a list.

In Maple value assignments must be presented to function eval as one argument too. If you have several variables to assign values too, wrap them into a list. Maple's list syntax is the same as in Maxima.

In Mathematica there is a function ReplaceAll, which in this context does what ev does in Maxima and what eval does in Maple. It's syntax is more like that of eval, that is, if you have multi-variable assignments, you have to wrap them into a list first. Lists in Mathematica are built using and :

Mathematica can also use a special shorthand notation here to accomplish the same task:

The notation /. is equivalent to calling ReplaceAll. It derives from the following mathematical notation:

Although tricks like this are quite neat from the user point of view, we will avoid them at this stage, since our aim here is to demonstrate how Maxima, Maple and Mathematica resemble each other.

Next: Functions Up: Algebra Previous: Fractions
Zdzislaw Meglicki
2001-02-26