3
$\begingroup$

Initially, I was trying to invert the following expression:

$$ \frac{e^{-a\sqrt s}}{s-c} $$ and got the following result:

InverseLaplaceTransform[E^(-a Sqrt[s])/(s - c), s, t]
(* ConditionalExpression[1/2 E^(-a Sqrt[c] + c t) (Erfc[(a - 2 Sqrt[c] t)/(2 Sqrt[t])] + 
    E^(2 a Sqrt[c]) Erfc[(a + 2 Sqrt[c] t)/(2 Sqrt[t])]), a > 0] *)

Then, I coded this expression in Python for other purposes in which $c$ was negative. I thought we would just ignore the imaginary part generated due to this and take the real part as our answer. But, I was getting wrong values. (Should have been in range of 10 but is in order of $10^4$)

So I checked it with Mathematica, but I don't get the result:

InverseLaplaceTransform[E^(-a Sqrt[s])/(s + c), s, t]
(* InverseLaplaceTransform[E^(-a Sqrt[s])/(c + s), s, t] *)

Am I doing something wrong here?

$\endgroup$
5
  • $\begingroup$ Welcome to the Mathematica Stack Exchange. Please use E instead of e and observe proper syntax. This function is present under the Neat Examples on the doc page. $\endgroup$
    – Syed
    Apr 22 at 9:41
  • $\begingroup$ The question has been edited. Pls look @Syed $\endgroup$
    – KNVCSG
    Apr 22 at 10:32
  • $\begingroup$ Domen has edited the question. Could you now look at it? @Syed $\endgroup$
    – KNVCSG
    Apr 22 at 11:33
  • $\begingroup$ I am on v12.2 on Win7-x64 and I see this. What $Version are you on? $\endgroup$
    – Syed
    Apr 22 at 11:36
  • $\begingroup$ I am on v13.3.1 on Win10-x64 $\endgroup$
    – KNVCSG
    Apr 22 at 12:08

2 Answers 2

3
$\begingroup$
$Version

"14.0.0 for Mac OS X ARM (64-bit) (December 13, 2023)"

Clear["Global`*"]

ilt1 = InverseLaplaceTransform[E^(-a  Sqrt[s])/(s - c), s, t]

enter image description here

InverseLaplaceTransform[E^(-a  Sqrt[s])/(s + c), s, t]

(* InverseLaplaceTransform[E^(-a Sqrt[s])/(c + s), s, t] *)

Include assumptions

ilt2 = Assuming[a > 0 && c > 0,
  InverseLaplaceTransform[E^(-a  Sqrt[s])/(s + c), s, t] // Simplify]

(* 1/2 E^(-I a Sqrt[c] - 
  c t) (Erfc[(a - 2 I Sqrt[c] t)/(2 Sqrt[t])] + 
   E^(2 I a Sqrt[c]) Erfc[(a + 2 I Sqrt[c] t)/(2 Sqrt[t])]) *)

(ilt1 /. c -> -c) == ilt2 // FullSimplify[#, a > 0 && c > 0] &

(* True *)
$\endgroup$
1
$\begingroup$

A trick:

InverseLaplaceTransform[
InverseLaplaceTransform[
LaplaceTransform[E^(-a*Sqrt[s])/(s + c), a, q] // Apart,
s, t] // Simplify // Expand, q, a] // FullSimplify

(* 1/2 E^(-I a Sqrt[c] - c t) (Erfc[(a - 2 I Sqrt[c] t)/(2 Sqrt[t])] + 
   E^(2 I a Sqrt[c])  Erfc[(a + 2 I Sqrt[c] t)/(2 Sqrt[t])])*)
$\endgroup$
2
  • $\begingroup$ Of course, your Code does show the expected answer in Mathematica, but the point is why exactly a simple line doesn't work. (I don't know what the expressions 'Apart' , 'Expand' are and how they are used $\endgroup$
    – KNVCSG
    Apr 24 at 6:54
  • $\begingroup$ @KNVCSG We ordinary users don't have much influence as it was programmed by the creators of Wolfram Mathematica. So you ask why it doesn't work, that's not my question. $\endgroup$ Apr 24 at 7:26

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.