# Calculate $\int_{-\infty}^{\infty}{\frac{dx}{x\sin{(\pi x)}}}$ using residues.

I want to calculate $$p.v.\int_{-\infty}^{\infty}{\frac{dx}{x\sin{(\pi x)}}}$$ using residue calculus. The function $$f(z)=\frac{1}{z\sin{(\pi z)}}$$ has the double pole $$z=0$$ and infinite simple poles at $$z_n=n\in\mathbb{Z}$$. According to residue theorem if we use the closed curve like the one shown in the picture then it can be proved that $$\int_{-\infty}^{\infty}{f(x)dx}=\pi i\sum_{k=1}^{n}{\mathrm{Res}_{z=z_k}{f(z)}}$$

After calculating the residues the result is $$\sum_{k=1}^{\infty}{\mathrm{Res}_{z=z_k}{f(z)}}=\sum_{k=1}^{\infty}{\frac{(-1)^n}{n\pi}}=-\frac{\ln{2}}{\pi}$$ Thus the integral will be $$\int_{-\infty}^{\infty}{\frac{1}{x\sin{(\pi x)}}dx}=-i\ln{2}$$

Is there any mistake in the method I used? The $$i$$ in the last result doesn't seem like it is supposed to remain as the integral is real.

• I'd say there must be something wrong as the given one is a real integral, so how come the result is a complex non-real number? – DonAntonio Jun 8 at 14:46
• That is my question exactly. A thought is that maybe the integral doen't converge but im not sure. – mac Jun 8 at 14:56
• Yes: the integral doesn't seem to converge. – DonAntonio Jun 8 at 17:54
• What the residue theorem says is that the integral around the loop is given by the residues for poles inside (picking up half-value for those on the loop itself). Note that your loop is not just the part along the real axis. It is also that half-circle. To find the integral along the real axis, you need the integral along the half circle to go to $0$ as the radius $R \to \infty$. But in this integral, that is not the case. – Paul Sinclair Jun 9 at 2:31