9. Given $P$ is any point on the circumcircle of a regular $n$-sided polygon $A_{1} A_{2} \cdots A_{n}$.
(1) Find the maximum and minimum values of $\sum_{k=1}^{n}\left|P A_{k}\right|$;
(2) When $P$ is not restricted to the circle, what is the minimum value of $\sum_{k=1}^{n}\left|P A_{k}\right|$?
9. (1) Let $A_{k}=\varepsilon^{k}(k=1,2, \cdots, n), \varepsilon=\mathrm{e}^{\frac{2 \pi}{n}}$. As shown in Figure $21-19, P=\mathrm{e}^{\mathrm{i} \theta}(0 \leqslant \theta \leqslant \frac{2 \pi}{n})$

It is easy to see that $\angle A_{1} P A_{k}=\frac{\pi}{n}(k-1)$, so $\arg \left[\overrightarrow{P A_{k}} \cdot \mathrm{e}^{-\frac{\pi}{n}(k-1) \mathrm{i}}\right]=\arg \left(\overrightarrow{P A_{k}}\right), k=1,2, \cdots, n$.
$$
\begin{aligned}
\text { Hence } \sum_{k=1}^{n}\left|P A_{k}\right| & =\sum_{k=1}^{n}\left|\mathrm{e}^{-\frac{\pi}{n}(k-1) \mathrm{i}} \cdot\left(A_{k}-P\right)\right| \\
& =\left|\sum_{k=1}^{n} P \cdot \exp \left(-\frac{(k-1) \pi}{n} \mathrm{i}\right)-\exp \left(\frac{(k+1) \pi}{n} \mathrm{i}\right)\right| \\
& =\left|\frac{2 P}{1-\mathrm{e}^{-\frac{\pi}{n}} \mathrm{i}}-\frac{2 \mathrm{e}^{\frac{2 \pi}{n_{i}}}}{1-\mathrm{e}^{\frac{\pi}{n}}}\right| \\
& =2 \cdot\left|\frac{P+\mathrm{e}^{\frac{\pi}{n} i}}{1-\mathrm{e}^{-\frac{\pi}{n}} \mathrm{i}}\right|=\frac{2 \cos \left(\frac{\theta}{2}-\frac{\pi}{2 n}\right)}{\sin \frac{\pi}{2 n}} .
\end{aligned}
$$

Since $\left|\frac{\theta}{2}-\frac{\pi}{2 n}\right| \leq \frac{\pi}{2 n}$, when $P$ is the midpoint of $\overparen{A_{1} A_{n}}$, $\sum_{k=1}^{n}\left|P A_{k}\right|$ is maximized, with the maximum value being $2 \csc \frac{\pi}{2 n}$; when $P$ is at $A_{1}$ or $A_{k}$, $\sum_{k=1}^{n}\left|P A_{k}\right|$ is minimized, with the minimum value being $2 \cot \frac{\pi}{2 n}$.
(2) If $P$ is not restricted to the circle, then
$$
\begin{aligned}
\sum_{k=1}^{n}\left|P A_{k}\right| & =\sum_{k=1}^{n}\left|A_{k}-P\right|=\sum_{k=1}^{n}\left|A_{k}^{-1}\left(A_{k}-P\right)\right| \geqslant \sum_{k=1}^{n} A_{k}^{-1}\left(A_{k}-P\right) \mid \\
& =\left|n-P \cdot \sum_{k=1}^{n} A_{k}^{-1}\right|=n .
\end{aligned}
$$

Thus, when $P=0$, $\sum_{k=1}^{n}\left|P A_{k}\right|$ has the minimum value $n$.