How to solve this indefinite integral using integral substitution? So while working on some physics problem for differential equations,  I landed at this weird integral $$ \int \frac 1 {\sqrt{1-\left(\frac 2x\right)}}\,dx $$
So since there is a square root, I thought I could use trig substitution, but I couldn't find anything that works out. How can one solve this integral in a nice simple manner? If you can solve it in a different way, it is still fine. $Thank$ $you!$
This is the answer given to me by symbolab $$ 4\left(-\frac{1}{4\left(\sqrt{1-\frac{2}{x}}-1\right)}-\frac{1}{4\left(\sqrt{1-\frac{2}{x}}+1\right)}-\frac{1}{4}\ln \left|\sqrt{1-\frac{2}{x}}-1\right|+\frac{1}{4}\ln \left|\sqrt{1-\frac{2}{x}}+1\right|\right)+C $$
 A: HINT:
Make the substitution $x=2\sec^2(\theta)$ and arrive at
$$4\int \sec^3(\theta)\,d\theta$$
A: $u=\sqrt{1-\frac{2}{x}} \implies u^2=1-\frac{2}{x} \implies 2u du=\frac{2}{x^2} dx \implies du=\frac{1}{x^2} \frac{1}{u} dx \implies du=\frac{1}{x^2} \frac{1}{\sqrt{1-\frac{2}{x}}} dx \text{ So now back to the integral } \int \frac{1}{\sqrt{1-\frac{2}{x}}}dx=\int \frac{x^2}{x^2 \sqrt{1-\frac{2}{x}}}dx \\ \text{ now putting in the sub } \int (\frac{2}{1-u^2})^2 du \text{ Note: I solve for }x^2 \text{ from my sub to plug in also }  \\ \text{ That is I solved } u^2=1-\frac{2}{x} \text{ for } x \text{ then squared result } \\ \text{  Then you can do partial fractions. } $
A: Adding to Dr. MV's hint,
$$\int\frac{1}{\sqrt{1-\frac2x}}\ \mathrm dx=\int\frac{\sqrt x}{\sqrt{x-2}}\ \mathrm dx$$
Using trigonometric substitution, we have
$$\sqrt x=\sqrt 2\sec\phi$$
Which implies that
$$x=2\sec^2\phi\Rightarrow \mathrm dx=4\tan\phi\sec^2\phi\ \mathrm d\phi$$
So now the integral becomes
$$\int\frac{4\sqrt 2\tan\phi\sec^3\phi}{\sqrt{2\sec^2\phi-2}}\ \mathrm d\phi$$
$$=4\int\frac{\tan\phi\sec^3\phi}{\sqrt{\sec^2\phi-1}}\ \mathrm d\phi$$
$$=4\int\frac{\tan\phi\sec^3\phi}{\sqrt{\tan^2\phi}}\ \mathrm d\phi$$
$$=4\int\sec^3\phi\ \mathrm d\phi$$
This integral has been answered numerous times. Study this to see how the following solution is derived. 
$$2\sec\phi\tan\phi+2\ln\left|\sec\phi+\tan\phi\right|+C$$
Now let's get an answer in terms of $x$. Note that
$$\sqrt x=\sqrt 2\sec\phi\Rightarrow\phi=\mathrm{arcsec}\left(\frac{\sqrt x}{\sqrt 2}\right)$$
And
$$ \tan\left(\mathrm{arcsec}(x)\right)=\sqrt{x^2-1}$$
Therefore
$$\frac{2\sqrt x}{\sqrt 2}\tan\left(\mathrm{arcsec}\left(\frac{\sqrt x}{\sqrt 2}\right)\right)+2\ln\left|\frac{\sqrt x}{\sqrt 2}+\tan\left(\mathrm{arcsec}\left(\frac{\sqrt x}{\sqrt 2}\right)\right)\right|+C$$
$$=\sqrt{x^2-2x}+2\ln\left|\sqrt{x-2}+\sqrt x\right|+C$$
A: Some hints
First of all, simple, thing, just rewrite the integrand this way
$$\frac{1}{\sqrt{\frac{x-2}{x}}}$$
Then substitute
$$y = \frac{x-2}{x} ~~~~~~~ \text{d}y = \frac{1}{x} - \frac{x-2}{x^2}\ \text{d}x$$
You're now with
$$2\int \frac{1}{(1 + y^2)\sqrt{y}}\ \text{d}y$$
And for this one, use
$$z = \sqrt{y} ~~~~~~~ \text{d}z = \frac{1}{2\sqrt{y}}\ \text{d}y$$
and your integral is now:
$$4\int \frac{1}{(1 - z^2)^2}\ \text{d}z$$
which is easily solvable by partial fractions:
$$\frac{1}{(1 - s^2)^2} = \frac{1}{4(z+1)} + \frac{1}{4(z+1)^2} - \frac{1}{4(z-1)} + \frac{1}{4(z-1)^2}$$
Split and do the easy integrals.
Final Result
$$x\sqrt{\frac{x-2}{x}} - \ln\left(\sqrt{\frac{x-2}{x}} - 1\right) + \ln\left(\sqrt{\frac{x-2}{x}} + 1\right) + C$$
