Do we have to consider different ranges when we a using trigonometric substitution? Several times during integration we use trigonometric substitutions like $x=\sin(y)$ or $x=\tan(y)$ but in such cases do we have to take care of the sign of $x$ by considering different ranges for $y$?
For example when we are integrating $$\frac{1}{x\sqrt{x^2-1}}$$ we may use $x=\sec(y)$.In case $0\leq y<\dfrac\pi2$ answer will be $\sec^{-1}{x}$ but if $\pi/2< y\leq\pi$ answer will be $\sec^{-1}{(-x)}$.Morever they do not differ by a constant as $\sec^{-1}{x}\ne \sec^{-1}{(-x)}+C$.
However in all books I have seen till now during trigonometric substitution range is never taken care of.My question is that is necessary and correct to take care of the range of the trigonometric variable substituted?Why or why not?
 A: I will try to answer this question and the linked question "in one" since they are related. 
Integration by substitution becomes a bit subtle when you want to replace $x$ with something else. Whenever you have a substitution of the form $x=g(u)$, you need to ensure $g$ is a bijection. In particular, the image of $g$ needs to be the domain of the integrand (or, at least, a superset of it). Hence if $x=\sec u$, we want $u \in [0, \pi]$. This is convention, of course; any branch will do so long as it's consistently used. The inverse now is 
$\sec u = x \Longleftrightarrow \cos u = \frac{1}{x} \Longleftrightarrow u = \arccos \frac{1}{x}$. The biconditional is justified because $u \in [0, \pi]$. There is no ambiguity. Now, 
$$\frac{du}{dx} =\frac{1}{|x| \sqrt{x^2 - 1}} $$ or $dx = |x| \sqrt{x^2 - 1} \ du =|\sec u \tan u| \ du = \sec u \tan u \ du$. The removal of the absolute value sign is justified because $u \mapsto \sec u \tan u$ is $\geq 0$ for all $u \in [0, \pi]$. 
This is precisely the same thing we get when we more "sloppily" differentiate with respect to $u$ with $x = \sec u$. 
Now, let's integrate your integral 
$$\int \frac{dx}{x \sqrt{x^2 - 1}} $$ from scratch. Let $x=\sec u$. Then $dx = \sec u \tan u \ du$. This yields
$$\int \text{sgn}(\tan u) \ du =  \text{sgn}(\tan u) |\sec^{-1} x| + C = 
\begin{cases}
\sec^{-1}(x) + C_1  & x \geq 1 \\
-\sec^{-1}(x) + C_2, & x \leq -1
\end{cases}$$
For your final answer, you can replace $\sec^{-1}$ with $\frac{\pi}{2} - \csc^{-1}$ and consolidate the constants; this should address the doubt raised in the other question. 
Working with disconnected domains and non-injective functions, in this context, it is a bit tricky to rigorously justify some stuff, but it all works out in the end. 
A: When solving integrals by substitution, the discussion of the signs is indeed often left implicit, sometimes by negligence, sometimes by educated guess. Sometimes also the focus of the discussion is to trace a path to the solution, leaving the "gory" details for later.
Looking at your particular case, we observe that the integrand is undefined for $|x|<1$ and the integration domain may not intersect $[-1,1]$. As the integrand is an odd function, its antiderivative will be even and WLOG it suffices to solve in the positive domain. This is why we may ignore the sign for a while.
