I need a function, which will collect terms next to the same rational power of a given variable. For the input
RCollect[3xy^(3/2)+2/y+zx/y-y/x+2*x^z y^(3/2),y]
the desired output is
(2+zx)y^(-1)-y/x+(3x+2x^z)y^(3/2).
I'm aware that output is ambiguous when powers of the RCollect variables are unspecified RCollect[2 x^k1+3 x^k2]
. In such a case, the function should collect terms next to x^k1
and x^k2
separately.