<s>[INST] Integration by substitution. Integrating $$\int (x^2+2)(x-1)^7    dx$$
Let $ u = x^2 + 2$ then $ \frac{du}{dx} = 2x$ 
I can't see where to go after this? 
I may have chosen the wrong substitution. Would it help if I let let $ u = \sqrt{u-2} $?
 [/INST] First note that it would be possible to expand this polynomial and integrate term by term, though this would be fairly annoying. However, if we make the substitution $u=x-1$, we can get rid of some of the work:
$\begin{align} \int(x^2+2)(x-1)^7\,dx&=\int((u+1)^2+2)u^7\,du
\\&=\int(u^2+2u+3)u^7\,du
\\&=\int u^9+2u^8+3u^7\,du
\\&=\frac{1}{10}u^{10}+\frac{2}{9}u^9+\frac{3}{8}u^8+C
\\&=\frac{1}{10}(x-1)^{10}+\frac{2}{9}(x-1)^9+\frac{3}{8}(x-1)^8+C
\end{align}$
</s>