The following code computes inverse Laplace Transform (trueLaplace
) manually and using Mathematica (observedLaplace
) of expression (expr
). Mathematica version has an extra imaginary term, making it numerically different from the one I computed manually.
Is this a bug? How do I restrict Mathematica to real-valued domain in this case?
IE, I expected $$\mathcal{L}^{-1}\left(\frac{\tan ^{-1}\left(\frac{\sqrt{2}}{\sqrt{s}}\right)}{\sqrt{2} \sqrt{s}}\right)=\frac{\sqrt{\frac{\pi }{2}} \text{erf}\left(\sqrt{2} \sqrt{t}\right)}{2 \sqrt{t}}$$ but got
$$\mathcal{L}^{-1}\left(\frac{\tan ^{-1}\left(\frac{\sqrt{2}}{\sqrt{s}}\right)}{\sqrt{2} \sqrt{s}}\right)=-\frac{\sqrt{\frac{\pi }{2}} \text{erf}\left(\sqrt{2} \sqrt{t}\right)}{2 \sqrt{t}}-i \sqrt{\frac{2}{\pi }} \sqrt{t} \, _2F_2\left(1,1;\frac{3}{2},2;-2 t\right)$$
expr = ArcTan[Sqrt[2]/Sqrt[s]]/(Sqrt[2] Sqrt[s]);
trueLaplace = (Sqrt[\[Pi]/2] Erf[Sqrt[2] Sqrt[t]])/(2 Sqrt[t])
observedLaplace = InverseLaplaceTransform[expr, s, t]
Print["Expected mismatch: ",
LaplaceTransform[trueLaplace, t, s] - expr /. s -> 2.]
Print["Observed mismatch: ",
LaplaceTransform[observedLaplace, t, s] - expr /. s -> 2.]
Apart[observedLaplace]
shows the difference between the two more clearly. $\endgroup$Integrate[ InverseLaplaceTransform[ D[ArcTan[a Sqrt[2]/Sqrt[s]]/(Sqrt[2] Sqrt[s]), a], s, t], {a, 0, 1}]
:) $\endgroup$