<s>[INST] $\int \sec^3x dx$ in disguise I found this integral, 
$$\int \sqrt{x^2+1}dx$$
on a problem list and I think it is a sneaky way of hiding a $\int \sec^3xdx$ problem but I am not sure if what I did was correct though, because of what happens at the end. 
So what I did was use trig-substitution and let $u=\tan\theta$ and $du=\sec^2\theta d\theta$
$$\int \sqrt{x^2+1}dx=\int\sqrt{\tan^2\theta+1}\sec^2\theta d\theta=\int \sec^3\theta d\theta$$
$$= \int (\tan^2\theta+1)\sec\theta d\theta = \int \tan^2\theta \sec\theta +\int \sec\theta d\theta$$
I will label $I_s=\int \sec\theta d\theta = \ln|\sec\theta+\tan\theta|$ so I have
$$\int \sec^3xdx=\int\tan^2x\sec x dx+I_s$$
and use integration by parts to solve $\int tan^2\theta \sec\theta d\theta$ that remains. I let $u=\sec\theta$ so $du=\sec\theta\tan\theta d\theta$ and $dv=\tan^2\theta\, d\theta$ such that $v=\tan\theta -\theta$
$$\int\tan^2x\sec x dx =\sec\theta (\tan\theta -\theta) - \int (\tan\theta-\theta)\sec\theta\tan\theta d\theta$$
$$= \frac 12 \sec\theta (\tan\theta -\theta) + \frac 12\int \theta \sec\theta\tan\theta \, d\theta$$
Again I use integration by parts, this time on $\frac 12\int \theta \sec\theta\tan\theta \, d\theta$ and let $u=\theta$ so $du=d\theta$ and $dv=\sec\theta\tan\theta \,d\theta$ so $v=\sec\theta$
$$\frac 12\int \theta \sec\theta\tan\theta \, d\theta = \frac 12 \theta \sec\theta - \frac 12 I_s$$
$$= \frac 12(\theta\sec\theta - I_s)$$
and use this result to get
$$\int\tan^2x\sec x dx = \frac 12 \sec\theta (\tan\theta -\theta) + \frac 12(\theta\sec\theta - I_s)$$
$$= \frac 12 \sec\theta\tan\theta - \frac 12 I_s$$
Putting everything back together and including an arbitrary constant $C$ i get
$$\int \sec^3\theta\,d\theta = \int \tan^2\theta\sec\theta d\theta + I_s$$
$$= \frac 12 \sec\theta\tan\theta - \frac 12 I_s + I_s + C$$
$$=\frac 12\sec\theta\tan\theta +\frac 12 \ln|\sec\theta+\tan\theta|+C$$
and substituting back into $x$-variable terms using $\tan\theta = x$ I have $\sec\theta = \sqrt{x^2+1}$ so 
$$\int \sqrt{x^2+1}dx =\frac 12x\sqrt{x^2+1} +\frac 12 \ln|\sqrt{x^2+1}+x|+C$$
The reason why I am not sure about this is because when substituting back I have $\sec\theta = \sqrt{x^2+1}$ which is the same as the integrand $\sqrt{x^2+1}$ that became $\sec^3\theta$ in the initial substitutions. What is going on here? 
Thank you all for the precious help!
 [/INST] From your trig sub $x=\tan\theta$,
\begin{align}
\int \sqrt{x^2+1}dx&=\int \sec\theta(\sec^2\theta d\theta)
\end{align}
That is, $\sqrt{x^2+1}=\sec\theta$ and $dx=\sec^2\theta d\theta$.  The integrand only changed to $sec^3\theta$ after both of these pieces are considered.
Reassuringly, $\sqrt{x^2+1}\ne\sec^3\theta$, because $dx\ne d\theta$.
</s>