I need to prove that $\displaystyle\int\_{-\infty}^{\infty} \dfrac{e^{-x}}{1+e^{-2\pi x}}\,dx=\dfrac{1}{2\sin\left(\frac{1}{2}\right)}$. This is an exercise from Basic Complex Analysis by Marsden and Hoffman. My attempt:

First, Marsden says that we need to consider the complex function $f(z)=\dfrac{e^{-z}}{1+e^{-2\pi z}}$ and the next curve 

[![enter image description here](https://i.stack.imgur.com/67jWM.jpg)](https://i.stack.imgur.com/67jWM.jpg)

$\gamma\_2=r+t\pi i$ with $t\in [0,1]$

$\gamma\_3=(\pi i+r)-2tr$ with $t\in [0,1]$

$\gamma\_4=(1-t)(\pi i-r)-tr$ with $t\in [0,1]$

Note that the only poles of the function $f(z)$ in the rectangle are when $z=\dfrac{i}{2}$, $z=\dfrac{3i}{2}$ and $z=\dfrac{5i}{2}$. From a direct calculation we obtain that $\text{Res}\left(f(z),\dfrac{i}{2}\right)=\dfrac{e^{-i/2}}{2\pi}$, $\text{Res}\left(f(z),\dfrac{3i}{2}\right)=\dfrac{e^{-3i/2}}{2\pi}$ and $\text{Res}\left(f(z),\dfrac{5i}{2}\right)=\dfrac{e^{-5i/2}}{2\pi}$.

After to a lot of calculations we obtain a bound for the integral over $\gamma\_2$: $$\dfrac{e^{-r}}{\sqrt{(1-e^{-2\pi r})^2}}\geq \dfrac{|e^{-r-t\pi i}|}{|1+e^{-2\pi(r+t\pi i)}|}\geq 0$$Thus $$\displaystyle\int\_{\gamma\_2}^{}f(\gamma\_2)\cdot d\gamma\leq \dfrac{e^{-r}}{\sqrt{(1-e^{-2\pi r})^2}}$$When $r\to\infty$ then $\displaystyle\int\_{\gamma\_2}^{}f(\gamma\_2)\cdot d\gamma\to 0$

I think that is the same for $\gamma\_4$ but I have troubles with $\gamma\_3$. After a lot of calculations we obtain the next bound: $$\dfrac{e^{-r+2rt}}{\sqrt{1+2e^{-2\pi}\cos(-2\pi^2)+e^{-4\pi r}}}\geq \dfrac{|e^{-r+2rt-\pi i}|}{|1+e^{-2\pi(\pi i+r-2rt)}|}$$ but when $r\to\infty$ we obtain that $\dfrac{e^{-r+2rt}}{\sqrt{1+2e^{-2\pi}\cos(-2\pi^2)+e^{-4\pi r}}}\to\infty$ and I need, maybe, that this limits exists (maybe, zero). 

Clearly I want the integrals over the curves because if $\gamma=\gamma\_1\cup\gamma\_2\cup\gamma\_3\cup\gamma\_4$ then $\displaystyle\int\_{\gamma} f(\gamma)\cdot d\gamma=\displaystyle\int\_{\gamma\_1} f(\gamma\_1) \cdot d\gamma\_1+\displaystyle\int\_{\gamma\_2} f(\gamma\_2) \cdot d\gamma\_2+\displaystyle\int\_{\gamma\_3} f(\gamma\_3) \cdot d\gamma\_3+\displaystyle\int\_{\gamma\_4} f(\gamma\_4) \cdot d\gamma\_4$ and I want to use the Residue Theorem. But, is the rectangle the correct curve? Here an screenshot of the exercise: 

[![enter image description here](https://i.stack.imgur.com/XTJVA.jpg)](https://i.stack.imgur.com/XTJVA.jpg)