Show that $f(x)=\sin x(1+\cos x)$ attains its maximum at $x= \pi/3$.
I differentiated the function $f$ and got $f'(x)=\cos x(1+2\cos x)$. After equating with $0$, I got $x=\pi/2$ and $x =\pi/3 + n\pi$ with $n\neq 0$. So I did not get $x= \pi/3$ even as an extreme value.
Note that, if $f(x)=\sin(x)\bigl(1+\cos(x)\bigr)$, then$$f'(x)=\cos(x)+\cos^2(x)-\sin^2(x)=\cos(x)+2\cos^2(x)-1.$$In order to solve the equation $f'(x)=0$, let $t=\cos(x)$. So, you have to solve the equation $2t^2+t-1=0$. It has two solutions: $-1$ and $\frac12$. And $\cos(x)=\frac12$ when $x=\frac\pi3$. Besides $f''\left(\frac\pi3\right)=-\frac{2\sqrt3}2$. Can you take it from here?