calculate $\int_{0}^{2\pi}\frac{1-\sin(t)}{2-\cos(t)}dt$ I need to calculate $\int_{\gamma} \frac{1-\sin(z)}{2-\cos (z)}dz$ where $\gamma$ is the upper hemisphere of the circle with center $\pi$ and radius $\pi$, with a positive direction.
The original question was to calculate $\int_{0}^{2\pi}\frac{1-\sin(t)}{2-\cos(t)}dt$ using complex integration.
So I connected the half circle from $2\pi$ to $0$ with the straight line $0$ to $2\pi$ to get a half circle centered around $\pi$ with radius $\pi$. Let's call the curve of this circle $\Gamma$, and the curve from $2\pi$ to $0$ $\gamma$.
We know that $\int_{\Gamma} \frac{1-\sin(z)}{2-\cos (z)}dz=\int_{\gamma}\frac{1-\sin(z)}{2-\cos (z)}dz+\int_{0}^{2\pi}\frac{1-\sin(t)}{2-\cos (t)}dt$
since $2-\cos (z)$ has no roots inside $\Gamma$, it's analytic in $\Gamma$ and so $\int_{\Gamma} \frac{1-\sin(z)}{2-\cos (z)}dz=0$.
All that's left is to find $\int_{\gamma}\frac{1-\sin(z)}{2-\cos (z)}dz$ and I'm having some difficulties.
I can't find an easy parametrization. It's a half circle centered around $\pi$ with radius $\pi$, so the parametrization $z(t)=\pi+\pi e^{it}$ comes to mind, but it's not very pleasant to calculate that integral with that parametrization.
I could use a hand.
The final answer should be $\frac{2\pi}{\sqrt 3}$
Edit:
As a comment suggested I went on a different approach:
$$\int_{0}^{2\pi} \frac{1-\sin (t)}{2-\cos (t)}dt=\int_{|z|=1}\frac{1-\frac{z-z^{-1}}{2i}}{2-\frac{z+z^{-1}}{2}}dz=\int_{|z|=1}\frac{-z^2+2iz+1}{-iz^2+4iz-i}dz$$
The roots of the denominator are $z_1=2+\sqrt{3}$ and $z_2=2-\sqrt{3}$, the numerator is not zero at those points, these are poles of the first order.
$Res(\frac{-z^2+2iz+1}{-iz^2+4iz-i},2+\sqrt{3})=\frac{3+2\sqrt{3}}{3}+(2+\sqrt{3})i$
$Res(\frac{-z^2+2iz+1}{-iz^2+4iz-i},2-\sqrt{3})=\frac{3-2\sqrt{3}}{3}+(2-\sqrt{3})i$
The sum of the residues is $2+4i$, so from residue theorem $$\int_{0}^{2\pi}\frac{1-\sin(t)}{2-\cos(t)}dt=\int_{|z|=1}\frac{1-\frac{z-z^{-1}}{2i}}{2-\frac{z+z^{-1}}{2}}dz=2i\pi(2+4i)=4i\pi-8\pi$$
Is this correct? This doesn't agree with the given answer of $\frac{2\pi}{\sqrt{3}}$

I suggest a different approach. First of all please note that
\begin{equation}
sin(t)=\frac{e^{jt}-e^{-jt}}{2j}
\end{equation}
and
\begin{equation}
cos(t)=\frac{e^{jt}-e^{-jt}}{2}
\end{equation}
Since $e^{jt}=z$ you can wtite your integral as
\begin{equation}
-\frac{j(z-j)^2}{1-4 z+z^2}
\end{equation}
while $dt= dz/(jz)$. Now your integral can be evaluates by adding the residues:
\begin{equation}
\int{-\frac{(z-j)^2}{z(1-4 z+z^2)}}=2 \pi j (Res(0)+Res(2-\sqrt(3)))
\end{equation}
The residue in $2+\sqrt(3)$ is outside the circle of radius 1, so it does not contribute to the integral. The results is exactly $\frac{2 \pi}{\sqrt 3}$.
