# contour integration of logarithm function

I'm new to contour integral involving branch point and stuck on this particular integration. Here is the problem:

$$\int_{\mathcal{C}}\log z\,\mathrm{d}z,$$

where $\mathcal{C}$ is a closed square contour connecting the points $-0.5+i$, $-1.5+i$, $-1.5-i$, $-0.5-i$. The branch cut of $\log z$ is chosen as the positive real axis. As far as I understand, the integrand within the contour is analytic so the result is zero. But Mathematica gives me $-2\pi i$.

Could anybody point it out for me where the problem is?

• @mrf: It is a related problem. I did not know that he won't be able to see it. By the way, I can see it. Aug 3, 2013 at 10:10

• maybe you can help me on an additional problem. Is there a complex version of integration-by-part? I saw someone used it but didn't find it in textbook. I tested integrals $\int_{\mathcal{C}} \frac{\log(x+1)}{x-2}\mathrm{d}x$ and $\int_{\mathcal{C}} \frac{\log(x-2)}{x+1}\mathrm{d}x$, where $\mathcal{C}$ encloses both -1 and 2. But the results do not match. Is it because they are not equal at the first place or I chose the wrong branch cut? Aug 3, 2013 at 14:42