Function Repository Resource:

FractionalD

Source Notebook

Calculate a fractional derivative

Contributed by: Sami Yrjänheikki

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

gives the fractional derivative .

Details and Options

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

Examples

Basic Examples (2) 

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 (5) 

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 (1) 

Method (1) 

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 (1) 

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 (1) 

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]=

Publisher

Sami Yrjänheikki

Version History

  • 1.0.0 – 15 April 2020

License Information