$\int_0^{2\pi}\sin\frac{x}{2}\cos^2\frac{x}{2}\,dx$ $$\int_0^{2\pi}\sin\frac{x}{2}\cos^2\frac{x}{2}\,dx$$
Tried substitution ($u = \cos\frac{x}{2}$), but I get $-\frac{\cos^3\frac{x}{2}}{3}$ ($-\frac{2}{3}$) instead of the correct answer, which is $1\frac{1}{3}$

It makes it a little easier to do this simple substitution for you to not mess up with constant multiple like you did (You got an extra $\frac{1}{3}$)
Substitute first $\frac{x}{2}=t$. To see the limits, when $x=2\pi, t=\pi$ and when $x=0, u=0$ and $\mathrm{d}x = 2\mathrm{d}t$
$$
\begin{align*}
\int_0^{2\pi}\sin\frac{x}{2}\cos^2\frac{x}{2} \mathrm{d}x &= 2 \int_0^{\pi}\sin t  \hspace{3pt}\cos^2 t \hspace{3pt} \mathrm{d}t\\
&= 2  \left|\frac{-\cos^3 t}{3} \right|_0^{\pi}\\
&= 2 \left[\left(\frac{1}{3}\right) - \left( \frac{-1}{3} \right) \right]\\
&= 2 \left(\frac{2}{3}\right) = \frac{4}{3}
\end{align*}
$$
