# How to solve $\int\frac{1}{\sqrt {2x} - \sqrt {x+4}} \, \mathrm{dx}$?

$$\int\frac{1}{\sqrt {2x} - \sqrt {x+4}} \, \mathrm{dx}$$

I have tried $$u$$-substitution and multiplying by the conjugate and then apply $$u$$-substitution. For the $$u$$-substitution, I have set $$u$$ equal to each square root term, set $$u$$ equal to the entire denominator, and set $$u$$ equal to each expression in the radical.

However, all my attempts have just made the integral more complex without an obvious way to simplify. Can someone provide insight please? Thank you.

Multiplying by the conjugate and applying a couple of substitutions does work. \begin{align*} \int\frac{1}{\sqrt {2x} - \sqrt {x+4}} \, \mathrm{d}x &=\int \underbrace{\frac{\sqrt{2x}}{x-4}}_{\sqrt{x} \to u} + \underbrace{\frac{\sqrt{x+4}}{x-4}}_{\sqrt{x+4} \to t} \; \mathrm{d}x\\ &=2\sqrt{2} \int \frac{u^2}{u^2-4} \; \mathrm{d}u+ 2\int \frac{t^2}{t^2-8} \; \mathrm{d}t \\ &=2\sqrt{2} \int \frac{u^2-4+4}{u^2-4} \; \mathrm{d}u+ 2\int \frac{t^2-8+8}{t^2-8} \; \mathrm{d}t \\ &=2\sqrt{2}u +2\sqrt{2} \ln{\bigg |\frac{u-2}{u+2}\bigg |} + 2t +2\sqrt{2}\ln{\bigg |\frac{t-2\sqrt{2}}{t+2\sqrt{2}}\bigg |}+\mathrm{C} \\ &=2\sqrt{2x} +2\sqrt{2} \ln{\bigg |\frac{\sqrt{x}-2}{\sqrt{x}+2}\bigg |} + 2\sqrt{x+4} +2\sqrt{2}\ln{\bigg |\frac{\sqrt{x+4}-2\sqrt{2}}{\sqrt{x+4}+2\sqrt{2}}\bigg |}+\mathrm{C} \\ \end{align*}
$$\int \frac{1}{\sqrt{2x}-\sqrt{x+4}}\ dx=\int \frac{(\sqrt{2x}+\sqrt{x+4})}{(\sqrt{2x}-\sqrt{x+4})(\sqrt{2x}+\sqrt{x+4})}\ dx=$$ $$=\int \frac{\sqrt{2x}+\sqrt{x+4}}{x-4}\ dx$$ $$=\int \frac{\sqrt{2x}\ dx}{x-4} + \int \frac{\sqrt{x+4}\ dx}{x-4}$$ $$=\int \frac{\sqrt{2}\ xd(\sqrt{x})}{x-4} + \int \frac{2(x+4)d(\sqrt{x+4})}{x-4}$$ $$=\int \frac{(2\sqrt{2}(x-4)+8\sqrt2)d(\sqrt{x})}{x-4} + \int \frac{(2(x-4)+16)d(\sqrt{x+4})}{x-4}$$ $$=2\sqrt{2} \int d(\sqrt{x})+8\sqrt2\int \frac{d(\sqrt{x})}{(\sqrt{x})^2-2^2} + 2\int d(\sqrt{x+4})+16\int \frac{d(\sqrt{x+4})}{(\sqrt{x+4})^2-(2\sqrt2)^2}$$ $$=2\sqrt2\sqrt{x}+8\sqrt{2}\frac{1}{2\cdot 2}\ln\left|\frac{\sqrt x-2}{\sqrt{x}+2}\right|+2\sqrt{x+4}+16\frac{1}{2\cdot 2\sqrt2}\ln\left|\frac{\sqrt{x+4}-2\sqrt2}{\sqrt{x+4}+2\sqrt2}\right|$$ $$=2\sqrt{2x}+2\sqrt{2}\ln\left|\frac{\sqrt x-2}{\sqrt{x}+2}\right|+2\sqrt{x+4}+2\sqrt2\ln\left|\frac{\sqrt{x+4}-2\sqrt2}{\sqrt{x+4}+2\sqrt2}\right|+C$$
$$I=\int\frac{1}{\sqrt {2x} - \sqrt {x+4}} \, dx$$
Get rid of the denominator $$u=\sqrt {2x} - \sqrt {x+4}\implies x=3 u^2+2 \sqrt{2}u \sqrt{u^2+4 }+4\implies \frac{dx}{du}=\frac{\sqrt{2} \left(4 u^2+8 \right)}{\sqrt{u^2+4 }}+6 u$$ $$I=\int6 du+\int\frac{4 \sqrt{2} u}{\sqrt{u^2+4}}du+\int\frac{8 \sqrt{2}}{u\sqrt{u^2+4} }du$$ $$I=6u+4 \sqrt{2} \sqrt{u^2+4}-4 \sqrt{2} \log \left(\frac{\sqrt{u^2+4}+2}{u}\right)$$