Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Consider the following expression:


Mathematica will not simplify it further. But $\Theta(x)\Theta(-x)$ is zero if considered as a generalized function, since you get zero if you integrate it against any test function: $\int dx\ \Theta(x)\Theta(-x) \varphi(x) = 0$ .

I have a long list of similar such expressions, in the variables $x1,x2,y1,y2$, such as:

 HeavisideTheta[x1-y1] HeavisideTheta[x2-y2] HeavisideTheta[-x1,-x2,-x1+x2,y1,-y1+y2]
 DiracDelta[x1+x2-y1-y2] HeavisideTheta[-x1,-x2,-x1+x2,x1-y2,-y1+y2]

For either of these, one can integrate against any test function $\varphi(x1,x2,y1,y2)$ and get zero. How can I get Mathematica to recognize such expressions as zero in a timely way?

I tried defining a function:


that would yield zero on such expressions. One way that works is to FourierTransform in all four variables; however, this takes hours for some of the expressions.

For completeness, let me write out the full versions of the two example terms above, as they appear in my application:

-(1/4)a^2 Exp[(2a + i b)(y1-x1)-(1/4)(a + 4 i b)(x2-y2)] HeavisideTheta[x1-y1] HeavisideTheta[x2-y2] HeavisideTheta[-x1,-x2,-x1+x2,y1,-y1+y2]
2 Exp[(3/4)(y2-x1)b] DiracDelta[x1+x2-y1-y2] HeavisideTheta[-x1,-x2,-x1+x2,x1-y2,-y1+y2]

The extra prefactors don't make any difference mathematically (either term is still zero as a generalized function), but they may make it more difficult for Mathematica.


share|improve this question
Have you used FullSimplify ? I get some simplification. – b.gatessucks Feb 12 '14 at 16:11
Related: link – Sektor Feb 12 '14 at 16:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.