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.

Required fields*

13
  • 11
    $\begingroup$ I think because (x | y) (x | y) evaluates to (x | y)^2, which doesn't match your expression. $\endgroup$ Commented Jun 13, 2016 at 4:04
  • $\begingroup$ What do you mean by "I want to eliminate terms like x^2, y^2, z^2, x y, x z, y z"? $\endgroup$ Commented Jun 13, 2016 at 4:04
  • 1
    $\begingroup$ Does MatchQ[#, _^2 | a_ b_] & /@ {x^2, y^2, z^2, x y, x z, y z} do what you want? Your post needs more information, because there is an inconsistency between the terms you want to eliminate and the patterns you are making. Do you want to eliminate any second-degree monomial? Or do you want to eliminate any second-order monomial that involves x or y? (or x or y and nothing else)? $\endgroup$ Commented Jun 13, 2016 at 4:06
  • 6
    $\begingroup$ Btw: MatchQ[x y, HoldPattern[(x | y) (x | y)]] $\endgroup$ Commented Jun 13, 2016 at 8:22
  • 1
    $\begingroup$ For more info, the reason @Kuba 's method works is to avoid the problem march mentioned. $\endgroup$ Commented Jun 13, 2016 at 9:19