Suppose we want to calculate $\cot^{-1}x-\cot^{-1}y$ for $\forall~x,y$
$$\cot^{-1}x-\cot^{-1}y=\theta\tag{1}$$
Let's find range of $\theta$, assuming $x$ and $y$ to be independent variables
$$\theta\in(-\pi,\pi)$$
Taking $\cot$ on both sides of equation $1$
$$\dfrac{\cot(\cot^{-1}x)\cot(\cot^{-1}y)+1}{\cot(\cot^{-1}y)-\cot(\cot^{-1}x)}=\cot\theta$$
$$\dfrac{xy+1}{y-x}=\cot\theta$$
Taking $\cot^{-1}$ on both sides
$$\cot^{-1}\dfrac{xy+1}{y-x}=\cot^{-1}(\cot\theta)$$
$$\cot^{-1}(\cot\theta)=\begin{cases} \pi+\theta,&-\pi<\theta<0 \\ \theta,&0<\theta<\pi \\ \end{cases}$$
So
$$\theta=\begin{cases} -\pi+\cot^{-1}\dfrac{xy+1}{y-x},&-\pi<\theta<0 \\ \cot^{-1}\dfrac{xy+1}{y-x},&0<\theta<\pi \\ \end{cases}$$
$$\cot^{-1}x-\cot^{-1}y=\begin{cases} -\pi+\cot^{-1}\dfrac{xy+1}{y-x},&-\pi<\cot^{-1}x-\cot^{-1}y<0 \\ \cot^{-1}\dfrac{xy+1}{y-x},&0<\cot^{-1}x-\cot^{-1}y<\pi\\ \end{cases}$$
$$\cot^{-1}x-\cot^{-1}y=\begin{cases} -\pi+\cot^{-1}\dfrac{xy+1}{y-x},&\cot^{-1}x-\cot^{-1}y\in(-\pi,0) \\ \cot^{-1}\dfrac{xy+1}{y-x},&\cot^{-1}x-\cot^{-1}y\in(0,\pi)\\ \end{cases}$$
$$\cot^{-1}x-\cot^{-1}y=\begin{cases} -\pi+\cot^{-1}\dfrac{xy+1}{y-x},&\dfrac{xy+1}{y-x}\in(-\infty,\infty) \\ \cot^{-1}\dfrac{xy+1}{y-x},&\dfrac{xy+1}{y-x}\in(-\infty,\infty)\\ \end{cases}$$
So finally we can write
$$\cot^{-1}x-\cot^{-1}y=\begin{cases} -\pi+\cot^{-1}\dfrac{xy+1}{y-x}, &x>y\\ \cot^{-1}\dfrac{xy+1}{y-x}, &x<y\\ \end{cases}$$
We can also derive for $\cot^{-1}x+\cot^{-1}y$ in the following way
Adding $\pi$ to both sides
$$\cot^{-1}x+\pi-\cot^{-1}y=\begin{cases} \cot^{-1}\dfrac{xy+1}{y-x}, &x>y\\ \pi+\cot^{-1}\dfrac{xy+1}{y-x}, &x<y\\ \end{cases}$$
$$\cot^{-1}x+\cot^{-1}(-y)=\begin{cases} \cot^{-1}\dfrac{xy+1}{y-x}, &x>y\\ \pi+\cot^{-1}\dfrac{xy+1}{y-x}, &x<y\\ \end{cases}$$
Replacing $y$ with $-y$
$$\cot^{-1}x+\cot^{-1}(y)=\begin{cases} \cot^{-1}\dfrac{-xy+1}{-y-x}, &x>-y\\ \pi+\cot^{-1}\dfrac{-xy+1}{-y-x}, &x<-y\\ \end{cases}$$
$$\cot^{-1}x+\cot^{-1}(y)=\begin{cases} \cot^{-1}\dfrac{xy-1}{y+x}, &x+y>0\\ \pi+\cot^{-1}\dfrac{xy-1}{y+x}, &x+y<0\\ \end{cases}$$
Is it correct, I am asking because I am not sure about it because in text-books I just find $\cot^{-1}x-\cot^{-1}y=\cot^{-1}\dfrac{xy+1}{y-x}$ and I was not finding formula for $\cot^{-1}x+\cot^{-1}(y)$.