Answer
$cos~\frac{x}{2} = \sqrt{\frac{10-3\sqrt{10}}{20}}$
Work Step by Step
Since $\frac{\pi}{2} \lt x \lt \pi$, then $\frac{\pi}{4} \lt \frac{x}{2} \lt \frac{\pi}{2}$. The angle $\frac{x}{2}$ lies in quadrant I, so $cos~\frac{x}{2}$ is positive.
$cot~x = \frac{adj}{opp} = -3 = \frac{-3}{1}$
If the adjacent side is -3 and the opposite side is 1, then the hypotenuse is $\sqrt{(-3)^2+(1)^2} = \sqrt{10}$
$cos~\frac{x}{2} = \sqrt{\frac{1+cos~x}{2}}$
$cos~\frac{x}{2} = \sqrt{\frac{1+(\frac{-3}{\sqrt{10}})}{2}}$
$cos~\frac{x}{2} = \sqrt{\frac{\frac{10-3\sqrt{10}}{10}}{2}}$
$cos~\frac{x}{2} = \sqrt{\frac{10-3\sqrt{10}}{20}}$