Do you have any idea how to solve this integral? $$\int\limits_0^\infty {\frac{{\cos \left( mx \right)}}{{x + {x_0}}}\left( {1 + n\left( x \right)} \right)} - \int\limits_0^\infty {\frac{{\cos \left( mx \right)}}{{x - {x_0}}}n\left( x \right)} $$ where $n$ is the Bose-Einstein distribution: $$n\left( x \right) = \frac{1}{{{e^{bx}} - 1}}$$ and $x_0>0,m>0,b>0$.
--Notes:
Note that $n(-x)=-n(x)-1$. $n(x)$ exhibits poles in the upper half plane for purely imaginary frequencies $i{x_j}$, where ${x_j} = \frac{{2\pi }}{b}j$, $j=0,1,2,...$ are the Matsubara frequencies. In these poles: $$n\left( x \right) \simeq \frac{1}{b}\frac{1}{{x - i{x_j}}}$$
--Other notes:
If instead of $\cos(x)$, the $\sin(x)$ function appears, the integral is trivial because we can write $\sin mx = ({e^{imx}} - {e^{ - imx}})/2i$, and make the substitution $x \to -x$ in the term ${e^{ - imx}}$. Using the property $n(-x)=-n(x)-1$ the integral can be extended from $- \infty$ to $\infty$:
$$\frac{1}{{2i}}\int\limits_{ - \infty }^\infty {\frac{{{e^{imx}}}}{{x + {x_0}}}\left( {1 + n\left( x \right)} \right)} - \frac{1}{{2i}}\int\limits_{ - \infty }^\infty {\frac{{{e^{imx}}}}{{x - {x_0}}}n\left( x \right)} $$
We can take the residuum in the Matsubara frequencies, and $ \pm x_0$.
For the cosine function this trick is not valid anymore, because we can not extend the integral to $[-\infty,\infty]$. Any ideas???