Subject: finding out if expr has the form F(y/x^a)
From: Barton Willis
Date: Fri, 14 Dec 2012 01:30:57 +0000
(1) Assuming differentiability, I think you can get the value of 'a' using solve(ratsimp(g*y*diff(e,y) + x * diff(e,x) + (1-g)* e), g). Here g
might be a gensym. Remember that solve might return 'all.' This will be a special case, more or less. When e involves symbolic functions
(for example e = h(x * y) * y/x), I think all this will work better using pdiff.
(2) Test that 'a' is free of x & y. Maybe 'a' needs to be ratsimp'ed---not sure.
(3) After this, a bit of ratsubst should polish off the calculation. Maybe there needs to be another freeof check--not sure.
Some simplifications (say sqrt(x^2) --> |x|) might interfere with all this, I don't know--(too many) option variables control such things...
--Barton
________________________________
load(pdiff)$
solution(g,x,y):=block
(
[g2, g3, g4, g5, g6, _a, inflag : true],
catch(g2:g*x/y,
if is(equal(at(denom(g2),y=1/x),0))=true then throw(false),
g3:at(g2,y=1/x),
if is(equal(g3,g2))=true then
(g6:1,_a:%r)
else
(
if is(equal(at(denom(radcan(diff(g3,x))),x=1),0))=true then throw(false),
g4:at(diff(g3,x),x=1),
if is(equal(radcan(g4),0))=true then
(
g5:at(diff(at(g,y=x),x),x=1),
_a:-abs(g5)+1
)
else
(
g6:at(diff(at(g,y=x),x)/g4,x=1),
_a:-ratsimp((g6+1)/(g6-1))
)
),
f:radcan(at(g*x/y,y=x^(_a+1)))),
if is(equal(radcan(rat(g-y/x*at(f,[x=y/x^_a]))),0))=true then ['a=_a,'f(x)=f]
)$