Skip to content

FunctionSign ​

1 if f is nonnegative over its whole domain, -1 if nonpositive, Indeterminate otherwise.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageFunctionSign!
FunctionSign(f, x)the sign of f in the real variable x, when it is constant over the whole real line.
Typed signatures
TypePackageApplies
(expression, symbol) -> expressionanalyticalways

Domain: Elementary functions

Details
  • Matches Wolfram's convention that this needs domain R\mathbb R to answer definitively -- FunctionSign(Sqrt(x), x) is Indeterminate even though x≥0\sqrt x\ge0 wherever it's defined, because x\sqrt x isn't defined for every real x (confirmed against wolframscript).
  • A polynomial's sign comes from its closed-form shape (see FunctionMonotonicity's classifier); a rational function's sign is the product of its numerator's and denominator's, when both are individually determinate; Exp is always 1.

Examples

Basic #

A perfect square is never negative

live ↗
InFunctionSign(x2,x)\mathrm{FunctionSign}(x^2, x)Out11

Known value · Wolfram 15.0.0, hand cross-checked

1/(x^2+1) is defined and positive for every real x

live ↗
InFunctionSign(1x2+1,x)\mathrm{FunctionSign}(\frac{1}{x^2+1}, x)Out11

Known value · Wolfram 15.0.0, hand cross-checked

Exp is always positive

live ↗
InFunctionSign(ex,x)\mathrm{FunctionSign}(e^{x}, x)Out11
Scope #

Squares are never negative, so the sign is 1 on a list

live ↗
InMap(_1⁡↦FunctionSign(_1⁡,x),[x2,x2+1])\mathrm{Map}(\operatorname{\_1}↦\mathrm{FunctionSign}(\operatorname{\_1}, x), \bigl\lbrack x^2, x^2+1\bigr\rbrack)Out[1,1]\bigl\lbrack1, 1\bigr\rbrack
Properties #

A cubic is negative for x<0 and positive for x>0

live ↗
InFunctionSign(x3,x)\mathrm{FunctionSign}(x^3, x)OutFunctionSign(x3,x)\mathrm{FunctionSign}(x^3, x)

Known value · Wolfram 15.0.0, hand cross-checked

About
Examples5
Checked againstWolfram Language 4 agree1 differ
CrosswalkWolfram Language