<s>[INST] Indefinite integral of $\sqrt{x^2-x}$ i was trying to compute the indefinite integral:
$$
\int\sqrt{x^2-x}dx
$$
but i got stuck: after a few (unsuccessful) attempts for some $u$-substitution, i tried integration by parts:
$$
\int\sqrt{x^2-x} \ dx=\int(x)'\sqrt{x^2-x} \ dx= \\ x\sqrt{x^2-x}-\int x(\sqrt{x^2-x})'dx= \\
=x\sqrt{x^2-x}-\frac{1}{2}\int x\frac{2x-1}{\sqrt{x^2-x}}dx= \\
=x\sqrt{x^2-x}-\int \frac{x^2}{\sqrt{x^2-x}}dx+\frac{1}{2}\int \frac{x}{\sqrt{x^2-x}}dx=...
$$
and now what? Can anybody help? 
 [/INST] Integrate by parts instead as follows
\begin{align}\int\sqrt{x^2-x}\ dx
= &\int\frac{\sqrt{x^2-x}}{2(x-\frac12)}d[(x-\frac12)^2]\\
= &\ \frac12(x-\frac12) \sqrt{x^2-x}-\frac18\int \frac 1{ \sqrt{x^2-x}}dx \\
 =& \ \frac12(x-\frac12) \sqrt{x^2-x}
-\frac18\tanh^{-1}\frac{\sqrt{x^2-x}}{x-\frac12}
\end{align}
</s>