<s>[INST] Calculation of $\int_{0}^{1}\frac{x-1+\sqrt{x^2+1}}{x+1+\sqrt{x^2+1}}dx$ Calculation of $\displaystyle \int_{0}^{1}\frac{x-1+\sqrt{x^2+1}}{x+1+\sqrt{x^2+1}}dx$
$\bf{My\; Try::}$ Let $x=\tan \psi\;,$ Then $\displaystyle dx = \sec^2 \psi$
So Integral convert into $\displaystyle \int_{0}^{\frac{\pi}{4}}\frac{\tan \psi-1+\sec \psi}{\tan \psi+1+\sec \psi}d\psi = \int_{0}^{\frac{\pi}{4}}\frac{\tan \psi+\sec \psi - 1}{\tan \psi+\sec \psi+1}d\psi$
Now Multiply both Numerator and Denominator by $\left(\tan \psi+\sec \psi-1\right)$
So $\displaystyle \int_{0}^{\frac{\pi}{4}}\frac{\tan \psi+\sec \psi-1}{\tan \psi+\sec \psi+1} \times \frac{\tan \psi+\sec \psi-1}{\tan \psi+\sec \psi-1}d\psi = \int_{0}^{\frac{\pi}{4}}\frac{\left(\tan \psi+\sec \psi-1\right)^2}{\left(\tan \psi+\sec \psi\right)^2-1}d\psi$
Now I did not understand how can i solve after that
Help required
Thanks.
 [/INST] Solution:
Let $$t=x+1+\sqrt{1+x^2}\to 1+x^2=(t-1-x)^2\to x=\frac{t^2-2t}{2t-2}\to dx=\frac{t^2-2t+2}{2(t-1)^2}dt$$
We have $$x-1+\sqrt{1+x^2}=t-2$$
And $$\frac{x-1+\sqrt{1+x^2}}{x+1+\sqrt{1+x^2}}=\frac{t-2}{t}$$
Hence $$I=\int_{0}^{1}\frac{x-1+\sqrt{1+x^2}}{x+1+\sqrt{1+x^2}}dx=\int_{2}^{2+\sqrt{2}}\frac{t-2}{t}\frac{t^2-2t+2}{2(t-1)^2}dt$$
$$=\int_{2}^{2+\sqrt{2}}\left[\frac{1}{2}-\frac{2}{t}+\frac{1}{t-1}-\frac{1}{2(t-1)^2}\right]dt=\cdots$$
</s>