"Unexpected behavior of log() in complex plane"



> This is consistent with somehow ignoring the assume(w<0).

Right.

>> Well, the point is that there is supposed to be a well-defined branch
>> cut for such functions, and almost universally this is the negative
>> real axis (see the post on ask.sagemath.org for Mathematica's
>> computation).

Talon said:

This is a point where i disagree (and probably prof Fateman also). This branch
cut is completely conventional. The only intrinsic datum is that there is a
singularity at 0.  Same as for the sqrt(x), which people say has a branch cut
for x<0. But then what about sqrt((x+1)*(x-1)*(x+2)*(x-2)) for example
(related to elliptic functions) or more complicated. What if i replace the
roots 1, 2, etc. by 3+4*I etc. In what way are you going to say there are
"canonical cuts"?  For a sufficiently complex expression you will have hard
time to understand things in terms of cuts, and you will be confronted to the
Riemann surface which is the true object here.

> I think that anyone who has a serious interest in functions of a single
> complex variable and such manipulations as integration is aware that branch
> cuts can be moved as a matter of convenience in computations.
> I certainly would not refer to whatever Mathematica does as definitive in
> this matter.

Yes, of course you are both right on this.  I'm not suggesting
anything of the nature (that is, that Mma is privileged in this
choice), and I used 'well-defined' in the sense that people expect the
IEEE versions, which I've heard (no guarantees!) are the 'usual' ones,
and that if the software decides on a branch to start, one should
stick with it as possible (i.e. as long as you don't go *past* the
cut, which isn't the case here).

But I hope you agree that it IS at least *confusing* that one thinks
one has picked a branch with the assume(w<0) for w real.


> in the complex context, log(1) is n*pi*I ?for any integer n.
> (complex) log is not a function but a "multivalued function". ?Any treatment
> that tries to pick a single value is essentially doomed in some
> circumstances. ?Sqrt() is similarly going to screw up if you replace

Yes.

> Hm, in the future you would save us some time by indicating which Maxima was
> used in Sage.

Sorry, I should have been clear from the start that I wasn't using the
one in Sage for the computations.

> There is a function in Maxima called "plog".
>
> limit(plog(w+%i*eps),eps,0);
> ?gives ?log(-w)+%i *%pi
>
>
> note that with the assumption on w, plog(w) alone is
> log(-w) +%i*%pi.
>
> The argument ?of log in this expression is positive since w<0....

Nice.  Probably this is what the poster on our site is actually
looking for.  And I should have remembered the discussion of plog
before.  See http://permalink.gmane.org/gmane.comp.mathematics.maxima.general/32433
for a relevant comment from Barton.

Anyway, this all is what I hoped would come from it; Maxima wants the
most general answer, as usual, even with assumptions, but there *is* a
way to do what is "expected" by the poster on a single-valued branch.
 Thanks.