Function Repository Resource:

# MonotonicFunctionQ

Check if a function is monotonic

Contributed by: Wolfram|Alpha Math Team
 ResourceFunction["MonotonicFunctionQ"][f,x] gives True if f is monotonic with respect to x. ResourceFunction["MonotonicFunctionQ"][f,x,dir] restricts the test to the direction dir.

## Details and Options

The direction dir can be any of Automatic, "Increasing" or "Decreasing" and defaults to Automatic. When dir is Automatic, ResourceFunction["MonotonicFunctionQ"] returns True if f is increasing or decreasing.
ResourceFunction["MonotonicFunctionQ"] expects f to be a univariate expression in terms of x, similar to what might be used in Plot.
ResourceFunction["MonotonicFunctionQ"] returns True based on the definition of f being monotonic; that is, f is increasing on an interval A if for all {x,y}A such that x<y, it is the case that f[x]f[y].

## Examples

### Basic Examples (2)

Compute whether an expression is monotonic:

 In[1]:=
 Out[1]=

Determine if an expression is increasing:

 In[2]:=
 Out[2]=

### Properties and Relations (3)

Note that a function with regions where it is constant may still be considered increasing:

 In[3]:=
 In[4]:=
 Out[4]=

For more information on the monotonicity of the input expression, use the resource function FunctionMonotonicity:

 In[5]:=
 Out[5]=

Such a curve is not strictly monotonic though:

 In[6]:=
 Out[7]=

## Publisher

Wolfram|Alpha Math Team

## Version History

• 2.0.0 – 23 March 2023
• 1.0.0 – 29 September 2020

## Author Notes

To view the full source code for MonotonicFunctionQ, run the following code:

 In[1]:=