4

It's a problem I encountered when answering this question and I think it's worth starting a new question for it. Consider the following expressions:

expr = Erfc[x/(2 Sqrt[t])] - E^(t + x) Erfc[Sqrt[t] + x/(2 Sqrt[t])];
texpr = E^(-Sqrt[s] x)/(s + s^(3/2));

texpr is the Laplace transform of expr when x > 0. This can be verified numerically:

With[{pre = 32}, 
 Block[{x = RandomReal[{0, 100}, WorkingPrecision -> pre], 
        s = RandomReal[{0, 100}, WorkingPrecision -> pre]}, 
  N[{texpr, NIntegrate[expr Exp[-s t], {t, 0, Infinity}, WorkingPrecision -> pre]}, 
    pre/2 // Floor]]]

But LaplaceTransform and InverseLaplaceTransform can't handle them well:

LaplaceTransform[expr, t, s]
(* Partly unevaluated *)
InverseLaplaceTransform[texpr, s, t]
(* Unevaluated *)

My question is, can we transform expr to texpr, and texpr to expr with some extra coding?

xzczd
  • 65,995
  • 9
  • 163
  • 468

1 Answers1

4

For texpr to expr. We can use:

texpr = E^(-Sqrt[s] x)/(s + s^(3/2));
s1 = LaplaceTransform[texpr, x, a] // Apart
s2 = InverseLaplaceTransform[s1, s, t] // Expand
InverseLaplaceTransform[s2[[1]], a, x] // FullSimplify

$$\text{erfc}\left(\frac{x}{2 \sqrt{t}}\right)-e^{t+x} \text{erfc}\left(\frac{2 t+x}{2 \sqrt{t}}\right)$$

For expr to texpr:

expr = Erfc[x/(2 Sqrt[t])] - E^(t + x) Erfc[Sqrt[t] + x/(2 Sqrt[t])];
ss1 = Assuming[{x > 0, t > 0}, LaplaceTransform[expr, x, a]] // Simplify // Expand
ss2 = LaplaceTransform[ss1, t, s]
Assuming[{a > 0, s > 0}, InverseLaplaceTransform[ss2, a, x] // Simplify]

$$\frac{e^{-\sqrt{s} x}}{s^{3/2}+s}$$

Edited:

For expr to texpr.The key is Assuming command:

Let:

 expr = Erfc[x/(2 Sqrt[t])] - E^(t + x) Erfc[Sqrt[t] + x/(2 Sqrt[t])];
 LaplaceTransform[expr, t, s]

dosen't work ?,but with Assuming:

 expr = Erfc[x/(2 Sqrt[t])] - E^(t + x) Erfc[Sqrt[t] + x/(2 Sqrt[t])];
 Assuming[{x > 0, t > 0}, LaplaceTransform[expr, t, s]] // FullSimplify

 (* E^(-Sqrt[s] x)/(s + s^(3/2)) *)
Mariusz Iwaniuk
  • 13,841
  • 1
  • 25
  • 41