Bug introduced in 9.0 or earlier and fixed in 10.4.0
I just discovered that Integrate
with simple poles in its integrand sometimes gives different results depending on number type of its limit (Exact vs Inexact).
(*Approximate upper limit*)
Integrate[1/z, {z, -1 - I, -1 + .5 I}] // N
-0.235002 + 5.03414 I
(*Exact upper limit*)
Integrate[1/z, {z, -1 - I, -1 + 1/2 I}] // N
-0.235002 - 1.24905 I
The second result is the one that everyone would agree with as it properly accounts for crossing the logarithmic cut running along the negative axis.
Two questions:
Is this the correct behavior of
Integrate
? I can't seem to find this behavior mentioned in the documentation.I have a huge Mathematica notebook (containing some 35
Integrate
calls) that is supposed to compute integrals symbolically and/or numerically depending on the type of its limit. e.g. of the form:f[a_,b_] := Integrate[1/z, {z, a, b}]
What would be some quick ways to get around this bug? I noticed
NIntegrate
correctly accounts for the branch cut, but it only works if there's nothing symbolic left.
Integrate[1/z, {z, -1 - I, -1 + t I}] /. t -> {1/2, 0.5}
? $\endgroup$ – J. M. will be back soon♦ Dec 14 '15 at 14:01ConditionalExpression
. After replacing, you getUndefined
for both cases. (btw you can't do your replace-list trick when there is aConditionalExpression
) $\endgroup$ – QuantumDot Dec 14 '15 at 14:08Log
, isn't $\int_a^b \frac{dx}{x} = \ln(b/a)$ always true for any $a, b \in \mathbb{C}$? What's the deal with all theCondintionalExpressions
that it spits out? $\endgroup$ – QuantumDot Jan 4 '16 at 17:29Integrate
is not going to figure out that that always corrects forLog[b]-Log[a]
. $\endgroup$ – Daniel Lichtblau Jan 4 '16 at 20:05