Skip to content

FunctionMonotonicity ​

1 if f is increasing over its whole domain, -1 if decreasing, 0 if constant, Indeterminate otherwise.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageFunctionMonotonicity!
FunctionMonotonicity(f, x)whether f is monotonic in the real variable x over the whole real line.
Typed signatures
TypePackageApplies
(expression, symbol) -> expressionanalyticalways

Domain: Elementary functions

Details
  • Matches Wolfram's own convention, confirmed against wolframscript, that a proper (non-Reals) domain already answers Indeterminate -- FunctionMonotonicity(Sqrt(x), x) and FunctionMonotonicity(Log(x), x) are Indeterminate, not declined, because their domain isn't all of R\mathbb R, not because this file can't analyze them.
  • For a polynomial with domain R\mathbb R, the sign of its derivative is read off in closed form -- constant sign (possibly touching zero at one point) gives 1 or -1, a proven sign change gives Indeterminate. Exp of an affine argument is always 1 or -1, by the sign of the argument's slope.
  • Declines only when the classifier itself declines (see FunctionDomain) or when a polynomial's derivative is a genuine multi-term polynomial of degree > 2 (its sign isn't determined here).

Examples

Basic #

A cubic is increasing everywhere -- its derivative 3x23x^2 never goes negative

live ↗
InFunctionMonotonicity(x3,x)\mathrm{FunctionMonotonicity}(x^3, x)Out11

Known value · Wolfram 15.0.0, hand cross-checked

A parabola turns around at its vertex

live ↗
InFunctionMonotonicity(x2,x)\mathrm{FunctionMonotonicity}(x^2, x)OutFunctionMonotonicity(x2,x)\mathrm{FunctionMonotonicity}(x^2, x)

Known value · Wolfram 15.0.0, hand cross-checked

Exp of an affine argument is always monotonic

live ↗
InFunctionMonotonicity(ex,x)\mathrm{FunctionMonotonicity}(e^{x}, x)Out11

Known value · Wolfram 15.0.0, hand cross-checked

Scope #
live ↗
InMap(()↦FunctionMonotonicity(_1⁡,x),[Ramp(x)+1,x+Ramp(x)])\mathrm{Map}(()↦\mathrm{FunctionMonotonicity}(\operatorname{\_1}, x), \bigl\lbrack\mathrm{Ramp}(x)+1, x+\mathrm{Ramp}(x)\bigr\rbrack)Out[FunctionMonotonicity(Ramp(x)+1,x),FunctionMonotonicity(x+Ramp(x),x)]\bigl\lbrack\mathrm{FunctionMonotonicity}(\mathrm{Ramp}(x)+1, x), \mathrm{FunctionMonotonicity}(x+\mathrm{Ramp}(x), x)\bigr\rbrack
Properties #

Sqrt's domain isn't all of R, so Wolfram's own convention is Indeterminate here -- confirmed against wolframscript

live ↗
InFunctionMonotonicity(x,x)\mathrm{FunctionMonotonicity}(\sqrt{x}, x)OutFunctionMonotonicity(x,x)\mathrm{FunctionMonotonicity}(\sqrt{x}, x)

Known value · Wolfram 15.0.0, hand cross-checked

About
Examples5
Checked againstWolfram Language 2 agree3 differ
CrosswalkWolfram Language