finding out if expr has the form F(y/x^a)
- Subject: finding out if expr has the form F(y/x^a)
- From: Richard Hennessy
- Date: Sat, 15 Dec 2012 17:13:00 -0500
Hi Aleksas:
There are some problems with the check() function that pdecheck1() does not have.
?Question from
http://www.math.utexas.edu/pipermail/maxima/2012/031063.html?
<snip>
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)
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))])$
<end snip>?
(%i20) check(1/x^3,x,y);
(out20) false
(%i21) pdecheck1(1/x^3,x,y);
(out21) [a = -2,'f(x) = 1/x,'g(x,y) = 1/x^3]
(%i22) pde:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),u(x,y):=1/x^3,a=-2;
(out22) -3/x^3 = -3/x^3
(%i23) ratsimp(lhs(%)-rhs(%));
(out23) 0
(%i24) check(y^4/x^3,x,y);
(out24) false
(%i25) pdecheck1(y^4/x^3,x,y);
(out25) [a = 2/3,'f(x) = x^3,'g(x,y) = y^4/x^3]
(%i26) pde:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),u(x,y):=y^4/x^3,a=2/3;
(out26) -y^4/(3*x^3) = -y^4/(3*x^3)
(%i27) ratsimp(lhs(%)-rhs(%));
(out27) 0
<snip>
(%i35) check(1/x^2,x,y);
(out35) false
(%i36) pdecheck1(1/x^2,x,y);
(out36) [a = -1,'f(x) = 1/x,'g(x,y) = 1/x^2]
(%i37) pde:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),u(x,y):=1/x^2,a=-1;
(out37) -2/x^2 = -2/x^2
(%i38) ratsimp(lhs(%)-rhs(%));
(out38) 0
<snip>
(%i42) check(1/x^3,x,y);
(out42) false
(%i43) pdecheck1(1/x^3,x,y);
(out43) [a = -2,'f(x) = 1/x,'g(x,y) = 1/x^3]
(%i44) pde:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),u(x,y):=1/x^3,a=-2;
(out44) -3/x^3 = -3/x^3
(%i45) ratsimp(lhs(%)-rhs(%));
(out45) 0
(%i46) check(1,x,y);
(out46) false
(%i47) pdecheck1(1,x,y);
(out47) [a = 1,'f(x) = 1/x,'g(x,y) = 1]
(%i48) pde:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),u(x,y):=1,a=1;
(out48) 0 = 0
(%i49) check(x,x,y);
(out49) false
(%i50) pdecheck1(x,x,y);
(out50) [a = 2,'f(x) = 1/x,'g(x,y) = x]
(%i51) pde:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),u(x,y):=x,a=2;
(out51) x = x
<snip>
/* a trivial case, but check is wrong */
(%i62) check(0,x,y);
(out62) false
(%i63) pdecheck1(0,x,y);
(out63) [a = %r,'f(x) = 0,'g(x,y) = 0]
(%i64) pde:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),u(x,y):=0,a=%r;
(out64) 0 = 0
/* a confusing case */
(%i65) pdecheck1(a*x,x,y);
(out65) [a = 2,'f(x) = a/x,'g(x,y) = a*x]
(%i66) check(a*x,x,y);
(out66) false
(%i67) pde:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),u(x,y):=a*x,a=2;
(out67) 2*x = 2*x
/* a simple one, less confusing */
(%i68) check(b*x,x,y);
(out68) false
(%i69) pdecheck1(b*x,x,y);
(out69) [a = 2,'f(x) = b/x,'g(x,y) = b*x]
(%i70) pde:a*y*diff(u(x,y),y)+x*diff(u(x,y),x)=(a-1)*u(x,y),u(x,y):=b*x,a=2;
(out70) b*x = b*x
pdecheck1(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 and member(is(notequal(_a,0)),['unknown, 'true]) then ['a=_a,'f(x)=f,'g(x,y)=y/x*at(f,x=y/x^_a)]
)$
Regards,
Rich