# Analytical Solution for the Problem of Point Location in Arbitrary Planar Domains
## 4 Calculation of the Contour Integral
### The Complex Logarithm  
The anti-derivative of the chosen function (8) is the logarithm of a complex number, which, formally, is a multi-valued result. By definition, the logarithm of a complex number \(z\) is the number \(w\) that satisfies the expression \(z=\mathrm{e}^{w}\). After this definition, it is then clear that the logarithm of \(z\), \(\mathrm{Ln}(z)\), is multi-valued; if \(z=r\mathrm{e}^{\mathrm{j}\theta}\), using \(\mathrm{j}=\sqrt{-1}\), and being true that \(\mathrm{re}^{\mathrm{j}\theta}=r\mathrm{e}^{\mathrm{j}(\theta+2\pi)}=\mathrm{ e}^{\mathrm{ln}\,r+\mathrm{j}(\theta+2\pi)}\), the following arises:  
\[\mathrm{Ln}(z)=\ln r+\mathrm{j}(\theta+2k\pi),k=0,\pm 1,\pm 2,\ldots \tag{11}\]  
It must be noted that the logarithm of a complex number is here graphed with a capital letter to stress its multi-valued nature. With multi-valued expressions, it is not possible to establish comparisons or other relational operations without precautions. The meaning of \(\mathrm{Ln}(z)\) depends on the branch where the logarithm is being evaluated, that is, the value of \(k\) in (11). However, the logarithm can be restricted to a single branch, called the principal value, where the imaginary part is unique, hence with only one possible argument, called the principal argument (often designated by the mathematical \(\mathrm{arg}()\) function). The principal value is obtained by making \(k=0\) in (11) resulting in:  
\[\ln(z)=\ln r+\mathrm{j}\arg(z)=\ln r+\mathrm{j}\theta. \tag{12}\]  
When restricted to the principal values, logarithms exhibit some particularities like, for example, \(\ln\left(\mathrm{e}^{-\mathrm{j}\frac{\mathrm{j}}{4}\pi}\right)\) equals \(\frac{3}{4}\pi\)j rather than \(-\frac{5}{4}\pi\)j, and, as well, \(\ln\left(\mathrm{e}^{-\mathrm{j}\pi}\right)=+\pi\mathrm{j}\) and not \(-\pi\mathrm{j}\)! As expected, the restriction of the function output to an interval will certainly cause discontinuity of that function and, indeed, \(\ln(z)\) is not continuous for all points of the non-positive real axis because it is clear that:  
\[ \begin{cases}\lim\limits_{\theta\to 0^{-}}\ln\mathrm{e}^{\mathrm{j}(\pi+ \theta)}=\lim\limits_{\theta\to 0^{+}}\ln\mathrm{e}^{\mathrm{j}(\pi- \theta)}=+\pi\mathrm{j}\\ \lim\limits_{\theta\to 0^{+}}\ln\mathrm{e}^{\mathrm{j}(\pi+\theta)}=-\pi \mathrm{j}\end{cases} . \tag{13}\]  
From the three terms on the right side of (18), the first and the last are always defined for any value of \(\delta\) (for the functions involved in this analysis). So, taking the limit when \(\delta\to 0\) will also force the middle term to be zero because the following holds true for any function \(f(\theta)\):  
\[\lim_{\delta\to 0}\int\limits_{\pi-\delta}^{\pi+\delta}\!\!f(\theta)\,\mathrm{d} \theta=\int\limits_{\pi}^{\pi}f(\theta)\,\mathrm{d}\theta=0. \tag{19}\]  
Therefore, and being \(F(\theta)\) the anti-derivative of \(f(\theta)\), expression (18) can be developed into (20):  
\[ \begin{split}\int\limits_{\pi-\alpha}^{\pi+\beta}\!\!f(\theta)\, \mathrm{d}\theta&=\lim_{\delta\to 0^{+}}\left[F(\theta)\right]_{\pi- \alpha}^{\pi-\delta}+F(\theta)\right]_{\pi+\delta}^{\pi+\beta}\\ &=\lim_{\delta\to 0^{+}}[F(\pi-\delta)-F(\pi-\alpha)+F(\pi+ \beta)-F(\pi+\delta)]\\ &=F(\pi+\beta)-F(\pi-\alpha)+\lim_{\delta\to 0^{+}}[F(\pi-\delta)-F( \pi+\delta)].\end{split}  \tag{20}\]  
Expression (20) shows that, when the integration path crosses the negative horizontal axis, the line integral of a function \(f\), has an additional term of \(\lim_{\delta\to 0^{+}}[F(\pi-\delta)-F(\pi+\delta)]\), whose concrete value depends obviously on the continuity of \(F(\theta)\). If \(F(\theta)\) happens to be continuous on the value \(\theta=\pi\), then that additional term is null, and we fall back to the fundamental theorem (9).