Possible bug LaplaceTransform in Mathematica

139 Views Asked by At

Let us consider in Mathematica 13.0 on Windows 10/Linux

LaplaceTransform[DiracDelta[x - 2]*Exp[-x^2], x, s]

E^(-2 (2 + s))

and then

 InverseLaplaceTransform[%, s, x]

DiracDelta[-2 + x]/E^4

I was learned that DiracDelta[x - 2]*Exp[-x^2] should be returned. Which command incorrectly works: the former or the latter? or both?

Addition. The same issue with

FourierTransform[DiracDelta[x - 2]*Exp[-x^2], x, s];
InverseFourierTransform[%, s, x]

DiracDelta[-2 + x]/E^4

Addition 2. The distributions $\delta(x−2)e^{-x^2}$ and $\delta(x−2)e^{−4 }$ are not the same since their derivatives differ.

3

There are 3 best solutions below

4
On

For unknown to me reason I cannot comment @BillWatts post ("Too long by 224 characters") so I present my comment as an answer.

You wrote "Mathematica appears to be using the standard DiracDelta integral $\int_a^b \delta (x-c) f(x) \, dx=f(c)$" as your main argument. That was discussed at the forum many times. I recall that Encyclopedia of Mathematics and W. Rudin, Functional analysis say nothing about the definition of the definite integrals of distributions as well the references there (The unsuccessful attempt to give that definition was made in P. Antosik, J. Mikusiński, R. Sikorski, "Theory of distributions. The sequential approach" , Elsevier (1973) ). This integral simply makes no sense in math. You also wrote "Some of the math references you have posted include this formula ". Can you give exact references? TIA. My conclusion is your post does not answer the question at all.

4
On

Okay, let's totally forget about what DiracDelta means in common sense and just consider whether the phenomenon the OP observed with Mathematica 13.0 is a bug or not.

The inverse Laplace transform of the Laplace transofm of a function $g$, $\mathcal{L}^{-1}[\mathcal{L}[g]]$ should be $g$, which is explained in the Wolfram's reference of InverseLaplaceTransform and indeed

InverseLaplaceTransform[LaplaceTransform[g[t], t, s], s, t]

gives

g[t]

For the OP's expression $\delta(x-2) e^{-x^2}$, the above property doesn't hold and actually

InverseLaplaceTransform[LaplaceTransform[DiracDelta[x - 2] Exp[- x^2], x, s], s, x]

gives

DiracDelta[-2 + x] / E^4

which is not the original input and so this should be wrong; this is the main point of the OP's claim.

But the "Possible Issues" section of LaplaceTransform states that

Simplification can be required to get back the original form

So let's ask Mathematica whether these two expressions are the same (or at least whether Mathematica considers/defines they are equivalent to each other):

Simplify[DiracDelta[x - 2] Exp[- x^2] == DiracDelta[-2 + x] / E^4]

which gives

True

as expected based on common sense. And of course, Mathematica considers their derivatives are also the same (Simplify is not needed in this case):

D[DiracDelta[x - 2] Exp[- x^2], x] == D[DiracDelta[-2 + x] / E^4, x]
True

Summary: this is not a bug.

Edit: the OP complained that "as expected based on common sense" is not math, in the comment, but the above answer does not intend to show any background math; it is a logic trying to show Mathematica is indeed working consistently, with a bit of abstraction of the details of the definition/implementation of the delta function, the Laplace transform and its inverse, which I feel worth sharing. (And, logic and abstraction are what you need for doing math.)

Another thing I would like to clarify is: the OP does not seem to like Mathematica reduces

D[Exp[- x^2] DiracDelta[x - 2], x]

to

Derivative[1][DiracDelta][-2 + x] / E^4

but this makes perfect sense because (sorry, the below is the math the OP doesn't like) $$ \int_{2-\epsilon_1}^{2+\epsilon_2} \left[ e^{-x^2} \delta(x-2) \right]' f(x) dx = \int_{2-\epsilon_1}^{2+\epsilon_2} e^{-4} \left[ \delta(x-2) \right]' f(x) dx = - e^{-4} f'(2), $$ for a sufficiently smooth test function $f(x)$ with positive $\epsilon_1$ and $\epsilon_2$. Indeed, Integrate can perform the above integral. I must admit Mathematica works very well with the delta function than I thought it would be.

1
On

This really isn't that hard, so let's go through it step by step. Look at the two expressions of interest here, the one you start with and the one Mathematica subsequently returns.

LaplaceTransform[DiracDelta[x - 2]*Exp[-x^2], x, s]
(*  E^(-2*(s + 2))  *)

and

LaplaceTransform[DiracDelta[x - 2]*Exp[-4], x, s]
(*  E^(-2*(s + 2))  *)

Both expressions give the same LaplaceTransform which means either of those expressions is correct for the InverseLaplaceTransform of $e^{-2 (s+2)}$. That is not saying that the two expressions are the same value, but only that they have the same LaplaceTransform. We can manually compute these LaplaceTransforms to show Mathematica is correct.

The LaplaceTransform if f[x] is given by

Lt = Integrate[f[x]*Exp[(-s)*x], {x, 0, Infinity}]

Define

f1[x_] = Exp[-x^2 - s x]

f2[x_] = Exp[-4 - s x]

The integrals giving the Laplace Transforms are therefore:

lt1 = Integrate[DiracDelta[x - 2]*f1[x], {x, 0, Infinity}]
(*  E^(-2*(s + 2))  *)

lt2 = Integrate[DiracDelta[x - 2]*f2[x], {x, 0, Infinity}]
(*  E^(-2*(s + 2))  *)

Both giving the same correct answers as before. Mathematica appears to be using the standard DiracDelta integral

$\int_a^b \delta (x-c) f(x) \, dx=f(c)$

for c within the limits of a and b,and 0 otherwise. Some of the math references you have posted include this formula. In our case c = 2 which is within 0 to Infinity and manually computing the integrals for lt1 and lt2 is as simple as evaluating

f1[2]

and

f2[2]

giving the same correct values as before.

Contrary to the many examples of DiracDelta integrals one finds on the Web, an infinite integral is not required. The only place in the universe that DiracDelta[x-2] is non-zero is at x = 2. Any integration limits that straddle x = 2 will give the same integral value as infinite limits will.