What is the range of $f(x) = \sec ^{-1}(x) + \tan^{-1} (x)$ . To find the range of this function
$$f(x) = \sec ^{-1}(x) + \tan^{-1} (x)$$
I solved it like,
Range ($\sec ^{-1}(x)$) = $[0,π] $~$ ${π/2}
and, Range ($\tan^{-1} (x)$) = $(-π/2 , π/2)$
So the resultant Range will be the intersection of the two individual ranges.
So I got my answer as $[0, π/2)$, but the textbook answer is $(0,π)$. Hence my question is what is happening here and where am I wrong.
Please help me to get the fundamentals used here.
 A: First of all, for real $\sec^{-1}x,$ we need $x^2\ge1$
$\implies$ either $x\ge1$ or $x\le-1$
Let $\sec^{-1}x=y\implies0\le y\le\pi,\ne\dfrac\pi2$  and $x=\sec y$
Case $\#1:$ When  $x<0, x\le-1$ and $y>\dfrac\pi2$
$\tan y=-\sqrt{x^2-1}\implies y=\pi+\tan^{-1}(-\sqrt{x^2-1})$
Set $x=-u, u\ge1,$
$$f(x)=\tan^{-1}(x)+\pi+\tan^{-1}(-\sqrt{x^2-1})=\pi-(\tan^{-1}u+\tan^{-1}\sqrt{u^2-1})=g(u)\text{(say)}$$
Clearly, $g(u)$ is a decreasing function
$$g(1)=?, \lim_{u\to\infty}g(u)=0$$
Case $\#2:$ When  $x>0, x\ge1$ and $y<\dfrac\pi2;$
$$f(x)=\tan^{-1}x+\tan^{-1}(\sqrt{x^2-1})$$ which is clearly an increasing function
Can you take it from here?
A: For $1\leqslant x<\infty$, the quantity $\sec^{-1}x$ increases from $0$ to (not quite) $\frac12\pi$, while $\tan^{-1}x$ increases from $\frac14\pi$ to (again not quite) $\frac12\pi$. Thus the range of $x\mapsto\sec^{-1}x+\tan^{-1}x$ on this part of its domain is $[\frac14\pi\,\pmb,\,\pi)$. For $-\infty< x\leqslant-1$, the inverse secant increases from (just above) $\frac12\pi$ to $\pi$, while the inverse tangent increases from (just above) $-\frac12\pi$ to $-\frac14\pi$. So this part of the range is $(0\,\pmb,\,\frac34\pi]$. The combined range is therefore $[\frac14\pi\,\pmb,\,\pi)\cup  (0\,\pmb,\,\frac34\pi]=(0\,\pmb,\,\pi)$.
