Use integration by substitution I'm trying to evaluate integrals using substitution. I had  
$$\int (x+1)(3x+1)^9 dx$$
My solution: Let $u=3x+1$ then $du/dx=3$
$$u=3x+1 \implies 3x=u-1 \implies x=\frac{1}{3}(u-1) \implies x+1=\frac{1}{3}(u+2) $$
Now I get $$\frac{1}{3} \int (x+1)(3x+1)^9 (3 \,dx) = \frac{1}{3} \int \frac{1}{3}(u+2)u^9 du = \frac{1}{9} \int (u+2)u^9 du \\
= \frac{1}{9} \int (u^{10}+2u^9)\,du = \frac{1}{9}\left( \frac{u^{11}}{11}+\frac{2u^{10}}{10} \right) + C$$ 
But then I get to this one 
$$\int (x^2+2)(x-1)^7 dx$$ 
and the $x^2$ in brackets is throwing me off.
I put $u=x-1\implies x=u+1,$ hence $x^2+2 =(u+1)^2 +2 = u^2+3$. So
$$ \int(x^2+2)(x-1)^7\, dx = \int (u+1)u^7 du = \int (u+u^7) du = \frac{u^2}{2}+\frac{u^8}{8} + C $$
Is this correct or have I completely missed the point?
 A: Nice work, (though a wee bit hard to read).
Let's look a bit more closely at the second integral.
Your substitution is correct: $$u = x-1 \implies x = u+1,\;dx = du, \\ x^2 + 2 =(u+1)^2 + 2$$
You got a bit mixed up when substituting into the factor $x^2 + 2$, to express it as a function of $u$.
Substituting, we get  $$\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\end{align}$$
I trust you can take it from here.
A: I know the question was about integration by substitution, but if you want another way, you can also do it using tabular integration by parts
$$x^2 + 2 \quad \quad \quad (x-1)^7$$
$$2x \quad \quad \quad \frac 1 8 (x-1)^8$$
$$2 \quad \quad \quad \frac 1 {72} (x-1)^9$$
$$0 \quad \quad \quad \frac 1 {720} (x-1)^{10}$$
So you get
$$(x^2 + 2)\left({\frac 1 8}\right)(x-1)^8 - (2x)\left({\frac 1 {72}}\right)(x-1)^9 + (2)\left({\frac 1 {720}}\right)(x-1)^{10} + C$$
If anyone can make the LaTeX look cool with arrows or an actual table I'd be much obliged :)
A: $\frac{19683 x^{11}}{11}+\frac{39366 x^{10}}{5}+15309 x^9+17496 x^8+13122 x^7+6804 x^6+\frac{12474 x^5}{5}+648 x^4+117 x^3+14 x^2+x$
