Solve the following equation in the set of real numbers:

$$
\sqrt{x_{1}-1^{2}}+2 \sqrt{x_{2}-2^{2}}+\cdots+n \sqrt{x_{n}-n^{2}}=\frac{x_{1}+x_{2}+\cdots+x_{n}}{2}
$$
I. solution. According to the inequality between the arithmetic and geometric means,

$$
k \sqrt{x_{k}-k^{2}}=\sqrt{k^{2}\left(x_{k}-k^{2}\right)} \leq \frac{k^{2}+\left(x_{k}-k^{2}\right)}{2}=\frac{x_{k}}{2} \quad(1 \leq k \leq n \text { integer })
$$

and equality holds precisely when $k^{2}=\left(x_{k}-k^{2}\right)$, that is, $x_{k}=2 k^{2}$. If we add these inequalities together, we get

$$
\sqrt{x_{1}-1^{2}}+2 \sqrt{x_{2}-2^{2}}+\cdots+n \sqrt{x_{n}-n^{2}} \leq \frac{x_{1}+x_{2}+\cdots+x_{n}}{2}
$$

and equality holds only if $x_{k}=2 k^{2}$ for every $k$.

Thus, the solution is: $x_{1}=2, x_{2}=8, x_{3}=18, \ldots, x_{n}=2 n^{2}$.

II. solution. Write down the Cauchy-Schwarz inequality for the numbers $1,2, \ldots, n$ and $\sqrt{x_{1}-1^{2}}, \ldots, \sqrt{x_{n}-n^{2}}$, then apply the inequality between the arithmetic and geometric means:

$$
\begin{gathered}
1 \sqrt{x_{1}-1^{2}}+2 \sqrt{x_{2}-2^{2}}+\cdots+n \sqrt{x_{n}-n^{2}} \leq \\
\leq \sqrt{1^{2}+2^{2}+\cdots+n^{2}} \sqrt{\left(x_{1}-1^{2}\right)+\cdots+\left(x_{n}-n^{2}\right)}= \\
=\sqrt{\left(1^{2}+\cdots+n^{2}\right)\left(x_{1}+\cdots+x_{n}-\left(1^{2}+\cdots+n^{2}\right)\right)} \leq \\
\leq \frac{\left(1^{2}+\cdots+n^{2}\right)+\left(x_{1}+\cdots+x_{n}-1^{2}-\cdots-n^{2}\right)}{2}=\frac{x_{1}+\cdots+x_{n}}{2}
\end{gathered}
$$

Equality in the first case holds when

$$
\sqrt{x_{1}-1^{2}}: \sqrt{x_{2}-2^{2}}: \ldots: \sqrt{x_{n}-n^{2}}=1: 2: \ldots: n
$$

that is, for some real number $c$, $\sqrt{x_{k}-k^{2}}=c k$. In the second case, the condition for equality is that $1^{2}+\cdots+n^{2}=$ $x_{1}+\cdots+x_{n}-1^{2}-\cdots-n^{2}$, that is,

$$
x_{1}+\cdots+x_{n}=2\left(1^{2}+\cdots+n^{2}\right)
$$

Substituting $(c k)^{2}+k^{2}=\left(c^{2}+1\right) k^{2}$ for $x_{k}$:

$$
\left(c^{2}+1\right)\left(1^{2}+\cdots+n^{2}\right)=2\left(1^{2}+\cdots+n^{2}\right)
$$

which means $c^{2}+1=2$

All this together means that equality holds precisely when $x_{k}=2 k^{2}$ for every $k$.