Solution (source code)

= Solution

Put $c=\cos\theta$ and $s=\sin\theta$. Taking the <real part> of $(c+is)^6$ in <De Moivre's theorem> gives
$$
\cos6\theta=c^6-15c^4s^2+15c^2s^4-s^6.
$$
Taking the <imaginary parts> of the second and fourth powers gives $\sin2\theta=2cs$ and $\sin4\theta=4cs(c^2-s^2)$. Hence
$$
\begin{aligned}
8\cos6\theta+15\sin4\theta\sin2\theta
&=8(c^6-15c^4s^2+15c^2s^4-s^6)+120c^2s^2(c^2-s^2)\\
&=\boxed{8(\cos^6\theta-\sin^6\theta).}
\end{aligned}
$$
The mixed powers cancel exactly.