I tried to solve the following integral using residue theorem. $$\int_0^\infty\frac{x}{\sinh x} ~\mathrm dx=\int_{-\infty}^\infty\frac{x}{e^x-e^{-x}}~\mathrm dx$$
$e^x-e^{-x}=0$ when $x=n\pi i, n\subset\mathbb Z$
So the residues are (when n is a positive integer) $$\frac{(-1)^n n\pi i}{2}$$ Thus the value of definite integral will be $$2\pi i\sum_{n=1}^\infty \frac{(-1)^n n\pi i}{2}=\pi^2(1-2+3-4+5-\ldots)$$
But the series diverges obviously. Here I used the technique that $$A=1-1+1-1+1-\ldots$$ $$A=1-(1-1+1-1+1-\ldots)$$ $$A=1-A, A=\frac{1}{2}$$ $$B=1-2+3-4+5-6+7-\ldots$$ $$B=(1-1+1-1+1-\ldots)-(1-2+3-4+5-\ldots)$$ $$B=A-B, B=\frac{1}{4}$$ Thus the integral value is $\frac{\pi^2}{4}$. Although the value itself is correct, I think this method is still controversial. How can this method become justified? Or is there a problem in my residue theorem solution?
but unluckily i never got a satisfying answer how this kind of calculations can be made rigorous – tired Jul 01 '16 at 10:58