I put together recipes provided by Mariusz Iwaniuk into standalone functions ilaplaceFeynmann
and ilaplaceMellin
. The Mellin transform approach seems to be the fastest
ClearAll["Global`*"];
ilaplace[expr_] := InverseLaplaceTransform[expr, s, t];
(* Custom Laplace transforms from "Hypergeometric" post *)
(*Mariusz solution from \
https://mathematica.stackexchange.com/a/285338/217*)
augmentInv[expr_, var_] := Module[{a1, a2, a3, a4, expra},
expra = expr /. {
ArcTan[a1_] -> ArcTan[a1/var],
Log[a1_] -> Log[a1/var],
Hypergeometric2F1[a1_, a2_, a3_, a4_] ->
Hypergeometric2F1[a1, a2, a3, a4/var]
};
If[MemberQ[Reduce`FreeVariables[expra], var], expra, expra/var]
];
ilaplaceMellin0[expr_] :=
Block[{expra, mellin, ilap, imellin, s, t, a},
expra = augmentInv[expr, a];
mellin = FunctionExpand@MellinTransform[expra, a, q];
ilap = InverseLaplaceTransform[mellin, s, t];
imellin = InverseMellinTransform[ilap, q, a] /. a -> 1;
FullSimplify@imellin
];
SetAttributes[ilaplaceMellin0, Listable];
ilaplaceMellin[expr_] :=
Block[{dummy},
Distribute@dummy@Expand[expr] /. dummy -> ilaplaceMellin0];
(* https://zackyzz.github.io/feynman.html *)
augment[expr_, var_] := Module[{a1, a2, a3, a4, expra},
expra = expr /. {
ArcTan[a1_] -> ArcTan[a1 var],
Log[a1_] -> Log[a1 var],
Hypergeometric2F1[a1_, a2_, a3_, a4_] ->
Hypergeometric2F1[a1, a2, a3, a4 var]
};
If[MemberQ[Reduce`FreeVariables[expra], var], expra, var*expra]
];
ilaplaceFeynmann0[expr_] := Block[{repl, ilap, a1, a2, a3, a4, a},
expra = augment[expr, a];
ilap = InverseLaplaceTransform[D[expra, a] // Factor, s, t];
Assuming[{t > 0}, Integrate[ilap, {a, 0, 1}]]
];
SetAttributes[ilaplaceFeynmann0, Listable];
ilaplaceFeynmann[expr_] :=
Block[{dummy},
Distribute@dummy@Expand[expr] /. dummy -> ilaplaceFeynmann0];
expr1 = ArcTan[Sqrt[2]/Sqrt[s]]/(Sqrt[2] Sqrt[s]);
expr2 = Hypergeometric2F1[1, 1/3, 4/3, s];
results =
Outer[TimeConstrained[#1[#2], 60] &, {ilaplace, ilaplaceFeynmann,
ilaplaceMellin}, {expr1, expr2}];
TableForm[results,
TableHeadings -> {{"default", "Feynmann", "Mellin"}, {expr1, expr2}}]
LaplaceTransform[(d^(1 - p) ExpIntegralE[1/p, -a d^-p t])/p, t, s]
), but was curious about a general technique for this $\endgroup$