finding out if expr has the form F(y/x^a)



?solution(g):=block([g2,g3,g6],g2:g*x/y,g3:at(g2,y = 1/x),
???????????????? g6:at(diff(at(g,y = x),x)/diff(g3,x),x = 1),
???????????????? a:-ratsimp((g6+1)/(g6-1)),f:at(g3,x = x^(1/(-1-a))),
???????????????? ['a = a,'f(x) = f])

expr : y/x*(sin(y/x^2)+cos((y/x^2)^2));

solution(expr);

(%o117) [a = 2,'f(x) = cos(x^2)+sin(x)]