Finding indefinite integral 2 $$\int\frac{\sqrt{a+x}}{\sqrt{a}+\sqrt{x}}\, dx$$
A few days ago I asked a similar (looking) question where all the pluses here were minuses.
It could be much more easily manipulated than this one using difference of $2$ squares. The other method used to solve the previous problem is replacing $x$ with $\arccos^2x$. Out of curiosity I have attempted to use the latter method to solve this integral, and made a little progress with it.
Just to make sure this integral has a solution, Wolframalpha found a solution that was not too bad.
Replacing $x$ with $\arctan^2t$, the integral becomes
$$\int\frac{2a \sec^3 t \tan t}{1+\tan t}\, dt$$ 
From here I tried to perfrom integration by parts, where $2a$ is taken outside of the integral, and numberator split into $sec x\tan x$ times $\sec^2x$, as $u$ and $v'$ respectively. $v$ can easily be found but $u'$ is messy. Integration by parts needed to be done again, also, which would have ended up really messy.
So I tried to convert everything into sines and cosines, then letting $u$ equal $\cos t$, and $du$ equal to $-\sin tdt$. 
$$\int\frac{2a\sin t}{\cos^3 t \cos t +\sin t}\, dt$$ 
$$\int\frac{-2au}{u^3 u+\sqrt{1-u^2}}\, dt$$ 
However that doesn't look very pretty either. I don't think it is possible to perform Partial Fraction Decomposition on it.
What are the right paths to take to solve this integral? Are there any 'tricks of the trade' I have missed along the way?
 A: One way to approach this problem is to use the following substitutions:
$b^2=a$ and $x=b^2u^2$ and $u=\frac{2v}{1-v^2}\implies\sqrt{1+u^2}=\frac{1+v^2}{1-v^2}\text{ and }\mathrm{d}u=2\frac{1+v^2}{(1-v^2)^2}\mathrm{d}v$
For example
$$
\begin{align}
\int\frac{\sqrt{a+x}}{\sqrt{a}+\sqrt{x}}\,\mathrm{d}x
&=\int\frac{\sqrt{b^2+b^2u^2}}{b+bu}2b^2u\,\mathrm{d}u\\
&=2b^2\int\frac{\sqrt{1+u^2}}{1+u}u\,\mathrm{d}u\\
&=8b^2\int\frac{v(1+v^2)^2}{(1+2v-v^2)(1-v^2)^3}\,\mathrm{d}v
\end{align}
$$
Now, at least, the problem can be handled with partial fractions.
$$
\begin{align}
\frac{8v(1+v^2)^2}{(1+2v-v^2)(1-v^2)^3}
&=\frac2{(v+1)^3}+\frac1{(v+1)^2}+\frac3{(v+1)}\\
&-\frac2{(v-1)^3}-\frac3{(v-1)^2}-\frac3{(v-1)}\\
&+\frac{2\sqrt2}{(v-1-\sqrt2)}-\frac{2\sqrt2}{(v-1+\sqrt2)}
\end{align}
$$
A: We multiply by $1 = \frac{\sqrt{a} - \sqrt{x}}{\sqrt{a} - \sqrt{x}}$:
$$\int\frac{\sqrt{a+x}}{\sqrt{a}+\sqrt{x}}dx = \int\frac{\sqrt{a^2+ax} - \sqrt{ax + x^2}}{a - x}dx$$
Now we can separate the integral into two parts. For the left part:
$$\int\frac{\sqrt{a^2+ax}}{a - x}dx = \int\frac{\sqrt{y}}{2a^2-y}dy = \frac{\sqrt{2}}{a}\int\frac{z^2}{a\sqrt{2}+z}+\frac{z^2}{a\sqrt{2}-z}dz$$
After substitutions $y = a^2 + ax$ and $z^2 = y$. This integral evaluates easily to
$$4z-8+2\sqrt{2}a(\log(z+a\sqrt{2}) - \log(z-a\sqrt{2})) =$$
$$=4\sqrt{a^2+ax}-8+2\sqrt{2}a(\log(\sqrt{a^2+ax}+a\sqrt{2}) - \log(\sqrt{a^2+ax}-a\sqrt{2}))$$
I haven't tried yet to evaluate the other integral.
A: Take $x=az$ and $z=s^2$, where $s\geq 0$. Then
\begin{aligned}
\int\frac{\sqrt{a+x}}{\sqrt{a}+\sqrt{x}}\, dx &=a \int\frac{\sqrt{1+z}}{1+\sqrt{z}}\, dz \\
&=2a \int \sqrt{1+s^2}\frac{s}{1+s}\, ds \\
&=2a \int \sqrt{1+s^2}\,ds-2a \int \frac{\sqrt{1+s^2}}{1+s}\, ds \\
&=2aI_1-2aI_2.
\end{aligned}
Here (using the standard substitution $s=\sinh(t)$) 
$$
I_1=\frac{1}{2}s\sqrt{1+s^2}+\frac{1}{2}\operatorname{arcsinh}(s)+C.
$$
Now consider $I_2$.
In the integrand $\sqrt{1+s^2}/(1+s)$, substitute $s=\tan(u),\,(0\leq u<\pi/2)$ and  $ds=du \sec^2(u)$. Then $\sqrt{1+s^2}=\sqrt{1+\tan^2(u)}=\sec(u)$ and $u=\tan^{-1}(s)$,
$$
I_2=\int\frac{\sec^3(u)}{1+\tan(u)}\,du.
$$
In the integrand $\sec^3(u)/(1+\tan(u))$, substitute (the standard)  $p=\tan(u/2),\,(0\leq p<1)$ and  $dp=(1/2)du\sec^2(u/2)$. Then 
 using this substitution $\sin(u)=(2 p)/(1+p^2)$, $\cos(u)=(1-p^2)/(1+p^2)$ and  $du=(2  dp)/(1+p^2)$ we obtain
$$
I_2=\int 2 \frac{(1+p^2)^2}{(1-p^2)^3 (1+\frac{2 p}{1-p^2})} dp=\int-\frac{2(1+p^2)^2}{(-1+p^2-2p)(-1+p^2)^2}\,dp.
$$
Here (using computer)
$$
\begin{aligned}
-\frac{2(1+p^2)^2}{(-1+p^2-2p)(-1+p^2)^2} &=\frac{1}{(p-1)^2}-\frac{4}{-1+p^2-2p} \\
&=-\frac{1}{p+1}+\frac{1}{p-1}-\frac{1}{(p+1)^2}.
\end{aligned}
$$
These 5 integrals can be calculated easily. Now you should make back substitutions and applying a lot of trigonometric identities to obtain the final answer. I omit the details because you asked about methods ('tricks') of calculating integrals.
A: *

*Avoid trigonometric substitutions, they only work in specially designed examples, i.e. if it is your only tool you will easy find exercises in which they are a pain.

*Rationalize the denominator, by using difference of squares as you have seen before.

*Rewrite as a sum of integrals of the form $\int R(\sqrt{\frac{ax+b}{cx+d}})\text{d}x$, where $R$ are rational functions.

*Apply the substitution $y=\frac{ax+b}{cx+d}$, which always work for all of these.


Addendum: For that integral that you got at the end you can use Euler's substitutions. This turns that last integrand into a rational function and from there partial fraction decomposition finishes it. Still, the trigonometric substitution was a long path to get to the rational function.
