Question: How to extract functions of specific variable

I'm looking for a method to extract the (unique) functions of a specific variable from a sum of functions, for example from u=sin(x)*sin(th)+sin(x)^2+sin(2x)+sin(th)^2+exp(x)+x i want to extract for x unique functions = {sin(x),sin(2x),exp(x),x} and for th unique functions = {sin(th)}. For a sum of only trigiometric functions, I use indets(u,trig(x)) and indets(u,trig(th)). However, for a sum of general functions I have no clue how to do this. Any help is welcome. Niels.
Please Wait...