I was trying to match on anyfunction that has \(x\) inside its arguments. It turned
out that matching \(f(a x)\) vs. \(f(a+x)\) needed to have the identical(x) being placed first
when it is a sum and last when it is a product. Very strange. Just be aware of
this
But
While with product, it is the other way around
But now this fail
I have not yet figure how to tell it that the order does not matter. Maple 2023.1
A better way than the above, if I want to find any function that takes in \(x\) or \(y\) as arguments
is to use patfunc like this
indets(f(a*x+b+y),patfunc(anything,`Or`({identical(x),identical(y)}))); {f(a*b + y)} indets(f(b+y),patfunc(anything,`Or`({identical(x),identical(y)}))); {f(b + y)} indets(exp(a*x),patfunc(anything,`Or`({identical(x),identical(y)}))); {exp(a*x)} indets(exp(a+x),patfunc(anything,`Or`({identical(x),identical(y)}))); {exp(x + a)}