solving $\int \cos^2x \sin2x dx$ 
$$\int \cos^2x \sin2x dx$$

$$\int \cos^2x \sin2x \, dx=\int \left(\frac{1}{2} +\frac{\cos2x}{2} \right) \sin2x \, dx$$
$u=\sin2x$
$du=2\cos2x\,dx$
$$\int \left(\frac{1}{2} +\frac{du}{4}\right)u \, du$$
Is the last step is ok?

Using the substitution you proposed $u\leadsto\sin2x$ one would get 
$$\begin{align}
\int\cos^2x\sin2x\,\mathrm dx&=\int\left(\dfrac12+\dfrac{\cos 2x}2\right)\sin 2x\,\mathrm dx\\
&=\int\dfrac{\sin 2x}2\,\mathrm dx+\int\dfrac{\sin 2x}{4}\underbrace{{2\cos 2x}\,\mathrm dx}_{\displaystyle\mathrm du}\\
&=\int\dfrac{\sin 2x}{2}\,\mathrm dx+\int\dfrac{u}{4}\,\mathrm du,
\end{align}$$ which is the correct form.
