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



Hello Rich, Barton,

Thanks for your input, I really appreciate it. This is part of a project I'm working on to classify first order ODE's based on their right hand sides. Once a working classification rule has been found, the difficulty indeed lies in making it robust in the sense that it is guaranteed to return a correct result. For the Kamke's ODE database I still have a couple of false identifications, part of it due to a too naive implementation of this 'homogeneous type G' equation. 

I hope to have some more time next week to look into pdiff more and work on the reimplementation of this part. 

Best,
NB

From: rich.hennessy at verizon.net
To: nijso at hotmail.com; maxima at math.utexas.edu
Subject: Re: [Maxima] finding out if expr has the form F(y/x^a)
Date: Thu, 13 Dec 2012 20:13:16 -0500











?It 
should be easy to fix, but:

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

--Barton?





Here is another try for someone to point out where 
it is broken. It never gives false positives but it may reject some true 
positives.  I don?t know.  This is kind of an obsession working on 
this (in a fun sort of way).  
 
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]
)$