Created
February 1, 2022 23:39
-
-
Save mtesseracted/acb16dcc1b744faa9c762c19d81bcf78 to your computer and use it in GitHub Desktop.
fractional derivatives of xe^x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* found at https://community.wolfram.com/groups/-/m/t/1313893 *) | |
(* \ | |
modified as per reddit user u/wxehtexw to integrate from -inf instead \ | |
of 0 *) | |
FractionalD[\[Alpha]_, f_, x_, opts___] := | |
Integrate[(x - t)^(-\[Alpha] - 1) (f /. x -> t), {t, -Infinity, x}, | |
opts, GenerateConditions -> False]/Gamma[-\[Alpha]] | |
FractionalD[\[Alpha]_?Positive, f_, x_, opts___] := | |
Module[{m = Ceiling[\[Alpha]]}, | |
If[\[Alpha] \[Element] Integers, D[f, {x, \[Alpha]}], | |
D[FractionalD[-(m - \[Alpha]), f, x, opts], {x, m}]]] | |
(* sanity checks *) | |
f[x_] := x^2 | |
FractionalD[1, f[x], x] | |
f[x_] := Sin[x] | |
FractionalD[-1, f[x], x] | |
f[x_] := Exp[x] | |
FractionalD[1, f[x], x] | |
FractionalD[1/2, f[x], x] | |
Simplify[FractionalD[3/2, f[x], x]] | |
(* test on xe^x *) | |
g[x_] := x Exp[x] | |
FullSimplify[FractionalD[1/4, g[x], x]] | |
FullSimplify[FractionalD[1/3, g[x], x]] | |
Simplify[FractionalD[1/2, g[x], x]] | |
FullSimplify[FractionalD[2/3, g[x], x]] | |
FullSimplify[FractionalD[3/4, g[x], x]] | |
Simplify[FractionalD[1, g[x], x]] | |
FullSimplify[FractionalD[5/4, g[x], x]] | |
FullSimplify[FractionalD[4/3, g[x], x]] | |
Simplify[FractionalD[3/2, g[x], x]] | |
Simplify[FractionalD[2, g[x], x]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment