# How to convince Mathematica that $(-1)^{2/3} = e^{2\pi i /3}$

I have a list T which contains 3 + 4*E^(2*Pi*I/3). Yet MemberQ[ T , 3 + 4*(-1)^(2/3) ] returns false.

One can check for themselves with MemberQ[{3 + 4*E^(2*Pi*I/3)}, 3 + 4*(-1)^(2/3)]. It will return False.

How can I tweak this so that the above returns True? Am I fumbling some detail regarding the principal branch?

• From the docs Possible Issues section for MemberQ: MemberQ tests for structural matches, not numerical equality . You could try this instead: ContainsAny[T, {3 + 4*(-1)^(2/3)}, SameTest -> Equal] Commented Aug 9, 2020 at 22:16
• ^ or alternatively, because ContainsAny is a bit slow, you could ComplexExpand your list T and the item before using MemberQ which (fingers crossed) will put them in the same structural form. Commented Aug 9, 2020 at 22:18
• Following the suggestion above: lis = {E^(2*Pi*I/3), (-1)^(2/3 )} //ComplexExpand //InputForm (* {-1/2 + (I/2)*Sqrt[3], -1/2 + (I/2)*Sqrt[3]} *) Commented Aug 9, 2020 at 22:32
• Or @@ (Equal[#, 3 + 4*(-1)^(2/3)] & /@ T) Commented Aug 9, 2020 at 23:41
• I find that ExpToTrig[] is faster than ComplexExpand[] for this sort of thing. Commented Aug 10, 2020 at 4:52