# 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. – Mhenni Benghorbal Aug 3 '13 at 10:10

## 1 Answer

You are correct. Mathematica probably uses another branch (and treats the integral as an improper one).

• Thanks @mrf. So do you mean this integral depends on which branch is chosen? Then it is indefinite, is it? – user88809 Aug 3 '13 at 10:00
• Taking the principal branch, the cut goes through the contour, so it's not a "standard" i tegral. You had specified the branch though (which you always have to do when dealing with functions having branch points). Once ypu have chosen the branch, the integral has a value. Changing the branch, changes the function and possible the value pf the integral. – mrf Aug 3 '13 at 10:03
• OK, I tried to select the negative real axis as branch cut and did obtain the same result as Mathematica did. Thanks again. – user88809 Aug 3 '13 at 14:17
• 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? – user88809 Aug 3 '13 at 14:42
• @user88809 It's better if you ask a new question about that instead. – mrf Aug 3 '13 at 22:02