Mathematical procedures

The following procedures are implemented in MathMate:
 
Procedure name
Procedure syntax
integration
Int (expression, expression; variable_name,expression)
summation
Sum (expression, expression; variable_name,expression)
equation (root search)
Root (expression, expression; variable_name,expression)
optimization (minimum search)
Opt (expression, expression; variable_name,expression)
 

Each mathematical procedure can be used in Calculator mode. There is also a special  MathMate mode associated with each procedure type.

Mathematical procedures in the expressions have special syntax. It is close to the syntax for functions of 4 variables (two of them represent the ends of the interval where procedure is applied and are followed by the procedure variable name and the underlying expression). The difference is that for a procedure the first two parameters are separated from the last two by a semicolon (;). For instance,

Int (0, 1; x, sin (x+y))

means integration from 0 to 1 of sin (x + y) dx with y being a parameter. The third parameter (procedure variable name) must be a single identifier.

Similar to functions, procedures can be arbitrarily nested. For instance,

Int (0, 1; x, Int (0, x; y, x^2 + y^2))

represents a double integral. If needed, the user has the possibility to compute something like

Int (Root (-1, 1; t, sin(t)), Opt (0, 4; x, x^2 - 1); y, Sum (0, 3; z, y^z)).

Note that for the Sum the "ends of the interval" mean summation indices, so only their integer part is used.

Note: The name of a parameter used as a variable for a procedure cannot be used as a non-variable parameter name elsewhere in the expression. It cannot either be used as a variable name for a procedure nested in the one for which it is a variable. In other words, expressions of the form

x+Int (0,1;x,x^2) or Int (0,1;x,Int(0,1;x,x^2))

are not recommended in the sense that these expressions compile well but the computed result is non-predictable. On the other hand, something like

Int (0,1;x,x^2) + Int (0,2;x, sin(x)) (or even Int (Int(0,1;x,x^2),1;x,sin(x)))

is most likely to be computed correctly. However, such practice is not encouraged. Use different variable names for different independent variables in procedures.

See also: