So I'm given this example in my notes:
$$\int x(x+3)^5dx$$
And when I integrate by parts and by substitution I end up getting two different answers, but I don't know why.
Integrating by parts:
If I let $u = x$ and $dv = (x + 3)^5$, then:
$$ \begin{align*} \int x(x+3)^5dx &= {x \over 6 }(x+3)^6 - \int {1 \over 6 }(x+3)^6dx\\ &= {x \over 6 }(x+3)^6 - {1 \over 6 }({1 \over 7 }(x+3)^7) + C\\ &= {x \over 6 }(x+3)^6 - {1 \over 42 }(x+3)^7 + C \end{align*} $$
Integration by u-substitution:
If I let $u = x + 3$, then ${du\over dx } = 1$ and $du = dx$:
$$
\begin{align*}
\int x(x+3)^5dx &= \int (u-3)u^5 \ du\\
&= \int u^6 - 3u^5\ du\\
&= {(x+3)^7 \over 7 } - {(x+3)^6 \over 2 } + C
\end{align*}
$$
Where am I going wrong?
In fact, the two solutions are equivalent (if you put the forgotten $C$ on the first integral): \begin{align*} \frac{x}{6}(x+3)^6 - \frac{1}{42}(x+3)^7 + C & = \frac{(x+3)-3}{6}(x+3)^6 - \frac{1}{42}(x+3)^7 + C \\ & = \frac{1}{6} (x+3)^7 - \frac{1}{2} (x+3)^6 - \frac{1}{42} (x+3)^7 + C \\ & = \frac{1}{7} (x+3)^7 - \frac{1}{2} (x+3)^6 + C. \end{align*}