Ah I see, thanks. As you indicate, correcting I(2.3) - I(2.1) (where I(x) is the indefinite integral returned by Wolfram|Alpha) for the discontinuity ΔI = I(lim x-> 2.2+) - I(lim x-> 2.2-) across the branch cut at x=x'≡2.2,
⎛ ⎛ f+x′⎞ ⎞
ΔI = (ΔLi₂) + log(f+x′)(Δlog) = 2πi ⎜log⎜-────⎟ - log(f+x′)⎟ = -4.9348 - 11.4868 i
⎝ ⎝ a-f ⎠ ⎠
- the
Li₂ argument -(f+x)/(a-f) passes from the lower half to the upper half plane, so the discont in Li₂ is +2 π i * log(-(f+x')/(a-f))
- the log argument (a+x)/(a-f) passes from the upper half to the lower half plane, so the discont in log is
-2πi
- [evaluation using Wolfram|Alpha for reference][1]
yields I(2.3) - I(2.1) - ΔI = 0.0937 + 0.0475 i, which agrees with the definite integral reported by Wolfram|Alpha.
I was interested to see whether Wolfram can automatically apply such branch cut crossing corrections for definite integrals. The example above suggests it can, but Wolfram could be falling back on numerical integration to do the definite integral. So, I tried an integral with the same form but with parameters
a=1.2-3.4e-7*i
f=5.6-7.8*i
from x=-1.3 to x=-1.1 . It should be problematic for numerical integrators because the denominator passes near 0 at x=-1.2.
Wolfram|Alpha [reports][2] the definite integral to be 3.22989 + 6.8354 * i. But, if instead the indefinite integral I(x) is used with care taken to correct for the branch cut crossing at x=Im(a*conj(f))/Im(f-a)=-1.19999980821..., the result is inconsistently [given][3] as 3.33223 + 6.90663 * i. The results from 1.) Wolfram|Alpha definite integration and from 2.) I(x) with a branch cut crossing correction converge if a is changed to a=1.2-3.4e-2*i, as shown [here][4] and [here][5] (the branch cut crossing is at x=-1.180736544... in this case). This can be attributed to the near zero in the denominator at x=-1.2 being less severe and so less problematic for numerical integrators than for a=1.2-3.4e-7*i .
From this, I conclude that
Wolfram|Alpha at least sometimes uses numerical integration to evaluate definite integrals with the form
x₂
⌠ ln(x+f)
⎮ ─────── dx
⌡ x+a
x₁
Doing analytical integration using the indefinite integral I(x) would be superior, but this would require that log and Li₂ be monitored for branch cuts. I wonder why Wolfram|Alpha doesn't take this approach. Maybe it would be hard to incorporate in a systematic way into the general analytical integration algorithm?