sqrt, abs, radcan. Re: maxima bug



I just thought I'd throw in my two cents.

Some would say that polar form is a more "natural" way to treat powers and
roots:
x+%i*y --> r*exp(%i*theta) --> r*exp(%i*theta + 2*n*%i*%pi),
where r = positive value of sqrt(x^2 + y^2), theta = atan2(x,y), and n is
an integer.

Then taking a root produces multiple answers:
(  r*exp(%i*theta + 2*n*%i*%pi) )^(z) = r^(z) * exp(%i*theta*z +
2*n*%i*%pi*z),
where r^z only has to worry about the "simple case" returning a real
positive value. Then the trick is to run through as many integers of n as
we care about. If z is rational number, then an finite set of n covers all
possible outputs. I believe (although I ask someone fact check this), if z
is irrational, then there are infinitely many answers.

Here is a less symbolic example (assuming sqrt returns the positive value):
( 1/sqrt(2) + %i/sqrt(2) )^(1/3) =
( 1 * exp( %i*pi/4 + 2*%i*%pi*n ) )^(1/3) =
( 1 * exp( %i*pi/12 + 2*%i*%pi*n/3 ) ) =

{
  cos(%pi/12) + %i*sin(%pi/12),
  cos(%pi*9/12) + %i*sin(%pi*9/12),
  cos(%pi*17/12) + %i*sin(%pi*17/12)
}

The moral of my story - the polar form with a factor of +2*n*pi*i reveals
that there are potentially multiple answers to general powers other than
just square root.


On Sat, Mar 17, 2012 at 7:25 AM, Richard Fateman
<fateman at eecs.berkeley.edu>wrote:

> On 3/16/2012 4:06 PM, Rubens Marinho wrote:
>
>> Dear all,
>>
>> radcan do understand assume and do it correctly.
>> consider de code
>>
> 1. The radcan program does not use the assume facility. The simplification
> that is done on the argument to radcan is outside the radcan program.
>
> 2. If you say   assume(z<0)
> then sqrt(z^2) comes out -z.
> This has nothing to do with radcan.
>
> This is a consequence of sqrt(z^2) being simplified to abs(z), and abs(z)
> simplifying to -z.
>
> I think it is an error to simplify sqrt(z^2) to abs(z). To avoid this
> error in
> the case that there are no assumptions on z, set radexpand:false.
>
> Unfortunately this is insufficient protection against mathematical errors
> in Maxima's current setup.   Sqrt(9) is {3,-3}, and if you forget it you
> will get wrong answers sometimes.
>
>
>
>
> ______________________________**_________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/**mailman/listinfo/maxima<http://www.math.utexas.edu/mailman/listinfo/maxima>;
>