integrate $\int\sqrt{x^2-1}dx$ unproven step In order to find $\int\sqrt{x^2-1}dx$ one makes substitutions $x=\sec(\theta)$ , $dx=\sec(\theta)\tan(\theta)d\theta$ and $\sqrt{x^2-1}$ = $\sqrt{\tan^2(\theta)}$. Then you find $\int{\tan^2(\theta) \sec(\theta)}d\theta$ directly as easy as $1+1=2$ it seems from many online sources and even WolframAlpha. But I tried for hours but every way I try, $\sqrt{\tan^2(\theta)}\neq\tan(\theta)$. I already taken into account $\theta$ is a substitution for $\sec^{-1}(x)$, does not make a difference. What do I think wrong? (edit: and also $\sqrt{\tan^2(\theta)} * \tan(\theta)$ != $\tan^2(\theta)$ )
 A: It's important to note that $\sec(\theta)=\sec(-\theta)=\sec(\theta+\pi)$. So when you perform the substitution $x=\sec(\theta)$, you should specify the range of $\theta$ so that for each $x$, there is only one $\theta$. 
For example we could take $\theta\in(0,\pi/2)$ if $x>0$ and $\theta\in (\pi,3\pi/2)$ if $x<0$. And then you can safely imply that $\tan\theta>0$, or $\sqrt{\tan^2\theta}=\tan\theta$.
A: Indeed,
$$
\sqrt{\tan^2\theta}\neq \tan \theta
$$
in general, but
$$
\sqrt{\tan^2\theta}=|\tan\theta|=
\begin{cases}
\tan\theta, & \text{if}\ \tan\theta\geq 0;\\
-\tan\theta, & \text{if}\ \tan\theta<0.
\end{cases}
$$
since for any real $x$,
$$
\sqrt{x^2}=|x|
$$
This means that you should be a bit careful with the sign.
A: $\int\sqrt (x^2-1)dx$
(1)Use a substitution of $x=cosh \theta$, $dx=sinh\theta$
=$\int\sqrt(cosh^2-1).(sinh\theta)d\theta$
=$\int\sqrt sinh^2\theta.(sinh\theta)d\theta$
=$\int\sinh^2\theta d\theta$
Using double angle formulae: $cosh 2\theta=1+2sinh^2\theta$
Hence, $sinh^2\theta=\frac{1}{2}(cosh 2\theta-1)$
=$\frac{1}{2}\int (cosh2\theta-1)d\theta$
=$\frac{1}{2}[\frac{sinh 2\theta}{2}-\theta]$
Need to otain final answer in terms of $x$,
so from (1), substitute $cosh\theta=x$ 
in $cosh^2\theta-sinh^2\theta=1$. Hence $sinh\theta=\sqrt(x^2-1)$
Therefore $sinh 2\theta=2cosh\theta sinh\theta=2x\sqrt(x^2-1)$ 
$\frac{1}{2}[\frac{2x\sqrt(x^2-1)}{2}-cosh^{-1}x]$+C
$\frac{x\sqrt(x^2-1)}{2}-\frac{cosh^{-1}x}{2}$+C
A: Here is a more complicated, but more rigorous way, of solving this problem. 
The function $f(x) = \sqrt{x^2-1}$ has domain $(-\infty,-1]\cup [1,\infty)$. But we will ignore the endpoints and rather think of it as being defined on $(-\infty,-1)\cup (1,\infty)$, because "differentiability" is defined on open intervals. Notice that the domain is disconnected. This means if $F_1(x),F_2(x)$ are anti-derivatives of $f(x)$, then it is no longer true that $F_1(x) = F_2(x) + c$ for some real number $c$. 
So instead what we have to do is choose one of these two intervals. The more natural choice is to pick the interval $(1,\infty)$ and treat $f(x)$ as being defined on that interval. 
Now let $g(x) = \sec^{-1} x$. This function is defined and differentiable on the same interval $(1,\infty)$. We also know that $g'(x) = \frac{1}{x\sqrt{x^2-1}}$. 
Observe that, for $x>1$, 
$$ f(x) = \sqrt{x^2-1} = \frac{x(x^2-1)}{x\sqrt{x^2-1}} = x(x^2-1)g'(x)$$
We also have that, 
$$ (x^2-1) = \sec^2(\sec^{-1} x) - 1 = \sec^2(g(x)) - 1 = \tan^2(g(x))$$
And, 
$$ x = \sec(\sec^{-1} x) = \sec(g(x))$$
Putting it together, 
$$ f(x) = \sec(g(x))\tan^2(g(x)) g'(x) $$
The "substitution rule" therefore tells us that if we find an anti-derivative $F(x)$ of $\sec(x)\tan^2(x)$ then $F(g(x))$ will be anti-derivative of $f(x)$.
As you can see your difficulty does not come up in this more rigorous method.  
