I am working on the Exponential Integrals and try to implement carefully the
characteristics of the functions including the transformations to other
representations. Because we have branch cuts for (-inf,0) often expressions like
1/2*(log(z)-log(1/z))-log(z)
are involed in the transformations of the Exponential Integrals. The above
expression simplifies to -%pi*%i for z on the branch cut (-inf,0) and is for any
other value zero. Therefore with the help of the above expression we can give
the transformations in a closed symbolically form. If we neglect this factor the
transformations get wrong for negative real values.
Numerically, Maxima gives correct results:
(%i44) rectform(1/2*(log(2-%i)-log(1/(2-%i)))-log(2-%i)),numer;
(%o44) 0.0
(%i45) rectform(1/2*(log(2+%i)-log(1/(2+%i)))-log(2+%i)),numer;
(%o45) 0.0
(%i46) rectform(1/2*(log(-2+%i)-log(1/(-2+%i)))-log(-2+%i)),numer;
(%o46) 0.0
(%i47) rectform(1/2*(log(-2-%i)-log(1/(-2-%i)))-log(-2-%i)),numer;
(%o47) 0.0
At last the correct numerical result for a negative real value:
(%i48) rectform(1/2*(log(-2)-log(1/(-2)))-log(-2)),numer;
(%o48) -3.141592653589793*%i
Unfortunately, I have found the following wrong simplification:
(%i49) 1/2*(log(z)-log(1/z))-log(z);
(%o49) 0
The reason is that Maxima simplifies:
(%i50) log(1/z);
(%o50) -log(z)
But that is wrong for z an element of (-inf,0). A complete and correct answer
would be
log(1/z) = 2 * %i * %pi * (arg(z) / (2 * %pi) + 1/2 ) - log(z)
So I get correct numerical results, but wrong symbolically results in the code
of the Exponential Integrals. I am searching for a workaround.
Should we report this as a bug?
Dieter Kaiser