Integrating: $\int_0^\infty \frac{\sin (ax)}{e^x + 1}dx$ I am trying to evaluate the following integral using the method of contour which I am not being able to. Can anyone point out what mistake I am making?
$$\int_0^\infty \frac{\sin ax}{e^x + 1}dx$$
I am considering the following contour. And function $\displaystyle f(z):= \frac{e^{iaz}}{e^z + 1}$

The pole of order $1$ occours at odd multiple of $i\pi$. By considering above contour there is no singularity. The integral can be broken down into six parts.
$$\int_0^R \frac{e^{iax}}{e^x + 1} dx + i \int_0^{2\pi} \frac{e^{ia(R + iy)}}{e^{R + iy} + 1} dy + \int_{R}^{0}\frac{e^{ia(x+2\pi i)}}{e^{x + 2 \pi i } + 1} dx +  \\ i \int_{2 \pi }^{\pi + \epsilon} \frac{e^{ai( iy)}}{e^{ iy } + 1}dy + \int_\gamma \frac{e^{iaz}}{e^z + 1} dz + i \int_{ \pi -\epsilon}^{0} \frac{e^{ia( iy)}}{e^{ iy } + 1}dy$$
First and third gives $\displaystyle (1 - e^{-2 a\pi})\int_0^R\frac{e^{iax}}{e^x + 1} dx$. Second goes to $0$ as $R \to \infty$
For fifth integral, $$\int_\gamma \frac{e^{iaz}}{e^z + 1} dz = \int_{-\pi/2}^{\pi/2} \frac{e^{ia\pi + a\epsilon e^{i\theta}}}{e^{i\pi + \epsilon e^{i\theta}+1}}i \epsilon i e^{i\theta }d\theta \to 0 \text{ as } \epsilon \to 0$$
The real part of fourth and sixth integral does not converge. But since my original integral is imaginary, it suffices to take imaginary part. As $\epsilon \to 0$, I get
$$i\int_{2\pi }^0 \Re \left [\frac{e^{-ay}}{e^{iy} + 1} \right] dy = i \int_{2\pi}^0 \frac{e^{-ay}}{2}dy = i \frac{e^{-2\pi a} - 1}{2a}$$
Finally using residue theorem, I am geting which is incorrect.
$$(1 - e^{-2 a\pi})\int_0^\infty \Im \left [\frac{e^{iax}}{e^x + 1} \right ] dx +\frac{e^{-2\pi a} - 1}{2a} = 0$$
Can anyone point out my mistake or give worked out solution?? Thanks in advance!!
ADDED::
I evaluated fifth integral incorrectly
$$\int_\gamma \frac{e^{iaz}}{e^z + 1} dz = \int_{-\pi/2}^{\pi/2} \frac{e^{ia(i\pi + \epsilon e^{i\theta})}}{e^{i\pi + \epsilon e^{i\theta}}+1}i \epsilon  e^{i\theta }d\theta = ie^{-a\pi}\int_{\pi/2}^{-\pi/2}\frac{e^{ia\epsilon e^{i\theta}}}{-e^{\epsilon e^{i\theta}} + 1} \epsilon e^{i\theta}d\theta = i \pi e^{-a\pi}$$
So the total sum should be
$$(1 - e^{-2 a\pi})\int_0^\infty \Im \left [\frac{e^{iax}}{e^x + 1} \right ] dx +\frac{e^{-2\pi a} - 1}{2a} +\pi e^{-a\pi}= 0 $$
After slight manipulation we find that
$$\int_0^\infty \frac{\sin ax}{e^x + 1}dx = -\frac{\pi}{2\sinh (\pi a)} +\frac{1}{2a}$$

Combine the 4th and 6th integrals to get the Cauchy principal value:
$$PV \int_{\pi}^0 dy \frac{e^{-a y}}{1+e^{i y}}  = PV \int_{\pi}^0dy \frac{e^{-a y}}{2 \cos{(y/2)}}  e^{-iy/2}  $$
You still need to evaluate the imaginary part of the integral.
