# Contour integration of $\int_{0}^{\pi}\tan{(\theta+ia)}d\theta$

I'm having real trouble with this one. This is my working so far.

$$I = \int_{0}^{\pi}\tan{(\theta+ia)d\theta} = \frac{1}{2}\int_{0}^{2\pi}\frac{\sin{(\theta+ia)}}{\cos{(\theta+ia)}}d\theta \\ =\frac{1}{2}\int_{0}^{2\pi}\frac{\sin{(ia)}\cos\theta+\cos{(ia)}\sin\theta}{\cos{(ia)}\cos\theta - \sin{(ia)}\sin\theta}d\theta \\ =\frac{1}{2}\int_{0}^{2\pi}\frac{i\sinh{(a)}\frac{z+1 / z}{2}+\cosh{(a)}\frac{z-1 / z}{2i}}{\cosh{(a)}\frac{z+1 / z}{2} - i\sinh{(a)}\frac{z-1 / z}{2i}}\cdot \frac{1}{iz}dz\\ =\frac{1}{2}\int_{0}^{2\pi}\frac{z(i\sinh{(a)}(z^2+1)-i\cosh{(a)}(z^2-1))}{z(\cosh{(a)}(z^2+1) - \sinh{(a)}(z^2-1))}\cdot \frac{1}{iz}dz\\ =\frac{1}{2}\int_{0}^{2\pi}\frac{i(\sinh{(a)}(z^2+1)-\cosh{(a)}(z^2-1))}{\cosh{(a)}(z^2+1) - \sinh{(a)}(z^2-1)}\cdot \frac{1}{iz}dz$$

I'm not sure how to find the residue past this point. Any help is appreciated! Edit: Missing brackets in the title.

• $a \in \mathbb{R}$ ?. Feb 9 '17 at 3:26

\begin{align} \cos(\theta +ia)&=\frac{e^{i(\theta +ia)}+e^{-i(\theta +ia)}}{2}=\frac{e^{-a}e^{i\theta }+e^{a}e^{-i\theta }}{2}=\frac{e^{2i\theta }+e^{2a}}{2e^ae^{i\theta }},\\ \sin(\theta +ia)&=\frac{e^{i(\theta +ia)}-e^{-i(\theta +ia)}}{2i}=\frac{e^{-a}e^{i\theta }-e^{a}e^{-i\theta }}{2i}=\frac{e^{2i\theta }-e^{2a}}{2ie^ae^{i\theta }}. \end{align} Therefore the integral becomes \begin{align} I=-\frac{i}{2}\int _0^{2\pi}\frac{e^{2i\theta} -e^{2a}}{e^{2i\theta} +e^{2a}}d\theta=-\frac{1}{2} \int _{|z|=1}\frac{z^2 -e^{2a}}{z^2+e^{2a}}\cdot\frac{dz}{z}, \end{align} since $d\theta =dz/(iz)$ for $z=e^{i\theta }$.
An alternative: With $\ds{a \in \mathbb{R}}$: