I am having trouble calculating the following integral:
$\oint_C \frac{\bar{z}}{z-Z} dz$
Here, Z is a complex constant and C is the contour of a square of side $2a$ centered at the origin.
I assumed that the problem is that $\bar{z}$ is not analytic inside C and tried substituting $\bar{z}$ with $-z\pm 2a$ or $z\pm 2a i$ for each of the corresponding straight segments of the contour. The problem is that I get unexpected discontinuities at $Re(Z)=\pm a$ and at $Im(Z)=\pm a$.
Can someone give me a clue for solving this?
I would simply take a straightforward approach and compute the integral explicitly.
$$\oint_C dz \frac{\bar{z}}{z-Z} = \int_{-a}^a dx \frac{x+i a}{x-i a -Z}+i \int_{-a}^a dy \frac{a-i y}{a+i y-Z}\\- \int_{-a}^a dx \frac{x-i a}{x+i a -Z}-i \int_{-a}^a dy \frac{-a-i y}{-a+i y-Z}$$