<s>[INST] Evaluating $\int _0^{\frac{\pi }{2}}\frac{1}{1+\cos \theta \cdot \cos x} \ \mathrm{d}x$ for $\theta \in (0, \pi)$ Within a problem with several steps, I am asked to show the following equality given that $\theta \in (0, \pi)$:
$$\pi\int _0^{\frac{\pi }{2}}\frac{1}{1+\cos \theta \cdot \cos x} \ \mathrm{d}x=\frac{\pi \theta}{\sin \theta}$$
I have no idea how to attack this. I don't see any clear trigonometric identity that I could apply. What would you suggest? Any hint/clue/help would be appreciated. Thanks.
You can check this post if you are interested in the rest of the problem.
 [/INST] Letting $t=\tan \frac{x}{2} $ yields
$$
\begin{aligned}
& \int_0^{\frac{\pi}{2}} \frac{1}{1+\cos \theta \cos x} d x \\
= & \int_0^1 \frac{1}{1+\cos \theta \frac{1-t^2}{1+t^2}} \cdot \frac{2 d t}{1+t^2} \\
= & 2 \int_0^1 \frac{1}{(1+\cos \theta)+(1-\cos \theta) t^2} d t \\
= & \frac{2}{\sqrt{(1+\cos \theta)(1-\cos \theta)}}\left[\tan \left(\sqrt{\frac{1-\cos \theta}{1+\cos \theta}} \cdot t\right)\right]_0^1 \\
= & \frac{2}{\sin \theta} \cdot \frac{\theta}{2} \\
= & \frac{\theta}{\sin \theta}
\end{aligned}
$$
</s>