How many solutions does this equation have
$$2 \cos^2\left(\frac12 x \right) \sin^2 x = x^2+x-2$$
where $0 \lt x \le \displaystyle\frac \pi9?$
I observed that $2 \cos^2\left(\frac12x\right)$ can be written as $1+\cos x$. Simplifying $\sin^2 x,$ we get
$$(1+\cos x)^2(1-\cos x)=x^2+x-2$$
But I don't understand what to do after that.
HINT:
In the given range, the left hand side is positive. How about the right side?