<s>[INST] Integrating $\frac{1}{(x-2)^4 \sqrt{x^2 + 6x + 2}}$ 
I'm struggling with the integral, $$\int\frac{1}{(x-2)^4 \sqrt{x^2 + 6x + 2}}dx.$$

I tried it as follows:
Substituting $x-2 = \frac1t \implies dx = \frac{-dt}{t^2}.$
$$\therefore \int\frac{dx}{(x-2)^4 \sqrt{x^2 + 6x + 2}} = \int \frac{- dt}{\frac{t^2}{t^4} \sqrt{(\frac1t + 2)^2 + 6 (\frac1t + 2) + 2}} = \int \frac{-t^3}{\sqrt{18t^2 + 10t + 1}}\ dt$$
How to continue from here?
 [/INST] Continuing where you left off,
$$\begin{align*}
I &= - \int \frac{t^3}{\sqrt{18t^2+10t+1}} \, dt \\[1ex]
&= -16 \int \frac{(s-5)^3}{(s^2-18)^4} \, ds
\end{align*}$$
by employing the substitution,
$$s = \frac{\sqrt{18t^2+10t+1}-1}t \implies t = \frac{2s-10}{18-s^2} \implies dt = \frac{2(18-10s+s^2)}{(18-s^2)^2} \, ds$$
The rest can be done by expanding into partial fractions.

Alternatively, starting over,
$$\begin{align*}
I &= \int \frac{dx}{(x-2)^4 \sqrt{x^2 + 6x + 2}} \\[1ex]
&= \frac18 \int \frac{(1-y^2)^3}{\left(y^2+\sqrt2\,y-4\right)^4} \, dy \tag{1} \\[1ex]
&= -\frac1{4\sqrt2} \int \frac{(z^2-2)^3}{\left(z^2+2z-8\right)^4} \, dz \tag{2}
\end{align*}$$
and again with partial fractions.


*

*$(1)$ : substitute

$$y = \frac{\sqrt{x^2+6x+2} - \sqrt2}{x} \implies x=\frac{2\sqrt2\,y-6}{1-y^2} \implies dx=\frac{2\left(\sqrt2\,y^2-6y+\sqrt2\right)}{(1-y^2)^2} \, dy$$

*

*$(2)$ : substitute $z=\sqrt2\,y$
</s>