<s>[INST] Evaluate $\int_{2}^{7} \frac{x}{1-\sqrt{2+x}} d x$ We have the following integral:
$$
\int_{2}^{7} \frac{x}{1-\sqrt{2+x}}\, dx
$$
And this is my solution, which seems to be wrong, and I am failing to see where exactly I failed at:
We have $u=1-\sqrt{2+x}, x=u^2-2u-1, dx=-2\sqrt{2+x}\, du$, and we know that $x\geq -2$ and thus $u\leq 1$:
\begin{align}
\int_{2}^{7} \frac{x}{1-\sqrt{2+x}}\, dx
&=-2\int_{-1}^{-2} \frac{(u^2+2u-1)(u-1)}{u}\, du\\
&= -2 \left( \int_{-1}^{-2} u^2 d u + \int_{-1}^{-2} u\, du +\int_{-1}^{-2} -3\, du + \int_{-1}^{-2} \frac{1}{u}\, du \right) \\
&= -2\left[\frac{u^3}{3}+\frac{u^2}{2}-3u+\ln{|u|}\right]_{-1}^{-2}\approx -18
\end{align}
Can someone please help me pinpoint the issue?
 [/INST] exactly, when you have $u=1-\sqrt{2+x}\ => x=u^2-2u-1$
Then $du=2(u-1)dx$
Plugging it into your formula we get
$=2\int\ \frac{(u^2-2u-1)(u-1)}{u}$
</s>