How to integrate $\int\sqrt{x^2+1}dx$ $$\int\sqrt{x^2+1}dx$$
I've been attempting this problem for days and I've made very little progress. I understand that I should substitute $x=\tan(x)$ and $dx=\sec^2(x)dx$ but beyond that I am very much lost.
 A: Making the substitution $x=\sinh u$ we have $$\int \sqrt{x^2+1} \; \mathrm{d}x=\int \cosh^2 u \;\mathrm{d}u=\int \frac{\cosh 2u+1}{2} \; \mathrm{d}u=\frac{\sinh 2u}{4}+\frac{u}{2}=\frac{\sinh u \cosh u}{2}+\frac{u}{2}$$
Using the hyperbolic functions and their sum of arguements. As we know $$\sinh u=x, \cosh u=\sqrt{x^2+1}, u=\sinh^{-1} x$$ the answer is $$\frac{1}{2} \left(x \sqrt{x^2+1}+\sinh^{-1} x\right)$$
Where $\sinh^{-1} x$ denotes the inverse hyperbolic sine function. 
A: So really you are interested in,
$$I=\int \sec^3(x) dx$$
Integration by parts , integrating $\sec^2 x$ and differentiating $\sec x$, gives:
$$=\sec x \tan x- \int \sec x \tan^2 x$$
$$=\sec x \tan x-\int \sec x (\sec x^2-1)$$
$$=\sec x \tan x-I+\ln (\sec x +\tan x)+C_1$$
So that
$$I=\frac{1}{2}\sec x \tan x+\frac{1}{2}\ln (\sec x+\tan x)+C$$
Now set up a triangle to figure out what $\sec \theta, \tan \theta$ are.
A: If we stick with your idea, we have
$$
\int \sqrt{x^2 + 1}\,dx =
\int \sqrt{\tan^2\theta + 1}\, \sec^2\theta \,d\theta = \\
\int\sec^3\theta\,d \theta
$$
For this integral, one would use the formula
$$
\int\sec^3\theta\,d \theta = \int (1 + \tan^2 \theta) \sec \theta\,d \theta  =\\
\int \sec \theta \,d \theta  + \int \tan \theta (\tan \theta \sec \theta) \,d\theta
$$
The first integral has a formula you can look up, using the trick
$$
\int \sec \theta \,d \theta = 
\int \frac{\sec \theta \tan \theta + \sec^2 \theta}{\sec \theta + \tan \theta} \,d \theta
$$
or using the half-angle substitution. The second can be done by parts, which gets you
$$
\int \tan \theta (\tan \theta \sec \theta) \,d\theta = 
\tan \theta \sec \theta - \int \sec^3 \theta \, d\theta
$$
which brings you to an equation on $\int \sec^3 \theta \, d\theta$ that can be solved.
A: You can also do:
$$\int\sqrt{x^2+1}\,dx = \int\frac{x^2+1}{\sqrt{x^2+1}}\,dx = \int x\cdot \frac{x}{\sqrt{x^2+1}}\,dx + \int\frac{1}{\sqrt{x^2+1}}\,dx = x\sqrt{x^2+1} - \int\sqrt{x^2+1}\,dx\,+ \ln(x+\sqrt{x^2+1}) \implies \int\sqrt{x^2+1}\,dx = \frac{1}{2}\big(x\sqrt{x^2+1}+\ln(x+\sqrt{x^2+1})\big) + C $$
