<s>[INST] Integration of $x/\sqrt{x^2-4x}$ How can one integrate: $$\int \frac{x}{\sqrt{x^2-4x}}\,dx$$
I tried setting $x^2-4x$ as a $t$ (and changing $dx$ concordantly) but it didn't work....
 [/INST] $t=x^2-4x$ and $\frac 1 2 \,dt=(x-2)\,dx$, so
$$
\int\frac x {\sqrt{x^2-4x}} \,dx = \int \frac{x-2}{\sqrt{x^2-4x}}\,dx+\int\frac2{\sqrt{x^2-4x}}\,dx.
$$
Use the substitution to evaluate the first integral.
Then: $\underbrace{x^2-4x = (x^2-4x+4)}_{\text{completing the square}}-4=(x-2)^2-4=4\left(\dfrac{x-2}{2}\right)^2-4 = 4\left(\left(\dfrac{x-2}2\right)^2-1\right)$.
Then you can say
\begin{align}
\sec\theta& =\dfrac{x-2}2 \\[8pt]
\sec\theta\tan\theta\,d\theta & =\dfrac{dx}2 \\[8pt]
\left(\dfrac{x-2}2\right)^2-1 & =\sec^2\theta-1=\tan^2\theta.
\end{align}
</s>