Function Repository Resource:

# FunctionConcavity (1.0.0)current version: 2.0.0 »

Compute the regions on which an expression is concave up or down

Contributed by: Wolfram|Alpha Math Team
 ResourceFunction["FunctionConcavity"][f,x] returns an association of information about whether f is concave up or concave down with respect to x. ResourceFunction["FunctionConcavity"][f,x,property] returns a specific property related to whether f is concave up or concave down with respect to x.

## Details and Options

ResourceFunction["FunctionConcavity"] expects f to be a univariate expression in terms of x, similar to what might be entered into Plot.
ResourceFunction["FunctionConcavity"] returns regions on which the second derivative of expr with respect to x is greater than 0 (concave up) or less than 0 (concave down).
The input property can be any of All, "ConcaveUp", "ConcaveDown", "Regions", "Plot" or "NumberLine", and defaults to "Regions".

## Examples

### Basic Examples (2)

Compute the regions on which a curve is concave up or down:

 In[1]:=
 Out[1]=

Return plots as well as the regions:

 In[2]:=
 Out[2]=

### Scope (4)

Use the "NumberLine" property to visualize the regions directly:

 In[3]:=
 Out[3]=

Use the "Plot" property to visualize the regions on the plot of the curve:

 In[4]:=
 Out[4]=

Note that at stationary points of the expression, the curve is neither concave up nor concave down. In this case, 0 is a member of neither of the regions:

 In[5]:=
 Out[5]=

To test that 0 is the only point where the second derivative is 0, use Resolve:

 In[6]:=
 Out[6]=

FunctionConcavity returns strict regions of the second derivative being non-zero as can be seen in this Piecewise expression:

 In[7]:=
 In[8]:=
 Out[8]=
 In[9]:=
 Out[9]=

### Possible Issues (3)

Working with the absolute value function Abs may return unexpected results:

 In[10]:=
 Out[10]=

This is due to the assumption of Complex inputs to Abs in comparison to RealAbs:

 In[11]:=
 Out[11]=

Using RealAbs returns the expected results:

 In[12]:=
 Out[12]=

### Neat Examples (1)

Compute the concavity of a periodic function and visualize it:

 In[13]:=
 Out[13]=

## Publisher

Wolfram|Alpha Math Team

## Version History

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

## Author Notes

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