Wolfram Research

Function Repository Resource:

FractionalD

Source Notebook

Calculate a fractional derivative

Contributed by: Sami Yrjänheikki

ResourceFunction["FractionalD"][f,{x,α}]

gives the fractional derivative αf/xα.

Details and Options

If α is an integer, ResourceFunction["FractionalD"][f,{x, α}] is equivalent to [f,{x,α}].
The Cauchy method uses the formula .
The Caputo method uses the formula .

Examples

Basic Examples

Half-derivative of x2:

In[1]:=
ResourceFunction["FractionalD"][x^2, {x, 1/2}]
Out[1]=

Taking the half-derivative twice yields the usual first derivative:

In[2]:=
ResourceFunction["FractionalD"][
 ResourceFunction["FractionalD"][x^2, {x, 1/2}], {x, 1/2}]
Out[2]=

Scope

If α is an integer, the result is the normal derivative:

In[3]:=
ResourceFunction["FractionalD"][Sin[x], {x, 3}] == D[Sin[x], {x, 3}]
Out[3]=

Half-derivative of elementary functions:

In[4]:=
ResourceFunction["FractionalD"][x^a, {x, 1/2}]
Out[4]=
In[5]:=
ResourceFunction["FractionalD"][Exp[x], {x, 1/2}]
Out[5]=
In[6]:=
ResourceFunction["FractionalD"][Log[x], {x, 1/2}]
Out[6]=

Half-derivative of trig functions:

In[7]:=
ResourceFunction["FractionalD"][Sin[x], {x, 1/2}]
Out[7]=
In[8]:=
ResourceFunction["FractionalD"][Cos[x], {x, 1/2}]
Out[8]=

Half-derivative of inverse trig functions:

In[9]:=
ResourceFunction["FractionalD"][ArcSin[x], {x, 1/2}]
Out[9]=
In[10]:=
ResourceFunction["FractionalD"][ArcCos[x], {x, 1/2}]
Out[10]=

A more exotic fractional derivative:

In[11]:=
ResourceFunction["FractionalD"][FresnelC[x], {x, 2/3}] // FullSimplify
Out[11]=

Options

Method

Choosing between Cauchy and Caputo may result in performance differences:

In[12]:=
ResourceFunction["FractionalD"][Sin[x], {x, 1/2}, Method -> "Cauchy"] // Timing
Out[12]=
In[13]:=
ResourceFunction["FractionalD"][Sin[x], {x, 1/2}, Method -> "Caputo"] // Timing
Out[13]=

Possible Issues

FractionalD uses integration under the hood. Sometimes the integral cannot be computed:

In[14]:=
ResourceFunction["FractionalD"][Tan[x], {x, 1/2}]
Out[14]=

Neat Examples

The fractional derivative smoothly interpolates between the function and its derivative:

In[15]:=
Manipulate[
 Plot[{x^2, 2 x, Evaluate@ResourceFunction["FractionalD"][x^2, {x, m}]}, {x, 0, 1}], {m, 0.001, 0.999}]
Out[15]=

Resource History

License Information