Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • $\begingroup$ Does this work for you: f[expr_ /; ! FreeQ[expr, _F] && ! FreeQ[expr, _G]] := 0; f[expr_] := expr ? $\endgroup$ Commented Nov 13, 2019 at 12:15
  • $\begingroup$ Thanks for your answer. Unfortunately it does not work because I specifically need F and G to also have the opposite arguments as stated F[X] and G[-X]. $\endgroup$ Commented Nov 13, 2019 at 12:26
  • $\begingroup$ Ah, maybe this one: f[expr_ /; ! FreeQ[expr, F[x_]] && ! FreeQ[expr, G[-x_]]] := 0; f[expr_] := expr. tested with f[F[Sin[x]]*G[Sin[-x]]] is 0 because MMA replaces G[Sin[-x]] with G[-Sin[x]]. $\endgroup$ Commented Nov 13, 2019 at 13:05
  • $\begingroup$ Yes, this works at first glance but I am not really sure it distinguishes the x argument correctly that it is the same in both F and G. Try this for example f[F[X] G[-Z]] this is evaluated to zero when it shouldn't since they do not have the same argument. $\endgroup$ Commented Nov 13, 2019 at 15:40