How to solve $\sin 2x \sin x+(\cos x)^2 = \sin 5x \sin 4x+(\cos 4x)^2$? How to solve $\sin 2x \sin x+(\cos x)^2 = \sin 5x \sin 4x+(\cos 4x)^2$?
\begin{align*}
2\cos x(\sin x)^2+(\cos x)^2 & = \frac{1}{2}(\cos x- \cos 9x) +(\cos 4x)^2\\
4\cos x(1-(\cos x)^2)+2(\cos x)^2 & = \cos x + \cos 9x +(2(\cos 4x)^2-1)+1\\
\cos x(4(1-(\cos x)^2 + 2\cos x -1) & = \cos 9x + \cos 8x + 1
\end{align*}
I don't see any way to get rid of $8x$ and $9x$ as arguments to have same angles from there

Using Euler's formula $e^{ix} = \cos x+i\sin x$ we can simplify this a bit:
\begin{align}
\sin 2x\sin x + \cos^2x &= \frac1{2i}\left(e^{2ix}-e^{-2ix}\right)\frac1{2i}\left(e^{ix}-e^{-ix} \right) + \frac14\left(e^{ix} + e^{-ix}\right)^2\\
&= \frac14\left(-e^{3ix} + e^{ix} +e^{-ix}-e^{-3ix} + e^{2ix} + 2 + e^{-2ix} \right)
\end{align}
and
\begin{align}
\sin 5x\sin 4x + \cos^24x &= \frac1{2i}\left(e^{5ix}-e^{-5ix}\right)\frac1{2i}\left(e^{4ix}-e^{-4ix}\right)+\frac14\left(e^{4ix}+e^{-4ix}\right)^2\\
&= \frac14\left(-e^{9ix} + e^{ix} +e^{-ix} -e^{-9ix} + e^{8ix} + 2 + e^{-8ix} \right).
\end{align}
Factoring and subtracting out common terms, we have
$$
-(e^{3ix} +e^{-3ix}) +e^{2ix}+e^{-2ix} = -(e^{9ix}+e^{-9ix}) +e^{8ix}+e^{-8ix}, 
$$
and hence
$$
\cos9x + \cos2x  = \cos8x +\cos3x.
$$
From the identity
$$
\cos\theta + \cos\varphi = 2\cos\left(\frac{\theta+\varphi}2\right)\cos\left(\frac{\theta-\varphi}2\right)
$$
this becomes
$$
\cos\left(\frac{11}2x\right)\left(\cos\left(\frac72x\right) - \cos\left(\frac52x\right) \right) = 0.
$$
From the identity
$$
\cos\theta - \cos\varphi = -2\sin\left(\frac{\theta+\varphi}2\right)\sin\left(\frac{\theta-\varphi}2\right)
$$
this becomes
$$
\cos\left(\frac{11}2x\right)\sin(3x)\sin\left(\frac12x\right)=0.
$$
Hence the solutions are
$$
x = \frac{2\pi\left(n+\frac12\right)}{11},\ n=-5,-4,-3,-2,-1,0,1,2,3,4
$$
and
$$
x = \frac{n\pi}3,\ n=-2,-1,0,1,2,3.
$$
