The problem: I am integrating complex logarithms over an angle $\phi$ over $[0,2\pi]$. It is quite complex (pun not intended) and I called Mathematica in to aid me. I am calculating an energy of a system (which must be real-valued) and getting a complex result.
The integration (done by Mathematica, which formally chooses the logarithm's branch cut as $]-\infty,0]$) yields
$2\pi (i \pi + 3 \ln{(-r)})$
With that branch cut, $\ln{(-r)} = \ln{|r|} + i\pi, (r>0)$, which results in a remaining imaginary term. The question I have is: is it allowed to "re-choose" the logarithms branch cut when evaluating the seemingly independent problem of evaluating the logarithm of a negative number, just so, that instead of a imaginary $i\pi$, I get $-i\pi/3$, nicely cancelling with the other term in the expression? In other words: is the integration independent of the choice of the branch cut in the sense that the branch cut can be changed afterwards?
Alternatively, how would I go about calculating the integral with another branch cut (the one I want), so I can see if the "better" branch cut gives a real result?
Thanks!
UPDATE: Here's the integrand itself:
$\int_\xi^R \rho d\rho \int_0^{2\pi} d\phi \frac{1}{\rho^2} \frac{4\rho^2+r^2-4r\rho \cos{\phi}}{\rho^2 +r^2-2r\rho \cos{\phi}}$
Splitting in partial fractions and calculating the integral over $\rho$ gives you
$\int_0^{2\pi} d\phi \left[ \ln{\left|\frac{R}{\xi}\right|} + \frac{2e^{2i\phi}-1}{e^{2i\phi}-1} \left( \ln{(R-r e^{i\phi})}-\ln{(\xi-r e^{i\phi})} \right) + \frac{e^{2i\phi}-2}{e^{2i\phi}-1} \left( \ln{(R-r e^{-i\phi})}-\ln{(\xi-re^{-i\phi})} \right) \right]$
This last one evaluates to the above complex expression after a call to Integrate[...,{$\phi$,0,2$\pi$}]
in Mathematica, if I make the physical assumption that $\xi << r << R$.