<s>[INST] Finding indefinite integral $$\int\frac{\sqrt{a-x}}{\sqrt{a}-\sqrt{x}}\, dx$$
Can someone give a hint as to how to break this apart into a do-able integral?
Just spent ages trying to substitute $\sqrt{a-x}$ and $\sqrt{x}$ as $u$, without success.
Advice/help much appreciated.
 [/INST] Note that $$\frac{{\sqrt {a - x} }}{{\sqrt a  - \sqrt x }} = \frac{{\sqrt {a - x} }}{{a - x}}\left( {\sqrt a  + \sqrt x } \right) = \frac{{\sqrt a  + \sqrt x }}{\sqrt{a - x}}$$
This allows to get an easy integral in the first summand. For the second one, we make a series of elementary yet (maybe) non-obvious manipulations
 $$\begin{align}
  \int {\sqrt {\frac{x}{{a - x}}} dx}  &\mathop  = \limits^{\left( 1 \right)}  \int {\sqrt {\frac{a}{u} - 1} \left( { - du} \right)}  \\
   &\mathop  = \limits^{\left( 2 \right)} \int {w\frac{{2wa}}{{{{\left( {{w^2} + 1} \right)}^2}}}dw}  \\
   &\mathop  = \limits^{\left( 3 \right)}  - \frac{{aw}}{{1 + {w^2}}} + a\int {\frac{{dw}}{{{w^2} + 1}}}  \\ 
    &\mathop  = \limits^{\left( 4 \right)} - \frac{{aw}}{{1 + {w^2}}} + a\arctan w\end{align} $$
Explanation
$(1)$ Make $u=a-x$
$(2)$ Make $w^2=\dfrac ua-1$
$(3)$ Integrate by parts with $f=w,g'=\dfrac{2w}{(1+w^2)^2}$
$(4)$ Use the usual trigonometric integral $(\tan^{-1}x)'=(1+x^2)^{-1}$
The above gives $$\int {\sqrt {\frac{x}{{a - x}}} dx}  = a\arctan \sqrt {\frac{x}{{a - x}}}  - \sqrt {x\left( {a - x} \right)}  + C$$
</s>