Let I=∫11+cotxdx
=∫sinxsinx+cosxdx
=12∫2sinxsinx+cosxdx
=12∫(sinx+cosx)+(sinx−cosx)(sinx+cosx)dx
=12∫1dx+12∫sinx−cosxsinx+cosxdx
=12(x)+12∫sinx−cosxsinx+cosxdxPut\sin x+\cos x=t\Rightarrow (\cos x-\sin x)dx=dt\therefore\displaystyle I=\frac {x}{2}+\frac {1}{2}\int \frac {-(dt)}{t}\displaystyle =\frac {x}{2}-\frac {1}{2}\log |t|+C\displaystyle =\frac {x}{2}-\frac {1}{2}\log |\sin x+\cos x|+C$