I want to expand the function $ f(z) = \frac {z-1}{z^2 -2z -3} $
in $ 0 < |z+1| < 4$
Then I want to use the result to evaluate this integral $ \int_C \frac {z-1}{(z+1)(z-3)} dz $
in $ C : |z+1|=2$
Now I approach this in 2 different ways, by extracting the residue from the expansion or by integrating the whole expansion
Laurent expansion:
$ f(z) = \frac {z-1}{z^2 -2z -3} = \frac {z-1}{(z+1)(z-3)} = (\frac {z-1}{z+1} )(\frac {1}{z-3}) = \frac {z-1}{z+1} (\frac {1}{(z+1)-4}) = \frac {z-1}{z+1} (\frac{-1}{4-(z+1)}) = \frac {1-z}{4(z+1)} \sum_{n=0}^{\infty} (\frac {z+1}{4})^n = \frac {1-z}{4(z+1)} [1 + \frac {z+1}{4} + \frac {(z+1)^2}{16} + \frac {(z+1)^3}{64} + ..... ] = \frac {1-z}{4(z+1)} + \frac {1-z}{16} + \frac{(1-z)(z+1)}{64} + \frac {(1-z)(z+1)^2}{256} + ..... $
Now I use 2 approaches, first one is to take the residue and work out the integral using the residue theorem and the other is to just integrate the whole expansion
Residue theorem approach:
From the expansion, the residue for $ C : |z+1|=2$ is equal to $ \frac{1}{2}$
Then, $\int_C \frac {z-1}{(z+1)(z-3)} dz = 2 \pi i \sum Res = 2 \pi i ( \frac {1}{2}) = \pi i$
Now the second approach:
$\int_C \frac {z-1}{(z+1)(z-3)} dz = \int_C \frac {1-z}{4(z+1)} \sum_{n=0}^{\infty} (\frac {z+1}{4})^n dz$
$ C: |z+1| = 2$ then, $ z+ 1 = 2 e^{i \theta}$ , $ dz = 2 i z d \theta$
$ \int_C \frac {z-1}{(z+1)(z-3)} dz = \int_C \frac {1-z}{4(z+1)} + \frac {1-z}{16} + \frac{(1-z)(z+1)}{64} + \frac {(1-z)(z+1)^2}{256} + ..... dz = 2i \int_0^{2 \pi} \frac{1-e^{i \theta}}{4} + \frac {(1-e^{i \theta})(e^{i \theta})}{8} + \frac {(1-e^{i \theta})(e^{2i \theta})}{16} + \frac {(1-e^{i \theta})(e^{3i \theta})}{32} + .... d \theta$
= $2i [ \frac {1}{4} \theta - \frac {e^{i \theta}}{4i} + \frac {e^{i \theta}}{8i} - \frac {e^{2i \theta}}{16i} + \frac {e^{2i \theta}}{32i} - \frac {e^{3i \theta}}{48i} + \frac {e^{3i \theta}}{98i} - \frac {e^{4i \theta}}{128i} + ..... ]$ as $ \theta $ goes from $0$ to $ 2 \pi$
Finally $ = 2i [ \frac { \pi}{2} - \frac {1}{8i} - \frac {1}{32i} - ... ] = \pi i - \frac {1}{4} - \frac {1}{16} - ....$
Now the problem is that with the residue theorem I got the answer $ \pi i $ , but by integrating the whole expansion, keeping in mind that the radius is $2$ yields $ \pi i $ minus a bunch of terms, is there a reason why?
$$f(z)=\frac{z-1}{(z+1)(z-3)}=\frac{(z+1)-2}{(z+1)(z+1-4)}$$Let $u=z+1$.
$$f(u)=\frac1u(u-2)\frac1{u-4}$$For $|u|\in(0,4)$, we can expand the third term
$$\begin{align}f(u)&=\frac1u(2-u)\frac14\sum_{n=0}^\infty \left(\frac u4\right)^n\\&=\frac14\sum_{n=0}^\infty\left(\frac{2u^{n-1}}{4^n}-\frac{u^n}{4^n}\right)\\&=\frac1{2u}+\frac14\sum_{n=0}^\infty\left(-\frac{2u^n}{4^{n+1}}\right)\end{align}$$
This means that the Laurent series for $f(z) $ is $$f(z)=\frac1{2(z+1)}+\frac14\sum_{n=0}^\infty\left(-\frac{2(z+1)^n}{4^{n+1}}\right)=\frac{1}{2(z+1)}-\frac18-\frac{(z+1)}{32}-\frac{(z+1)^2}{512}-\cdots$$
Now if you integrate the whole expansion, you should get $\pi i$ again.