Example 1 Given that $p$ is a prime number greater than 3. Find
$$
\prod_{k=1}^{p}\left(1+2 \cos \frac{2 k \pi}{p}\right)
$$

(2012, Tsinghua University Mathematics Autumn Camp Test)
【Analysis】This is an application problem of roots of unity. The key is to first express $\cos \frac{2 k \pi}{p}$ using roots of unity, and then use the properties of roots of unity for calculation.
Let $\varepsilon=\mathrm{e}^{\frac{2 \pi x}{p}}$. Then
$$
\begin{array}{l}
\varepsilon^{p}=1, \varepsilon^{\frac{p}{2}}=\mathrm{e}^{-\pi \mathrm{i}}=-1, \\
2 \cos \frac{2 k \pi}{p}=\varepsilon^{k}+\varepsilon^{-k} . \\
\text { Hence } \prod_{k=1}^{p}\left(1+2 \cos \frac{2 k \pi}{p}\right) \\
=3 \prod_{k=1}^{p-1}\left(1+\varepsilon^{k}+\varepsilon^{-k}\right) \\
=\frac{3 \prod_{k=1}^{p-1}\left(1+\varepsilon^{k}+\varepsilon^{2 k}\right)}{\prod_{k=1}^{p-1} \varepsilon^{k}} \\
=\frac{3 \prod_{k=1}^{p-1}\left(1+\varepsilon^{k}+\varepsilon^{2 k}\right)}{\varepsilon^{\frac{2 x-11}{2}}} \\
=3 \prod_{k=1}^{p-1}\left(1+\varepsilon^{k}+\varepsilon^{2 k}\right) \\
=3 \prod_{k=1}^{n-1} \frac{\left(1-\varepsilon^{3 k}\right)}{\left(1-\varepsilon^{k}\right)} .
\end{array}
$$

Since the prime $p>3$, we have $(3, p)=1$.
Thus, $3,3 \times 2, \cdots, 3(p-1)$ exactly cover all non-zero residue classes of $p$.
Therefore, $\prod_{k=1}^{p-1}\left(1-\varepsilon^{3 k}\right)=\prod_{k=1}^{p-1}\left(1-\varepsilon^{k}\right)$.
Hence, $\prod_{k=1}^{p}\left(1+2 \cos \frac{2 k \pi}{p}\right)=3$.