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.
 A: Since $\cos x = 1-2\sin^2 \frac{x}{2}$,
$$
f(x)=\left(2-2\sin^2\frac{x}{2}\right)\sin \frac{x}{2} = 2\sin \frac{x}{2} - 2\sin^3\frac{x}{2}.
$$
Thus you can find the maximum of $f(x)$ by finding the maximum of $g(x)=2x-2x^3$ defined on $(0,1)$.
A: 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}$.
A: 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}$.
