Hello I am trying to find the Principal part at the pole $z = 1$ of the function $\frac{z}{(z^2-1)^2}$. Clearly, the function has a pole at $z=1,-1$, and by a theorem, $z=1$ is an order $2$ pole. Now the principal part of a pole is defined in my book as
The sum of the negative powers, $$ P(z)=\sum_{k=-N}^{-1} a_{k}\left(z-z_{0}\right)^{k}=\frac{a_{-N}}{\left(z-z_{0}\right)^{N}}+\cdots+\frac{a_{-1}}{z-z_{0}}, $$ $\text { is called the principal part of } f(z) \text { at the pole } z_{0} \text {. }$, where $N$ is the order of the pole. so in my case,
$(1)$ $P(z) = \sum_{k=-2}^{-1} a_{k}\left(z-1\right)^{k}=\frac{a_{-2}}{(z-1)^2} + \frac{a_{-1}}{(z-1)}$ ?. How would I find the $a_k$ in this case? I went back to the definition of a Laurent Series and saw the definition $a_n$ is defined as $(2)$ $a_{n}=\frac{1}{2 \pi i} \oint_{\left|z-z_{0}\right|=r} \frac{f(z)}{\left(z-z_{0}\right)^{n+1}} d z, \quad-\infty<n<\infty$.
But this confuses me because the answer in the book is
$\text { Double poles at } \pm 1 \text {, principal parts } \mp(1 / 4)(z \pm 1)^{2} \text {. }$
so by looking at the answer, apparently $a_{-1} = 0$ since the answer does not have the $\frac{a_{-1}}{(z-1)}$ term in $(1)$. But if I used $(2)$ to find $a_{-1}$, it becomes $a_{-1}=\frac{1}{2 \pi i} \oint_{\left|z-1\right|=r} \frac{\frac{z}{(z^2-1)^2}}{\left(z-1\right)^{0}} d z$, which is not $0$ because its not analytic at the domain and cannot apply cauchy theorem.
Am I overthinking this problem? how can I find the $a_k$ in this problem?
I suppose you're thinking abit too much into it: The simplest way to find a Laurent expansion is by not calculating it at all.
Here's what I mean: Near $z=1$, you can view your function $f(z) = \frac{z}{(z^2-1)^2}$ as the product of two very different functions: $$f(z) = \frac{1}{(z-1)^2}\cdot\frac{z}{(z+1)^2}$$
The left factor is already written in its Laurent series, while the right factor is holomorphic around $z=1$, meaning it can be expressed as a regular power series (i.e. with only non-negative exponents): $$\frac{z}{(z+1)^2} = \sum\limits_{k=0}^\infty a_k(z-1)^k = a_0 + a_1(z-1)+a_2(z-1)^2...$$
So when multiplying both factors to get $f(z)$, we see immediatly that all terms $a_k(z-1)^k$ with $k\geq 2$ have non-negative exponents, i.e. don't belong to the principal part:
$$f(z) = \frac{1}{(z-1)^2}\cdot(a_0 + a_1(z-1)+a_2(z-1)^2+...) = a_0(z-1)^{-2}+a_1(z-1)^{-1}+a_2+...$$
Basically the exponents of the original series are shifted by $-2$. So to get the desired coefficients for your Laurent expansion of $f$ at $z=1$, you only have to calculate $a_0 = \left. \frac{z}{(z+1)^2}\right|_{z=1} = \frac{1}{4}$ and $a_1 = \left. \left(\frac{z}{(z^2+1)^2}\right)'\right|_{z=1} = 0$.
That $a_1$ vanishes is also evident from the formula you mentioned in your post: $$ \frac{1}{2\pi i}\int\limits_{\partial B_r(1)} \frac{f(z)}{(z-1)^0} d z = \frac{1}{2\pi i}\int\limits_{\partial B_r(1)} \frac{z}{(z-1)^2(z+1)^2} d z = 0,$$ since the integrand has no singularity of order $1$ inside the chosen curve of integration.