4.13 How to find all functions in an expression?

Given expression \(3 \sin \left (x \right )+t +3 f \left (x , t\right ) t +g \left (x , t\right )\) find all functions, if any, in the expression.

Use indets with function

restart; 
expr := 3*sin(x)+t+3*f(x,t)*t+g(x,t); 
res  := indets(expr,function); 
if numelems(res)<>0 then 
   print("Found these functions",res); 
else 
   print("could not find any function)"); 
fi;
 

"Found these functions", f(x, t), g(x, t), sin(x)