nary
====

An nary operator is used to denote a function of any number of arguments, each of which is separated by an occurrence of the operator, e.g. A+B or A+B+C.  The nary("x") function is a syntax extension function to declare x to be an nary operator. Functions may be declared to be nary.  If declare(j,nary); is done, this tells the simplifier to simplify, e.g. j(j(a,b),j(c,d)) to j(a, b, c, d).

See also syntax.

nofix
=====

nofix operators are used to denote functions of no arguments. The mere presence of such an operator in a command will cause the corresponding function to be evaluated.  For example, when one types "exit;" to exit from a Maxima break, "exit" is behaving similar to a nofix operator.  The function nofix("x") is a syntax extension function which declares x to be a nofix operator.

See also syntax.

postfix
=======

postfix operators like the prefix variety denote functions of a single argument, but in this case the argument immediately precedes an occurrence of the operator in the input string, e.g. 3! . The postfix("x") function is a syntax extension function to declare x to be a postfix operator.

See also syntax.

prefix
======

A prefix operator is one which signifies a function of one argument, which argument immediately follows an occurrence of the operator.  prefix("x") is a syntax extension function to declare x to be a prefix operator.

See also syntax.

Arithmetic operators
====================

 -- Operator: +
 -- Operator: -
 -- Operator: *
 -- Operator: /
 -- Operator: ^

     The symbols + * / and ^ represent addition, multiplication, division, and exponentiation, respectively. The name of these operators are "+" "*" "//" and "^", which may appear where the name of a function or operator is required.

     The symbols + and - represent unary addition and negation, respectively, and the names of these operators are "+" and "-", respectively.

     Subtraction a - b is represented within Maxima as addition, a + (- b). Expressions such as a + (- b) are displayed as subtraction. Maxima recognizes "-" only as the name of the unary negation operator, and not as the name of the binary subtraction operator.

     Division a / b is represented within Maxima as multiplication, a * b^(- 1). Expressions such as a * b^(- 1) are displayed as division. Maxima recognizes "//" as the name of the division operator.

     Addition and multiplication are n-ary, commutative operators. Division and exponentiation are binary, noncommutative operators.

     Maxima sorts the operands of commutative operators to construct a canonical representation. For internal storage, the ordering is determined by orderlessp. For display, the ordering for addition is determined by ordergreatp, and for multiplication, it is the same as the internal ordering.

     Arithmetic computations are carried out on literal numbers (integers, rationals, ordinary floats, and bigfloats). Except for exponentiation, all arithmetic operations on numbers are simplified to numbers. Exponentiation is simplified to a number if either operand is an ordinary float or bigfloat or if the result is an exact integer or rational; otherwise an exponentiation may be simplified to sqrt or another exponentiation or left unchanged.

     Floating-point contagion applies to arithmetic computations: if any operand is a bigfloat, the result is a bigfloat; otherwise, if any operand is an ordinary float, the result is an ordinary float; otherwise, the operands are rationals or integers and the result is a rational or integer.

     Arithmetic computations are a simplification, not an evaluation. Thus arithmetic is carried out in quoted (but simplified) expressions.

     Arithmetic operations are applied element-by-element to lists when the global flag listarith is true, and always applied element-by-element to matrices. When one operand is a list or matrix and another is an operand of some other type, the other operand is combined with each of the elements of the list or matrix.

     Examples:

     Addition and multiplication are n-ary, commutative operators. Maxima sorts the operands to construct a canonical representation. The names of these operators are "+" and "*".

          (%i1) c + g + d + a + b + e + f;
          (%o1)               g + f + e + d + c + b + a
          (%i2) [op (%), args (%)];
          (%o2)              [+, [g, f, e, d, c, b, a]]
          (%i3) c * g * d * a * b * e * f;
          (%o3)                     a b c d e f g
          (%i4) [op (%), args (%)];
          (%o4)              [*, [a, b, c, d, e, f, g]]
          (%i5) apply ("+", [a, 8, x, 2, 9, x, x, a]);
          (%o5)                    3 x + 2 a + 19
          (%i6) apply ("*", [a, 8, x, 2, 9, x, x, a]);
                                           2  3
          (%o6)                       144 a  x

     Division and exponentiation are binary, noncommutative operators. The names of these operators are "//" and "^".

          (%i1) [a / b, a ^ b];
                                        a   b
          (%o1)                        [-, a ]
                                        b
          (%i2) [map (op, %), map (args, %)];
          (%o2)              [[//, ^], [[a, b], [a, b]]]
          (%i3) [apply ("//", [a, b]), apply ("^", [a, b])];
                                        a   b
          (%o3)                        [-, a ]
                                        b

     Subtraction and division are represented internally in terms of addition and multiplication, respectively.

          (%i1) [inpart (a - b, 0), inpart (a - b, 1), inpart (a - b, 2)];
          (%o1)                      [+, a, - b]
          (%i2) [inpart (a / b, 0), inpart (a / b, 1), inpart (a / b, 2)];
                                             1
          (%o2)                       [*, a, -]
                                             b

     Computations are carried out on literal numbers. Floating-point contagion applies.

          (%i1) 17 + b - (1/2)*29 + 11^(2/4);
                                                 5
          (%o1)                   b + sqrt(11) + -
                                                 2
          (%i2) [17 + 29, 17 + 29.0, 17 + 29b0];
          (%o2)                   [46, 46.0, 4.6b1]

     Arithmetic computations are a simplification, not an evaluation.

          (%i1) simp : false;
          (%o1)                         false
          (%i2) '(17 + 29*11/7 - 5^3);
                                        29 11    3
          (%o2)                    17 + ----- - 5
                                          7
          (%i3) simp : true;
          (%o3)                         true
          (%i4) '(17 + 29*11/7 - 5^3);
                                          437
          (%o4)                         - ---
                                           7

     Arithmetic is carried out element-by-element for lists (depending on listarith) and matrices.

          (%i1) matrix ([a, x], [h, u]) - matrix ([1, 2], [3, 4]);
                                  [ a - 1  x - 2 ]
          (%o1)                   [              ]
                                  [ h - 3  u - 4 ]
          (%i2) 5 * matrix ([a, x], [h, u]);
                                    [ 5 a  5 x ]
          (%o2)                     [          ]
                                    [ 5 h  5 u ]
          (%i3) listarith : false;
          (%o3)                         false
          (%i4) [a, c, m, t] / [1, 7, 2, 9];
                                    [a, c, m, t]
          (%o4)                     ------------
                                    [1, 7, 2, 9]
          (%i5) [a, c, m, t] ^ x;
                                                x
          (%o5)                     [a, c, m, t]
          (%i6) listarith : true;
          (%o6)                         true
          (%i7) [a, c, m, t] / [1, 7, 2, 9];
                                        c  m  t
          (%o7)                     [a, -, -, -]
                                        7  2  9
          (%i8) [a, c, m, t] ^ x;
                                    x   x   x   x
          (%o8)                   [a , c , m , t ]

 -- Operator: **

     Exponentiation operator. Maxima recognizes ** as the same operator as ^ in input, and it is displayed as ^ in 1-dimensional output, or by placing the exponent as a superscript in 2-dimensional output.

     The fortran function displays the exponentiation operator as **, whether it was input as ** or ^.

     Examples:

          (%i1) is (a**b = a^b);
          (%o1)                         true
          (%i2) x**y + x^z;
                                        z    y
          (%o2)                        x  + x
          (%i3) string (x**y + x^z);
          (%o3)                        x^z+x^y
          (%i4) fortran (x**y + x^z);
                x**z+x**y
          (%o4)                         done

Relational operators
====================

 -- Operator: <
 -- Operator: <=
 -- Operator: >=
 -- Operator: >

General operators
=================

 -- Operator: ^^

     Noncommutative exponentiation operator. ^^ is the exponentiation operator corresponding to noncommutative multiplication ., just as the ordinary exponentiation operator ^ corresponds to commutative multiplication *.

     Noncommutative exponentiation is displayed by ^^ in 1-dimensional output, and by placing the exponent as a superscript within angle brackets < > in 2-dimensional output.

     Examples:

          (%i1) a . a . b . b . b + a * a * a * b * b;
                                  3  2    <2>    <3>
          (%o1)                  a  b  + a    . b
          (%i2) string (a . a . b . b . b + a * a * a * b * b);
          (%o2)                  a^3*b^2+a^^2 . b^^3

 -- Operator: !
     The factorial operator. For any complex number x (including integer, rational, and real numbers) except for negative integers, x! is defined as gamma(x+1).

     For an integer x, x! simplifies to the product of the integers from 1 to x inclusive. 0! simplifies to 1. For a floating point number x, x! simplifies to the value of gamma (x+1). For x equal to n/2 where n is an odd integer, x! simplifies to a rational factor times sqrt (%pi) (since gamma (1/2) is equal to sqrt (%pi)). If x is anything else, x! is not simplified.

     The variables factlim, minfactorial, and factcomb control the simplification of expressions containing factorials.

     The functions gamma, bffac, and cbffac are varieties of the gamma function. makegamma substitutes gamma for factorials and related functions.

     See also binomial.

     The factorial of an integer, half-integer, or floating point argument is simplified unless the operand is greater than factlim.

          (%i1) factlim : 10;
          (%o1)                          10
          (%i2) [0!, (7/2)!, 4.77!, 8!, 20!];
                      105 sqrt(%pi)
          (%o2)   [1, -------------, 81.44668037931199, 40320, 20!]
                           16

     The factorial of a complex number, known constant, or general expression is not simplified. Even so it may be possible simplify the factorial after evaluating the operand.

          (%i1) [(%i + 1)!, %pi!, %e!, (cos(1) + sin(1))!];
          (%o1)      [(%i + 1)!, %pi!, %e!, (sin(1) + cos(1))!]
          (%i2) ev (%, numer, %enumer);
          (%o2) [(%i + 1)!, 7.188082728976037, 4.260820476357,
                                                         1.227580202486819]

     The factorial of an unbound symbol is not simplified.

          (%i1) kill (foo);
          (%o1)                         done
          (%i2) foo!;
          (%o2)                         foo!

     Factorials are simplified, not evaluated. Thus x! may be replaced even in a quoted expression.

          (%i1) '([0!, (7/2)!, 4.77!, 8!, 20!]);
                    105 sqrt(%pi)
          (%o1) [1, -------------, 81.44668037931199, 40320,
                         16
                                                       2432902008176640000]

 -- Operator: !!
     The double factorial operator.

     For an integer, float, or rational number n, n!! evaluates to the product n (n-2) (n-4) (n-6) ... (n - 2 (k-1)) where k is equal to entier (n/2), that is, the largest integer less than or equal to n/2. Note that this definition does not coincide with other published definitions for arguments which are not integers.

     For an even (or odd) integer n, n!! evaluates to the product of all the consecutive even (or odd) integers from 2 (or 1) through n inclusive.

     For an argument n which is not an integer, float, or rational, n!! yields a noun form genfact (n, n/2, 2).

 -- Operator: #
     Represents the negation of syntactic equality =.

     Note that because of the rules for evaluation of predicate expressions (in particular because not EXPR causes evaluation of EXPR), not A = B is equivalent to is(A # B), instead of A # B.

     Examples:

          (%i1) a = b;
          (%o1)                         a = b
          (%i2) is (a = b);
          (%o2)                         false
          (%i3) a # b;
          (%o3)                         a # b
          (%i4) not a = b;
          (%o4)                         true
          (%i5) is (a # b);
          (%o5)                         true
          (%i6) is (not a = b);
          (%o6)                         true

 -- Operator: .
     The dot operator, for matrix (non-commutative) multiplication. When "." is used in this way, spaces should be left on both sides of it, e.g. A . B.  This distinguishes it plainly from a decimal point in a floating point number.

     See also dot, dot0nscsimp, dot0simp, dot1simp, dotassoc, dotconstrules, dotdistrib, dotexptsimp, dotident, and dotscrules.

 -- Operator: :
     The assignment operator.  E.g. A:3 sets the variable A to 3.

 -- Operator: ::
     Assignment operator.  :: assigns the value of the expression on its right to the value of the quantity on its left, which must evaluate to an atomic variable or subscripted variable.

 -- Operator: ::=
     Macro function definition operator. ::= defines a function (called a "macro" for historical reasons) which quotes its arguments, and the expression which it returns (called the "macro expansion") is evaluated in the context from which the macro was called. A macro function is otherwise the same as an ordinary function.

     macroexpand returns a macro expansion (without evaluating it). macroexpand (foo (x)) followed by ''% is equivalent to foo (x) when foo is a macro function.

     ::= puts the name of the new macro function onto the global list macros. kill, remove, and remfunction unbind macro function definitions and remove names from macros.

     fundef or dispfun return a macro function definition or assign it to a label, respectively.

     Macro functions commonly contain buildq and splice expressions to construct an expression, which is then evaluated.

     Examples

     A macro function quotes its arguments, so message (1) shows y - z, not the value of y - z. The macro expansion (the quoted expression '(print ("(2) x is equal to", x)) is evaluated in the context from which the macro was called, printing message (2).

          (%i1) x: %pi;
          (%o1)                          %pi
          (%i2) y: 1234;
          (%o2)                         1234
          (%i3) z: 1729 * w;
          (%o3)                        1729 w
          (%i4) printq1 (x) ::= block (print ("(1) x is equal to", x),
                '(print ("(2) x is equal to", x)));
          (%o4) printq1(x) ::= block(print("(1) x is equal to", x),
                                          '(print("(2) x is equal to", x)))
          (%i5) printq1 (y - z);
          (1) x is equal to y - z
          (2) x is equal to %pi
          (%o5)                          %pi

     An ordinary function evaluates is arguments, so message (1) shows the value of y - z. The return value is not evaluated, so message (2) is not printed until the explicit evaluation ''%.

          (%i1) x: %pi;
          (%o1)                          %pi
          (%i2) y: 1234;
          (%o2)                         1234
          (%i3) z: 1729 * w;
          (%o3)                        1729 w
          (%i4) printe1 (x) := block (print ("(1) x is equal to", x),
                '(print ("(2) x is equal to", x)));
          (%o4) printe1(x) := block(print("(1) x is equal to", x),
                                          '(print("(2) x is equal to", x)))
          (%i5) printe1 (y - z);
          (1) x is equal to 1234 - 1729 w
          (%o5)              print((2) x is equal to, x)
          (%i6) ''%;
          (2) x is equal to %pi
          (%o6)                          %pi

     macroexpand returns a macro expansion. macroexpand (foo (x)) followed by ''% is equivalent to foo (x) when foo is a macro function.

          (%i1) x: %pi;
          (%o1)                          %pi
          (%i2) y: 1234;
          (%o2)                         1234
          (%i3) z: 1729 * w;
          (%o3)                        1729 w
          (%i4) g (x) ::= buildq ([x], print ("x is equal to", x));
          (%o4)    g(x) ::= buildq([x], print("x is equal to", x))
          (%i5) macroexpand (g (y - z));
          (%o5)              print(x is equal to, y - z)
          (%i6) ''%;
          x is equal to 1234 - 1729 w
          (%o6)                     1234 - 1729 w
          (%i7) g (y - z);
          x is equal to 1234 - 1729 w
          (%o7)                     1234 - 1729 w

 -- Operator: :=

     The function definition operator. F(X_1, ..., X_N) := EXPR defines a function named F with arguments X_1, ..., X_N and function body EXPR. := never evaluates the function body (unless explicitly evaluated by quote-quote ''). The function so defined may be an ordinary Maxima function (with arguments enclosed in parentheses) or an array function (with arguments enclosed in square brackets).

     When the last or only function argument X_N is a list of one element, the function defined by := accepts a variable number of arguments. Actual arguments are assigned one-to-one to formal arguments X_1, ..., X_(N - 1), and any further actual arguments, if present, are assigned to X_N as a list.

     All function definitions appear in the same namespace; defining a function f within another function g does not limit the scope of f to g.

     If some formal argument X_K is a quoted symbol, the function defined by := does not evaluate the corresponding actual argument. Otherwise all actual arguments are evaluated.

     See also define and ::=.

     Examples:

     := never evaluates the function body (unless explicitly evaluated by quote-quote).

          (%i1) expr : cos(y) - sin(x);
          (%o1)                    cos(y) - sin(x)
          (%i2) F1 (x, y) := expr;
          (%o2)                   F1(x, y) := expr
          (%i3) F1 (a, b);
          (%o3)                    cos(y) - sin(x)
          (%i4) F2 (x, y) := ''expr;
          (%o4)              F2(x, y) := cos(y) - sin(x)
          (%i5) F2 (a, b);
          (%o5)                    cos(b) - sin(a)

     The function defined by := may be an ordinary Maxima function or an array function.

          (%i1) G1 (x, y) := x.y - y.x;
          (%o1)               G1(x, y) := x . y - y . x
          (%i2) G2 [x, y] := x.y - y.x;
          (%o2)                G2     := x . y - y . x
                                 x, y

     When the last or only function argument X_N is a list of one element, the function defined by := accepts a variable number of arguments.

          (%i1) H ([L]) := apply ("+", L);
          (%o1)                H([L]) := apply("+", L)
          (%i2) H (a, b, c);
          (%o2)                       c + b + a

 -- Operator: =
     The equation operator.

     An expression A = B, by itself, represents an unevaluated equation, which might or might not hold. Unevaluated equations may appear as arguments to solve and algsys or some other functions.

     The function is evaluates = to a Boolean value. is(A = B) evaluates A = B to true when A and B are identical. That is, A and B are atoms which are identical, or they are not atoms and their operators are identical and their arguments are identical. Otherwise, is(A = B) evaluates to false; it never evaluates to unknown. When is(A = B) is true, A and B are said to be syntactically equal, in contrast to equivalent expressions, for which is(equal(A, B)) is true. Expressions can be equivalent and not syntactically equal.

     The negation of = is represented by #. As with =, an expression A # B, by itself, is not evaluated. is(A # B) evaluates A # B to true or false.

     In addition to is, some other operators evaluate = and # to true or false, namely if, and, or, and not.

     Note that because of the rules for evaluation of predicate expressions (in particular because not EXPR causes evaluation of EXPR), not A = B is equivalent to is(A # B), instead of A # B.

     rhs and lhs return the right-hand and left-hand sides, respectively, of an equation or inequation.

     See also equal and notequal.

     Examples:

     An expression A = B, by itself, represents an unevaluated equation, which might or might not hold.

          (%i1) eq_1 : a * x - 5 * y = 17;
          (%o1)                    a x - 5 y = 17
          (%i2) eq_2 : b * x + 3 * y = 29;
          (%o2)                    3 y + b x = 29
          (%i3) solve ([eq_1, eq_2], [x, y]);
                                  196         29 a - 17 b
          (%o3)          [[x = ---------, y = -----------]]
                               5 b + 3 a       5 b + 3 a
          (%i4) subst (%, [eq_1, eq_2]);
                   196 a     5 (29 a - 17 b)
          (%o4) [--------- - --------------- = 17,
                 5 b + 3 a      5 b + 3 a
                                            196 b     3 (29 a - 17 b)
                                          --------- + --------------- = 29]
                                          5 b + 3 a      5 b + 3 a
          (%i5) ratsimp (%);
          (%o5)                  [17 = 17, 29 = 29]

     is(A = B) evaluates A = B to true when A and B are syntactically equal (that is, identical). Expressions can be equivalent and not syntactically equal.

          (%i1) a : (x + 1) * (x - 1);
          (%o1)                    (x - 1) (x + 1)
          (%i2) b : x^2 - 1;
                                        2
          (%o2)                        x  - 1
          (%i3) [is (a = b), is (a # b)];
          (%o3)                     [false, true]
          (%i4) [is (equal (a, b)), is (notequal (a, b))];
          (%o4)                     [true, false]

     Some operators evaluate = and # to true or false.

          (%i1) if expand ((x + y)^2) = x^2 + 2 * x * y + y^2 then FOO else
                BAR;
          (%o1)                          FOO
          (%i2) eq_3 : 2 * x = 3 * x;
          (%o2)                       2 x = 3 x
          (%i3) eq_4 : exp (2) = %e^2;
                                        2     2
          (%o3)                       %e  = %e
          (%i4) [eq_3 and eq_4, eq_3 or eq_4, not eq_3];
          (%o4)                  [false, true, true]

     Because not EXPR causes evaluation of EXPR, not A = B is equivalent to is(A # B).

          (%i1) [2 * x # 3 * x, not (2 * x = 3 * x)];
          (%o1)                   [2 x # 3 x, true]
          (%i2) is (2 * x # 3 * x);
          (%o2)                         true

 -- Operator: and
     The logical conjunction operator. and is an n-ary infix operator; its operands are Boolean expressions, and its result is a Boolean value.

     and forces evaluation (like is) of one or more operands, and may force evaluation of all operands.

     Operands are evaluated in the order in which they appear. and evaluates only as many of its operands as necessary to determine the result. If any operand is false, the result is false and no further operands are evaluated.

     The global flag prederror governs the behavior of and when an evaluated operand cannot be determined to be true or false. and prints an error message when prederror is true. Otherwise, operands which do not evaluate to true or false are accepted, and the result is a Boolean expression.

     and is not commutative: a and b might not be equal to b and a due to the treatment of indeterminate operands.

 -- Operator: or
     The logical disjunction operator. or is an n-ary infix operator; its operands are Boolean expressions, and its result is a Boolean value.

     or forces evaluation (like is) of one or more operands, and may force evaluation of all operands.

     Operands are evaluated in the order in which they appear. or evaluates only as many of its operands as necessary to determine the result. If any operand is true, the result is true and no further operands are evaluated.

     The global flag prederror governs the behavior of or when an evaluated operand cannot be determined to be true or false. or prints an error message when prederror is true. Otherwise, operands which do not evaluate to true or false are accepted, and the result is a Boolean expression.

     or is not commutative: a or b might not be equal to b or a due to the treatment of indeterminate operands.

 -- Operator: not
     The logical negation operator. not is a prefix operator; its operand is a Boolean expression, and its result is a Boolean value.

     not forces evaluation (like is) of its operand.

     The global flag prederror governs the behavior of not when its operand cannot be determined to be true or false. not prints an error message when prederror is true. Otherwise, operands which do not evaluate to true or false are accepted, and the result is a Boolean expression.

 -- Function: abs (EXPR)
     Returns the absolute value EXPR.  If EXPR is complex, returns the complex modulus of EXPR.

 -- Keyword: additive
     If declare(f,additive) has been executed, then:

     (1) If f is univariate, whenever the simplifier encounters f applied to a sum, f will be distributed over that sum.  I.e. f(y+x) will simplify to f(y)+f(x).

     (2) If f is a function of 2 or more arguments, additivity is defined as additivity in the first argument to f, as in the case of sum or integrate, i.e. f(h(x)+g(x),x) will simplify to f(h(x),x)+f(g(x),x). This simplification does not occur when f is applied to expressions of the form sum(x[i],i,lower-limit,upper-limit).

 -- Keyword: allbut
     works with the part commands (i.e. part, inpart, substpart, substinpart, dpart, and lpart).  For example,

          (%i1) expr : e + d + c + b + a;
          (%o1)                   e + d + c + b + a
          (%i2) part (expr, [2, 5]);
          (%o2)                         d + a

     while

          (%i1) expr : e + d + c + b + a;
          (%o1)                   e + d + c + b + a
          (%i2) part (expr, allbut (2, 5));
          (%o2)                       e + c + b

     allbut is also recognized by kill.

          (%i1) [aa : 11, bb : 22, cc : 33, dd : 44, ee : 55];
          (%o1)                 [11, 22, 33, 44, 55]
          (%i2) kill (allbut (cc, dd));
          (%o0)                         done
          (%i1) [aa, bb, cc, dd];
          (%o1)                   [aa, bb, 33, 44]

     kill(allbut(A_1, A_2, ...)) has the effect of kill(all) except that it does not kill the symbols A_1, A_2, ... .

 -- Declaration: antisymmetric
     If declare(h,antisymmetric) is done, this tells the simplifier that h is antisymmetric.  E.g. h(x,z,y) will simplify to - h(x, y, z).  That is, it will give (-1)^n times the result given by symmetric or commutative, where n is the number of interchanges of two arguments necessary to convert it to that form.

 -- Function: cabs (EXPR)
     Returns the complex absolute value (the complex modulus) of EXPR.

 -- Function: ceiling (X)

     When X is a real number, return the least integer that is greater than or equal to X.

     If X is a constant expression (10 * %pi, for example), ceiling evaluates X using big floating point numbers, and applies ceiling to the resulting big float. Because ceiling uses floating point evaluation, it's possible, although unlikely, that ceiling could return an erroneous value for constant inputs. To guard against errors, the floating point evaluation is done using three values for fpprec.

     For non-constant inputs, ceiling tries to return a simplified value.  Here are examples of the simplifications that ceiling knows about:

          (%i1) ceiling (ceiling (x));
          (%o1)                      ceiling(x)
          (%i2) ceiling (floor (x));
          (%o2)                       floor(x)
          (%i3) declare (n, integer)$
          (%i4) [ceiling (n), ceiling (abs (n)), ceiling (max (n, 6))];
          (%o4)                [n, abs(n), max(n, 6)]
          (%i5) assume (x > 0, x < 1)$
          (%i6) ceiling (x);
          (%o6)                           1
          (%i7) tex (ceiling (a));
          $$\left \lceil a \right \rceil$$
          (%o7)                         false

     The function ceiling does not automatically map over lists or matrices. Finally, for all inputs that are manifestly complex, ceiling returns a noun form.

     If the range of a function is a subset of the integers, it can be declared to be integervalued. Both the ceiling and floor functions can use this information; for example:

          (%i1) declare (f, integervalued)$
          (%i2) floor (f(x));
          (%o2)                         f(x)
          (%i3) ceiling (f(x) - 1);
          (%o3)                       f(x) - 1

 -- Function: charfun (P)

     Return 0 when the predicate P evaluates to false; return 1 when the predicate evaluates to true.  When the predicate evaluates to something other than true or false (unknown), return a noun form.

     Examples:

          (%i1) charfun (x < 1);
          (%o1)                    charfun(x < 1)
          (%i2) subst (x = -1, %);
          (%o2)                           1
          (%i3) e : charfun ('"and" (-1 < x, x < 1))$
          (%i4) [subst (x = -1, e), subst (x = 0, e), subst (x = 1, e)];
          (%o4)                       [0, 1, 0]

 -- Declaration: commutative
     If declare(h,commutative) is done, this tells the simplifier that h is a commutative function.  E.g. h(x,z,y) will simplify to h(x, y, z).  This is the same as symmetric.

 -- Function: compare (X, Y)

     Return a comparison operator OP (<, <=, >, >=, =, or #) such that is (X OP Y) evaluates to true; when either X or Y depends on %i and X # Y, return notcomparable; when there is no such operator or Maxima isn't able to determine the operator, return unknown.

     Examples:

          (%i1) compare (1, 2);
          (%o1)                           <
          (%i2) compare (1, x);
          (%o2)                        unknown
          (%i3) compare (%i, %i);
          (%o3)                           =
          (%i4) compare (%i, %i + 1);
          (%o4)                     notcomparable
          (%i5) compare (1/x, 0);
          (%o5)                           #
          (%i6) compare (x, abs(x));
          (%o6)                          <=

     The function compare doesn't try to determine whether the real domains of its arguments are nonempty; thus

          (%i1) compare (acos (x^2 + 1), acos (x^2 + 1) + 1);
          (%o1)                           <

     The real domain of acos (x^2 + 1) is empty.

 -- Function: entier (X)
     Returns the largest integer less than or equal to X where X is numeric.  fix (as in fixnum) is a synonym for this, so fix(X) is precisely the same.

 -- Function: equal (A, B)

     Represents equivalence, that is, equal value.

     By itself, equal does not evaluate or simplify. The function is attempts to evaluate equal to a Boolean value. is(equal(A, B)) returns true (or false) if and only if A and B are equal (or not equal) for all possible values of their variables, as determined by evaluating ratsimp(A - B); if ratsimp returns 0, the two expressions are considered equivalent. Two expressions may be equivalent even if they are not syntactically equal (i.e., identical).

     When is fails to reduce equal to true or false, the result is governed by the global flag prederror. When prederror is true, is complains with an error message. Otherwise, is returns unknown.

     In addition to is, some other operators evaluate equal and notequal to true or false, namely if, and, or, and not.

     The negation of equal is notequal.

     Examples:

     By itself, equal does not evaluate or simplify.

          (%i1) equal (x^2 - 1, (x + 1) * (x - 1));
                                  2
          (%o1)            equal(x  - 1, (x - 1) (x + 1))
          (%i2) equal (x, x + 1);
          (%o2)                    equal(x, x + 1)
          (%i3) equal (x, y);
          (%o3)                      equal(x, y)

     The function is attempts to evaluate equal to a Boolean value. is(equal(A, B)) returns true when ratsimp(A - B) returns 0. Two expressions may be equivalent even if they are not syntactically equal (i.e., identical).

          (%i1) ratsimp (x^2 - 1 - (x + 1) * (x - 1));
          (%o1)                           0
          (%i2) is (equal (x^2 - 1, (x + 1) * (x - 1)));
          (%o2)                         true
          (%i3) is (x^2 - 1 = (x + 1) * (x - 1));
          (%o3)                         false
          (%i4) ratsimp (x - (x + 1));
          (%o4)                          - 1
          (%i5) is (equal (x, x + 1));
          (%o5)                         false
          (%i6) is (x = x + 1);
          (%o6)                         false
          (%i7) ratsimp (x - y);
          (%o7)                         x - y
          (%i8) is (equal (x, y));
          (%o8)                        unknown
          (%i9) is (x = y);
          (%o9)                         false

     When is fails to reduce equal to true or false, the result is governed by the global flag prederror.

          (%i1) [aa : x^2 + 2*x + 1, bb : x^2 - 2*x - 1];
                              2             2
          (%o1)             [x  + 2 x + 1, x  - 2 x - 1]
          (%i2) ratsimp (aa - bb);
          (%o2)                        4 x + 2
          (%i3) prederror : true;
          (%o3)                         true
          (%i4) is (equal (aa, bb));
          Maxima was unable to evaluate the predicate:
                 2             2
          equal(x  + 2 x + 1, x  - 2 x - 1)
           -- an error.  Quitting.  To debug this try debugmode(true);
          (%i5) prederror : false;
          (%o5)                         false
          (%i6) is (equal (aa, bb));
          (%o6)                        unknown

     Some operators evaluate equal and notequal to true or false.

          (%i1) if equal (y, y - 1) then FOO else BAR;
          (%o1)                          BAR
          (%i2) eq_1 : equal (x, x + 1);
          (%o2)                    equal(x, x + 1)
          (%i3) eq_2 : equal (y^2 + 2*y + 1, (y + 1)^2);
                                   2                   2
          (%o3)             equal(y  + 2 y + 1, (y + 1) )
          (%i4) [eq_1 and eq_2, eq_1 or eq_2, not eq_1];
          (%o4)                  [false, true, true]

     Because not EXPR causes evaluation of EXPR, not equal(A, B) is equivalent to is(notequal(A, B)).

          (%i1) [notequal (2*z, 2*z - 1), not equal (2*z, 2*z - 1)];
          (%o1)            [notequal(2 z, 2 z - 1), true]
          (%i2) is (notequal (2*z, 2*z - 1));
          (%o2)                         true

 -- Function: floor (X)

     When X is a real number, return the largest integer that is less than or equal to X.

     If X is a constant expression (10 * %pi, for example), floor evaluates X using big floating point numbers, and applies floor to the resulting big float. Because floor uses floating point evaluation, it's possible, although unlikely, that floor could return  an erroneous value for constant inputs.  To guard against errors, the floating point evaluation is done using three values for fpprec.

     For non-constant inputs, floor tries to return a simplified value.  Here are examples of the simplifications that floor knows about:

          (%i1) floor (ceiling (x));
          (%o1)                      ceiling(x)
          (%i2) floor (floor (x));
          (%o2)                       floor(x)
          (%i3) declare (n, integer)$
          (%i4) [floor (n), floor (abs (n)), floor (min (n, 6))];
          (%o4)                [n, abs(n), min(n, 6)]
          (%i5) assume (x > 0, x < 1)$
          (%i6) floor (x);
          (%o6)                           0
          (%i7) tex (floor (a));
          $$\left \lfloor a \right \rfloor$$
          (%o7)                         false

     The function floor does not automatically map over lists or matrices. Finally, for all inputs that are manifestly complex, floor returns a noun form.

     If the range of a function is a subset of the integers, it can be declared to be integervalued. Both the ceiling and floor functions can use this information; for example:

          (%i1) declare (f, integervalued)$
          (%i2) floor (f(x));
          (%o2)                         f(x)
          (%i3) ceiling (f(x) - 1);
          (%o3)                       f(x) - 1

 -- Function: notequal (A, B)
     Represents the negation of equal(A, B).

     Examples:

          (%i1) equal (a, b);
          (%o1)                      equal(a, b)
          (%i2) maybe (equal (a, b));
          (%o2)                        unknown
          (%i3) notequal (a, b);
          (%o3)                    notequal(a, b)
          (%i4) not equal (a, b);
          (%o4)                    notequal(a, b)
          (%i5) maybe (notequal (a, b));
          (%o5)                        unknown
          (%i6) assume (a > b);
          (%o6)                        [a > b]
          (%i7) equal (a, b);
          (%o7)                      equal(a, b)
          (%i8) maybe (equal (a, b));
          (%o8)                         false
          (%i9) notequal (a, b);
          (%o9)                    notequal(a, b)
          (%i10) maybe (notequal (a, b));
          (%o10)                        true

 -- Operator: eval
     As an argument in a call to ev (EXPR), eval causes an extra evaluation of EXPR. See ev.

 -- Function: evenp (EXPR)
     Returns true if EXPR is an even integer. false is returned in all other cases.

 -- Function: fix (X)
     A synonym for entier (X).

 -- Function: fullmap (F, EXPR_1, ...)
     Similar to map, but fullmap keeps mapping down all subexpressions until the main operators are no longer the same.

     fullmap is used by the Maxima simplifier for certain matrix manipulations; thus, Maxima sometimes generates an error message concerning fullmap even though fullmap was not explicitly called by the user.

     Examples:

          (%i1) a + b * c;
          (%o1)                        b c + a
          (%i2) fullmap (g, %);
          (%o2)                   g(b) g(c) + g(a)
          (%i3) map (g, %th(2));
          (%o3)                     g(b c) + g(a)

 -- Function: fullmapl (F, LIST_1, ...)
     Similar to fullmap, but fullmapl only maps onto lists and matrices.

     Example:

          (%i1) fullmapl ("+", [3, [4, 5]], [[a, 1], [0, -1.5]]);
          (%o1)                [[a + 3, 4], [4, 3.5]]

 -- Function: is (EXPR)
     Attempts to determine whether the predicate EXPR is provable from the facts in the assume database.

     If the predicate is provably true or false, is returns true or false, respectively. Otherwise, the return value is governed by the global flag prederror. When prederror is true, is complains with an error message. Otherwise, is returns unknown.

     ev(EXPR, pred) (which can be written  EXPR, pred at the interactive prompt) is equivalent to is(EXPR).

     See also assume, facts, and maybe.

     Examples:

     is causes evaluation of predicates.

          (%i1) %pi > %e;
          (%o1)                       %pi > %e
          (%i2) is (%pi > %e);
          (%o2)                         true

     is attempts to derive predicates from the assume database.

          (%i1) assume (a > b);
          (%o1)                        [a > b]
          (%i2) assume (b > c);
          (%o2)                        [b > c]
          (%i3) is (a < b);
          (%o3)                         false
          (%i4) is (a > c);
          (%o4)                         true
          (%i5) is (equal (a, c));
          (%o5)                         false

     If is can neither prove nor disprove a predicate from the assume database, the global flag prederror governs the behavior of is.

          (%i1) assume (a > b);
          (%o1)                        [a > b]
          (%i2) prederror: true$
          (%i3) is (a > 0);
          Maxima was unable to evaluate the predicate:
          a > 0
           -- an error.  Quitting.  To debug this try debugmode(true);
          (%i4) prederror: false$
          (%i5) is (a > 0);
          (%o5)                        unknown

 -- Function: maybe (EXPR)
     Attempts to determine whether the predicate EXPR is provable from the facts in the assume database.

     If the predicate is provably true or false, maybe returns true or false, respectively. Otherwise, maybe returns unknown.

     maybe is functionally equivalent to is with prederror: false, but the result is computed without actually assigning a value to prederror.

     See also assume, facts, and is.

     Examples:

          (%i1) maybe (x > 0);
          (%o1)                        unknown
          (%i2) assume (x > 1);
          (%o2)                        [x > 1]
          (%i3) maybe (x > 0);
          (%o3)                         true

 -- Function: isqrt (X)
     Returns the "integer square root" of the absolute value of X, which is an integer.

 -- Function: lmax (L)

     When L is a list or a set, return apply ('max, args (L)).  When L isn't a list or a set, signal an error.

 -- Function: lmin (L)

     When L is a list or a set, return apply ('min, args (L)). When L isn't a list or a set, signal an error.

 -- Function: max (X_1, ..., X_N)

     Return a simplified value for the maximum of the expressions X_1 through X_N. When get (trylevel, maxmin), is 2 or greater, max uses the simplification max (e, -e) --> |e|.  When get (trylevel, maxmin) is 3 or greater, MAX tries to eliminate expressions that are between two other arguments; for example, max (x, 2*x, 3*x) --> max (x, 3*x). To set the value of trylevel to 2, use put (trylevel, 2, maxmin).

 -- Function: min (X_1, ..., X_N)

     Return a simplified value for the minimum of the expressions x_1 through x_n. When get (trylevel, maxmin), is 2 or greater, min uses the simplification min (e, -e) --> -|e|.  When get (trylevel, maxmin) is 3 or greater, min tries to eliminate expressions that are between two other arguments; for example, min (x, 2*x, 3*x) --> min (x, 3*x). To set the value of trylevel to 2, use put (trylevel, 2, maxmin).

 -- Function: polymod (P)
 -- Function: polymod (P, M)
     Converts the polynomial P to a modular representation with respect to the current modulus which is the value of the variable modulus.

     polymod (P, M) specifies a modulus M to be used instead of the current value of modulus.

     See modulus.

 -- Function: mod (X, Y)

     If X and Y are real numbers and Y is nonzero, return X - Y * floor(X / Y). Further for all real X, we have mod (X, 0) = X. For a discussion of the definition mod (X, 0) = X, see Section 3.4, of "Concrete Mathematics," by Graham, Knuth, and Patashnik. The function mod (X, 1) is a sawtooth function with period 1 with mod (1, 1) = 0 and mod (0, 1) = 0.

     To find the principal argument (a number in the interval (-%pi, %pi]) of a complex number, use the function X |-> %pi - mod (%pi - X, 2*%pi), where X is an argument.

     When X and Y are constant expressions (10 * %pi, for example), mod uses the same big float evaluation scheme that floor and ceiling uses. Again, it's possible, although unlikely, that mod could return an erroneous value in such cases.

     For nonnumerical arguments X or Y, mod knows several simplification rules:

          (%i1) mod (x, 0);
          (%o1)                           x
          (%i2) mod (a*x, a*y);
          (%o2)                      a mod(x, y)
          (%i3) mod (0, x);
          (%o3)                           0

 -- Function: oddp (EXPR)
     is true if EXPR is an odd integer. false is returned in all other cases.

 -- Operator: pred
     As an argument in a call to ev (EXPR), pred causes predicates (expressions which evaluate to true or false) to be evaluated. See ev.

 -- Function: make_random_state (N)
 -- Function: make_random_state (S)
 -- Function: make_random_state (true)
 -- Function: make_random_state (false)

     A random state object represents the state of the random number generator. The state comprises 627 32-bit words.

     make_random_state (N) returns a new random state object created from an integer seed value equal to N modulo 2^32. N may be negative.

     make_random_state (S) returns a copy of the random state S.

     make_random_state (true) returns a new random state object, using the current computer clock time as the seed.

     make_random_state (false) returns a copy of the current state of the random number generator.

 -- Function: set_random_state (S)
     Copies S to the random number generator state.

     set_random_state always returns done.

 -- Function: random (X)
     Returns a pseudorandom number. If X is an integer, random (X) returns an integer from 0 through X - 1 inclusive. If X is a floating point number, random (X) returns a nonnegative floating point number less than X. random complains with an error if X is neither an integer nor a float, or if X is not positive.

     The functions make_random_state and set_random_state maintain the state of the random number generator.

     The Maxima random number generator is an implementation of the Mersenne twister MT 19937.

     Examples:

          (%i1) s1: make_random_state (654321)$
          (%i2) set_random_state (s1);
          (%o2)                         done
          (%i3) random (1000);
          (%o3)                          768
          (%i4) random (9573684);
          (%o4)                        7657880
          (%i5) random (2^75);
          (%o5)                11804491615036831636390
          (%i6) s2: make_random_state (false)$
          (%i7) random (1.0);
          (%o7)                   .2310127244107132
          (%i8) random (10.0);
          (%o8)                   4.394553645870825
          (%i9) random (100.0);
          (%o9)                   32.28666704056853
          (%i10) set_random_state (s2);
          (%o10)                        done
          (%i11) random (1.0);
          (%o11)                  .2310127244107132
          (%i12) random (10.0);
          (%o12)                  4.394553645870825
          (%i13) random (100.0);
          (%o13)                  32.28666704056853

 -- Function: rationalize (EXPR)

     Convert all double floats and big floats in the Maxima expression EXPR to their exact rational equivalents. If you are not familiar with the binary representation of floating point numbers, you might be surprised that rationalize (0.1) does not equal 1/10.  This behavior isn't special to Maxima -- the number 1/10 has a repeating, not a terminating, binary representation.

          (%i1) rationalize (0.5);
                                          1
          (%o1)                           -
                                          2
          (%i2) rationalize (0.1);
                                         1
          (%o2)                          --
                                         10
          (%i3) fpprec : 5$
          (%i4) rationalize (0.1b0);
                                       209715
          (%o4)                        -------
                                       2097152
          (%i5) fpprec : 20$
          (%i6) rationalize (0.1b0);
                               236118324143482260685
          (%o6)                ----------------------
                               2361183241434822606848
          (%i7) rationalize (sin (0.1*x + 5.6));
                                        x    28
          (%o7)                     sin(-- + --)
                                        10   5

     Example use:

          (%i1) unitfrac(r) := block([uf : [], q],
              if not(ratnump(r)) then
                 error("The input to 'unitfrac' must be a rational number"),
              while r # 0 do (
                  uf : cons(q : 1/ceiling(1/r), uf),
                  r : r - q),
              reverse(uf));
          (%o1) unitfrac(r) := block([uf : [], q],
          if not ratnump(r) then
             error("The input to 'unitfrac' must be a rational number"),
                                            1
          while r # 0 do (uf : cons(q : ----------, uf), r : r - q),
                                                1
                                        ceiling(-)
                                                r
          reverse(uf))
          (%i2) unitfrac (9/10);
                                      1  1  1
          (%o2)                      [-, -, --]
                                      2  3  15
          (%i3) apply ("+", %);
                                         9
          (%o3)                          --
                                         10
          (%i4) unitfrac (-9/10);
                                            1
          (%o4)                       [- 1, --]
                                            10
          (%i5) apply ("+", %);
                                          9
          (%o5)                         - --
                                          10
          (%i6) unitfrac (36/37);
                                  1  1  1  1    1
          (%o6)                  [-, -, -, --, ----]
                                  2  3  8  69  6808
          (%i7) apply ("+", %);
                                         36
          (%o7)                          --
                                         37

 -- Function: sign (EXPR)
     Attempts to determine the sign of EXPR on the basis of the facts in the current data base.  It returns one of the following answers: pos (positive), neg (negative), zero, pz (positive or zero), nz (negative or zero), pn (positive or negative), or pnz (positive, negative, or zero, i.e. nothing known).

 -- Function: signum (X)
     For numeric X, returns 0 if X is 0, otherwise returns -1 or +1 as X is less than or greater than 0, respectively.

     If X is not numeric then a simplified but equivalent form is returned. For example, signum(-x) gives -signum(x).

 -- Function: sort (L, P)
 -- Function: sort (L)
     Sorts a list L according to a predicate P of two arguments, such that P (L[k], L[k + 1]) is true for any two successive elements. The predicate may be specified as the name of a function or binary infix operator, or as a lambda expression. If specified as the name of an operator, the name is enclosed in "double quotes".

     The sorted list is returned as a new object; the argument L is not modified. To construct the return value, sort makes a shallow copy of the elements of L.

     If the predicate P is not a total order on the elements of L, then sort might run to completion without error, but the result is undefined. sort complains if the predicate evaluates to something other than true or false.

     sort (L) is equivalent to sort (L, orderlessp). That is, the default sorting order is ascending, as determined by orderlessp. All Maxima atoms and expressions are comparable under orderlessp, although there are isolated examples of expressions for which orderlessp is not transitive; this is a bug.

     Examples:

          (%i1) sort ([11, -17, 29b0, 7.55, 3, -5/2, b + a, 9 * c,
                19 - 3 * x]);
                         5
          (%o1) [- 17, - -, 3, 7.55, 11, 2.9b1, b + a, 9 c, 19 - 3 x]
                         2
          (%i2) sort ([11, -17, 29b0, 7.55, 3, -5/2, b + a, 9*c, 19 - 3*x],
                ordergreatp);
                                                             5
          (%o2) [19 - 3 x, 9 c, b + a, 2.9b1, 11, 7.55, 3, - -, - 17]
                                                             2
          (%i3) sort ([%pi, 3, 4, %e, %gamma]);
          (%o3)                [3, 4, %e, %gamma, %pi]
          (%i4) sort ([%pi, 3, 4, %e, %gamma], "<");
          (%o4)                [%gamma, %e, 3, %pi, 4]
          (%i5) my_list: [[aa,hh,uu], [ee,cc], [zz,xx,mm,cc], [%pi,%e]];
          (%o5) [[aa, hh, uu], [ee, cc], [zz, xx, mm, cc], [%pi, %e]]
          (%i6) sort (my_list);
          (%o6) [[%pi, %e], [aa, hh, uu], [ee, cc], [zz, xx, mm, cc]]
          (%i7) sort (my_list, lambda ([a, b], orderlessp (reverse (a),
                reverse (b))));
          (%o7) [[%pi, %e], [ee, cc], [zz, xx, mm, cc], [aa, hh, uu]]

 -- Function: sqrt (X)
     The square root of X. It is represented internally by X^(1/2).  See also rootscontract.

     radexpand if true will cause nth roots of factors of a product which are powers of n to be pulled outside of the radical, e.g. sqrt(16*x^2) will become 4*x only if radexpand is true.

 -- Option variable: sqrtdispflag
     Default value: true

     When sqrtdispflag is false, causes sqrt to display with exponent 1/2.

 -- Function: sublis (LIST, EXPR)
     Makes multiple parallel substitutions into an expression.

     The variable sublis_apply_lambda controls simplification after sublis.

     Example:

          (%i1) sublis ([a=b, b=a], sin(a) + cos(b));
          (%o1)                    sin(b) + cos(a)

 -- Function: sublist (LIST, P)
     Returns the list of elements of LIST for which the predicate p returns true.

     Example:

          (%i1) L: [1, 2, 3, 4, 5, 6];
          (%o1)                  [1, 2, 3, 4, 5, 6]
          (%i2) sublist (L, evenp);
          (%o2)                       [2, 4, 6]

 -- Option variable: sublis_apply_lambda
     Default value: true - controls whether lambda's substituted are applied in simplification after sublis is used or whether you have to do an ev to get things to apply. true means do the application.

 -- Function: subst (A, B, C)
     Substitutes A for B in C.  B must be an atom or a complete subexpression of C.  For example, x+y+z is a complete subexpression of 2*(x+y+z)/w while x+y is not. When B does not have these characteristics, one may sometimes use substpart or ratsubst (see below).  Alternatively, if B is of the form e/f then one could use subst (a*f, e, c) while if B is of the form e^(1/f) then one could use subst (a^f, e, c).  The subst command also discerns the x^y in x^-y so that subst (a, sqrt(x), 1/sqrt(x)) yields 1/a.  A and B may also be operators of an expression enclosed in double-quotes " or they may be function names.  If one wishes to substitute for the independent variable in derivative forms then the at function (see below) should be used.

     subst is an alias for substitute.

     subst (EQ_1, EXPR) or subst ([EQ_1, ..., EQ_K], EXPR) are other permissible forms.  The EQ_I are equations indicating substitutions to be made. For each equation, the right side will be substituted for the left in the expression EXPR.

     exptsubst if true permits substitutions like y for %e^x in %e^(a*x) to take place.

     When opsubst is false, subst will not attempt to substitute into the operator of an expression. E.g. (opsubst: false, subst (x^2, r, r+r[0])) will work.

     Examples:

          (%i1) subst (a, x+y, x + (x+y)^2 + y);
                                              2
          (%o1)                      y + x + a
          (%i2) subst (-%i, %i, a + b*%i);
          (%o2)                       a - %i b

     For further examples, do example (subst).

 -- Function: substinpart (X, EXPR, N_1, ..., N_K)
     Similar to substpart, but substinpart works on the internal representation of EXPR.

     Examples:

          (%i1) x . 'diff (f(x), x, 2);
                                        2
                                       d
          (%o1)                   x . (--- (f(x)))
                                         2
                                       dx
          (%i2) substinpart (d^2, %, 2);
                                            2
          (%o2)                        x . d
          (%i3) substinpart (f1, f[1](x + 1), 0);
          (%o3)                       f1(x + 1)

     If the last argument to a part function is a list of indices then several subexpressions are picked out, each one corresponding to an index of the list.  Thus

          (%i1) part (x + y + z, [1, 3]);
          (%o1)                         z + x

     piece holds the value of the last expression selected when using the part functions.  It is set during the execution of the function and thus may be referred to in the function itself as shown below. If partswitch is set to true then end is returned when a selected part of an expression doesn't exist, otherwise an error message is given.

          (%i1) expr: 27*y^3 + 54*x*y^2 + 36*x^2*y + y + 8*x^3 + x + 1;
                        3         2       2            3
          (%o1)     27 y  + 54 x y  + 36 x  y + y + 8 x  + x + 1
          (%i2) part (expr, 2, [1, 3]);
                                            2
          (%o2)                         54 y
          (%i3) sqrt (piece/54);
          (%o3)                        abs(y)
          (%i4) substpart (factor (piece), expr, [1, 2, 3, 5]);
                                         3
          (%o4)               (3 y + 2 x)  + y + x + 1
          (%i5) expr: 1/x + y/x - 1/z;
                                       1   y   1
          (%o5)                      - - + - + -
                                       z   x   x
          (%i6) substpart (xthru (piece), expr, [2, 3]);
                                      y + 1   1
          (%o6)                       ----- - -
                                        x     z

     Also, setting the option inflag to true and calling part or substpart is the same as calling inpart or substinpart.

 -- Function: substpart (X, EXPR, N_1, ..., N_K)
     Substitutes X for the subexpression picked out by the rest of the arguments as in part.  It returns the new value of EXPR.  X may be some operator to be substituted for an operator of EXPR.  In some cases X needs to be enclosed in double-quotes " (e.g.  substpart ("+", a*b, 0) yields b + a).

          (%i1) 1/(x^2 + 2);
                                         1
          (%o1)                        ------
                                        2
                                       x  + 2
          (%i2) substpart (3/2, %, 2, 1, 2);
                                         1
          (%o2)                       --------
                                       3/2
                                      x    + 2
          (%i3) a*x + f(b, y);
          (%o3)                     a x + f(b, y)
          (%i4) substpart ("+", %, 1, 0);
          (%o4)                    x + f(b, y) + a

     Also, setting the option inflag to true and calling part or substpart is the same as calling inpart or substinpart.

 -- Function: subvarp (EXPR)
     Returns true if EXPR is a subscripted variable, for example a[i].

 -- Function: symbolp (EXPR)
     Returns true if EXPR is a symbol, else false. In effect, symbolp(x) is equivalent to the predicate atom(x) and not numberp(x).

     See also Identifiers.

 -- Function: unorder ()
     Disables the aliasing created by the last use of the ordering commands ordergreat and orderless. ordergreat and orderless may not be used more than one time each without calling unorder. See also ordergreat and orderless.

     Examples:

          (%i1) unorder();
          (%o1)                          []
          (%i2) b*x + a^2;
                                             2
          (%o2)                       b x + a
          (%i3) ordergreat (a);
          (%o3)                         done
          (%i4) b*x + a^2;
           %th(1) - %th(3);
                                       2
          (%o4)                       a  + b x
          (%i5) unorder();
                                        2    2
          (%o5)                        a  - a

 -- Function: vectorpotential (GIVENCURL)
     Returns the vector potential of a given curl vector, in the current coordinate system. potentialzeroloc has a similar role as for potential, but the order of the left-hand sides of the equations must be a cyclic permutation of the coordinate variables.

 -- Function: xthru (EXPR)
     Combines all terms of EXPR (which should be a sum) over a common denominator without expanding products and exponentiated sums as ratsimp does.  xthru cancels common factors in the numerator and denominator of rational expressions but only if the factors are explicit.

     Sometimes it is better to use xthru before ratsimping an expression in order to cause explicit factors of the gcd of the numerator and denominator to be canceled thus simplifying the expression to be ratsimped.

          (%i1) ((x+2)^20 - 2*y)/(x+y)^20 + (x+y)^(-19) - x/(x+y)^20;
                                          20
                           1       (x + 2)   - 2 y       x
          (%o1)        --------- + --------------- - ---------
                              19             20             20
                       (y + x)        (y + x)        (y + x)
          (%i2) xthru (%);
                                           20
                                    (x + 2)   - y
          (%o2)                     -------------
                                             20
                                      (y + x)

 -- Function: zeroequiv (EXPR, V)
     Tests whether the expression EXPR in the variable V is equivalent to zero, returning true, false, or dontknow.

     zeroequiv has these restrictions:

      1. Do not use functions that Maxima does not know how to differentiate and evaluate.

      2. If the expression has poles on the real line, there may be errors in the result (but this is unlikely to occur).

      3. If the expression contains functions which are not solutions to first order differential equations (e.g.  Bessel functions) there may be incorrect results.

      4. The algorithm uses evaluation at randomly chosen points for carefully selected subexpressions.  This is always a somewhat hazardous business, although the algorithm tries to minimize the potential for error.

     For example zeroequiv (sin(2*x) - 2*sin(x)*cos(x), x) returns true and zeroequiv (%e^x + x, x) returns false. On the other hand zeroequiv (log(a*b) - log(a) - log(b), a) returns dontknow because of the presence of an extra parameter b.