<s>[INST] what is $\int{\sqrt{\frac{x}{x-c}}} dx$ Tried all methods I knew, but couldn't get to a solution:
$$\int{\sqrt{\frac{x}{x-c}}} dx$$
where $c$ is a constant.
Since I myself wasn't able to solve it, I tried using online integral calculators. One answer i got was
$$\int{\sqrt{\frac{x}{x-c}}} dx =\frac{\sqrt{x/(-c + x)}\cdot(\sqrt{x}(-c + x) + c\cdot\sqrt{-c + x}\cdot\log{(2(\sqrt{x} + \sqrt{-c + x}))})}{\sqrt{x}} + C$$
Is this correct? I tried another calculator, and that gave me a slightly different result.
 [/INST] Assume $$x=c\sec^2\theta$$
then, $$dx=2c\,\sec^2 \theta\,\tan \theta\,d\theta$$
Substituting these we get,
$$\int \sqrt[2]{\dfrac {c\sec^2 \theta} {c\tan^2 \theta}}\;2\,c \sec^2 \theta\,\tan\theta \,d\theta$$
$$2\,c\int sec^3\theta\,d\theta$$
Using integration by parts by considering $\sec\theta$ as the first function and $sec^2\theta$ as the second function, we get
$$2\,c\int \sec^3 \theta \, d \theta = c\sec \theta \tan \theta + c\ln|\sec \theta + \tan \theta| + C$$
Replace $\sec \theta$ with $\sqrt{\frac xc}$ and $\tan \theta$ with $\sqrt{\frac xc-1}$
$$\sqrt{x} \sqrt{x-c}+c \log \left(\sqrt{x-c}+\sqrt{x}\right)+C_1$$
</s>