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



Hi List,

Taking this one on was a hard task.  The new version is wrong too.  I give up.  FYI the expression 1/x^2, should not return false, since it should work and has a solution [a = -1, f(x) = 1/x]. My version gets false, does anyone else have any ideas.  Also 1/x should return false, but instead returns [a=0, f(x) = 1/x] but the request was that a != 0.  I would try some more but I have other thing I have to do.

Best of luck,

Richard Hennessy


From: Richard Hennessy 
Sent: Thursday, December 13, 2012 3:48 PM
To: Barton Willis ; NB ; maxima at math.utexas.edu 
Subject: Re: [Maxima] finding out if expr has the form F(y/x^a)

?It should be easy to fix, but:

(%i4) solution(1/(y-1/x),x,y);
expt: undefined: 0 to a negative exponent.

--Barton?


Thanks for pointing this out.  I fixed two cases including the above which, I think, should be false.  They include Barton?s case and additionally 1/(y-1/x^n).  I think there are others, which I don?t know about yet.  In any case, these are not ?easy to fix? IMHO.  I hope I did not break anything by fixing these two.

load(pdiff)$
solution(g,x,y):=block
(
    [g2,g3,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(g4,0))=true then throw(false),
        g6:at(diff(at(g,y=x),x)/g4,x=1),
        _a:-ratsimp((g6+1)/(g6-1))
    ),
    f: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]
)$




--------------------------------------------------------------------------------
_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima