Maximum of $f(x) =(1+\cos x)\cdot \sin(\frac{x}{2})$ on $x \in (0, \pi)$ I've attempted to solve this question by using $$f(x) = 2\sin\frac{x}{2}\cos^2\frac{x}{2} \leq \frac{(2\sin\frac{x}{2}+\cos^2\frac{x}{2})^2}{2}$$ but it results in the wrong answer every time. Is there another way to solve this question and is there anything I can do to change my method to make it work.

By AM-GM $$\left(1+\cos{x}\right)\sin\frac{x}{2}=2\cos^2\frac{x}{2}\sin\frac{x}{2}=2\left(\sin\frac{x}{2}-\sin^3\frac{x}{2}\right)=$$
$$=-2\left(-\sin\frac{x}{2}+\sin^3\frac{x}{2}+\frac{1}{3\sqrt3}+\frac{1}{3\sqrt3}\right)+\frac{4}{3\sqrt3}\leq$$
$$\leq-2\left(-\sin\frac{x}{2}+3\sqrt[3]{\sin^3\frac{x}{2}\cdot\frac{1}{3\sqrt3}\cdot\frac{1}{3\sqrt3}}\right)+\frac{4}{3\sqrt3}=\frac{4}{3\sqrt3}.$$
THe equality occurs for $\sin\frac{x}{2}=\frac{1}{\sqrt3}$, which says that the answer is $\frac{4}{3\sqrt3}$.
