solve the trigonometric equation: $2(1 - \cos(x))-x\sin(x)=0$ for find a global maximum I need to prove that the function $f: (0,\pi] \to \mathbb{R}$ given by $f(x):= \dfrac{x - \sin(x)}{1 - \cos(x)}$ has a global maximum in $x=\pi$.
Ok I did that: first I need find critical points but I have a problem with trigonometric equation $f^{'}(x)=\dfrac{(1-\cos(x))^2-(x - \sin(x))\sin(x)}{(1 - \cos(x))^2}$ doing $f^{'}(x)=0$ then $\dfrac{(1 - \cos(x)^{2}) - (x - \sin(x))\sin(x)}{(1 - \cos(x))^2}=0$.
In conclusion, I need to first solve the trigonometric equation: $2(1 - \cos(x))-x\sin(x)=0$ do you know other way to any viable solution for this problem
Here is my attempt:
$$\begin{align}
f'(x) &= (1-\cos(x))^2 + (-x\sin(x)+\sin^2(x))\\
&= 1 - 2\cos(x) + \cos^2(x) + \sin^2(x) - x\sin(x)\\
&= 1 - 2\cos(x) + 1 - x\sin(x)\\
&= 2 - 2\cos(x) - x\sin(x)\\
&= 2(1 - \cos(x)) - x\sin(x)\\
&= 0
\end{align}$$

For $x\in[0,\pi)$ we have $$4\sin^2\frac{x}{2}-2x\sin\frac{x}{2}\cos\frac{x}{2}=0,$$ which gives
$$\sin\frac{x}{2}=0$$ or $x=0.$
Also, $$2\sin\frac{x}{2}=x\cos\frac{x}{2}$$ or $$\tan\frac{x}{2}=\frac{x}{2},$$ which gives $x=0$ again and we know that $$\tan\frac{x}{2}>\frac{x}{2}$$ for any $0<x<\pi.$
Id est, $f'$ has no zeros on $(0,\pi).$
But $f'$ is a continues on $(0,\pi]$ function and $f'\left(\frac{\pi}{2}\right)>0,$ which says that $f$ increases.
Id est, $$\max_{(0,\pi]}f=f(\pi).$$
