In appendix C of Quantum Physics in One Dimension of Thierry Giamarchi, it is claimed that (See (C.22)) after performing the Matsubara sum over the bosonic frequencies $\omega_n=2\pi n/\beta$ in $$\frac{1}{\beta\Omega}\sum_k\sum_n e^{i(kx-\omega_n\tau)}\times \frac{-i2\pi\omega_n/k}{\omega_n^2+u^2k^2}, $$ and taking the $\beta\to\infty$ limit we are left with (see (C.25)) $$-i\int_0^\infty\frac{dk}{k}e^{-\alpha k}e^{-u\cdot\text{sign}(\tau)\tau}\sin(k\cdot\text{sign}(\tau)x),$$ where the factor $e^{-\alpha k}$ is introduced to ensure convergence. The "naive" result would be (see (C.26)) $$-i\text{sign}(\tau)\arctan\left[\frac{x}{u|\tau|+\alpha}\right]$$ I have had troubles when trying to reproduce these results. First I do not get (C.25) when computing the Matsubara sum. I have used the weighting function $g(z)=\theta(\tau)(-\beta f_B(-z))+\theta(-\tau)f_B(z)$, where $f_B(z)$ is the Bose-Einstein distribution (see Matsubara sums). On the other hand, if I take the limit from the beginning and compute the sum as the integral $$\sum_n \to \int d\omega \frac{\beta}{2\pi},$$ using complex integration then I still get something slightly different, namely, $$-\frac{1}{2}\int_0^\infty \text{sign}(\tau)\frac{e^{-\alpha k}}{k}(e^{ikx}e^{-uk|\tau|}-e^{-ikx}e^{uk|\tau|}).$$
Where I messed up?