I initially attempted this with contours. But, then I tried series.

The coth is a wee bit easier using series because we can write coth as

\(\displaystyle \coth(x)=\frac{e^{2x}+1}{e^{2x}-1}\)

So, we have:

\(\displaystyle \int_{0}^{\infty}e^{-ax}\sin(ax)\left(\frac{e^{2x}+1}{e^{2x}-1}\right)dx\)

\(\displaystyle =\int_{0}^{\infty}e^{-ax}\sin(ax)dx+2\int_{0}^{\infty}e^{-ax}\sin(ax)\cdot \frac{1}{e^{2x}-1}dx\)

\(\displaystyle =\frac{1}{2a}+2\int_{0}^{\infty}\sin(ax)\sum_{n=1}^{\infty}e^{-(a+2n)x}dx\)

\(\displaystyle =\frac{1}{2a}+2\sum_{n=1}^{\infty}\int_{0}^{\infty}e^{-(a+2n)x}\sin(ax)dx\)

\(\displaystyle =\frac{1}{2a}+\sum_{n=1}^{\infty}\frac{a}{a^{2}+2an+2n^{2}}\)

Now, the cot one requires some sort of identity that'll work.

I do know a closed form sum for this, but have not derived it yet.

\(\displaystyle \sum_{n=1}^{\infty}\frac{a}{2a^{2}-4an+4a^{2}}-\sum_{n=1}^{\infty}\frac{a}{2a^{2}+4an+4a^{2}}\)

Now, add them and get:

\(\displaystyle =\frac{1}{2a}+\frac{1}{2}\sum_{n=1}^{\infty}\frac{a}{a^{2}+2an+2n^{2}}+\frac{1}{2}\sum_{n=1}^{\infty}\frac{a}{a^{2}-2an+2n^{2}}\)

\(\displaystyle =\frac{\pi}{2}\cdot \frac{\sinh(\pi a)}{\cosh(\pi a)-\cos(\pi a)}\)

This evaluates to the required result, but as I said, I have not worked it out by hand.

E, you can go ahead and post your method. It is, no doubt, better than mine.

I managed to make some headway on this using contours. But, not a nice, full solution.

The poles are infinite and the resulting series depend on whether 'a' is even or odd.

So, the above solution can be reduced down to tanh and coth terms depending on odd or even 'a'.

EDIT: I found the solution to this on that German site. Here, they use a sin identity for the cot term.

http://de.wikibooks.org/wiki/Formelsamm ... ot,coth%29