It's said that
$$\frac{\pi }{2}-\tan^{-1}\left(x\right)=\tan^{-1}\left(\frac{1}{x}\right)\tag{1}$$
Well what about this. Lets say
$$\frac{\pi }{2}-\tan^{-1}x=\frac{\left(\pi \:-2\tan^{-1}x\right)}{2}$$
Now let
$$2\tan^{-1}x=\tan^{-1}y\tag{2}$$
Then we can write
$$\frac{\pi }{2}-\tan^{-1}x=\frac{\left(\pi -\tan^{-1}y\right)}{2}$$
$$=-\frac{\tan^{-1}y}{2}$$
$$=-\frac{2\tan^{-1}x}{2}$$
$$=-\tan^{-1}x\neq(1)$$
What's happening? Am I wrong somewhere?