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



Question from
http://www.math.utexas.edu/pipermail/maxima/2012/031063.html

Dear all,
I would like to find out if an expression is of (or can be written in) the

general form (y/x)*f(y/x^a), with 'a' a nonzero constant. The difficulty I
have here is the generality of the function f. You can have:
expr:y^3+1/x^(3/2);
or:
expr:(y/x)*sin(y^2/x^4 + y^3/x^6);

I think it reduces to this:
(after dividing by y/x,) How to find out if there is a constant 'a' for which
a substitution H=y/x^a leads to an expression free of x and y?

Best,
NB

****************************************************************************************

Solution:

  Theorem.
Expresion u(x,y)  has the form  u(x,y)=y/x*f(y/x^a)  if only if
u(x,y) is solution of pde
a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y)

(%i1) check(g,x,y):=block([eq,sol,a],
eq:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),
subst(u(x,y)=g,eq), ev(%%,nouns),
sol:radcan(solve(%%,a)),
if not freeof (x,y, sol) then return(false),
[g='f(y/x^a)*y/x,sol[1],f(x)=radcan(subst([y=x^(a+1),sol[1]],g*x/y))])$

 Examples:
(%i2) check(y^3/x^(3/2),x,y);
(%o2) [y^3/x^(3/2)=(y*f(y/x^a))/x,a=1/4,f(x)=x^2]

(%i3) check(y^3+x^(3/2),x,y);
(%o3) false

(%i4) check(y/x*sin(y/x^2+y^3/x^6),x,y);
(%o4) [(y*sin(y^3/x^6+y/x^2))/x=(y*f(y/x^a))/x,a=2,f(x)=sin(x^3+x)]

(%i5) check((y/x)^2,x,y);
(%o5) [y^2/x^2=(y*f(y/x^a))/x,a=1,f(x)=x]

(%i6) check((y*x)^4,x,y);
(%o6) [x^4*y^4=(y*f(y/x^a))/x,a=-5/3,f(x)=x^3]

(%i7) check(1,x,y);
(%o7) [1=(y*f(y/x^a))/x,a=1,f(x)=1/x]

(%i8) check(x/sqrt(y),x,y);
(%o8) [x/sqrt(y)=(y*f(y/x^a))/x,a=4/3,f(x)=1/x^(3/2)]

(%i9) check((x/sqrt(y))^n,x,y);
(%o9) [(x/sqrt(y))^n=(y*f(y/x^a))/x,a=(2*n+2)/(n+2),f(x)=1/x^((n+2)/2)]

(%i10) check(log(y)-log(x),x,y);
(%o10) [log(y)-log(x)=(y*f(y/x^a))/x,a=1,f(x)=log(x)/x]

(%i11) check(x,x,y);
(%o11) [x=(y*f(y/x^a))/x,a=2,f(x)=1/x]

best
Aleksas Domarkas