<s>[INST] Difficult Integral: $\int\frac{x^n}{\sqrt{1+x^2}}dx$ How to calculate this difficult integral: $\int\frac{x^2}{\sqrt{1+x^2}}dx$?
The answer is $\frac{x}{2}\sqrt{x^2\pm{a^2}}\mp\frac{a^2}{2}\log(x+\sqrt{x^2\pm{a^2}})$.
And how about $\int\frac{x^3}{\sqrt{1+x^2}}dx$?
 [/INST] Since $\frac{d}{dt}\sqrt{1+t^2} = \frac{t}{\sqrt{1+t^2}}$, we can integrate by parts to get
$$
\int \frac{t^2}{\sqrt{1+t^2}}\mathrm dt = \int t\cdot \frac{t}{\sqrt{1+t^2}}\mathrm dt
= t\sqrt{1+t^2} - \int \sqrt{1+t^2}\mathrm dt.
$$
Cheating a little bit by looking at a table of integrals, we get that since
$$
\frac{d}{dt} \left [ t\sqrt{1+t^2} + \ln(t + \sqrt{1+t^2}) \right ]
= t\frac{t}{\sqrt{1+t^2}} + \sqrt{1+t^2} + \frac{1}{t + \sqrt{1+t^2}}
\left [ 1 + \frac{t}{\sqrt{1+t^2}} \right ]
$$
which simplifies to $2\sqrt{1+t^2}$, the integral on the right above is 
$\frac{1}{2}[t\sqrt{1+t^2} + \ln(t + \sqrt{1+t^2})]$ and thus we have
$$
\int \frac{t^2}{\sqrt{1+t^2}}\mathrm dt 
= \frac{1}{2}\left [t\sqrt{1+t^2} - \ln(t + \sqrt{1+t^2})\right ] 
$$
which matches the answer given by Charles Bao if we set $X=x$ and $a=1$ in his original post.
</s>