I'm learning about the theory of integration in the complex plane and need to verify my work to this problem since my textbook is using a different method of resolution :
$ $
Evaluate the line integral $$ \int_{\gamma} (z + \frac {1}{z - 1}) \, dz $$ where $ \gamma $ is the perimeter of the parallelogram with vertices $ i, -i, 2 + i, 2 - i $.
$ $
Here's my attempt :
$ $
$$ \int_{\gamma} (z + \frac {1}{z - 1}) \, dz = \int_{\gamma} \frac {z ( z - 1 ) + 1}{z - 1} \, dz = \int_{\gamma} \frac {z^2 - z + 1}{z - 1} \, dz = \int_{\gamma} \frac {f(z)}{z - 1} \, dz $$
$ $
Since the function $ f(z) = z^2 - z + 1 $ is analytic within and on $ \gamma $ and since the point $ z_0 = 1 $ is interior to $ \gamma $, by Cauchy's integral formula it follows that
$ $
$$ \int_{\gamma} \frac {f(z)}{z - z_0} \, dz = 2 \pi i \, f(z_0) \Rightarrow \int_{\gamma} \frac {f(z)}{z - 1} \, dz = 2 \pi i \, f(1) = 2 \pi i $$
$ $
My textbook however is giving a different method of resolution with a similar result :
$ $
$$ \int_{\gamma} (z + \frac {1}{z - 1}) \, dz = 2 \pi i \, \text{Res}_{z=1}(z + \frac {1}{z - 1}) = 2 \pi i $$
$ $
Apparently the author is using Cauchy's residue theorem to evaluate the given line integral. Does this makes my method of resolution false? If not, is there any advantage of using one method over the other in this case?