Skip to main content
10 events
when toggle format what by license comment
May 13, 2022 at 15:41 comment added BabaYaga Also useful to put || (AllTrue[list,Head[#] === Symbol &]) in the condition if list={a,b,c} which is also a problem for Intersection.
May 13, 2022 at 11:10 comment added Syed Please see update for a possible failsafe mechanism. Do try this with the PolynomialGCD and see if it helps.
May 13, 2022 at 11:09 history edited Syed CC BY-SA 4.0
added a failsafe as requested by the OP
May 13, 2022 at 10:48 comment added BabaYaga @Syed, Is it possible to apply a failsafe to your method? For example {a^-n (1+a^n b),b,a^-n} is one such example where Intersection fails, but PolynomialGCD works as expected. But in the Intersection way, although it can not find the common factor, it tries anyway to write the intersection. One would expect to return in such cases just a common factor 1 instead of errors and symbolical form of the common factor with intersection of terms.
May 13, 2022 at 8:51 vote accept BabaYaga
May 7, 2022 at 7:20 comment added Syed @Boogeyman I looked at TreeForm and realized that parts of the tree were identical. Once you expand this expression, the peculiarities of internal FullForm representations would prohibit such a filtering in general as a structural intersection is being calculated, not a computational one.
May 7, 2022 at 7:10 comment added BabaYaga I think this would be too much to ask to Mathematica. I was expecting to use Assuming n>1 etc. Probably one has to make the expressions in a particular form (according to the requirement) and then apply Intersection. I find both a combination of Intersection & PolynomialGCD useful for some of my other cases similar to the one in the question.
May 6, 2022 at 19:18 comment added Michael E2 Works in the OP's case but not in general, neither with list = Expand[list] nor list = {r x + r^(2 - n) y, r (x + 2 y)}.
May 6, 2022 at 18:34 comment added Ben Izd Great answer. Even shorter Intersection @@ list ;)
May 6, 2022 at 17:08 history answered Syed CC BY-SA 4.0