cas complex tests



On 11/11/2010 7:33 AM, Barton Willis wrote:
> How many users will be satisfied with:
>
>   (%i1) integrate(sqrt((x^2-2*x+1)/x),x,0,1);
>   (%o1) -4/3
>
>   (%i2) integrate(sqrt(x-2+1/x),x,0,1);
>   (%o2) 4/3
>
> --Barton
>
I'm not sure that this has to do with integration.

sqrt((x^2-2*x+1)/x)

is simplified  to  sqrt(1/x) * sqrt(x^2-2*x+1)

which is, in general, false.

Proof.  Take that "simplified" version and evaluate at %i and you get  
-sqrt(2)*%i.

The unsimplified expression can be evaluated at %i  by first evaluating 
the "radicand"
to yield -2.   taking the sqrt give sqrt(2)*%i.

The signs differ, in case you didn't notice.

Just to check if this is something introduced by Maxima hackers:
This same "feature" appears in Macsyma 2.4.0, so no, it's been around
for a while.

RJF