Finding the value of given integral The given integral is :$$\displaystyle\int_0^1 \dfrac{\sin{\theta}(\cos^2{\theta} -\cos^2{\frac{\pi}{5}})(\cos^2{\theta} -\cos^2{\frac{2\pi}{5}})}{\sin{5\theta}} \, d\theta$$
I tried solving it with some trigonometric identities but comes out it does not work here.
However solution given starts with these equations mentioned down below and later they substituted $z= \cos{\theta}+ i\sin(\theta)$
$$\begin{array}{r}
z^{10}-1=\left(z^2-1\right)\left[z^2-2 \cos \left(\frac{\pi}{5}\right) z+1\right]\left[z^2-2\left(\cos \frac{2 \pi}{5}\right) z+1\right] \\
\quad \times\left(z^2-2 \cos \frac{4 \pi}{5} z+1\right)\left(z^2-2 \cos \frac{6 \pi}{5} z+1\right)
\end{array}$$
$$\begin{aligned}
z^5-\frac{1}{z^5}=\left(z-\frac{1}{z}\right) &\left(z-2 \cos \frac{\pi}{5}+\frac{1}{z}\right)\left(z-2 \cos \frac{2 \pi}{5}+\frac{1}{z}\right) \\
& \times\left(z-2 \cos \frac{4 \pi}{5}+\frac{1}{z}\right)\left(z-2 \cos \frac{6 \pi}{5}+\frac{1}{z}\right)
\end{aligned}$$
Can anyone help me understand how I can derive these equations and use them here in this integral?
Thank you for your help.

Note that
$$\begin{aligned}
z^5-\frac{1}{z^5}
=&\ \left(z-\frac{1}{z}\right)\left(z-2 \cos \frac{\pi}{5}+\frac{1}{z}\right)\left(z-2 \cos \frac{2 \pi}{5}+\frac{1}{z}\right) \\
& \>\>\> \times\left(z+2 \cos \frac{2 \pi}{5}+\frac{1}{z}\right)\left(z+2 \cos \frac{\pi}{5}+\frac{1}{z}\right)\\
\end{aligned}$$
Then, set $z=e^{i\theta}$ to get
$$\begin{aligned}
\sin5\theta=&\ \sin\theta\left(2\cos\theta -2 \cos \frac{\pi}{5}\right)\left(2\cos\theta -2 \cos \frac{2 \pi}{5}\right) \\
& \>\>\>\times\left(2\cos\theta+2 \cos \frac{\pi}{5}\right)\left(2\cos\theta+2 \cos \frac{2 \pi}{5}\right)\\
=&\ 16\sin{\theta}\left(\cos^2{\theta} -\cos^2{\frac{\pi}{5}}\right)\left(\cos^2{\theta} -\cos^2{\frac{2\pi}{5}}\right)
\end{aligned}$$
Thus
$$\int_0^1 \dfrac{\sin{\theta}(\cos^2{\theta} -\cos^2{\frac{\pi}{5}})(\cos^2{\theta} -\cos^2{\frac{2\pi}{5}})}{\sin{5\theta}} \, d\theta
= \int_0^1 \frac1{16}d\theta = \frac1{16}$$
