8. Find the value using multiple methods: $\cos \frac{\pi}{7}-\cos \frac{2 \pi}{7}+\cos \frac{3 \pi}{7}$.
8. Solution 1: Original expression $=\cos \frac{\pi}{7}+\cos \frac{3 \pi}{7}+\cos \frac{5 \pi}{7}=\cos \frac{3 \pi}{7}+2 \cos \frac{3 \pi}{7} \cos \frac{2 \pi}{7}=\cos \frac{3 \pi}{7}\left(2 \cos \frac{2 \pi}{7}+1\right)=$ $\cos \frac{3 \pi}{7}\left(3-4 \sin ^{2} \frac{\pi}{7}\right)=\frac{\cos \frac{3 \pi}{7}\left(3 \sin \frac{\pi}{7}-4 \sin ^{3} \frac{\pi}{7}\right)}{\sin \frac{\pi}{7}}=\frac{\cos \frac{3 \pi}{7} \cdot \sin \frac{3 \pi}{7}}{\sin \frac{\pi}{7}}=\frac{\frac{1}{2} \sin \frac{6 \pi}{7}}{\sin \frac{\pi}{7}}=\frac{1}{2}$.
Solution 2: Original expression $=\frac{2 \sin \frac{2 \pi}{7} \cos \frac{\pi}{7}+2 \sin \frac{2 \pi}{7} \cos \frac{3 \pi}{7}+2 \sin \frac{2 \pi}{7} \cos \frac{5 \pi}{7}}{2 \sin \frac{2 \pi}{7}}$
$$
=\frac{\left(\sin \frac{3 \pi}{7}+\sin \frac{\pi}{7}\right)+\left(\sin \frac{5 \pi}{7}-\sin \frac{\pi}{7}\right)+\left(\sin \frac{7 \pi}{7}-\sin \frac{3 \pi}{7}\right)}{2 \sin \frac{2 \pi}{7}}
$$

Solution 3: Let $z=\cos \theta+\mathrm{i} \sin \theta, \theta=\frac{2}{7} \pi$, then $\bar{z}=\cos \theta-\mathrm{i} \sin \theta$
$z^{n}=\cos n \theta+\mathrm{i} \sin n \theta, \overline{z^{n}}=\cos n \theta-\mathrm{i} \sin n \theta$, hence $\cos n \theta=\frac{z^{n}+\overline{z^{n}}}{2}=\frac{z^{2 n}+1}{2 \cdot z^{n}}$
Thus the original expression $=\cos \frac{\pi}{7}+\cos \frac{3 \pi}{7}+\cos \frac{5 \pi}{7}=-\left(\cos \frac{2 \pi}{7}+\cos \frac{4 \pi}{7}+\cos \frac{6 \pi}{7}\right)$
$=-\frac{1}{2}\left(\frac{z^{2}+1}{z}+\frac{z^{4}+1}{z^{2}}+\frac{z^{6}+1}{z^{3}}\right)=\frac{-1}{2 z^{3}}\left(z^{6}+z^{5}+z^{4}+z^{3}+z^{2}+z+1\right)+\frac{1}{2}$
$=-\frac{1}{2 \cdot z^{3}} \cdot \frac{z^{7}-1}{z-1}+\frac{1}{2}=\frac{1}{2}$ (since $z^{7}=1$ ).

Solution 4: Since $z^{7}+1=0$ has all roots in the complex plane: $-1, \cos \frac{\pi}{7} \pm \mathrm{i} \sin \frac{\pi}{7}, \cos \frac{3 \pi}{7} \pm i \sin \frac{3 \pi}{7}, \cos \frac{5 \pi}{7} \pm$ i is $\frac{5 \pi}{7}$, by Vieta's formulas:
$$
\begin{array}{l}
\quad-1+\left(\cos \frac{\pi}{7}+i \sin \frac{\pi}{7}\right)+\left(\cos \frac{\pi}{7}-i \sin \frac{\pi}{7}\right)+\left(\cos \frac{3 \pi}{7}+i \sin \frac{3 \pi}{7}\right)+\left(\cos \frac{3 \pi}{7}-i \sin \frac{3 \pi}{7}\right)+ \\
\left(\cos \frac{5 \pi}{7}+i \sin \frac{5 \pi}{7}\right)+\left(\cos \frac{5 \pi}{7}-i \sin \frac{5 \pi}{7}\right)=0
\end{array}
$$

That is, $-1+2\left(\cos \frac{\pi}{7}+\cos \frac{3 \pi}{7}+\cos \frac{5 \pi}{7}\right)=0$, so $\cos \frac{\pi}{7}+\cos \frac{3 \pi}{7}+\cos \frac{5 \pi}{7}=\frac{1}{2}$.
Thus, $\cos \frac{\pi}{7}-\cos \frac{2 \pi}{7}+\cos \frac{3 \pi}{7}=\frac{1}{2}$.
Solution 5: Since in $\triangle A B C$ there is the identity: $\cos 2 A+\cos 2 B+\cos 2 C=-1-4 \cos A \cos B \cos C$.
Let $A=\frac{\pi}{7}, B=\frac{2 \pi}{7}, C=\frac{4 \pi}{7}$, then
$$
\cos \frac{2 \pi}{7}+\cos \frac{4 \pi}{7}+\cos \frac{8 \pi}{7}=-1-4 \cos \frac{\pi}{7} \cos \frac{2 \pi}{7} \cos \frac{4 \pi}{7}
$$

That is, $\cos \frac{\pi}{7}-\cos \frac{2 \pi}{7}+\cos \frac{3 \pi}{7}=1+4 \cos \frac{\pi}{7} \cos \frac{2 \pi}{7} \cos \frac{4 \pi}{7}=1+\frac{8 \sin \frac{\pi}{7} \cos \frac{\pi}{7} \cos \frac{2 \pi}{7} \cos \frac{4 \pi}{7}}{2 \sin \frac{\pi}{7}}=1+$
$$
\frac{\sin \frac{8 \pi}{7}}{2 \sin \frac{\pi}{7}}=1-\frac{1}{2}=\frac{1}{2}
$$