How to calculate $\int\frac{1}{x + 1 + \sqrt{x^2 + 4x + 5}}\ dx$? How to calculate $$\int\frac{1}{x + 1 + \sqrt{x^2 + 4x + 5}}dx?$$ I really don't know how to attack this integral. I tried $u=x^2 + 4x + 5$ but failed miserably. Help please.
 A: $$\int\frac{1}{x+1+\sqrt{x^{2}+4x+5}}dx=\int\frac{(x+1)-\sqrt{x^{2}+4x+5}}{-2x-4}$$
$$=\frac{-1}{2}\int\frac{x+1}{x+2}dx-\frac{1}{2}\int\frac{\sqrt{x^{2}+4x+5}}{x+2}dx$$
The first integral can be dealt with but noticing:
$$\int\frac{x+1}{x+2}dx=\int1dx-\int\frac{1}{x+2}dx$$
The second integral is dealt with as follows:
$$\int\frac{\sqrt{x^{2}+4x+5}}{x+2}dx=\int\frac{\sqrt{(x+2)^{2}+1}}{x+2}dx$$
Let $x+2=\tan(u)$ then:
$$\int\frac{\sec^{3}(u)}{\tan(u)}du=\int\sec^{2}(u)\csc(u)=\tan(u)\csc(u)+\int\csc(u)du$$
A: $$\frac1{x+1+\sqrt{x^2+4x+5}}=-\frac{x+1-\sqrt{x^2+4x+5}}{2(x+2)}$$
$$=-\frac{x+2-1-\sqrt{x^2+4x+5}}{2(x+2)}$$
$$=-\frac12+\frac1{2(x+2)}+\frac{\sqrt{(x+2)^2+1}}{2(x+2)}$$
Setting $x+2=\tan y,$
$$\int\frac{\sqrt{(x+2)^2+1}}{(x+2)}\ dx=\int\frac{\sec y}{\tan y}\sec^2y\ dy$$
$$=\int\frac{dy}{\cos^2y\sin y}=\int\frac{\sin y\ dy}{\cos^2y(1-\cos^2y)}$$
Set $\displaystyle\cos y=u$
A: Another approach : (The shortest one)
Using Euler substitution by setting $t-x=\sqrt{x^2+4x+5}$, we will obtain 
$x=\dfrac{t^2-5}{2t+4}$ and $dx=\dfrac{t^2+4t+5}{2(t+2)^2}\ dt$, then the integral turns out to be
$$
-\int\dfrac{t^2+4t+5}{2(t+2)(t+3)}\ dt=\int\left[\frac1{t+3}-\frac1{2(t+2)}-\frac12\right]\ dt.
$$
The last part uses partial fraction decomposition and the rest should be easy to be solved.
A: \begin{align}
\int\frac1{x+1+\sqrt{x^2+4x+5}}\ dx&=\int\frac1{x+1+\sqrt{(x+2)^2+1}}\ dx\\
&\stackrel{\color{red}{[1]}}=\int\frac{\sec^2y}{\sec y+\tan y-1}\ dy\\
&\stackrel{\color{red}{[2]}}=\int\frac{\sec y}{\sin y-\cos y+1}\ dy\\
&\stackrel{\color{red}{[3]}}=\int\frac{1+t^2}{t(1+t)(1-t^2)}\ dt\\
&\stackrel{\color{red}{[4]}}=\int\left[\frac1{t}-\frac1{2(t+1)}-\frac1{2(t-1)}-\frac{1}{(t+1)^2}\right]\ dt.
\end{align}
The rest is yours.

Notes :
$\color{red}{[1]}\;\;\;$Put $x+2=\tan y\;\Rightarrow\;dx=\sec^2y\ dy$.
$\color{red}{[2]}\;\;\;$Multiply by $\dfrac{\cos y}{\cos y}$.
$\color{red}{[3]}\;\;\;$Use Weierstrass substitution, $\tan\frac{y}{2}=t$.
$\color{red}{[4]}\;\;\;$Use partial fractions decomposition.
