Changevar bug



This looks like a bug in something that changevar calls. Consider
the following:

(C2) expr1:sqrt(a^2+sqrt(b^2+c/x));
				      c	   2	 2
(D2) 			    SQRT(SQRT(- + b ) + a )
				      x
(C3) assume(a>0,b>0,c>0,x>0,y>0,y>a);
(D3) 		  [a > 0, b > 0, c > 0, x > 0, y > 0, y > a]
(C4) int1:'integrate(expr1,x);
			 /
			 [	     c	  2     2
(D4) 			 I SQRT(SQRT(- + b ) + a ) dx
			 ]	     x
			 /
(C5) change1:y=expr1;
					c    2	   2
(D5) 			  y = SQRT(SQRT(- + b ) + a )
					x
(C6) changevar(int1,change1,y,x);
			 /
			 [	     c	  2     2
(D6) 			 I SQRT(SQRT(- + b ) + a ) dx
			 ]	     x
			 /

Maxima can't do that but it can do:

(C7) int2:scanmap(factor,changevar(int1,change1^2,y,x));
     2	  2
Is  a  - y   positive, negative, or zero?


negative;

		       /			   2    2
		       [ y (y - a) (y + a) SQRT(2 a  - y )
(D7) 		 - 4 c I --------------------------------- dy
		       ]     2	      2 2   2	     2 2
		       /   (y  - b - a )  (y  + b - a )


The sqrt term is incorrect. It should be y. Maxima should have known
that y^2 > a^2 from the assumptions but it definitely knows because
I told it so.  It ignored all that, assumed a^2 > y^2, and got the 
wrong answer.

Perhaps the problem is related to this:

(C8) change2:solve(change1^2,x)[1];
     2	  2
Is  a  - y   positive, negative, or zero?


negative;
					c
(D8) 			  x = ----------------------
			       4      2	 2    2	   4
			      y  - 2 a  y  - b  + a

(C9) frob:subst(change2,expr1);

                                 4      2  2    4     2
(D9)                  SQRT(SQRT(y  - 2 a  y  + a ) + a )  

Obviously, the inner sqrt is the issue. Note also,

(C10) scanmap(factor,frob);
						  2
(D10) 			  SQRT((y - a) (y + a) + a )

(C11) scanmap(factor,frob,bottomup);

Error: Caught fatal error [memory may be damaged]
Fast links are on: do (si::use-fast-links nil) for debugging
Error signalled by MACSYMA-TOP-LEVEL.
Broken at SCANMAP1.  Type :H for Help.
MAXIMA>>
:q

(C12)

This last bit is just bad.

Thanks.

-- 
Earth
    2001-06-24 21:00:44.919 UTC (JD 2452085.375520)
    X  =   0.056850134, Y  =  -0.935983388, Z  =  -0.405661861 (au)
    X' =   0.016908515, Y' =   0.000876676, Z' =   0.000379300 (au/d)