when I use x = tan x, I get the answer as tan^-1(x)
when I use x = cot x, I get the answer as -cot^-1(x)
You mean, I hope, "u= tan(x)" and "u= cot(x)". And you should have got $\displaystyle tan^{-1}(x)+ C$ and $\displaystyle cot^{-1}(x)+ C$. As others have said, yes, those are the same with different constants.
Does this mean tan^-1(x) = -cot^-1(x)? How is this possible?