I am being asked to find the indefinite integral

$\displaystyle \int x(x^{2}-1)^3dx$

The solution reads as:

The factor $\displaystyle x$ in the integrand is, except for a constant multiple, the derivative of $\displaystyle x^{2}-1$,

so that we can apply equation

$\displaystyle \int[f(x)]^{n}f'(x)dx=\frac{1}{n+1}[f(x)]^{n+1}+c$

with $\displaystyle f(x)=x^{2}-1$ and $\displaystyle n=3$.

Since $\displaystyle f'(x)=2x$, we write $\displaystyle x=\frac{1}{2}(2x)$ before applying the formula.

Thus we have

$\displaystyle \int x(x^{2}-1)^{3}dx=\frac{1}{2}\int(x^{2}-1)^{3}(2x)dx$

Why the $\displaystyle (2x)$ and why the $\displaystyle \frac{1}{2}$ outside of the integral?

Many thanks all.