Question:
$\frac{1}{1+\cot x}$
Solution:
Let $I=\int \frac{1}{1+\cot x} d x$
$=\int \frac{1}{1+\frac{\cos x}{\sin x}} d x$
$=\int \frac{\sin x}{\sin x+\cos x} d x$
$=\frac{1}{2} \int \frac{2 \sin x}{\sin x+\cos x} d x$
$=\frac{1}{2} \int \frac{(\sin x+\cos x)+(\sin x-\cos x)}{(\sin x+\cos x)} d x$
$=\frac{1}{2} \int 1 d x+\frac{1}{2} \int \frac{\sin x-\cos x}{\sin x+\cos x} d x$
$=\frac{1}{2}(x)+\frac{1}{2} \int \frac{\sin x-\cos x}{\sin x+\cos x} d x$
Let $\sin x+\cos x=t \Rightarrow(\cos x-\sin x) d x=d t$
$\begin{aligned} \therefore I &=\frac{x}{2}+\frac{1}{2} \int \frac{-(d t)}{t} \\ &=\frac{x}{2}-\frac{1}{2} \log |t|+\mathrm{C} \\ &=\frac{x}{2}-\frac{1}{2} \log |\sin x+\cos x|+\mathrm{C} \end{aligned}$