Function Repository Resource:

FunctionDifferentiability

Source Notebook

Find the conditions for which a single-variable, real-valued function is differentiable

Contributed by: Wolfram|Alpha Math Team

ResourceFunction["FunctionDifferentiability"][f,x]

returns the conditions for which f is differentiable with respect to x.

ResourceFunction["FunctionDifferentiability"][f,{x,n}]

returns the conditions for which f is n-times differentiable with respect to x.

ResourceFunction["FunctionDifferentiability"][{f,cons},x]

returns the conditions for which f constrained to cons is differentiable with respect to x.

ResourceFunction["FunctionDifferentiability"][{f,cons},{x,n}]

returns the conditions for which f constrained to cons is n-times differentiable with respect to x.

ResourceFunction["FunctionDifferentiability"][{{f1,f2,}},x]

returns the conditions for which the functions {f1,f2,} are all differentiable with respect to x.

Details

ResourceFunction["FunctionDifferentiability"] has the attribute HoldFirst.
ResourceFunction["FunctionDifferentiability"] takes only real-valued functions.
The constraint cons can be any logical combination of equations or inequalities:
lhs==rhsequations
lhs>rhs,lhsrhs,lhs<rhs,lhsrhsinequalities (LessEqual,)

Examples

Basic Examples (3) 

Compute the conditions for which a given function is differentiable:

In[1]:=
ResourceFunction["FunctionDifferentiability"][(x + 3)/(x^2 - 4), x]
Out[1]=

Compute the conditions for differentiability of a function subject to a constraint:

In[2]:=
ResourceFunction[
 "FunctionDifferentiability"][{(x + 3)/(x^2 - 4), x > 0}, x]
Out[2]=

A function that is differentiable for all real numbers returns True:

In[3]:=
ResourceFunction["FunctionDifferentiability"][x^2, x]
Out[3]=

The following function is once-differentiable everywhere but not twice-differentiable at x=0:

In[4]:=
fnc[x_] := Piecewise[{{-x^2/2, x <= 0}, {x^2/2, x > 0}}];
In[5]:=
ResourceFunction["FunctionDifferentiability"][fnc[x], {x, 1}]
Out[5]=
In[6]:=
ResourceFunction["FunctionDifferentiability"][fnc[x], {x, 2}]
Out[6]=

Properties and Relations (2) 

FunctionDifferentiability has the attribute HoldFirst, enabling calculations such as the following:

In[7]:=
ResourceFunction["FunctionDifferentiability"][x/x, x]
Out[7]=

For a list of functions, FunctionDifferentiability returns the conditions for which all elements are differentiable:

In[8]:=
ResourceFunction["FunctionDifferentiability"][{{Sin[x], 1/(x - 2)}},
  x]
Out[8]=

Possible Issues (1) 

Since FunctionDifferentiability takes only real-valued functions, it will treat Abs as RealAbs:

In[9]:=
ResourceFunction["FunctionDifferentiability"][Abs[x], x]
Out[9]=

Publisher

Wolfram|Alpha Math Team

Version History

  • 2.0.0 – 23 March 2023
  • 1.0.1 – 28 March 2022
  • 1.0.0 – 27 July 2021

Related Resources

Author Notes

To view the full source code for FunctionDifferentiability, evaluate the following:

In[1]:=
SystemOpen[
 FileNameJoin[{DirectoryName[FindFile["ResourceFunctionHelpers`"]], "FunctionDifferentiability.wl"}]]

License Information