<s>[INST] Trigonometric equation $\tan x \tan 2x = \cot 2x \cot 3x$ 
Find $\cos 8x$ if:
$$\tan x \tan 2x = \cot 2x \cot 3x$$

We can verify quickly that $\tan 2x \to \infty$ and $\tan 3x \to \infty$ are not solutions of the trig equation, so the equation may be rewritten as:
$$\tan x \tan^2 2x \tan 3x = 1$$
Using expansion formulas, we may see that:
$$\tan 2x = \frac{2 \tan x}{1 - \tan^2 x}$$
And also:
$$\tan 3x = \frac{3 \tan x - \tan^3 x}{1 - 3 \tan^2 x}$$
By long calculations, I have obtained that:
$$\tan x \in \{-1 - \sqrt{2}, -1 + \sqrt{2}, 1 - \sqrt{2}, 1 + \sqrt{2}\}$$
However, I am not able to take those calculations further. I have learnt about Chebyshev polynomials, but using WolframAlpha, the expression is really hairy and not realy easy to cope with.
Is there a smarter trick to solve the question? If not, how should I simplify my calculations?
 [/INST] 
$\tan x \tan^2 2x \tan 3x = 1$

Using the product-to-sum identity $\,\tan \theta \tan \varphi ={\frac {\cos(\theta -\varphi )-\cos(\theta +\varphi )}{\cos(\theta -\varphi )+\cos(\theta +\varphi )}}\,$:
$$1 = \tan^2 2x \cdot\frac{\cos 2x - \cos 4 x}{\cos 2 x + \cos 4 x}= \frac{1 - \cos^2 2x}{\cos^2 2x}\cdot\frac{\cos 2x - 2 \cos^2 2x+1}{\cos 2x+2\cos^2 2x - 1} \tag{1}$$
With $\,t = \cos 2x\,$:
$$
\begin{align}
t^2(2t^2+t-1)=(1-t^2)(-2t^2+t+1) \;\;&\iff\;\; 2 t^3 + 2 t^2 - t - 1 = 0
\\ &\iff\;\; (t+1)(2t^2-1) = 0
\\ &\iff\;\; t \in \left\{-1, \pm \frac{\sqrt{2}}{2} \right\}
\end{align}
$$
The root $\,t=-1\,$ must be excluded because the denominator in $\,(1)\,$ vanishes when $\,\cos 2x=-1\,$, which leaves $\,\cos 2x = \pm \frac{\sqrt{2}}{2}\,$.
</s>