6
$\begingroup$

I want to simplify a complicated expression with some Dirac delta distributions, but FullSimplify does not do what I want. Specifically, I want

FullSimplify[x/y DiracDelta[x - y], x>0 && y>0]

to evaluate to DiracDelta[x - y]. Does anybody know how to make Mathematica simplify this?

I am using Mathematica 9.0.1.0 on Windows.

$\endgroup$
  • 1
    $\begingroup$ may be because it does not know if x>y? Assuming[x > 0 && y > 0 && x > y, FullSimplify[x/y DiracDelta[x - y]]] gives zero. (I assume you are looking for zero as answer.) The point is, just telling M that x>0 and y>0, does not say anything about if x==y or not. $\endgroup$ – Nasser Oct 20 '14 at 20:35
  • $\begingroup$ I am looking for DiracDelta[x-y] as an answer. I added the assumptions only to avoid a division by zero, so the constraint on x is not needed. From the answer @Jens gave below, we can see that even that constraint is not necessary. $\endgroup$ – Nikki Bisschop Oct 21 '14 at 9:39
11
$\begingroup$

Here is a trick that allows you to get exactly what you're looking for:

FourierTransform[
 InverseFourierTransform[
   x/y DiracDelta[x - y], 
 x, k],
k, x]

DiracDelta[x - y]

What I did here is to apply the Fourier transform and its inverse, which is of course the identity and therefore is equivalent to the original expression. But in doing so, Mathematica automatically did the required simplifications because it knows exactly how to deal with Dirac deltas inside Fourier integrals. By the way, Mathematica can even deal with derivatives of the delta function in the same way.

Edit

As stated by Nikki in the comment, it's important to keep track of which entry in the DiracDelta is the intended integration variable. This is not always clear from just looking at the delta function because it is by definition symmetric. The choice of intended integration variable is specified in the InverseFourierTransform above.

The reason why it's not done by Simplify

The ambiguity as to the integration variable is really the answer to the question why FullSimplify doesn't do anything with DiracDelta. Strictly speaking, DiracDelta is a distribution and not a function. It picks out the value of a function given to it, at the position specified by a parameter. This operation happens to be symmetric in the example of the question in that parameter and function variable have interchangeable roles, but nonetheless their distinction becomes important when the argument of DiracDelta is itself a function that depends on the "parameter" and the "variable" in an asymmetric way.

Take, for example, $y\,\delta(x-f(y))$. If we assume $x$ to be the integration variable, nothing needs to be simplified. If, on the other hand, $y$ is the integration variable, the simplification goal would be to let $y$ stand alone inside the delta function, requiring us to invert the function $f$. There is no way to decide which of these routes is desired unless you state whether $x$ or $y$ is the integration variable. This situation is illustrated in the examples below.

More examples

Sometimes you do have to add assumptions in order to get a fully simplified result, because Mathematica's default assumption that variables are complex also applies to DiracDelta, and you may not want that. Here is an example, modified from the comment by Dr.Wolfgang:

Assuming[y > 0, 
 FourierTransform[
  InverseFourierTransform[
    (y/x DiracDelta[y - x^2]),
   x, k], k, x]]

1/2 DiracDelta[x - Sqrt[y]] - 1/2 DiracDelta[x + Sqrt[y]]

This is an application of the transformation of variables formula for delta functions. We can push this to make even more symbolically general statements like this:

Assuming[y > 0 && n ∈ Integers && n > 0, 
 FourierTransform[
  InverseFourierTransform[
    (y/x DiracDelta[y - x^n]),
   x, k], k, x]]

DiracDelta[x - y^(1/n)]/n

However, as you can see by comparison with the previous, more concrete result (n = 2), the more general answer here is missing the fact that the inverse of the power has multiple branches which should be summed over. So I guess this is a caveat not to get carried away and always do a sanity check when simplifying complicated delta function expressions with Mathematica.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ For completeness it is useful to note that the order of using the functions is immaterial. InverseFourierTransform[ FourierTransform[x/y DiracDelta[x - y], x, k], k, x] gives the same result. $\endgroup$ – Bob Hanlon Oct 21 '14 at 2:46
  • $\begingroup$ @BobHanlon Yes, that's right, either way is fine (and if for some reason one way doesn't work, you can always try the other order to make sure). $\endgroup$ – Jens Oct 21 '14 at 4:45
  • $\begingroup$ I was hoping for something more general than this trick, but it works if you know which variables occur in the Dirac delta. If nobody comes with a more elegant solution I will accept your answer in a day. $\endgroup$ – Nikki Bisschop Oct 21 '14 at 9:15
  • $\begingroup$ @ Jens: nice trick. But look what happens if you do it with (x/y DiracDelta[x - y^2]). $\endgroup$ – Dr. Wolfgang Hintze Oct 21 '14 at 16:32
  • $\begingroup$ @Dr.WolfgangHintze Well, you get the correct answer. There is no problem at all. @Nikki Yes, the notation of the Dirac delta function is sometimes ambiguous because it doesn't include the info as to which variable is the integration variable. This can only be fixed by stating that information in the (Inverse)FourierTransform. $\endgroup$ – Jens Oct 21 '14 at 16:38
2
$\begingroup$

DiracDelta must be inside an integral to have much meaning. From its documentation: "DiracDelta can be used in integrals, integral transforms, and differential equations. "

Assuming[Element[y, Reals],
 Integrate[x/y DiracDelta[x - y], {x, -Infinity, Infinity}]]

1

Assuming[Element[x, Reals],
 Integrate[x/y DiracDelta[x - y], {y, -Infinity, Infinity}]]

1

Assuming[x > y,
 Integrate[x/y DiracDelta[x - y], {y, -Infinity, Infinity}]]

0

Assuming[y > x,
 Integrate[x/y DiracDelta[x - y], {y, -Infinity, Infinity}]]

0

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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