Answer
$$ \frac{1}{42}\left(z^{3}+1\right)^{14}+\frac{1}{13}\left(z^{3}+1\right)^{13}+c$$
Work Step by Step
Given $$ \int\left(z^{5}+4 z^{2}\right)\left(z^{3}+1\right)^{12} d z= \int z^{2}\left(z^{3}+4\right)\left(z^{3}+1\right)^{12} d z$$
Let
$$u=z^{3}+1 \ \ \ \Rightarrow \ \ du= (3z^2 )dz $$
then
\begin{align*}
\int\left(z^{5}+4 z^{2}\right)\left(z^{3}+1\right)^{12} d z &=\frac{1}{3} \int(u+3) u^{12} d u \\ &=\frac{1}{3} \int\left(u^{13}+3 u^{12}\right) d u \\ &=\frac{1}{3}\left(\frac{1}{14} u^{14}+3\left(\frac{1}{13} u^{13}\right)+c\right) \\ &=\frac{1}{42} u^{14}+\frac{1}{13} u^{13}+c\\
&=\frac{1}{42} u^{14}+\frac{1}{13} u^{13}+c\\
&= \frac{1}{42}\left(z^{3}+1\right)^{14}+\frac{1}{13}\left(z^{3}+1\right)^{13}+c
\end{align*}