N-th roots of complex numbers?



>
>   From: John Lapeyre <lapeyre.math122a at gmail.com>
>   >  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.)
>
>   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. But, Maxima, in order to satisfy other users'
>   expectations gives me
>
>     log(exp(2*%pi*%i+3+%i)) --> %i+3
>
>   (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. 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).
>
>   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.
>
>   (%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's my 2p.

The issue stems from the substitution

%i^(1/3) <-- (-1)^(1/6)     (*)

A polynomical p with coefficients in Q[%i] has a conjugate p' obtained
by moving from one of the two isomorphic extensions of Q using the
substitution %i <-- -%i. The substitution (*) means that you, John,
will find the roots of pp', not just p. And that is what happens.

However, if we take the view that the -1 in all the 6-th roots are the
square of the same algebraic integer, then we remain in one of the two
conjugate fields (and its extension) and get only 3 solutions.

Maxima can do that job. Just replace %i with an algebraic integer
satisfying the same characteristic equation:

(%i1) rat(?^2);

(%o1) ?^2
(%i2) tellrat(%+1);

(%o2) [?^2+1]
(%i3) solve(x^3=?,x);

(%o3) [x = (sqrt(3)*%i-1)*?^(1/3)/2,x = -(sqrt(3)*%i+1)*?^(1/3)/2,x
                                                                      = ?
                                                                      ^(1/3)]
(%i4) subst('%i=?,%);

(%o4) [x = ?^(1/3)*(sqrt(3)*?-1)/2,x = -?^(1/3)*(sqrt(3)*?+1)/2,x
                                                                      = ?
                                                                      ^(1/3)]
(%i5) map(lambda([u],ratsimp(rhs(u)^3)),%);

(%o5) [?,?,?]

I am inclined to say that (*) is a bug, that Maxima should not do that
substitution, but...

As a user, I am inclined to use tellrat when I can. This has been less
polluted by users' (generally conflicting and often muddled)
expectations about how things should behave. The 'simplification' (*)
is one example.

Leo