Question: how to use indets to find specific functions in expression?

I gave up. Spend 40 minutes trying everything and can't figure the right syntax. 

I need to use indets to obtain all occurrences of specific function in expression. Such as sin() or cos() or ln(), etc...

The indets commands has the form indets(expression, type).

But what is the type of ln ? It is of function type. But this picks up all other functions in the expression. I tried specfun and could not make it work. For example

expr:=x+sin(x)+ln(y)+10+ln(x+y)^2;

I want  to obtain  {ln(y),ln(x+y)^2}

I tried

indets(expr,function); 
indets(expr,specfun(ln));

and many more. Since indets needs a name of a type in the second argument, then what is the type name for ln or sin or cos, etc... I can't use indential, it did not work, since it is not a symbol I am looking for. I could use patmatch, but I am trying to learn indets for all these things.

Do I need to use subsindets for this? I still do not know how to use subsindets.

Maple 2019.1

Please Wait...