Contour integral of $\log(z)/(z+a)^2$ around z=0 My question is primarily conceptual: Consider a function $f(z)$ which has a branch cut from $z=0$ to $z=\infty$ along the positive Re(z) axis. If I wish to integrate it along a small, clockwise circle around $z=0$, what care must I take when integrating over the branch cut? I've been trying to find references and failing, so if you have a link to some notes or a book reference, I'd appreciate it. If instead, you could give me a hint on the following example, I would appreciate that, too. 
In particular, I am trying to compute the contour integral $\oint_{\varepsilon} \frac{\log(z)}{(z+a)^2} dz$ where $a \in \mathbb{C}$, and $\varepsilon$ is the small, counter-clockwise circle around $z=0$. I have tried the following:


*

*Parametrizing: $z=\rho e^{i \theta}$, $dz = iz d\theta$, so that$^{\dagger}$ $\oint_{\varepsilon} \frac{\log(z)}{(z-a)} dz = i \int_0^{2 \pi} \frac{\log \rho + i\theta}{(\rho e^{i\theta}+a)^2}\rho e^{i \theta} d\theta=g(\theta)|_{0}^{2\pi}$ 


Ultimately, I want to take the limit $\rho \rightarrow 0$, but this causes $\log \rho$ to diverge.


*Would this work?: $\int \frac{\log(z)}{(z+a)^2} dz = \frac{z \log(z) - (a+z)\log(a+z)}{a(a+z)}+c$, so is the following true? $\oint_{\varepsilon} \frac{\log(z)}{(z+a)^2} dz = \left[ \frac{z \log(z) - (a+z)\log(a+z)}{a(a+z)} \right]_{\theta=0}^{\theta=2 \pi} = 2 \pi i \frac{\rho}{a(a+\rho)}$



$\dagger$ :   $g(\theta)|_0^{2\pi} = \frac{i \rho}{a} \left[ \log \rho \left( i \log\left( 1 + \frac{z}{a} \right) + \theta - \frac{i}{\left( 1 + \frac{z}{a} \right)} \right) + i \left(Li_2\left(-\frac{z}{a} \right) + \frac{\theta}{2} \left(i\theta-2+\frac{2}{\left( 1 + \frac{z}{a} \right)}\right) - (i+\theta)\log\left( 1 + \frac{z}{a} \right) \right) \right]_0^{2\pi}$ 
$g(\theta)|_0^{2\pi}= \frac{2 \pi i \rho}{a}\left[ \log \rho + \frac{1}{2}\left(2 \pi + 2i - \frac{2i}{ 1 + \frac{\rho}{a} } \right) + i \log \left( 1 + \frac{\rho}{a} \right) \right]$
where $z(\theta) = \rho e^{i \theta}$ and $Li_n(z)$ is the polylogarithm.
 A: You were on the right track.  The integral around the circle of radius $\rho$ and centered at $z=0$ can be expressed as
$$\oint_{|z|=\rho}\frac{\log z}{(z+a)^2}\,dz=\int_0^{2\pi}\frac{\log \rho +i\theta}{(\rho e^{i\theta}+a)^2}\,\rho d\theta$$
Now, recall that we have $\lim_{\rho \to 0}\rho \log \rho=0$.  Therefore, for $a\ne0$, the limit of the integral of interest is zero.
A: I think what you did is fine, up to the nonelementary integral you got.
When you set up such an integral you have to state clearly what you mean by $\log z$ when $z\in\Omega:={\mathbb C}\setminus{\mathbb R}_{\geq0}$. It seems that you have the following in mind: When $z=\rho e^{i\theta}$ with $0<\theta<2\pi$ then $\log z:=\log\rho +i\theta$.
(i) Parametrizing $\gamma:=\partial D_\rho$ you obtain
$$\int_\gamma{\log z\over(a+z)^2}\>dz=i\int_0^{2\pi}{\log\rho +i\theta \over(a+\rho e^{i\theta})^2}\rho e^{i\theta}\>d\theta\ .$$
This integral only seems to be nonelementary (see below), but in the limit $\rho\to0+$ you obtain $0$ anyway, since $\lim_{\rho\to0+}\rho\log\rho=0$.
(ii) The given integrand ${\log z\over(a+z)^2}$ has a primitive in $\Omega$, namely the function
$$f(z):={1\over a}\left({z\over a+z}\log z-\log(a+z)\right)\ .$$
Taking limits at the "ends" of $\gamma$ caused by the cut we therefore get
$$\int_\gamma{\log z\over(a+z)^2}\>dz=\lim_{\theta\to 2\pi-} f\bigl(\rho e^{i\theta}\bigr)-\lim_{\theta\to 0+} f\bigl(\rho e^{i\theta}\bigr)={2\pi i\>\rho\over a(a+\rho)}\ .$$
Note that the $\log(a+z)$ term gives no contribution as long as $\rho<|a|$.
