how to find a complex integral when the singular point is on the given curve how to evaluate ∮1/(z-2) dz around the square with vertices  2±2i ,-2±2i
the function is not analytic on z=2.but z=2 is on the given curve.so that can't apply cauchy,s integral formula.how can i do this?
 A: As Ted Shifrin mentions, the integral does not make sense. One could try to make sense of the integral by making the contour take a semi-circular detour around $2$, and taking a limit as the radius of the arc goes to $0$, but this picture is not very interesting: if the pole is inside, you would get $2\pi i$ from Cauchy's integral theorem (depending on the orientation, you might get its negative). If the pole is outside the contour, you would get $0$ also from Cauchy's theorem (if a function is analytic on a simply connected domain, the integral of that function over a simple closed curve in the domain gets you zero).
A: The original problem is:
\begin{equation}\label{original}\tag{1}
  \oint\limits_{\Gamma}\frac{1}{z-2}\,\mathrm{d}z
\end{equation}
Where $\Gamma$ is the following contour:

From the figure we see that: $\Gamma = \Gamma_1 + \Gamma_2 + \Gamma_3 + \Gamma_4$. And the contour orientation is the standard one: counterclockwise.
As stated before, strictly speaking, there is no solution to this problem.
The fact that the pole lies on $\Gamma$, stops us from modifying it so that the pole is outside.
But let's pretend nothing stops us to modify $\Gamma$ to calculate the integral.
So we modify $\Gamma$ as follows:

Where $\Gamma_\epsilon = L_1 + C_\epsilon + L_2 + L_3 + L_4 + L_5$, the and $C_\epsilon$ is the half circle with radius $\epsilon$ and center $z=2$.
In this case, the contour integral over $\Gamma_\epsilon$ is zero:
\begin{equation}\tag{2}\label{2}
  \oint\limits_{\Gamma_\epsilon}\frac{1}{z-2}\,\mathrm{d}z = 0
\end{equation}
But let's take a closer look using the segments of $\Gamma_\epsilon$ and letting $\epsilon\rightarrow0$
\begin{eqnarray}\label{modified_expanded}
  \lim_{\epsilon\rightarrow0}
  \oint\limits_{\Gamma_\epsilon}\frac{1}{z-2}\,\mathrm{d}z 
   &=&
  \lim_{\epsilon\rightarrow0} 
  \left(\int\limits_{L_1} + \int\limits_{L_2} + \int\limits_{L_3} 
  +\int\limits_{L_4} + \int\limits_{L_5} 
  +\int\limits_{C_\epsilon}\right)\frac{1}{z-2}\,\mathrm{d}z\\
  &=& \oint\limits_{\Gamma}\frac{1}{z-2}\,\mathrm{d}z + 
      \lim_{\epsilon\rightarrow0}\int\limits_{C_\epsilon}\frac{1}{z-2}\,\mathrm{d}z = 0 \tag{3}\label{3}
\end{eqnarray}
We now parameterize $C_\epsilon : {z = 2 + \epsilon\,e^{i\theta}}$  with $\theta \in [3\pi/2,\pi/2]$, and insert in \ref{3}:
\begin{eqnarray}
 \oint\limits_{\Gamma}\frac{1}{z-2}\,\mathrm{d}z 
  &=& 
 -\lim_{\epsilon\rightarrow0}\int\limits_{C_\epsilon}\frac{1}{z-2}\,\mathrm{d}z
 \\
 &=&-\lim_{\epsilon\rightarrow0}\int\limits_{3\pi/2}^{\pi/2}\frac{i\epsilon e^{i\theta}}{\epsilon e^{i\theta}}\,\mathrm{d}\theta\nonumber\\
  &=& -i
  \int\limits_{3\pi/2}^{\pi/2}\,\mathrm{d}\theta\nonumber\\
  &=& -i(\pi/2 - 3\pi/2)\\
  &=& i\pi
\end{eqnarray}
So, if we allow $\Gamma$ to be modified we have the result:
\begin{equation}\label{4}\tag{4}
 \oint\limits_{\Gamma}\frac{1}{z-2}\,\mathrm{d}z = i\pi
\end{equation}
This makes completely geometric sense because if the pole were inside $\Gamma$, e.g. $\oint\limits_{\Gamma}\frac{1}{z-1}\mathrm{d}\,z$ the result would be $2i\pi$, i.e. if $\Gamma$ encloses totally (half) the pole the result is $2i\pi$ ($i\pi$).
If $\Gamma$ were the circle with radius 2, this would still hold, as the tangent at $z=2$ would still subtend an angle of $\pi$.
On the other hand, if $\Gamma$ were, for example, an equilateral triangle, with one corner at $z=2$, the result would be $i\pi/3$.
Finally, using $C_\epsilon$ "the other way round", would give the same result.
Here Cauchy's integral theorem and the "the other way round integral" would give $2i\pi - i\pi = i\pi$ which is equal to \ref{4}
A: This is the situation where you can apply the concept Cauchy Principal Value.
Cauchy Principal Value
