Is it possible to apply Cauchy's residue theorem to a piecewise holomorphic function? Say for example I have the complex function given by
\begin{gather} f(z) = \begin{cases} A/z & 0 < \theta < \pi/3 \\ B/z & \pi/3 < \theta < \pi \\ 0 & \pi < \theta < 2\pi \end{cases} \end{gather}
where $A$ and $B$ are constants either real or complex. What is the contour integral of $f$ around the unit circle, that is
\begin{gather} \oint_{z = 1} f dz = \hspace{1mm}? \end{gather}
If you could refer me to any references regarding this topic that would also be helpful.
We can integrate this by hand to see how far we would have gotten with Cauchy's integral formula (or residue theorem...).
Take the curve $\gamma: [0,2\pi] \to \mathbb{C}, t \mapsto e^{it}$, then
$$\int_\gamma f dz = \int_0^{2\pi} \gamma'(t) f(\gamma(t)) dt = \int_0^{\pi/3} i e^{it} \frac{A}{e^{it}} dt + \int_{\pi/3}^{\pi} i e^{it} \frac{B}{e^{it}} dt = A i\pi/3 + 2B i\pi/3 i.$$
Since we have some kind of symmetry here, we can see the following: Even though Cauchy's integral formula by itself does not work here, since it only works for a holomorphic function, the integral around a part of the circle with angles $[a \pi,b \pi]$ is given by $\frac{b-a}{2}$ times the usual Cuachy formula for the integral around the whole circle. Beware that this need not be true for other paths like ellipsis where the symmetry cannot be used. But this is very specific to your situation and you see that an explicit calculation is even shorter.