1 | initial version |
Note that, for Sage :
sage: bool(tan(arctan(x))==x)
True
sage: bool(arctan(tan(x))==x)
False
(Indeed, the first expression is defined (and True) for all $x\in\mathbb{R}$, whereas the second is defined for $x\neq\frac{2k+1}{2}\pi,~k\in\mathbb{Z}$, and True only for $x \in \left]-\frac{\pi}{2},~\frac{\pi}{2}\right[$).
Note also that, for Sage :
sage: tan(pi/2-x).trig_expand()
cot(x)
sage: tan(x-pi/2).trig_expand()
-cot(x)
sage: bool(cot(x)==1/tan(x))
True
which allow to retrieve your equalities (assuming that the domain choosen for $\arctan$ is indeed $\left]-\frac{\pi}{2},~\frac{\pi}{2}\right[$).