sign - Maple Help

sign

sign of a number or a polynomial

 Calling Sequence sign(expr, [x1, x2, ...], 'y')

Parameters

 expr - multivariate polynomial [x1, ...] - (optional) list of indeterminates y - (optional) unevaluated name

Description

 • The sign function computes the sign of the leading coefficient of expr. The sign function works for polynomials with coefficients of type numeric. It does not take assumptions into account.
 • The leading coefficient of expr is determined with respect to the indeterminates given.  If none are given, the leading coefficient is taken with respect to all its indeterminates.  Note therefore that the leading coefficient is dependent on the order of the indeterminates which may vary from one Maple session to another, but not within a session.
 • The unevaluated name specified as the optional third argument is assigned the leading term.

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

Examples

 > $\mathrm{sign}\left(0\right)$
 ${1}$ (1)
 > $\mathrm{sign}\left(-\frac{2}{3}\right)$
 ${-1}$ (2)
 > $\mathrm{expr}≔3{x}^{2}{y}^{4}-2x{y}^{5}+x$
 ${\mathrm{expr}}{≔}{3}{}{{x}}^{{2}}{}{{y}}^{{4}}{-}{2}{}{x}{}{{y}}^{{5}}{+}{x}$ (3)
 > $\mathrm{indets}\left(\mathrm{expr}\right)$
 $\left\{{x}{,}{y}\right\}$ (4)
 > $\mathrm{sign}\left(\mathrm{expr}\right)$
 ${1}$ (5)
 > $\mathrm{sign}\left(\mathrm{expr},\left[x,y\right]\right)$
 ${1}$ (6)
 > $\mathrm{sign}\left(\mathrm{expr},\left[y,x\right]\right)$
 ${-1}$ (7)
 > $\mathrm{sign}\left(\mathrm{expr},\left[y,x\right],'a'\right)$
 ${-1}$ (8)
 > $a$
 ${x}{}{{y}}^{{5}}$ (9)

You can also plot the sign function. A first attempt:

 > $\mathrm{plot}\left(\mathrm{sign}\left(x\right),x=-1..1\right)$

Notice that the plot results in the line $y=1$.  This occurs because it computes the constant sign(x)=1 and plots that. To get the expected plot, enclose sign(x) in right-single quotes. Since the function has a discontinuity, include the option discont to get a better plot.

 > $\mathrm{plot}\left('\mathrm{sign}\left(x\right)',x=-1..1,\mathrm{discont}=\mathrm{true}\right)$