# Different answers using different methods

I stumbled upon this integral $$\int_0^{2\pi} \frac{4ie^{i\theta}}{4e^{i\theta}} d\theta$$. Now if if do it using the formula$$\int\frac{f'(x)}{f(x)} dx=ln|f(x)|+C$$ then i have $$=ln|4e^{2\pi i}|-ln|4e^{(0) i}|$$ $$=ln|4|-ln|4|$$ $$=0$$ But if i cancel out $4e^{i\theta}$ then i am left with $\theta$. And the integration results in $$=[\theta]_0^{2\pi}$$ $$=2\pi i$$. I know that there is something wrong . Please help...

• The issue is that logs with complex arguments are very... complex. You should read up on logs in the complex case. Unfortunately, any proper answer to this question will repeat a lecture or two of material in an introductory course on complex analysis. Aug 1, 2017 at 15:06
• @CameronWilliams Can you point out which the correct answer to this is? Aug 1, 2017 at 15:08
• $\ln$ is not defined on $\mathbb{C}$ Aug 1, 2017 at 15:18
• If you intend to use logarithms, I suggest using $$\lim_{a\to0^+,b\to2\pi^-}\int_a^b\dots~\mathrm d\theta$$(also, you are missing the $d\theta$) Aug 1, 2017 at 16:53

You do actually need the complex logarithm for your first approach. Taking the modulus of $f(x)$ in $\ln|f(x)|$ produces the mistake - for complex numbers $z$, we have $\ln(z)' = \frac 1z$, this is what you want to use - no modulus there! However, one has to be careful: The $\ln$ here is the complex logarithm, which is quite tricky on its own.

In order to understand the issues with the complex logarithm correctly, let's take a closer look: Consider the complex number $z = e^{i\theta}$. You might say that $\ln(z) = i\theta$. But now we also have $z = e^{i\theta +2i\pi}$. Now $\ln(z) = i\theta +2i\pi$! You get countably many possibilities for the logarithm. That's why you usually specify which 'option' you pick for the logarithm, that's called a 'branch'. Once you pick a branch, you have to be careful since the branch will have a discontinuity along a line starting from the origin - this is where you 'cut out' you particular branch of the logarithm. See Wikipedia for a detailed discussion of this property.

In order to remedy the first approach in your question, let us specify that $\ln$ is the branch mapping such that for $z\in\mathbb C\setminus\{0\}$ we have $\ln z = \ln|z| + i\arg(z)$, and $\arg(z)\in[0,2\pi)$ (which is a specification we make), and the logarithm of the modulus is just the classical, real logarithm. (Something like that should always be specified before working with a complex logarithm, in order to avoid confusion!)

Then $$\int_0^{2\pi}\frac{ie^{ix}}{e^{ix}} d x = \int_0^{2\pi} (\ln e^{ix})' d x = \int_0^{2\pi} (ix)' d x = i\int_0^{2\pi} 1 d x =2i\pi.$$

In the first step we have used that on $\mathbb C\setminus \mathbb R_0^+$ we have $\ln(z)' = \frac 1z$. Note that in the second step we have used our specification of the logarithm-branch. You could also use another branch, but you have to be careful to choose it in a way that the integration path does not cross the branch cut (i.e. the discontinuity).

• So pretty much adding $2\pi i$ will go on giving me different answers. Interesting. Aug 1, 2017 at 15:34
• You mentioned "branch" , can you be more specific what that means? Also the question i was working on was precisely to evaluate $\int_c\frac{dz}{z-2}$ around the circle |z-2|=4. Does this convey some message on 'branch'? Aug 1, 2017 at 15:35
• I would say this is a slightly different situation: On the one hand, this integral can be evaluated using the residual theorem, on the other hand you may use that the multivalued logarithm is an antiderivative. The height of the jump between two neighboring branches of the logarithm is then the result of integration. Aug 1, 2017 at 15:45
• Which i guess is $2\pi i$ Aug 1, 2017 at 15:47
• In this case, different branches will still give you the same result - the logarithms just differ by a constant, and since it is inside of the derivative, the constant gets lost. Aug 1, 2017 at 16:03

Appearantly you are integrating the following function

$$\int_{\gamma}\frac{1}{z}dz$$

where we have $\gamma$ is a circle with radius equals to 4 and center at the origin . Now this function has no anti derivative in a nbhd of zero because of the branch point.

Another mistake is to assume that the integral equals to zero because the function is analytic on a closed contour which is not the case here. We have a pole at zero. By the residue theorem we have

$$\int_{\gamma}\frac{1}{z}dz = 2\pi i \, \mathrm{Res}(f,0) = 2\pi i$$

Now using parametrization $z = 4e^{i\theta}$

$$\int_{0}^{2\pi}\frac{4ie^{i\theta}}{4e^{i\theta}}dz = 2\pi i$$