Question:
Evaluate: $\int \frac{1+\cos x}{1-\cos x} d x$
Solution:
Let $I=\int \frac{1+\cos x}{1-\cos x} d x$
$\Rightarrow \int \frac{1+\cos x}{1-\cos x} d x$
$\Rightarrow \int \frac{2 \cos ^{2} \frac{x}{2}}{2 \sin ^{2} \frac{x}{2}} d x$
$\Rightarrow \int \cot ^{2} \frac{x}{2} d x$
$\Rightarrow \int\left(\operatorname{cosec}^{2} \frac{x}{2}-1\right) d x$
$\Rightarrow \frac{\left(-\cot \frac{x}{2}\right)}{\frac{1}{2}}-x$
Hence, $I=-2 \cot \frac{x}{2}-x+C$