<s>[INST] $\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}$
 [/INST] $u = \cos \dfrac{x}{2}  \Rightarrow du = - \dfrac{1}{2}\sin\dfrac{x}{2} \cdot dx$ 
Then your integrand becomes $-2 u^2 du$.
Can you take it from here?
</s>