Which of these answers is the correct indefinite integral? (Using trig-substitution or $u$-substitution give different answers) Answers obtained from two online integral calculators:

$$\begin{align}\int\dfrac{\sqrt{1 + x}}{\sqrt{1 - x}}\,\mathrm dx &= -\sqrt{\dfrac{x + 1}{1 - x}} + \sqrt{\dfrac{x + 1}{1 - x}}x - 2\arcsin\left(\dfrac1{\sqrt2}\sqrt{1 - x}\right) + C \\ 
\int\dfrac{\sqrt{1 + x}}{\sqrt{1 - x}}\,\mathrm dx &= 2\sin^{-1}\left(\dfrac{\sqrt{x + 1}}{\sqrt2}\right) - \sqrt{1 - x^2} + \text{ constant}
\end{align}$$

Answers from online calculator shown above, and my answers shown in the link:


Update:
I realized that the substitution for $\theta$ was supposed to be $\arcsin$ not $\arccos$, so the answer would have been the same as the right hand side. 
But I also noticed that using the initial substitution to plug $x$ back in the final answer will not always give the correct answer because in a similar question: 
$$\int \frac{\sqrt{x^2-1}}x dx$$
has a trig-substitution of $x = \sec\theta$, and the answer in terms of $\theta$ would be: $\tan \theta - \theta + C$. Then the final answer in terms of $x$ should be : $\sqrt{x^2-1} - \operatorname{arcsec}(x) + C$.
But online integral calculators give the answer: $\sqrt{x^2-1} - \arctan(\sqrt{x^2-1}) + C$, which doesn't match the original substitution of:
$$x = \sec\theta \to \theta = \operatorname{arcsec}(x)$$
Anyone know why the calculator gives that answer which doesn't match the original trig-substitution of $x = \sec \theta \to \theta = \operatorname{arcsec}(x)$?
 A: Now, both answers are correct.  They merely look different.  They differ by a constant.
Note 1...
$$
-\sqrt{\frac{x+1}{1-x}}+\sqrt{\frac{x+1}{1-x}}\;x
=
-\sqrt{\frac{x+1}{1-x}}\;(1-x)
=
-\frac{\sqrt{x+1}\;(1-x)}{\sqrt{1-x}}
\\=
-\sqrt{x+1}\sqrt{1-x}
=-\sqrt{(1+x)(1-x)}
=-\sqrt{1-x^2}
$$
Note 2...
$$
2\,\arcsin \left( \frac{\sqrt {1+x}}{\sqrt {2}} \right) =\pi-2\,\arcsin
 \left( \frac{\sqrt {1-x}}{\sqrt {2}} \right) 
$$
A: Since you've already understood the first part, I'll address your second question.
Starting off with $\displaystyle\int \frac{\sqrt{x^2-1}}{x}\mathrm dx$, substitute $x = \sec(\theta)$ for $\theta \in \left[0, \frac{\pi}{2}\right) \cup \left(\frac{\pi}{2}, \pi\right]$ as usual (keep the domain in mind for later). Of course, that means $\sqrt{x^2-1} = \sqrt{\sec^2(\theta)-1} = \sqrt{\tan^2(\theta)} = \vert \tan(\theta)\vert$ and $\dfrac{\mathrm dx}{\mathrm d\theta} = \sec(\theta)\tan(\theta) \iff \mathrm dx = \sec(\theta)\tan(\theta)\mathrm d\theta$. This simplifies as follows:
$$\displaystyle\int \frac{\sqrt{x^2-1}}{x}\mathrm dx \longrightarrow \int\frac{\vert \tan(\theta)\vert}{\sec(\theta)}\sec(\theta)\tan(\theta)\mathrm d\theta = \int\vert \tan(\theta)\vert\tan(\theta)\mathrm d\theta$$
For $\theta \in \left[0, \frac{\pi}{2}\right)$, $\tan(\theta) \geq 0$, so you get 
$$\int \tan^2(\theta) \mathrm d\theta = \int \left[\sec^2(\theta)-1\right] \mathrm d\theta = \tan(\theta)-\theta+C \longrightarrow \sqrt{x^2-1}-\text{arcsec}(x)+C$$
Since tangent is positive in the first quadrant, $\tan(\theta) = \sqrt{x^2-1}$, so the $\theta$ term can also be replaced with $\arctan\left(\sqrt{x^2-1}\right)$.
For $\theta \in \left(\frac{\pi}{2}, \pi\right]$, $\tan(\theta) \leq 0$, so you get 
$$-\int \tan^2(\theta) \mathrm d\theta = -\int \left[\sec^2(\theta)-1\right] \mathrm d\theta = \theta-\tan(\theta)+C \longrightarrow \sqrt{x^2-1}+\text{arcsec}(x)+C$$
Since tangent is negative in the second quadrant, $\tan(\theta) = \tan(\theta -\pi) = -\sqrt{x^2-1}$ (remember that tangent takes arguments in the first and fourth quadrants), so the $\theta$ term can also be replaced with $\pi-\arctan\left(\sqrt{x^2-1}\right)$.
In both cases, the anti-derivative could be re-written as $\sqrt{x^2-1}-\arctan\left(\sqrt{x^2-1}\right)+C$. Basically, it just "combines" your other two anti-derivatives and expresses them as a single function rather than having one for each case.
A: Let
\begin{align}
  I &= \int \frac{\sqrt{1+x}}{\sqrt{1-x}}\;dx
    = \int \frac{1+x}{\sqrt{1-x^2}}\;dx
\end{align}
Left side:

Let $x = \sin\theta$, $dx = \cos\theta\;d\theta$.
  \begin{align}
  I &= \int \frac{1+\sin\theta}{\sqrt{\cos^2\theta}}\cos\theta\;d\theta  \\
    &= \int \left(1+\sin\theta \right)d\theta  \\
    &= \theta - \cos\theta + c  \\
    &= \arccos\left(\sqrt{1-x^2}\right) - \sqrt{1-x^2} + c
  \end{align}

Right side:

\begin{align}
  I &= \int \frac{1}{\sqrt{1-x^2}}\;dx + \int \frac{x}{\sqrt{1-x^2}}\;dx  \\
  u &= 1 - x^2,\;\; -\frac{1}{2}du = x\,dx  \\ \implies
  I &= \arcsin x - \frac{1}{2}\int u^{-1/2}\;du  \\
    &= \arcsin x - \sqrt{u} + c  \\
    &= \arcsin x - \sqrt{1 - x^2} + c
  \end{align}

The answers would be the exact same, if $\arccos\left(\sqrt{1-x^2}\right) = \arcsin x$. And therein lies the difference. On the "Left side", the substitution you originally made was $x = \sin\theta$. So when you replace $\theta$ you should substitute $\theta = \arcsin x$.
By the rules of trig substitution, they should be equivalent. But canonically, the arcsin function has a range of $-\pi/2$ to $\pi/2$, while the arccos function has a range of $0$ to $\pi$. So when you use $\arccos\left(\sqrt{1-x^2}\right)$, as-is you are losing the case where $-1 < x < 0$. The integral has a kink in it, but that's not what you want, seeing as how the function being integrated is continuous and differentiable at $x=0$.
You could shift arccos by an appropriate amount and use that solution, but I think it would be easier to go with arcsin here.
