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.

First you should simplify the term and then bild the antiderivative, what is really easy after simplifying the term:
$$
\begin{align*}
y &= \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}} ~\operatorname{d}\theta\\
F(\theta) &= \int_{0}^{\theta} \dfrac{\sin{\theta}(\cos^2{\theta} -\cos^2{\frac{\pi}{5}})(\cos^2{\theta} -\cos^2{\frac{2\pi}{5}})}{\sin{5\theta}} ~\operatorname{d}\theta = \int_{0}^{\theta} f(\theta) ~\operatorname{d}\theta\\
f(\theta) &= \dfrac{\sin{\theta}(\cos^2{\theta} -\cos^2{\frac{\pi}{5}})(\cos^2{\theta} -\cos^2{\frac{2\pi}{5}})}{\sin{5\theta}}\\
f(\theta) &= \dfrac{1}{16}\\
F(\theta) &= \int_{0}^{\theta} \dfrac{1}{16} ~\operatorname{d}\theta\\
F(\theta) &= \dfrac{\theta}{16}\\
y &= \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}} ~\operatorname{d}\theta = F(1) - F(0)\\
F(1) - F(0) &= \dfrac{1}{16} - \dfrac{0}{16}\\
F(1) - F(0) &= \dfrac{1}{16} - 0\\
F(1) - F(0) &= \dfrac{1}{16}\\
F(1) - F(0) &= 0.0625\\
\end{align*}
$$
$$ 
\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}} ~\operatorname{d}\theta = 0.0625\\ $$
If you can't simplefy it, you also would be able to integrate it without simplefying it but that's way more complex and unambiguously.
