I have this integral where the integrand is divergent at $p=\{0, \pi i\}$,
$$\lim_{r\rightarrow \infty} \int_{ib}^r \frac{1}{\cosh(p/2)\sinh(p/2)}\, dp$$
where $0 \leq b \leq \pi$ and $0 \leq r < \infty$.
I have this solid contour shown in the image below. My goal is to find the integral in the range $[0,\infty]$ (the horizontal solid contour) OR in the range $[\pi i,0]$ (the vertical solid contour) but the integral is divergent. My strategy is to use the solid contour and close the contour using the dashed lines then since there are no poles inside the closed contour, the integral in the closed contour is zero. Since the vertical dashed line contribution to the integral vanishes as $r \rightarrow \infty$, the integral in the range $[0,\infty]$ is just negative times the rest of the contour (except the bottom solid contour which is what I want).
Using Mathematica to evaluate the integral along the contour, I get
$$\lim_{r\rightarrow \infty} \int_0^r \frac{1}{\cosh(p/2)\sinh(p/2)} \,dp + \lim_{a\rightarrow 0}\Bigl(-4 \log(\cot(a/2)) - 2 \log(\tanh(a/2))\Bigr) = 0$$
$$\lim_{r\rightarrow \infty} \int_0^r \frac{1}{\cosh(p/2)\sinh(p/2)}\,dp = \lim_{a\rightarrow 0}\Bigl(4 \log(\cot(a/2)) + 2 \log(\tanh(a/2))\Bigr)$$
The contribution of $C_1$ and $C_2$ given the residues are $-i \pi$ and $i \pi$ respectively so they just cancel. Note that the indentation is given by a small radius $a$ around the poles.
The limit $a \rightarrow 0$ produces divergences on both terms. Is there anyway to solve this? Maybe there is another way of closing the contour to make this work or another way of drawing even the whole contour?
You can also see my post in Mathematica Stack Exchange (Contour integral around complex plane) for the relevant calculations.
Edit: My goal can accommodate two things, either find the integral on the vertical solid contour or the horizontal solid contour (in the appropriate limits as defined above).
