<s>[INST] Evaluate the integral $\int \:\frac{\sqrt{x^2+2\cdot\:\:x+2}}{x}dx$ $$\int \:\frac{\sqrt{x^2+2\cdot\:\:x+2}}{x}dx$$
I have tried to form a square above i also tried to get the x below under the root
but got nothing
 [/INST] Continuing from Momo's answer where was proposed the interesting change of variable $x=\tan(\theta)-1$, the integral reduces to $$I=\int \frac{d\theta}{\cos^2(\theta)\,(\sin(\theta)-\cos(\theta))}$$ Using the tangent half-angle substitution (just as Momo proposed), it reduces to $$I=\int\frac{2 \left(t^2+1\right)^2}{\left(t^2-1\right)^2 (t^2+2t-1)}\,dt$$ Using partial fraction decomposition $$\frac{2 \left(t^2+1\right)^2}{\left(t^2-1\right)^2 (t^2+2t-1)}=\frac{4}{t^2+2 t-1}+\frac{1}{t+1}-\frac{1}{(t+1)^2}-\frac{1}{t-1}+\frac{1}{(t-1)^2}$$ which makes $$I=\frac 2{1-t^2}+\log\left(\frac{1+t}{1-t}\right)+\sqrt 2\log\left(\frac{\sqrt 2-1-t}{\sqrt 2+1+t}\right)$$
</s>