Are these both the right answer for the integral?



Richard Hennessy a ?crit :
> Hi List,
>  
> I found an article which gives an integral problem of interest.
>  
> integrate(3*x^2*sqrt(1-1/x^2),x);
>  
> Maxima alone said it works out to (1-1/x^2)^(3/2)*x^3, with 
> abs_integrate loaded the answer is the same (1-1/x^2)^(3/2)*x^3, but 
> with pw.mac loaded Maxima gives 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x)
>  
> They all agree that diff(integrate(3*x^2*sqrt(1-1/x^2),x),x) gives the 
> original form back, but not directly.  You have to simplify to get 
> everything to cancel out to 0.  I don?t know why pw.mac returns an 
> answer with %i in it.  Is that a bug?
>  
> Rich
>  
Hi Rich,
The function is a multivalued function defined on the complex plane 
except at 0 , 1 and -1.
So on the real line, depending on how the integral is computed, the 
answer is defined only up to an additive constant on each of the 
intervals ]-inf,-1[ , ]-1,0[ , ]0,1[ , ]1,inf[. The answer with pw.mac 
just adds %i, this is ok, it could even be worse : adding  %i + 
5*%i*signum(1-x) - (3+2*%i)*signum(1+x)  is also a correct result.
So I don't know either why pw.mac adds %i, but I would consider it as a 
feature, not a bug.

Eric
>  
>  
> (%i25) kill(all);
> (out0) done
> (%i1) 3*x^2*sqrt(1-1/x^2);
> (out1) 3*sqrt(1-1/x^2)*x^2
> (%i2) integrate(%,x);
> (out2) (1-1/x^2)^(3/2)*x^3
> (%i3) diff(%,x);
> (out3) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2)
> (%i4) radcan(%-(out1));
> (out4) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x))
> (%i5) radcan(%);
> (out5) 0
>  
> (%i6) kill(all);
> (out0) done
> (%i1) load(pw);
> (out1) "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/pw.mac"
> (%i2) 3*x^2*sqrt(1-1/x^2);
> (out2) 3*sqrt(1-1/x^2)*x^2
> (%i3) pwint(%,x);
> (out3) 3*(((x-1)*(x+1))^(3/2)/3+%i/3)*signum(x)
> (%i4) diff(%,x);
> (out4) 3*x*sqrt((x-1)*(x+1))*signum(x)
> (%i5) radcan(%-(out2));
> (out5) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x)
> (%i6) radcan(%);
> (out6) sqrt(x-1)*sqrt(x+1)*(3*x*signum(x)*abs(x)-3*x^2)/abs(x)
> (%i7) signum2abs(%);
> (out7) 0
>  
> (%i8) kill(all);
> (out0) done
> (%i1) load(abs_integrate);
> (out1) 
> "C:/Maxima-5.22.1/share/maxima/5.22.1/share/contrib/integration/abs_integrate.mac"
> (%i2) 3*x^2*sqrt(1-1/x^2);
> (out2) 3*sqrt(1-1/x^2)*x^2
> (%i3) integrate(%,x);
> (out3) (1-1/x^2)^(3/2)*x^3
> (%i4) diff(%,x);
> (out4) 3*(1-1/x^2)^(3/2)*x^2+3*sqrt(1-1/x^2)
> (%i5) radcan(%-(out2));
> (out5) -sqrt(x-1)*sqrt(x+1)*(-3*x^4+x^2*(3*x^2-3)+3*x^2)/(x^2*abs(x))
> (%i6) radcan(%);
> (out6) 0
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>