Question: substitution in the denominator problem



Hello,

I wonder how one can perform easily such substitutions in Maple:
I want to substitute the sqrt expression with a symbol in the following expressions:
In the first case it works with subs:

restart;
f1:=a*sqrt(x-y)+b;
subs(sqrt(x-y)=g,f1);


In the second case it doesn't work withs subs and algsubs too, the difference is that the sqrt expression is in the denominator of f2:

f2:=a/sqrt(x-y)+b;
subs(sqrt(x-y)=g,f2);

algsubs(sqrt(x-y)=g,f2);

I tried it with  evalindets but I had no success (it substitutes in the nominator).

evalindets(f2,'sqrt(anything)',t->g);

Please Wait...