Question: How can I extract the specific terms in an expression?

Dear All,

I have the given expression f as follows. I want to extract terms with sin, sinh, and exp in this expression. For example, for sin, cos, sinh and exp, I want the outputs to be -4*sin(x), -5*cos(x^3)*sin(y^2), 5*sinh(x^2) and 2*exp(y^2), respectively. Also, if I want to get terms having sin(x) and sin(y^2), I like to receive -4*sin(x) and -5*cos(x^3)*sin(y^2), respectively. And also, for terms including sinh(x^3), I want to get Void output. The above goals cannot be achieved with the following commands. Can anyone help me?

f := -4*sin(x) + 2*exp(y^2) + 5 - 5*cos(x^3)*sin(y^2) + 5*sinh(x^2);

indets(f, trig);

selectfun(f, exp);

selectremove(has, f, trig);

Please Wait...