It should match cases like x**2*f(x)**2 right, since x**2*f(x)**2 is also a function of (x*y), I'm just testing if factor is a function of x*y, Do correct me if I'm wrong.