For an example, How to find list of all \(\ln \) functions in this expression?
restart; expr:=ln(abs(x+1))+2*x*ln(x)+sin(x); tmp := indets(expr,'specfunc(anything,ln)'); # tmp := {ln(x), ln(abs(x + 1))}
To pick only \(\ln \) functions which has \(abs\) inside them anywhere, replace the above with
restart; expr:=ln(abs(x+1))+2*x*ln(x)+sin(x); lis:=indets(expr,'specfunc(anything,ln)'); select(Z->has(Z,abs),lis) # tmp := {ln(abs(x + 1))}
Or, better alternative to the above is