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.

When you have $2 \sin \frac{x}{2} (1-\sin^2 \frac x2) = 2\sin \frac x2 - 2\sin^3 \frac x2$, where $x$ varies between $0$ and $\pi$, hence we can let $y= \sin \frac x2$, then $y$ varies between $0$ and $1$, and we are trying to find the maximum value of $2y-2y^3$. Now, we can just use ordinary differentiation, $2-6y^2=0\implies y^2 = \frac 13$, and in this case, the value of $2y-2y^3$ is $2y(1-y^2)=\frac{2}{3} \times \frac{2}{\sqrt 3}$.
