I wish to show that: $$\oint_C \frac{\cosh(z)\cos(z)}{\sin(z)}dz=2\pi i \frac{\sinh((n+1/2)\pi)}{\sinh(\pi/4)} \,$$
where $n$ is determined by the Contour(s): $ C=\{z; |z|=(n+1/2)\pi\} $ and $ n \in \mathbb{N}_0$,
this function has poles at $k\pi$ where $k\in\mathbb{Z}$. The integral can be calculated via the Residue Theorem.
for $n=0$ we have just the pole at zero $$ Res_1(0)= \lim_{x\to0} z\frac{\cosh(z)\cos(z)}{\sin(z)}=1 $$ (where the 1 in the subscript symbolises that the pole is of order 1)
becouse $\frac{sin(0)}{0}=1 $ a $\cosh(0)=1$ i $\cos(0)=1$
for some other $n\in\mathbb{N}$
$$Res_1(0)= \lim_{x\to \pm n\pi} z\frac{(z-(\pm)n\pi)\cosh(z)\cos(z)}{\sin(z)} \overset{\mathrm{L'Hopital}}{=} \cosh(n\pi)$$
so the integral is: $$2\sum_{k=0}^{n}\cosh(k\pi)-1 \overset{\mathrm{geom.series}}{=} 2\frac{1-e^{(n+1)\pi}+1-e^{-(n+1)\pi}}{1-e}=\frac{4-4ch((n+1)\pi)}{1-e}$$
that means tha for some $n$ I get:
$$\oint_C \frac{\cosh(z)\cos(z)}{\sin(z)}dz=2\pi i \Big[-1+\frac{4-4ch((n+1)\pi)}{1-e}\Big] $$
which is not what I am supposed to get.
Where am I wrong (if I am wrong)?
The residues look OK, but their summation doesn't. Also, it might be more efficient to combine that sum with the residue at $0$ into $\sum_{k=-n}^n \cosh k\pi$.
Using $\sinh (x) \cosh (y) = \frac12(\sinh (y+x) - \sinh (y-x))$ one would get $$\begin{align} \sinh(\frac{\pi}2) \sum_{k=-n}^n \cosh k\pi & =\frac 12\sum_{k=-n}^n (\sinh ((k+\frac12)\pi)-\sinh((k-\frac 12)\pi))= \\ & = \frac 12(\sinh ((n+\frac12)\pi)-\sinh((-n-\frac 12)\pi))= \\ & = \sinh ((n+\frac12)\pi)\end{align}$$
But the same result can be reached with a straightforward $$\begin{align} 2\sum_{k=0}^n \cosh (k\pi) & =\sum_{k=0}^n (e^{k\pi}+e^{-k\pi})= \frac{e^{(n+1)\pi}-1}{e^{\pi}-1}+\frac{e^{-(n+1)\pi}-1}{e^{-\pi}-1}=\\ & = \frac{e^{(n+\frac 12)\pi}-e^{-\frac {\pi}2}}{e^{\frac{\pi}2}-e^{-\frac{\pi}2}}+\frac{e^{-(n+\frac 12)\pi}-e^{\frac {\pi}2}}{e^{-\frac{\pi}2}-e^{\frac{\pi}2}} =\\ & =\frac{\sinh ((n+\frac12)\pi)}{\sinh(\frac{\pi}2)}+1\end{align}$$
This confirms the expected value of the integral, apart from the $\pi/4$, which looks like a typo because it leads to an incorrect result for $n=0$.