<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] You can successively reduce this to simple integrals using sum formulae,
$$\int_0^{2\pi}\sin\frac{x}{2}\cos^2\frac{x}{2} dx = \frac{1}{2}\int_0^{2\pi}\sin(x)\cos\frac{x}{2} dx = \frac{2}{4}\int_0^{\pi}\left(\sin\frac{3x}{2} + \sin\frac{x}{2}\right) dx$$
This will give you, $\frac{1}{2} \times \frac{8}{3} = \frac{4}{3}$
</s>