Example 17 Let $x_{i} \geqslant 0(i=1,2, \cdots, n)$ and $\sum_{i=1}^{n} x_{i}^{2}+2 \sum_{1 \leqslant i<j \leqslant n} \sqrt{\frac{i}{j}} x_{i} x_{j}=1$, find the maximum and minimum values of $\sum_{i=1}^{n} x_{i}$. (2001 National High School Mathematics League Additional Question)

The key is to find the maximum value of $\sum_{i=1}^{n} x_{i}$. Make the transformation $x_{k}=\sqrt{k} y_{k}(k=\Gamma, 2=\cdots, n)$, and the substitution $a_{i}=y_{i}+ y_{i+1}+\cdots+y_{n}(i=1,2, \cdots, n)$, and use the Cauchy-Schwarz inequality to find the maximum value of $\sum_{i=1}^{n} x_{i}$.
Solve for the minimum value first, because
$$\sum_{i=1}^{n} x_{i}^{2}+2 \sum_{1 \leqslant i<j \leqslant n} x_{i} x_{j} \geqslant \sum_{i=1}^{n} x_{i}^{2}+2 \sum_{1 \leqslant i<j \leqslant n} \sqrt{\frac{i}{j}} x_{i} x_{j}=1 \Rightarrow \sum_{i=1}^{n} x_{i} \geqslant 1$$

Equality holds if and only if there exists $i$ such that $x_{i}=1, x_{j}=0, j \neq i$. Therefore, the minimum value of $\sum_{i=1}^{n} x_{i}$ is 1.
Next, solve for the maximum value. Let $x_{k}=\sqrt{k} y_{k}(k=1,2, \cdots, n)$, so
$$\sum_{k=1}^{n} k y_{k}^{2}+2 \sum_{1 \leqslant k<j \leqslant n} k y_{k} y_{j}=1$$

Let
$$\begin{array}{l}
M=\sum_{k=1}^{n} x_{k}=\sum_{k=1}^{n} \sqrt{k} y_{k} \\
\left\{\begin{array}{l}
y_{1}+y_{2}+\cdots+y_{n}=a_{1} \\
y_{2}+\cdots+y_{n}=a_{2} \\
\cdots \\
y_{n}=a_{n}
\end{array}\right.
\end{array}$$

Then (1) $\Leftrightarrow a_{1}^{2}+a_{2}^{2}+\cdots+a_{n}^{2}=1$, let $a_{n+1}=0$, then
$$\begin{aligned}
M= & \sum_{k=1}^{n} \sqrt{k}\left(a_{k}-a_{k+1}\right)=\sum_{k=1}^{n} \sqrt{k} a_{k}-\sum_{k=1}^{n} \sqrt{k} a_{k+1}= \\
& \sum_{k=1}^{n} \sqrt{k} a_{k}-\sum_{k=1}^{n} \sqrt{k-1} a_{k}=\sum_{k=1}^{n}(\sqrt{k}-\sqrt{k-1}) a_{k}
\end{aligned}$$

By the Cauchy-Schwarz inequality, we get
$$M \leqslant\left[\sum_{k=1}^{n}(\sqrt{k}-\sqrt{k-1})^{2}\right]^{\frac{1}{2}} \cdot\left(\sum_{k=1}^{n} a_{k}^{2}\right)^{\frac{1}{2}}=\left[\sum_{k=1}^{n}(\sqrt{k}-\sqrt{k-1})^{2}\right]^{\frac{1}{2}}$$

Equality holds $\Leftrightarrow \frac{a_{1}^{2}}{1}=\frac{a_{2}^{2}}{(\sqrt{2}-1)^{2}}=\cdots=$
$$\begin{array}{l}
\frac{a_{k}^{2}}{(\sqrt{k}-\sqrt{k-1})^{2}}=\cdots=\frac{a_{n}^{2}}{(\sqrt{n}-\sqrt{n-1})^{2}} \Leftrightarrow \\
\frac{a_{1}^{2}+a_{2}^{2}+\cdots+a_{n}^{2}}{1+(\sqrt{2}-1)^{2}+\cdots+(\sqrt{n}-\sqrt{n-1})^{2}}=\frac{a_{k}^{2}}{(\sqrt{k}-\sqrt{k-1})^{2}} \Leftrightarrow \\
a_{k}=\frac{\sqrt{k}-\sqrt{k-1}}{\left[\sum_{k=1}^{n}(\sqrt{k}-\sqrt{k-1})^{2}\right]^{\frac{1}{2}}}, k=1,2, \cdots, n
\end{array}$$

Since $a_{1} \geqslant a_{2} \geqslant \cdots \geqslant a_{n}$, thus
$$y_{k}=a_{k}-a_{k-1}=\frac{2 \sqrt{k}-(\sqrt{k+1}+\sqrt{k-1})}{\left[\sum_{k=1}^{n}(\sqrt{k}-\sqrt{k-1})^{2}\right]^{\frac{1}{2}}} \geqslant 0$$

That is, $x_{k} \geqslant 0$, $\square$
The maximum value sought is $\left[\sum_{k=1}^{n}(\sqrt{k}-\sqrt{k-1})^{2}\right]^{\frac{1}{2}}$.