I have just started programming in Mathematica and still have to get a hang of it (and rule-based programming), so I apologize if this question may seem stupid. I will explain it with a concrete example.
I have an expression which is an inequality, and I have to determine if the unknown variable appears under a square root (the expression might also not contain any square roots at all).
So, my first thought was to use
The problem occurs when
x appears at deeper levels of the expression tree under
expr = 3 Sqrt[2 x + 9] + 23/ 7 x^2 >= 0
GreaterEqual[Plus[..., Times[3, Power[Plus[9, Times[2, x]], Rational[1, 2]]]], 0]
So I can't use
x_Sqrt as it's head is
Times, and not
Is there anyway I can build a pattern to use with
FreeQ or is there any other function that can determine if a given expression contains a symbol AFTER a given head (e.g.,
Power[(something with x), 1/2] as in my case).