alias - Maple Help

alias

define an abbreviation or denotation

 Calling Sequence alias(e1, e2, ..., eN)

Parameters

 e1, e2, ..., eN - zero or more equations

Description

 • Mathematics has many special notations and abbreviations. Typically, these notations are found in written statements such as Let J denote the Bessel function of the first kind'' or Let alpha denote a root of the polynomial x^3-2''. The alias facility allows you to state abbreviations for the longer unique names that Maple uses and, more generally, to give names to arbitrary expressions.
 • To define F as an alias for fibonacci, use alias(F=fibonacci). To redefine F as an alias for hypergeom,  use alias(F=hypergeom). To remove this alias for F, use alias(F=F).
 • Aliases work as follows. Consider defining alias(J=BesselJ), and then entering J(0, -x). On input the expression J(0, -x) is transformed to BesselJ(0, -x). Maple then evaluates and simplifies this expression as usual. In this example, Maple returns BesselJ(0, x). Finally, on output, BesselJ(0, x) is replaced by J(0, x).
 • Because aliases are resolved at the time of parsing the original input, they substitute literally, without regard to values of variables and expressions.  For example, alias(a[1]=exp(1)) followed by evalf(a[1]) will replace a[1] with exp(1) to give the result 2.718281828, but evalf(a[i]) will not substitute a[i] for its alias even when i=1.  This is because a[i] does not literally match a[1].
 • Aliases defined inside a procedure or other compound statement are not effective for resolving input matches in the body of that statement.  This is the case because the current statement is parsed in its entirety before the alias command is evaluated.
 • The arguments to alias are equations. When alias is called, the equations are evaluated from left to right, but are not subject to existing aliases. Therefore, you cannot define one alias in terms of another. Next, the aliases are defined. Finally, a sequence of all existing aliases is returned as the function value.
 • An alias may be defined for any Maple object except a string or numerical constant. You may assign to a variable by assigning to its alias. Parameters and local variables are not affected by aliases.

 • The alias command is thread-safe as of Maple 15.

Examples

Define an alias for the binomial function.

 > $\mathrm{alias}\left(C=\mathrm{binomial}\right)$
 ${C}$ (1)
 > $C\left(4,2\right)$
 ${6}$ (2)
 > $C\left(n,m\right)$
 ${C}{}\left({n}{,}{m}\right)$ (3)

Redefine C as an alias for cat.

 > $\mathrm{alias}\left(C=\mathrm{cat}\right)$
 ${C}$ (4)
 > $C\left("C","is no longer an alias for the binomial function."\right)$
 ${"C is no longer an alias for the binomial function."}$ (5)

Remove the alias for C.

 > $\mathrm{alias}\left(C=C\right)$
 > $C\left(4,2\right)$
 ${C}{}\left({4}{,}{2}\right)$ (6)

You can define more than one alias in one line.

 > $\mathrm{alias}\left(F=F\left(x\right),\mathrm{Fx}=\mathrm{diff}\left(F\left(x\right),x\right)\right)$
 ${F}{,}{\mathrm{Fx}}$ (7)
 > $\mathrm{diff}\left(F,x\right)$
 ${\mathrm{Fx}}$ (8)
 > $\mathrm{diff}\left(\mathrm{Fx},x\right)$
 $\frac{{{\partial }}^{{2}}}{{\partial }{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{F}$ (9)
 > $\mathrm{has}\left(\mathrm{Fx},x\right)$
 ${\mathrm{true}}$ (10)

You cannot define one alias in terms of another.

 > $\mathrm{alias}\left(\mathrm{Fxx}=\mathrm{diff}\left(\mathrm{Fx},x\right)\right)$
 > $\mathrm{alias}\left(\mathrm{\alpha }=\mathrm{RootOf}\left({x}^{2}-2\right)\right)$
 ${F}{,}{\mathrm{Fx}}{,}{\mathrm{\alpha }}$ (11)
 > $\mathrm{factor}\left({x}^{4}-4,\mathrm{\alpha }\right)$
 ${-}\left({{x}}^{{2}}{+}{2}\right){}\left({-}{x}{+}{\mathrm{\alpha }}\right){}\left({x}{+}{\mathrm{\alpha }}\right)$ (12)
 > $\mathrm{alias}\left(f=g\right)$
 ${F}{,}{\mathrm{Fx}}{,}{\mathrm{\alpha }}{,}{f}$ (13)
 > $f≔\mathrm{sin}$
 ${f}{≔}{\mathrm{sin}}$ (14)
 > $g\left(\mathrm{\pi }\right)$
 ${0}$ (15)