Evaluate using contour integration $\int_0^{\pi}\frac{\sin(2\theta)}{5-3\cos(\theta)}d\theta$ I had been given in my complex analysis examination the following problem. 
Evaluate the following integral by using contour integration:
$$
\int_0^{\pi}\dfrac{\sin(2\theta)}{5-3\cos(\theta)}d\theta
$$
The answer to which is:
$$
\dfrac{2}{9}(log_e(1024)-6).
$$ 
I tried to get this answer trying different ways but I just could not find a way to do it. 
A thing to notice is that there is no $\pi$ term occurring in the final answer which means whatever the contour is which will give the answer easily is such that by integrating along that contour the value which we will get will be proportional to $\dfrac{1}{i\pi }$. This is because the $2\pi i$ term multiplying the residue should be canceled out as the actual answer does not have $\pi$ dependence. The $pi$ in the denominator gives a hint to me that this going to be complicated as in complex analysis at least in introductory courses nowhere $\pi$ comes in the denominator unless the problem is intentionally set up that way.
Another thing to notice is that if we have to use a contour that covers the angle from $0$ to $\pi$. Usually, the limits given in such problems is $0$ to $2\pi$ which is easy to do just by replacing $sine$ and $cosine$ term as follows:
$$
 sin(\theta) \rightarrow \dfrac{1}{2i}(z-\dfrac{1}{z})
$$
$$ 
cos(\theta) \rightarrow \dfrac{1}{2}(z+\dfrac{1}{z})
$$
$$
d\theta \rightarrow \dfrac{dz}{iz}
$$
and then carrying out the contour integral along $|z|=1$ contour. The limits of the integral could be converted to $0$ to $2\pi$ by proper substitution and then the contour integral by above procedure could be carried out but that would not help as it will bring in fractional order poles (as $cos\dfrac{\theta}{2}$  term will appear) which residue theory can't deal with.
So, what I need is a hint on how to do it. 
 A: Your question is basically whether
$$\int_0^{\pi}\frac{\sin 2\theta \,\mathrm{d}\theta}{5-3\cos\theta}=\int_{-1}^1\frac{2x\,\mathrm{d}x}{5-3x}= \tfrac{4}{9}(5\,\ln 2-3)$$
can be written as an integral about a closed curve of some algebraic function  over the rationals. This statement is believed to be false; it is in fact an open problem to demonstrate as much (Kontsevich and Zagier, Problem 5).
The usual method (substituting $x=\cos\theta$) will have to do.
A: I just saw this question and found it very interesting! :)
You can use a contour integral but by using the identity $\sin 2t = 2\sin t\cos t$ first.
So let's try to calculate
$$\int_0^{2\pi}\frac{\sin 2t}{5-3\cos t}dt = \int_0^{2\pi}\frac{2\sin t\cos t}{5-3\cos t}dt .$$
Put $z=e^{it}$. Then $dt= \frac{dz}{iz}$ and we know that
$$\sin t = \frac{1}{2i}\left(z- z^{-1}\right),\quad\cos t = \frac{1}{2}\left(z+ z^{-1}\right).$$
So for a contour $C$ given by $\left\{ z=e^{it} , 0\le t \le 2\pi \right\}$
there holds
$$I = \int_C \frac{\frac{1}{2i}\left(z- z^{-1}\right) \frac{1}{2}\left(z+ z^{-1}\right) \frac{dz}{iz} }{ 5-3\left(\frac{1}{2}\left(z+ z^{-1}\right)\right)} = \int_C \frac{(z^4-1)dz}{2(z-3)z^2(3z-1)}.$$
To evaluate this integral note that the integrand is analytic except at the zeros of the denominator i.e. $0, 1/3$ and $3$.
Since only $0$ and $1/3$ are inside $C$, we just need to apply the Residue Theorem to obtain desired value.
Put
$$g(z) = \frac{z^4-1}{2(z-3)z^2(3z-1)}.$$
Then
\begin{eqnarray*}
I &=& 2\pi i\big[ \text{res}_{z=0}\,g(z) +\text{res}_{z=1/3}\,g(z) \big]\\
&=& 2\pi i\left[ -\frac{5}{9} + \frac{5}{9}\right]\\
&=&  0\\
\end{eqnarray*}
This can be confirm using the antiderivative provided in Wolfram Alpha.
Clearly, you cannot use this result to calculate
$$\int_0^{\pi}\frac{\sin 2t}{5-3\cos t}dt$$
since
$$\int_0^{\pi}\frac{\sin 2t}{5-3\cos t}dt \neq \frac{1}{2}\int_0^{2\pi}\frac{\sin 2t}{5-3\cos t}dt.$$
In addition to the answer provided by K V Dave.
