$\displaystyle

\int_0^{{\raise0.5ex\hbox{$\scriptstyle \pi $}

\kern-0.1em/\kern-0.15em

\lower0.25ex\hbox{$\scriptstyle 2$}}} {{\textstyle{{dx} \over {1 + \cos \left( x \right)}}}} = \int_0^{{\raise0.5ex\hbox{$\scriptstyle \pi $}

\kern-0.1em/\kern-0.15em

\lower0.25ex\hbox{$\scriptstyle 2$}}} {{\textstyle{{1 - \cos \left( x \right)} \over {\sin ^2 \left( x \right)}}}dx}

$$\displaystyle

= - \int_0^{{\raise0.5ex\hbox{$\scriptstyle \pi $}

\kern-0.1em/\kern-0.15em

\lower0.25ex\hbox{$\scriptstyle 2$}}} {\left( {1 - \cos \left( x \right)} \right) \cdot \left( {\cot \left( x \right)} \right)^\prime dx}

$

Now integrate by parts.