$cot(x-y) = \frac{cotx.coty+1}{coty-cotx}$. Given $tanx = p+1$ and $tany= p-1$. So, $cotx = \frac{1}{p+1}$ and $coty = \frac{1}{p-1}$.
$cot(x-y)= \frac{cotx.coty+1}{coty-cotx} = \frac{\frac{p^2}{p^2-1}}{\frac{2}{p^2-1}}=\frac{p^2}{2}$
So, $2cot(x-y) = p^2$ (Option B)