Answer
$$2-\frac{\pi}{2}$$
Work Step by Step
\begin{aligned}
\int_{\pi / 2}^{\pi} \cot ^{2} \frac{\theta}{2} d \theta &=\left[-2 \cot \frac{\theta}{2}-\theta\right]_{\pi / 2}^{\pi}
\\ &=2+\frac{\pi}{2}-\pi \\
&= 2-\frac{\pi}{2}\end{aligned}