Fractional Calculus

Visualizing Fractional Derivatives and Integrals

Ernest Lee

Torrey Pines High School

Introduction

Fractional calculus is a branch of mathematics that involves differentiation and integration of functions to an arbitrary order, including non-integer values.

The Gamma Function

Γ(z) = (∫_0^∞)(t^(z-1))(e^(-t))dt

The Gamma Function takes factorials of non-integer values.  This is utilized in taking fractional derivatives and integrals.
The built-in mathematica function is denoted by Gamma[]

Example

Gamma[3.14]

Fractional Derivative Definition for a Monomial

((d^α)/(d(t^α)))(t^k)=((Γ(k+1))/(Γ(k-α+1)))(t^(k-α))

This formula allows for differentiation to order α of a monomial with exponent k.

Introduction (con't)

The Riemann-Liouville Fractional Integral

(Subscript[D, t]^(-q))f(t)=(1/(Γ(q))) (∫_0^t)(((t-τ))^(q-1))f(τ)dτ

This formula allows for integration to order q, or equivalently, differentiation to order -q, where q is a real number.

The Riemann-Liouville Differintegral

In order to derive a general formula for fractional differentiation to order q, we simply take the Riemann-Liouville Fractional Integral at order n - q and differentiate it at order n where n is the integer ceiling of q.

(Subscript[D, t]^q)f(t)=(1/(Γ(n-q)))((d^n)/(d(t^n))) (∫_0^t)(((t-τ))^(n-q-1))f(τ)dτ

This formula allows for differentiation to order q.

Visualizing Simple Fractional Derivatives

Manipulate

I first implemented a specialized fractional derivative formula for monomials only.  This is useful in illustrating the nature of fractional derivatives on a few simple functions.

FractionalDExp[lambda_,mu_] := Gamma[lambda+1]/ Gamma[lambda - mu +1] * t ^(lambda - mu);

Manipulate[
Column[{
Show[
If[MemberQ[n,0],Plot[Tooltip[N[FractionalDExp[degree,0]], N[FractionalDExp[degree,0]]],{t,-5,5},PlotRange->{{-5,5},{-5^degree,5^degree}},PlotStyle->{Blue},ImageSize->400],{}],

If[MemberQ[n,1],Plot[Tooltip[N[FractionalDExp[degree,1]],N[FractionalDExp[degree,1]]],{t,-5,5},PlotRange->{{-5,5},{-5^degree,5^degree}},PlotStyle->{Green},ImageSize->400],{}],

If[MemberQ[n,2],Plot[Tooltip[N[FractionalDExp[degree,2]],N[FractionalDExp[degree,2]]],{t,-5,5},PlotRange->{{-5,5},{-5^degree,5^degree}},PlotStyle->{Purple},ImageSize->400],{}],

If[MemberQ[n,3],Plot[Tooltip[N[FractionalDExp[degree,3]],N[FractionalDExp[degree,3]]],{t,-5,5},PlotRange->{{-5,5},{-5^degree,5^degree}},PlotStyle->{Cyan},ImageSize->400],{}],

If[MemberQ[n,4],Plot[Tooltip[N[FractionalDExp[degree,4]],N[FractionalDExp[degree,4]]],
{t,-5,5},PlotRange->{{-5,5},{-5^degree,5^degree}},PlotStyle->{Orange},ImageSize->400],{}],

If[MemberQ[n,5],Plot[Tooltip[N[FractionalDExp[degree,5]],N[FractionalDExp[degree,5]]],
{t,-5,5},PlotRange->{{-5,5},{-5^degree,5^degree}},PlotStyle->{Yellow},ImageSize->400],{}],

Plot[Tooltip[N[FractionalDExp[degree,order]],N[FractionalDExp[degree,order]]],{t,-5,5},PlotRange->{{-5,5},{-5^degree,5^degree}},PlotStyle->{Thickness[.005],Red}]],

Row[{"Order of Differentiation = ", order}],Row[{Style["f(t) = ",Blue],Style[ N[FractionalDExp[degree,0]],Blue]}],Row[{Style[If[order==0,HoldForm[D^0],D^order],Red],Style["f(t) = " ,Red],Style[ N[FractionalDExp[degree,order]],Red]}]
},{Center,Center}],

"X1"->{{order,0,"Order of Differentiation"},0,5,.1},"X2"->{{degree,2,"Degree of Exponentiation"},1,5,1},{{n,{Floor[order],Ceiling[order]},"Plot n'th Derivative"},{0,1,2,3,4,5},ControlType->CheckboxBar},


ExpressionCell[Button[
Row[{"Reset Values"},Center],
order=0;degree=2;]],

FrameLabel-> {{"",""},{"",Style["Visualizing Simple Fractional Derivatives",20,FontFamily-> Times,Bold]}}


	]

Identical Implementation With The Riemann-Liouville Differintegral

Manipulate

Next, I implemented a similar manipulate utilizing the Riemann-Liouville Differintegral as the definition.

RLIntegral[q_Integer?NonNegative,f_,t_Symbol,assumptions:OptionsPattern[Integrate]]:=D[f,{t,q}];

RLIntegral[q_,f_,t_Symbol,assumptions:OptionsPattern[Integrate]]:=(RLIntegral[q,f,t,assumptions]= (1/Gamma[-q]) * Integrate[(f/.t->var)*(t - var)^(-q-1),{var,0,t},assumptions]);

RLExp[q_,f_,t_Symbol,assumptions:OptionsPattern[Integrate]] :=If[q==0,f,If[IntegerQ[q]==True,D[f,{t,q}],D[RLIntegral[-Ceiling[q] + q,f,t,assumptions],{t,Ceiling[q]}]]];

Manipulate[
Column[{Show[Plot[Evaluate[RLExp[Rationalize[0],t^degree,t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange-> {{-5,5},{-5^degree,5^degree}},PlotStyle-> Blue],
Plot[Evaluate[RLExp[Rationalize[1],t^degree,t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange-> {{-5,5},{-5^degree,5^degree}},PlotStyle-> Green],
Plot[Evaluate[RLExp[Rationalize[2],t^degree,t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange-> {{-5,5},{-5^degree,5^degree}},PlotStyle-> Purple],
Plot[Evaluate[RLExp[Rationalize[3],t^degree,t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange-> {{-5,5},{-5^degree,5^degree}},PlotStyle-> Cyan],
Plot[Evaluate[RLExp[Rationalize[4],t^degree,t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange-> {{-5,5},{-5^degree,5^degree}},PlotStyle-> Orange],Plot[Evaluate[RLExp[Rationalize[order],t^degree,t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange-> {{-5,5},{-5^degree,5^degree}},PlotStyle->{Thickness[.005],Red}]],

Row[{"Order of Differentiation = ",N[order]}],Row[{Style["f(t) = ",Blue],Style[ Evaluate[RLExp[Rationalize[0],t^degree,t,Assumptions->t>0]],Blue]}],Row[{Style[If[order==0,HoldForm[D^0],D^order],Red],Style["f(t) = " ,Red],Style[N[Evaluate[ RLExp[Rationalize[order],t^degree,t,GenerateConditions->False]]],Red]}]
},{Center}],

"X1"->{{order,0,"Order of Differentiation"},0,5,1/10},"X2"->{{degree,2,"Degree of Exponentiation"},1,5,1},

ExpressionCell[Button[
Row[{"Reset Values"},Center],
order=0;degree=2]],

FrameLabel-> {{"",""},{"",Style["Visualizing Simple Fractional Derivatives (R-L)",20,FontFamily-> Times,Bold]}}]

Fractional Derivatives of Sine

Manipulate

RLIntegral[q_Integer?NonNegative,f_,t_Symbol,assumptions:OptionsPattern[Integrate]]:=D[f,{t,q}];

RLIntegral[q_,f_,t_Symbol,assumptions:OptionsPattern[Integrate]]:=(RLIntegral[q,f,t,assumptions]= (1/Gamma[-q]) * Integrate[(f/.t->var)*(t - var)^(-q-1),{var,0,t},assumptions]);

RLExp[q_,f_,t_Symbol,assumptions:OptionsPattern[Integrate]] :=If[q==0,f,If[IntegerQ[q]==True,D[f,{t,q}],D[RLIntegral[-Ceiling[q] + q,f,t,assumptions],{t,Ceiling[q]}]]];

Manipulate[
Column[{Show[Plot[Evaluate[RLExp[Rationalize[0],3Sin[t],t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange-> 5,PlotStyle-> Blue],
Plot[Evaluate[RLExp[Rationalize[1],3Sin[t],t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange-> 5,PlotStyle-> Green],
Plot[Evaluate[RLExp[Rationalize[2],3Sin[t],t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange-> 5,PlotStyle-> Purple],
Plot[Evaluate[RLExp[Rationalize[order],3Sin[t],t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotRange->5,PlotStyle->{Thickness[.005],Red}]],

Row[{"Order of Differentiation = ",N[order]}],Row[{Style["f(t) = ",Blue],Style[ Evaluate[RLExp[Rationalize[0],3Sin[t],t,GenerateConditions->False]],Blue]}],Row[{Style[If[order==0,HoldForm[D^0],D^order],Red],Style["f(t) = " ,Red],Style[N[Evaluate[ RLExp[Rationalize[order],3Sin[t],t,GenerateConditions->False]]],Red]}]
},{Center}],

"X1"->{{order,0,"Order of Differentiation"},0,2,1/10},

ExpressionCell[Button[
Row[{"Reset Values"},Center],
order=0;]],

FrameLabel-> {{"",""},{"",Style["Fractional Derivatives of Sine",20,FontFamily-> Times,Bold]}}]

Fractional Derivatives and Integrals with Polynomials

This manipulate implements both the R-L Integral and Differintegral and can accept user input.  It can take simple polynomials as arguments but not periodic or exponential functions.

Manipulate

Manipulate[Column[{Show[

Plot[f,{t,-5,5},ImageSize->400,PlotStyle->{Red,Thickness[.005]},PlotRange->{{-5,5},{-25,25}}],If[deriv==True,Plot[Evaluate[RLExp[Rationalize[orderD],f,t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotStyle->Blue],{}],If[integral==True,Plot[Evaluate[RLIntegral[-(Rationalize[orderI]),f,t,GenerateConditions->False]],{t,-5,5},ImageSize->400,PlotStyle->Green],{}]],

Row[{Style["f(t) = ",Red],Style[f,Red]}],
Row[{Style[If[orderD==0,HoldForm[D^0],D^orderD],Blue]," ",Style["f(t) = " ,Blue],Style[If[orderD==0,f,N[Evaluate[RLExp[Rationalize[orderD],f,t,GenerateConditions->False]]]],Blue]}],

Row[{Style[If[orderI==0,HoldForm[D^0],"I"^orderI],Green]," ",Style["f(t) = " ,Green],Style[If[orderI==0,f,N[Evaluate[ RLIntegral[-(Rationalize[orderI]),f,t,GenerateConditions->False]]]],Green]}]
},{Center}],

{{f,t^2,"f(t)"},t^2,InputField},{{orderD,1,"Order of Differentiation"},InputField},{{orderI, 1, "Order of Integration"},InputField},{{deriv,True,"Show Derivative"},{True, False}},{{integral,True,"Show Integral"},{True, False}},

FrameLabel-> {{"",""},{"",Style["Fractional Derivatives of Polynomials",20,FontFamily-> Times,Bold]}}]

Future Projects

Manipulate

Applications of Fractional Calculus

Fractional Differential Equations

Applications in Physics

Java in Mathematica

Fourier Transforms

Bessel Functions

Thanks

Abigail Brown

Sasha Pavlyk

Wolfram Research