Maxima's log is inconsistent with Maxima's plog and with itself?

只谈情不闲聊 提交于 2020-08-26 13:44:26

问题


What is the error with my thinking?

Sometimes imagpart(log(-%i)) is negative:

(%i1641) imagpart(log(-%i));
                                       %pi
(%o1641)                             - ---
                                        2

But this shows the imaginary part of log ranging from 0 to 2*pi:

wxplot2d(imagpart(log(-1/exp(%i*2*%pi*x))), [x, -1, +1]);

image here. Are the results of Maxima's log() predictable without studying the source code, and if so, how?

Edited to document additional bizarre Maxima behavior. Compare the ranges between these two:

wxplot2d(imagpart(log(+exp(%i*2*%pi*x))), [x, -1, +1]);
wxplot2d(imagpart(log(-exp(%i*2*%pi*x))), [x, -1, +1]);

What's the secret to predicting Maxima's results?

Edited to add: Despite the extensive replies about log being "multivalued", the same behavior is exhibited plog, proving log's "multivalued" nature to be irrelevant.


回答1:


imagpart(log(a+b*%i)) is immediately converted to atan2(b,a), as you can easily confirm.

Of course there are other values for the mathematical log() in the complex plane, but what matters here is imagpart choses one, and the plot programs plot it. imagpart(log(-x)) is atan(0,x)+ %pi/2, presumably because log(-x)= log(x)+log(-1), etc.

The dangers of using an arbitrarily chosen branch of a function can be illustrated without using complex numbers and log. All you need is square-root. If you (or your computer system) insist that sqrt(9) is 3, and never -3, you are already courting proofs of false statements.



来源:https://stackoverflow.com/questions/63539603/maximas-log-is-inconsistent-with-maximas-plog-and-with-itself

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!