There was a case where I wanted to detect form \(f(x) g(\frac {y}{x})\), i.e. \(f(x)\) can be any expression which is function of \(x\) only (it can be constant also) multiplied by a function whose argument must be \(\frac {y}{x}\) or a constant multiplied by \(\frac {y}{x}\).
This means something like \(x g(\frac {y}{x})\) or \(x^2 e^{3 \frac {y}{x}}\) or \(f(x) \sin {\frac {y}{x}}\) or \(\cos {\frac {y}{x}}\) where in this last case \(f(x)=1\) which is allowed.
TO FINISH.