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

  • $\begingroup$ Apart[observedLaplace] shows the difference between the two more clearly. $\endgroup$
    – JimB
    May 17, 2023 at 16:38
  • $\begingroup$ Workaround: Integrate[ InverseLaplaceTransform[ D[ArcTan[a Sqrt[2]/Sqrt[s]]/(Sqrt[2] Sqrt[s]), a], s, t], {a, 0, 1}] :) $\endgroup$ May 18, 2023 at 14:04
  • $\begingroup$ @MariuszIwaniuk haha, that trick works so well, I wonder if it makes sense to have it as a ResourceFunction $\endgroup$ May 18, 2023 at 16:46
  • 1
    $\begingroup$ @YaroslavBulatov It,s only a Feynman's Trick: zackyzz.github.io/feynman.html $\endgroup$ May 18, 2023 at 17:49
  • 1
    $\begingroup$ InverseLaplaceTransform[ArcTan[Sqrt[2]/Sqrt[s]]/(Sqrt[2] Sqrt[s]), s, t] == InverseLaplaceTransform[ 1/8 Inactive[ FoxH][{{{1, 1/2}, {3/2, 1/2}}, {}}, {{{1, 1/2}}, {{1/2, 1/2}}}, Sqrt[2] Sqrt[1/s]], s, t] == Inactive[ FoxH][{{{1, 1/2}, {3/2, 1/2}}, {}}, {{{1, 1/2}}, {{1/2, 1/2}, {1, 1/2}}}, Sqrt[2] Sqrt[t]]/( 8 t) == (Sqrt[\[Pi]/2] Erf[Sqrt[2] Sqrt[t]])/(2 Sqrt[t]) $\endgroup$ Jul 20, 2023 at 20:19

1 Answer 1


If you square both expressions and replace 2 t -> 4 t^2 and do


you see that there is a factor Sqrt[1 + I] between.

Physicists now, that there exist denumerable conventions for LaplaceTransforms. Since its use is in DSolve of linear equations demanding linear combinations of solutions, the factor is without significance. The determination of the coeffients is always the last step to fit the boundary or start conditions.

If one succeeds to find a solution by what kind of guessing or copying, one always is obliged to verify it by insertion into the differential equation.

Bottom line: If on takes square roots, its easier to compare squares in the result and then fine tune the Arg.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.