Example 20 (1) Let $n$ be a prime number greater than 3, find the value of $\left(1+2 \cos \frac{2 \pi}{n}\right)\left(1+2 \cos \frac{4 \pi}{n}\right) \cdots\left(1+2 \cos \frac{2 m \pi}{n}\right)$.
(2) Let $n$ be a natural number greater than 3, find the value of 
$\left(1+2 \cos \frac{\pi}{n}\right)\left(1+2 \cos \frac{2 \pi}{n}\right)\left(1+2 \cos \frac{3 \pi}{n}\right) \cdots\left(1+2 \cos \frac{(n-1) \pi}{n}\right)$.
(1) Let $\omega=\mathrm{e}^{\frac{2 \pi i}{n}}$, then $\omega^{n}=1, \omega^{-\frac{n}{2}}=\mathrm{e}^{\pi i}=-1, 2 \cos \frac{2 k \pi}{n}=\omega^{k}+\omega^{-k}$,
$$
\begin{aligned}
\prod_{k=1}^{n}\left(1+2 \cos \frac{2 k \pi}{n}\right) & =\prod_{k=1}^{n}\left(1+\omega^{k}+\omega^{-k}\right)=\prod_{k=1}^{n} \omega^{-k}\left(\omega^{k}+\omega^{2 k}+1\right) \\
& =\omega^{-\frac{n(n+1)}{2}} \cdot 3 \prod_{k=1}^{n-1} \frac{1-\omega^{3 k}}{1-\omega^{k}}=(-1)^{n+1} \cdot 3 \prod_{k=1}^{n-1} \frac{1-\omega^{3 k}}{1-\omega^{k}} .
\end{aligned}
$$

Since $n$ is a prime number greater than 3,
we have $(-1)^{n+1}=1$, and $3,3 \times 2, \cdots, 3(n-1), \bmod n$, covers all residue classes of $n$, thus $\prod_{k=1}^{n-1}\left(1-\omega^{3 k}\right)=\prod_{k=1}^{n-1}\left(1-\omega^{k}\right)$.
Therefore, $\int_{k=1}^{n}\left(1+2 \cos \frac{2 k \pi}{n}\right)=3$.
(2) The $2 n$ roots of $z^{2 n}-1=0$ are $\pm 1$ and $z_{k}=\mathrm{e}^{\pm \frac{k \pi i}{n}}(k=1,2, \cdots, n-1)$,

then $z^{2 n}-1=\left(z^{2}-1\right) \int_{k=1}^{n-1}\left(z-\mathrm{e}^{\frac{k \pi i}{n}}\right)\left(z-\mathrm{e}^{-\frac{k \pi i}{n}}\right)$
$$
=\left(z^{2}-1\right) \int_{k=1}^{n-1}\left(z^{2}+1-2 z \cos \frac{k \pi}{n}\right) \text {. }
$$

Let $z=\mathrm{e}^{\frac{2 \pi}{3}}$, then $z^{2}+1=-z$, thus
$$
\begin{array}{l}
z^{2 n}-1=\left.\left(z^{2}-1\right)(-z)^{n-1}\right|_{k=1} ^{n-1}\left(1+2 \cos \frac{k \pi}{n}\right) . \\
\left.\right|_{k=1} ^{n-1}\left(1+2 \cos \frac{k \pi}{n}\right)=\frac{z^{2 n}-1}{\left(z^{2}-1\right)(-z)^{n-1}}=
\end{array}
$$
$\left\{\begin{array}{l}0 \text {, if } n=3 k ; \\ \frac{z^{2}-1}{\left(z^{2}-1\right)(-z)^{3 k}}=(-y)^{3 k}=(-1)^{n-1} \text {, if } n=3 k+1 ; \\ \frac{z-1}{\left(z^{2}-1\right)(-z)^{3 k+1}}=\frac{(-1)^{3 k+1}}{(z+1) z}=\frac{(-1)^{3 k+1}}{-1}=(-1)^{n}, \text { if } n=3 k+2(k \in \mathbf{N}) .\end{array}\right.$