# Why does FreeQ seem not to work with complex numbers?

I guess I do not understand how Mathematica evaluates this simple expression inside FreeQ

a = 2 I
FreeQ[a, I]
FreeQ[2 I, I]
FreeQ[I, I]

(* 2 I *)
(* True *)
(* True *)
(* False *)

• Check FullForm[a] or FullForm[ I ], etc. There are a lot of questions in the site about complex numbers an some ideas about how to cope with the difficulties that arise when trying to match them – Dr. belisarius Jun 29 '15 at 4:08
• Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory Tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. – bbgodfrey Jun 29 '15 at 4:17
• FreeQ[...,Complex]... – ciao Jun 29 '15 at 4:17
• Thank you, FreeQ[..., Complex] works just fine. – Peter Jun 29 '15 at 4:23
• If you want to check the form of the expression as you entered it, you can do FreeQ[HoldForm[2 I], HoldPattern[I]]. – Simon Rochester Jun 29 '15 at 4:39