N-th roots of complex numbers?



On 10/2/2013 8:45 AM, John Lapeyre wrote:
>
> > Regardless of what Maxima means when it types out (-1)^(1/6), there is the
> > question of what THE USER MEANS WHEN HE?SHE TYPES IT IN!
> >
> > It turns out to be easier if there is at least one variable name say 
> x in there, because
> > you can attach a meaning as x-> positive infinity.
>
> I'm not exactly sure what you're getting at. I do understand
> the idea that a user is allowed to attach any meaning to
> input and output expressions without any reference to
> any notion of mathematical correctness.(But, maybe that
> has little overlap with your point.)
I have seen a situation in which a human wished to write an expression
with the fewest possible operators. When he needed abs(x)  he wrote it
as   sqrt(x^2).  Some people gave him grief for this.

The limit argument has to do with something like a root of E(x). Which one?
If there is a positive real interpretation of this as x->inf, thereby 
bypassing
all finite singularities, that can be handled consistently.  It is what 
radcan does,
and this is explained, among other places, in my PhD thesis, Essays in
algebraic simplification.  There seem to be a few copies online.

>
> So, there is a question about what the user means
> when he?she types something.
> For instance, suppose I believe log(exp(Q)) should always
> return Q. 
The problem here is that exp(Q)  simplifies so that  exp(Q+2*%pi*%i)
is changed to exp(Q)  before the simplifier for log() ever sees it.

It is difficult to give directions as to how to treat something that are
based on what used to be.  Like giving someone driving directions:
"Turn left at the corner where there used to be an elm tree until they
cut it down."

> But, Maxima, in order to satisfy other users'
> expectations gives me
>
>  log(exp(2*%pi*%i+3+%i)) --> %i+3

I think it does not have to do with expectations, but order of
simplification.
try
subst(Q=2*%pi*%i+3+%i, log(exp(Q)));
>
> (There is probably some flag that changes this.) It
> gives me a principal value. This is not magical, special,
> better, or more correct, than values on other branches.
That's right.
> It's
> a convention so that different components can interact
> and know what to expect.
>
> > For constants, in isolation, the position I take is that
> > a particular item like (-1)^(1/6) is a six-tuple. Unless you know
> > more info about it.
>
> Ok, Let's assume (-1)^(1/6) is a six-tuple. Here is just
> one of the ways in which this makes solve's answer wrong.
>
> (%i1) solve(z^3 = 8*%i,z);
> (%o1) [z = (-1)^(1/6)*sqrt(3)*%i-(-1)^(1/6),
>        z = -(-1)^(1/6)*sqrt(3)*%i-(-1)^(1/6),z = 2*(-1)^(1/6)]
>
> Here I choose just one root of
> (-1)^(1/6), the one given by rectform.
>
> (%i2) rectform((-1)^(1/6));
> (%o2) %i/2+sqrt(3)/2
>
> So one of the solutions to the equation
> is 2 *( %i/2+sqrt(3)/2).

whatever sqrt(3)  means, which could be either or both of 2 values.
>
> The function genroots_from_principal multiplies
> its first argument by each of the 6 roots of
> z^6=1, generating the six solutions represented
> by the last element of the list returned by solve.
I think the fallacy here is that there is no guarantee that the last 
element of the list returned by solve
is a "primitive root"
>
> (%i3) genroots_from_principal(2*(%i/2+sqrt(3)/2), 6);
> (%o3) [%i+sqrt(3),2*%i,%i-sqrt(3),-%i-sqrt(3),-2*%i,sqrt(3)-%i]
>
> Now cube each result.
>
> (%i4) map(lambda([x],ratsimp(x^3)), 
> genroots_from_principal(2*(%i/2+sqrt(3)/2),6));
> (%o4) [8*%i,-8*%i,8*%i,-8*%i,8*%i,-8*%i]
>
> We get three expressions that satisfy z^3=8 and three that do not,
> that is, three wrong answers. If instead we assume that (-1)^(1/6)
> represents any one of a specific set of three of the six roots, then
> solve has listed each of the three solutions exactly once.

Here are some tests you can try.

M: solve(z^3=8*%i,z);
p:  apply("*", M);    /* the product of the roots */
ratsimp(p);   /* gives  z^3=8*%i,  OK */

expand(p);  /* gives z^3= -8*(-1)^(1/6).     OK only if (-1)^(1/6) is 
defined as %i, which it isn't apparently because... */
rectform(%);   /* gives  z^3= -4*%i-4*sqrt(3) */

apply("+",M);  /*  gives 3*z = 0 */

That last example would lead some people to think that the collection of
solutions is wrong because then 3z=0 means z=0  which is false, so some
of the equations must be wrong.
The real explanation is that there are 3 different values for z. Adding them
up should give zero.   But adding 3 different z's does not give 3*z.

Sorry I'm not giving you a solution to all these issues in the form of
"Oh, there's a bug. here's a patch....".

RJF