<s>[INST] Integration by Parts on $\sqrt{1+x^2}dx$ I have been asked to show that $$\int\sqrt{1+x^2}dx=\frac{1}{2}x\sqrt{1+x^2}+\frac{1}{2}\int\frac{1}{{\sqrt{1+x^2}}}dx$$
I'm aware of how to do this with trig substitution, but the question is specifically regarding integration by parts, and the only examples I can find keep using trig subs.
So far I have integrated twice. The first time was with $u=\sqrt{1+x^2},v'=1$. Resulting in the following:
$$\int\sqrt{1+x^2}dx=x\sqrt{1+x^2}-\int\frac{x}{\sqrt{1+x^2}}dx$$
The first term is almost correct. Integrating this new integral, with $u=\frac{x}{\sqrt{1+x^2}}, v'=1$. Gave me the following:
$$\int\sqrt{1+x^2}dx=x\sqrt{1+x^2}-\frac{x^2}{\sqrt{1+x^2}}+\frac{1}{2}\int\frac{x}{\sqrt{1+x^2}}dx$$
From here I'm pretty much stuck. I can't seem to figure out how I am supposed to get rid of the middle term. The final integral can be put into the right form if I divide by $x$, but then the first term loses it's $x$ scalar and I still can't drop the middle term.
I feel as though I've made a mistake on one of the integrations, but I've been looking over it for that long that the whole thing is blurry.
 [/INST] Alternative method, but not really so different from the other answer:
\begin{align}
\int\sqrt{1+x^2}\,dx
&=
\int\frac{1+x^2}{\sqrt{1+x^2}}\,dx
\\[6px]
&=\int\frac{1}{\sqrt{1+x^2}}\,dx+
\int x\frac{x}{\sqrt{1+x^2}}\,dx 
\qquad \biggl(u=x, v'=\frac{x}{\sqrt{1+x^2}}\biggr)
\\[6px]
&=\int\frac{1}{\sqrt{1+x^2}}\,dx+x\sqrt{1+x^2}-\int\sqrt{1+x^2}\,dx
\end{align}
Therefore
$$
2\int\sqrt{1+x^2}\,dx
=
x\sqrt{1+x^2}+\int\frac{1}{\sqrt{1+x^2}}\,dx
$$
</s>