# 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.

-
Two ideas: $x+2=\tan u$, or multiply by the conjugate. I am pretty sure that the first one will work :) – chubakueno Jun 28 '14 at 16:01
The change of variables $x=-2+\frac{t-t^{-1}}{2}$ will transform this into an integral of a (very simple) rational function. – Start wearing purple Jun 28 '14 at 16:14

\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.

-
@TunkFey. This is a beautiful answer ! Cheers :) – Claude Leibovici Jun 28 '14 at 16:17
@ClaudeLeibovici Thanks. I got the idea from chubakueno's comment and I answered it while watching WC'14, Brazil vs Chile. I missed the goal. Hahaha... – Tunk-Fey Jun 28 '14 at 16:24
Am I missing something? Where does that fourth power in the denominator in the first step come from? – Mike Jun 28 '14 at 16:37
The name "Weierstrass substitution" is probably a misnomer since Fred Rickey reports going through all of Weierstrass' writings looking for it, without success. But he found it in Euler's writings a century before Weierstrass. It is spread by Stewart's calculus book. I have a private communication from Stewart saying he didn't invent the terminology himself, but without specificity about where he got it. – Michael Hardy Jun 28 '14 at 17:02

$$\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$$

-

$$\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$

-

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.

-