sign - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim

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.

Thread Safety

 • The sign command is thread-safe as of Maple 15 .
 • For more information on thread safety, see index/threadsafe.

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.

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

 See Also