Integral $\int \sqrt{1+x^2}dx$

I was trying to do this integral $$\int \sqrt{1+x^2}dx$$ I saw this question and its' use of hyperbolic functions. I did it with binomial differential method since the given integral is in a form of $\int x^m(a+bx^n)^p\,dx$ and I spent a lot of time on it so I would like to see if it can be done this way and where did I go wrong. $$\int(1+x^2)^\frac{1}{2}dx$$ $m=0$, $n=2$, $p=\frac{1}{2}$

Because $\frac{m+1}{n}+p \in \mathbb Z$ I used substitution $x^{-2}+1=t^2$.
From there I got:
$$-\frac{dx}{x^3}=t\,dt$$ $$x=\frac{1}{\sqrt {t^2-1}}$$ $$t=\frac{\sqrt{1+x^2}}{x}$$

I expanded the original with $x^4$:
$$\int \frac{x^4\sqrt{1+x^2}dx}{x^4}=\int \left(\frac{1}{\sqrt{t^2-1}}\right)^4t(-tdt)=\int\frac{-t^2dt}{(t^2-1)^2}$$

Now I used partial integration:
$u=t$,
$du=dt$,
$dv=\frac{-tdt}{(t^2-1)^2}$,
$v=\frac{1}{2(t^2-1)}$

Then
\begin{align} \int\frac{-t^2dt}{(t^2-1)^2} &=\frac{t}{2(t^2-1)}-\frac{1}{2}\int \frac{dt}{t^2-1}= \\ &=\frac{t}{2(t^2-1)}-\frac{1}{2}\frac{1}{2}\ln\frac{t-1}{t+1}= \\ &=\frac{\frac{\sqrt{1+x^2}}{x}}{2\left(\left(\frac{\sqrt{1+x^2}}{x}\right)^2-1\right)}-\frac{1}{4}\ln\frac{\frac{\sqrt{1+x^2}}{x}-1}{\frac{\sqrt{1+x^2}}{x}+1}= \\ &=\frac{x\sqrt{1+x^2}}{2}-\frac{1}{4}\ln\frac{\sqrt{1+x^2}-x}{\sqrt{1+x^2}+x}=\\ &=\frac{x\sqrt{1+x^2}}{2}-\frac{1}{4}\ln\frac{\sqrt{1+x^2}-x}{\sqrt{1+x^2}+x}\cdot\frac{\sqrt{1+x^2}-x}{\sqrt{1+x^2}-x}=\\ &=\frac{x\sqrt{1+x^2}}{2}-\frac{1}{4}\ln(\sqrt{1+x^2}-x)^2=\\ &=\frac{x\sqrt{1+x^2}}{2}-\frac{1}{2}\ln(\sqrt{1+x^2}-x)+C \end{align}

The solution is
$$\frac{x\sqrt{1+x^2}}{2}+\frac{1}{2}\ln(x+\sqrt{1+x^2})+C$$ My solution looks very similar, so where did I go wrong?

• You can also calculate your integral by using the substitution x = tanu Feb 21 '18 at 12:06

Solutions are same. Observe that $\sqrt{1+x^2}-x=\frac{1+x^2-x^2}{\sqrt{1+x^2}+x}=\frac{1}{\sqrt{1+x^2}+x}$.
Let $x = \sinh \theta$, then set $$I=\int \sqrt{1+x^2}dx$$ Whence \begin{align} I &= \int \sqrt{1+x^2}dx \\ &= \int \sqrt{1+\sinh^2 \theta}\cosh \theta d \theta \\ &= \int \cosh^2 \theta d \theta \\ &= \frac{1}{2}\int 1 + \cosh 2 \theta d \theta \\ &= \frac{1}{2}\theta+\frac{1}{4}\sinh 2 \theta + c\\ &= \frac{1}{2}\sinh^{-1}x+\frac{1}{2}x\sqrt{1+x^2}+c\\ &=\frac{1}{2}\ln(x + \sqrt{1+x^2})+\frac{1}{2}x\sqrt{1+x^2}+c \end{align}
What don't you do the substitution $x=\sinh(x)$ and use $$\cosh^2(x)=\frac{1+\cosh(2x)}{2}\ \ ?$$