# integration of complex trigonometric function

Compute $$\oint_{|z-\frac{\pi}{2}|=\pi+1}z\cdot \tan(z)dz$$

My solution: the integrand is a meromorphic function with simple poles at points: $\frac{\pi}{2}+n\pi$, with $n$ integer. Among these points, $\pm \frac{\pi}{2},\frac{3}{2}\pi$ lie inside the contour. I use the formula for simple poles: $$Res\left(\frac{f}{g},z_0\right)=\frac{f(z_0)}{g'(z_0)}$$ In my case ($f=z\sin z, g=\cos z$) i get: $$Res\left(z\cdot \tan(z),\pm\frac{\pi}{2}\right)=\mp\frac{\pi}{2}$$ and $$Res\left(z\cdot \tan(z),\frac{3\pi}{2}\right)=-\frac{3\pi}{2}$$ I apply residue formula to get $I=-3\pi^2i$. Someone could say me if i made some mistakes?

-

There are three singularities inside the given path, $-\frac\pi2,\frac\pi2,\frac{3\pi}2$.
For $z=-\frac\pi2$, let $z=w-\frac\pi2$ $$z\tan(z)=-\frac{\left(w-\frac\pi2\right)\cos(w)}{\sin(w)}\to\frac\pi2$$ For $z=\frac\pi2$, let $z=w+\frac\pi2$ $$z\tan(z)=-\frac{\left(w+\frac\pi2\right)\cos(w)}{\sin(w)}\to-\frac\pi2$$ For $z=\frac{3\pi}2$, let $z=w+\frac{3\pi}2$ $$z\tan(z)=-\frac{\left(w+\frac{3\pi}2\right)\cos(w)}{\sin(w)}\to-\frac{3\pi}2$$ Thus, the sum of the residues inside the contour is $-\dfrac{3\pi}2$. To get the integral, multiply by $2\pi i$ to get $$\oint_{|z-\frac{\pi}{2}|=\pi+1}z\tan(z)\mathrm{d}z=-3\pi^2i$$ It looks as if you are fine.