Why does this integral vanish? $\int_C \frac{e^{az}}{1+e^z}dz$ I'm looking for an argument that would prove that the integral
$$I=\int_C \frac{e^{az}}{1+e^z}dz$$
vanishes for $R \to \infty$, where $C$ is the horizontal line segment from $(1+i)R$ to $(-1+i)R$, and $a \in (0,1)$. Here $R$ goes to infinity 'discretely', so as to avoid the singularies at $(2n+1)\pi i$, the line segment is placed between the subsequent singularities. Parametrizing the contour with $z(t)=iR+t, \ t\in[-R,R]$ and attempting to bound the integral gives me:
$$|I| \le \int_{-R}^{R} \frac{e^{at}dt}{|1+e^{t+iR}|}$$
but I don't know what to do with this, using the reverse tringle inequality doesn't help because the denominator becomes $e^t -1$, and the integral goes through zero...
Additional information:
This problem cropped up when doing the following exercise: "By choosing a suitable contour, show that  $$\int_\mathbb{R} \frac{e^{ax}}{1+e^x}dx = \frac{\pi}{\sin(a\pi)},$$ where $0<a<1$. I managed to solve this integral now, by choosing the integration contour to be a rectangle with vertices $\pm R, \pm R + 2\pi i$. But originally, I was trying the verteces $\pm R, (\pm 1+i)R$, where the values of $R$ are restricted so the contour doesn't go through a singularity. Letting $R$ to infinity will then have the contour capture all of the residues on the positive imaginary axis, the sum of which (times $2 \pi i$) is precisely $\frac{\pi}{\sin(a\pi)}$, meaning the top part has to tend to zero. Letting $R$ change in discrete steps, $R_n = 2\pi n$ gives a nonzero value of the top integral though, namely $$I_{top} = e^{2\pi i a n} I_n$$ where $$I_n = \int_{-2\pi n}^{2 \pi n} f(x)dx.$$ So, in the limit, things don't actually work out because of the weird oscillatory term. But apparently, taking the limit is not even necessary, as the top integral is always proportional to the bottom one, so their sum is equal to the residues contained inside, which are calculated easily enough.
 A: In general, the integral $I$ does not converge to $0$ as $R \to \infty$:
For $R \notin \{(2k+1) \cdot \pi; k \in \mathbb{Z}\}$ let $$I(R) := \int_C \frac{e^{a \cdot z}}{1+e^{z}} \, dz$$ where the contour $C$ is parametrized by $z(t) = \imath \, R +t$, $t \in [-R,R]$. By definition, we have
$$\begin{align*} I(R) &= \imath \, e^{\imath \, a \cdot R} \cdot \int_{-R}^R \frac{e^{a \cdot t}}{1+e^{\imath \, R+t}}  \, dt \\ &=\imath \, e^{\imath \, a \cdot R} \cdot \int_{-R}^R \frac{e^{a \cdot t}}{1+e^{\imath \, R+t}} \cdot \frac{1+e^{-\imath \, R + t}}{1+e^{-\imath \, R+t}} \, dt \\
&= \imath \, e^{\imath \, a \cdot R} \cdot \int_{-R}^R \frac{e^{a \cdot t}+e^{(a+1) \cdot t} \cdot e^{-\imath \, R}}{e^{2t}+\cos^2(R)+2e^t \cdot \cos^2(R)} \, dt \\
&= \imath \, e^{\imath \, a \cdot R} \cdot (I_1(R)-\imath \, I_2(R)) \end{align*}$$
where
$$\begin{align*} I_1(R) &:= \int_{-R}^R \frac{e^{a \cdot t}+e^{(a+1) \cdot t} \cdot \cos(R)}{e^{2t}+\cos^2(R)+2e^t \cdot \cos^2(R)} \, dt \\ I_2(R) &:= \sin(R) \cdot \int_{-R}^R \frac{e^{(a+1) \cdot t}}{e^{2t}+\cos^2(R)+2e^t \cdot \cos^2(R)} \, dt \end{align*}$$
Now pick a sequence $(R_n)_{n \in \mathbb{N}}$ such that $R_n \to \infty$ and $R_n \notin \{(2k+1) \cdot \pi; k \in \mathbb{N}\}$ for each $n \in \mathbb{N}$. The calculation above shows that $$\lim_{n \to \infty} I(R_n) = 0 \Leftrightarrow \lim_{n \to \infty}  I_1(R_n) = \lim_{n \to \infty} I_2(R_n) = 0$$ First of all, by the positivity of the integrand,
$$\begin{align*} |I_2(R_n)| &\geq |\sin(R_n)|  \cdot \underbrace{\int_{-R_n}^{R_n} \frac{e^{(a+1) \cdot t}}{(e^t+1)^2} \, dt}_{\geq c>0} \end{align*}$$
Consequently, $|\sin(R_n)| \to 0$ is a necessary condition for the convergence of $I_2(R_n)$. This implies $|\cos(R_n)| \to 1$. Without loss of generality, we may assume $\cos(R_n) \to 1$ or $\cos(R_n) \to -1$ (otherwise we choose a suitable subsequence). In the first case we find by the dominated convergence theorem,
$$I_2(R_n) \to I_2 := \int_{-\infty}^{\infty} \frac{e^{a \cdot t} + e^{(a+1) \cdot t}}{(e^t+1)^2} \, dt$$
Obviously, $I_2>0$, i.e. $I(R_n)$ does not converge to $0$. In the other case, i.e. $\cos(R_n) \to -1$, we have
$$I_2(R_n) \to I_2 := \int_{-\infty}^{\infty} \frac{e^{a \cdot t} - e^{(a+1) \cdot t}}{(e^t+1)^2} \, dt$$
Actually, it depends on $a$ whether this integral equals $0$ or not. For example, if $a=1/2$, it's not difficult to see that $I_2=0$. But in general, $I_2 \neq 0$. This means that in both cases $I(R_n) \to 0$ does in general not hold.

Concerning your original problem: Choose a sequence $R_n \to \infty$ and $R_n \notin \{(2k+1) \cdot \pi; k \in \mathbb{Z}\}$. Set $r_n := \frac{1}{\sqrt{R_n}}$. We consider the contour integral
$$\int_{D_n} \frac{e^{a \cdot z}}{1+e^z} \, dz$$
where the parametrization of $D_n$ is given by $z(t) = R_n \cdot e^{\imath \, t}$, $t \in [0,\pi]$. We split up the integral as follows
$$\begin{align*} \int_{D_n} \frac{e^{a \cdot z}}{1+e^z} \, dz &= \underbrace{\int_0^{\frac{\pi}{2}-r_n} \frac{e^{a \cdot z(t)}}{1+e^{z(t)}} \cdot z'(t)\, dt}_{=: J_1} \\ &\quad + \underbrace{\int_{\frac{\pi}{2}-r_n}^{\frac{\pi}{2}+r_n} \frac{e^{a \cdot z(t)}}{1+e^{z(t)}} \cdot z'(t)\, dt}_{=: J_2}+\underbrace{\int_{\frac{\pi}{2}+r_n}^{\pi} \frac{e^{a \cdot z(t)}}{1+e^{z(t)}} \cdot z'(t)\, dt}_{=: J_3} \end{align*}$$
and estimate the terms separately. Some standard calculations and estimats yield
$$\begin{align*} |J_1| &\leq R_n \cdot \int_{0}^{\frac{\pi}{2}-r_n} \frac{e^{a \cdot R_n \cdot \cos(t)}}{e^{R_n \cdot \cos(t)}-1} \, dt \end{align*}$$
The mapping $t \mapsto \frac{e^{a \cdot R \cdot \cos(t)}}{e^{R \cdot \cos(t)}-1}$ is monotonely increasing on $[0,\pi/2-r_n]$, therefore
$$|J_1| \leq R_n \cdot \frac{\pi}{2} \cdot \frac{e^{a \cdot R_n \cdot \cos(\pi/2-r_n)}}{e^{R_n \cdot \cos(\pi/2-r_n)}-1} \to 0 \quad (n \to \infty)$$
(Note that $R_n \cdot \cos(\pi/2-r_n) \to \infty$ as $n \to \infty$ and $a \in (0,1)$.) Similarly, we find
$$|J_3| \leq R_n \cdot \frac{\pi}{2} \cdot \frac{e^{a \cdot R_n \cdot \cos(\pi/2+r_n)}}{1-e^{R_n \cdot \cos(\pi/2+r_n)}} \to 0 \quad (n \to \infty)$$
The convergence of the term $|J_2|$ is rather obvious. This shows
$$\left| \int_{D_n} \frac{e^{a \cdot z}}{1+e^z} \, dz \right| \to 0$$
as $n \to \infty$. Therefore, the claim follows from the residue theorem.
A: I haven't taken complex analysis so I don't know the validity of this, but if 0

By some basic limit laws the limit of e^(az)/(1+e^z) as z goes to infinity = lim as (e^az)/(e^z) as z goes to infinity = 0.
How this applies to any integral definitions in complex analysis, I don't know. Also note that e^z/(1+e^z) = .5tanh(.5z) + .5.
Wish I could help more but I am coming at this problem with only real analysis knowledge.
