<s>[INST] How to find $\int \frac {dx}{(x-1)^2\sqrt{x^2+6x}}$? find the integral of $f(x)=\frac1{(x-1)^2\sqrt{x^2+6x}}$
my attempt =
$(x-1)=a$,     $a=x+1$  so the integral'd be
$\int \frac {dx}{(x-1)^2\sqrt{x^2+6x}}=\int\frac{da}{a^2\sqrt{a^2+8a+7}} $
lets say  $\sqrt{a^2+8a+7}=(a+1)t$
so $a=\frac{7-t}{t-1}$ and $da=\frac{-6dt}{(t-1)^2}$
$\int\frac{da}{a^2\sqrt{a^2+8a+7}}=\int\frac{\frac{-6dt}{(t-1)^2}}{(\frac{7-t}{t-1})^2\frac{6t}{t-1}}=-\int\frac{(t-1)dt}{(7-t)^2t}$
$\frac{(t-1)}{(7-t)^2t}=\frac{A}{t}+\frac{B}{7-t}+\frac{C}{(7-t)^2}$
then $A=B=\frac{-1}{7}$ and $C=6$
$-\int\frac{(t-1)dt}{(7-t)^2t}=\frac{1}{7}\int\frac{dt}{t}+\frac{1}{7}\int\frac{dt}{7-t}-6\int\frac{dt}{(7-t)^2}=\frac{ln|t|}{7}-\frac{ln|7-t|}{7}+6\frac{1}{7-t}$
finally we      substitute      $t=\frac{7+a}{a+1}$ and a=x+1
is my solution attempt correct? if it is, is there another simpler way to solve?
edit: a should equal to x-1 and x =a+1
 [/INST] Let $\displaystyle a=\frac{7-t^2}{t^2-1}$ instead of $\displaystyle a=\frac{7-t}{t-1} $ ??
Doing that and simplifying we get, $\displaystyle -\frac{12 t}{\left(t^2-1\right)^2}$ and integrating, we get
$$-2 \left(-\frac{3 t}{7 \left(t^2-7\right)}+\frac{2 \log \left(\sqrt{7}-t\right)}{7 \sqrt{7}}-\frac{2 \log \left(t+\sqrt{7}\right)}{7 \sqrt{7}}\right)$$
Putting back $x$ and simplifying we get
$$\frac{-7 \sqrt{x (x+6)}-4 \sqrt{7} (x-1) \log \left(\sqrt{7}-\frac{\sqrt{x (x+6)}}{x}\right)+4 \sqrt{7} (x-1) \log \left(\frac{\sqrt{7} x+\sqrt{x (x+6)}}{x}\right)}{49 (x-1)}$$
Differentiating it and simplifying we get, your original function.
</s>