Contour Integration on a Rectangle showing that the vertical sides go to 0 I am trying to integrate $\displaystyle\int_{-\infty}^{\infty} \frac{e^{x/4}}{1+e^x}$ using a rectangular contour.  I have solved to the point that integral is $\pi \sqrt{2}$ (using that $z = \pi i$).
My question is, I have solved the top and the bottom parts of the rectangle to acquire the answer, but I am having difficulty in proving that the vertical edges of the rectangle go to 0.  Any help would be awesome.
 A: Assuming the contour is a rectangle with vertices $(-A, A, -A+2\pi i,A+2\pi i)$ for $A>0$, we can solve for $\int_{-\infty}^\infty\frac{e^{\frac{x}{4}}}{1+e^x}$ by integrating $f(z)=\frac{e^{\frac{z}{4}}}{1+e^z}$ over the contour and sending $A\to\infty$. Note that $f(z)$ is meromorphic in an open set containing this contour with exactly one simple pole at $z=\pi i$. The residue there is
$$
\text{res}_{\pi i}f=\lim_{z\to\pi i}\frac{e^{\frac{z}{4}}(z-\pi i)}{1+e^z}=e^{\frac{\pi i}{4}}\lim_{z\to\pi i}\frac{z-\pi i}{1+e^z}=-\frac{1}{\sqrt{2}}-\frac{i}{\sqrt{2}}
$$
by L'Hopital's rule.
The top side of the contour can be parametrized by $z=2\pi i+x$ as $x$ travels from $A$ to $-A$ (this is the leftward direction, in keeping with the counter-clockwise orientation of the contour). Thus setting $I$ to be the integral in question, we have
$$
\lim_{A\to\infty}\int_{top} f(z)dz=\int_{\infty}^{-\infty}\frac{e^{\frac{2\pi i+x}{4}}}{1+e^{{2\pi i+x}}}dx
=\int_{\infty}^{-\infty}\frac{ie^\frac{x}{4}}{1+e^x}dx=-iI
$$
The side on the right (parametrized by $z=A+ix$) goes to zero because the
integral has finite length ($2\pi$) and the integrand $f(z)$ is bounded by
$$
\left|\frac{e^{\frac{A+ix}{4}}}{1+e^{A+ix}}\right| =
\frac{e^{\frac{A}{4}}|e^{ix}|}{|1+e^Ae^{ix}|}\leq\frac{e^{\frac{A}{4}}}{\left|e^A-1\right|}\to 0,
$$
and the left side similarly vanishes because we have the similar bound
$$
\frac{e^{-\frac{A}{4}}}{\left|e^{-A}-1\right|}\to\frac{0}{1}=0.
$$
Obviously the bottom side converges to the integral $I$, so for the whole contour we can apply the residue theorem to see
$$
\int_{rectangle}f(z)dz=I-iI+0+0=I(1-i)=2\pi\cdot\text{res}_{\pi i}f=\sqrt{2}\pi(1-i)
$$
Therefore $I=\sqrt{2}\pi$.
