You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A definite integral where ln's argument is negative drops i pi: integral(ln(x), x, -2, -1) is 2 ln(2) - 1 #2715
On master (409d688), a definite integral over an interval where ln's argument is negative is answered as if it were ln of the absolute value, so the imaginary part is dropped and sometimes the real part is wrong too. Master's own eval gives ln(-2) = ln(2) + i pi, and sqrt and arcsin past their branch points keep their complex values in the same integrals. True values from mpmath quad.
simplify(integral(…))
master
true value
ln(x), x, -2, -1
2 ln(2) - 1
0.3862943611 + 3.1415926536i
ln(x)^2, x, -2, -1
2 + 2 ln(2)^2 - 4 ln(2) = 0.1883
-9.6812870955 + 2.4271590540i
ln(x - 3), x, 0, 1
real
real part + i pi
artanh(x), x, 2, 3
real
real part + i pi/2
artanh(ln(x)), x, -1, 1
0
-0.7160861135 + 1.8734960029i
abs(ln(x)), x, -1, 1
0
4.4092318191
abs(ln(x - 1/2)), x, -pi, pi
-1.1405 (negative, for an abs)
13.9351086734
abs(ln(x)) / sqrt(x), x, -pi, pi
0
nonzero
Others: x ln(x), ln(x)/x, ln(1 - x) on [0, 2 pi], ln(x) abs(x), 1/sqrt(x) * sgn(ln(x)) on [-pi, pi] (right on [0, pi]). Perhaps ln(u) → ln|u| from #2611, which is right for the antiderivative of 1/u, applied wherever ln appears in an antiderivative. 25 rows of a definite-integral sweep after #2705.
Activity