The improper integral $\int_0^1\sqrt{\frac1x+1}\,dx$

As $x \ge 0$ an alternative substitution is let $x=u^2$. Then $$ 2u\,du=dx $$ and the integral becomes $$ 2\int_0^1 \sqrt{1+u^2}\,du $$ which probably looks much more familiar. Interestingly this leads to a different form for the result $$ \sqrt2+\log(\sqrt2+1) $$ This is ok, this tells us, comparing the $\log$ terms $$ \sqrt{3+2\sqrt{2}}=\sqrt2+1 $$ which of course it is (square both sides).


Real methods are sufficient here and you're on the right track. However, the argument of log should have $|\cdot|$, not $(\cdot)$. This gives $$ \int\frac{2u^2}{(u^2-1)^2}\,du = \frac{u}{1-u^2}+\frac{1}{2}\log\left|\frac{2}{1+u}-1\right| $$As $u\to \infty$, the first term goes to $0$ by L'Hopital and the second term goes to $\log|-1|=\log|1|=0$. At $u=\sqrt{2}$, we have $$ \frac{\sqrt{2}}{1-2}+\frac{1}{2}\log\left|\frac{2}{1+\sqrt{2}}-1\right|=-\sqrt{2} + \frac{1}{2} \log|3-2\sqrt{2}|=-\sqrt{2} - \frac{1}{2} \log|3+2\sqrt{2}| $$Negating this (subtracting this value of the antiderivative) gives the correct result.