\begin{align*}&\cot^{-1}(\tan 2x)+\cot^{-1} (-\tan 3x) \\ &=\cot^{-1} (\cot(\tfrac{\pi}{2}-2x))+\cot^{-1} (\cot(\tfrac{\pi}{2}+3x))\\ &=\tfrac{\pi}{2}-2x+\tfrac{\pi}{2}+3x\\ &=\pi -x.\end{align*}
Where did I go wrong in the process? The range of the inverse functions as well as the calculations seem fine to me. But the answer from book I am using, however, doesn't match with it. The book instead says the answer is $x$. But that's only possible when we take $\cot^{-1} (-\tan 3x)=-\cot^{-1}(\tan 3x)$. I am not sure if that's true since I know $\cot^{-1} (-x)=\pi-\cot^{-1} x$. But this fact also however doesn't give the answer $x$ and neither $\pi-x$. So I am confused.