Using residue theory, show that $\oint_C\frac{e^{z/2}}{1+e^z}dz = 2\pi$ 
Using residue theory, show that $$\oint_C\frac{e^{z/2}}{1+e^z}dz = 2\pi$$

I've been attempted this problem using residue theory and the Cauchy integral formula that over a closed contour containing a pole (root at $\pi i$),
We should be able to confirm $2\pi$ using the equation $f(i\pi)\cdot 2\pi i$, but when I do this I am getting $-2\pi$, can anyone assist me?
 A: mrf's answer already shows you the way, but because of what you wrote at the end of your question, you  apparently want to use Cauchy's theorem
$$f(z_0)=\frac1{2\pi i}\int\limits_\gamma \frac{f(z)}{z-z_0}dz$$
whenever $\;f(z)\;$ is analytic on the simple, closed path $\,\gamma\,$ and inside the domain it encloses.
In our case, we can take the Taylor series around $\;\pi i\;$ :
$$e^z=-1-\frac{(z-\pi i)}{1!}-\frac{(z-\pi i)^2}{2!}-\ldots=-\sum_{k=0}^\infty\frac{(z-\pi i)^k}{k!}\implies$$
$$1+e^z=-(z-\pi i)-\mathcal O((z-\pi i)^2)\implies\frac1{1+e^z}=-\frac1{z-\pi i}\frac1{1+\mathcal O(z-\pi i)}$$
Notice that for $\,|z-\pi i|<1\;$ , we have that
$$\frac1{1+\mathcal O(z-\pi i)}=1-\mathcal O(z-\pi i)+\left(\mathcal O(z-\pi i)\right)^2-\ldots$$
and thus our integral, when $\,C\,$ encloses only the pole $\,\pi i\,$ , is
$$\oint\limits_C\frac{e^{z/2}}{1+e^z}dz=-\oint\limits_C\frac{e^{z/2}}{z-\pi i}dz=\left.-2\pi i\cdot e^{z/2}\right|_{z=\pi i}=-2\pi i\cdot i=2\pi$$
where $\,f(z):=e^{z/2}\implies f(\pi i)=e^{\pi i/2}=i\;$
A: The singularities of $\dfrac{e^{z/2}}{1+e^z}$ are all simple, so we can compute the residue at $\pi i$ by using L'Hospital:
$$
\begin{align}
\lim_{z\to\pi i}\frac{(z-\pi i)e^{z/2}}{1+e^z}
&=e^{\pi i/2}\lim_{z\to\pi i}\frac{z-\pi i}{1+e^z}\\
&=i\lim_{z\to\pi i}\frac1{e^z}\\[6pt]
&=-i
\end{align}
$$
Thus, the integral along any path circling $\pi i$ once counter-clockwise, and no other singularities, is $2\pi i(-i)=2\pi$. Thus,
$$
\oint_C\frac{e^{z/2}}{1+e^z}\,\mathrm{d}z=2\pi
$$
A: Assuming that $i\pi$ is the only pole inside your contour, and that the contour is counter clockwise oriented,
$$
\operatorname{Res}\limits_{z=i\pi} \frac{e^{z/2}}{1+e^z} = \left. \frac{e^{z/2}}{e^z} \right|_{z=i\pi} = \frac{e^{i\pi/2}}{e^{i\pi}} = -i,
$$
so
$$
\int_C \frac{e^{z/2}}{1+e^z}\,dz = 2\pi i \cdot (-i) = 2\pi.
$$
A: To verify it with $f(i\pi)$, you need to modify the integrand as 
$$ f(i\pi )= \frac{1}{2\pi i} \oint_C\frac{e^{z/2}\frac{(e^z+1)}{(z-i\pi)}}{(z-i\pi)}dz, $$
where $f(z)$ is given by
$$f(z)=\begin{cases} e^{z/2}\frac{(e^z+1)}{(z-i\pi)}, \, z\neq i\pi \\
-i,\,z=i\pi  \end{cases}.$$
Note:
$$\lim_{z\to i\pi}\frac{(e^z+1)}{(z-i\pi)}=-1.$$
A: Firstly, if we are to use residue theorem on this problem, the poles must be identified. This can be done by setting the denominator equal to $0$. 
$$1 + e^z = 0$$ 
Since we are working with the principle value, the only pole we are concerned with is located at $z = \pi i$. 
Next, we must take care of some assumptions that have to be made in order to use the residue theorem. 


*

*We must assume that the pole we found lies in $C$ in order for us to apply it to the residue theorem. 

*To obtain the correct sign on the solution, we must assume the $C$ is taken in the counter clockwise orientation. 
Now, we are ready to use the residue theorem to prove the integral. 
Since 
$$\oint_C f(z)dz = 2\pi i\sum_{k=0}^n Res(f;z_k)$$ 
the residue at $z = \pi i$ is equal to 
$$\lim_{z\to\pi i}\frac{(z-\pi i)e^{z/2}}{1+e^z}$$
$$=e^{\pi i/2}\lim_{z\to\pi i}\frac{z-\pi i}{1+e^z}$$
$$=i\lim_{z\to\pi i}\frac1{e^z}$$
Which is equal to $-i$. As this is the only simple pole in the contour, the integral must be equal to $2\pi i (-i)$ which is $2\pi$. 
Therefore, we have validated 
$$\oint_C\frac{e^{z/2}}{1+e^z}dz = 2\pi$$
