4. Solve in the set of real numbers the equation

$$
\frac{x-a_{1}}{a_{2}+\ldots+a_{n}}+\frac{x-a_{2}}{a_{1}+a_{3}+\ldots+a_{n}}+\ldots+\frac{x-a_{n}}{a_{1}+\ldots+a_{n-1}}=\frac{n x}{a_{1}+\ldots+a_{n}}
$$

where $n \geq 2$ and $a_{i}>0, i \in\{1,2, \cdots, n\}$.
Solution.

Let $s=\sum_{i=1}^{n} a_{i}$. The equation can be rewritten as

$$
\sum_{i=1}^{n} \frac{x-a_{i}}{s-a_{i}}=\frac{n x}{s}
$$

or

$$
\left(\sum_{i=1}^{n} \frac{1}{s-a_{i}}-\frac{n}{s}\right) x=\sum_{i=1}^{n} \frac{a_{i}}{s-a_{i}}
$$

But

$$
\sum_{i=1}^{n} \frac{a_{i}}{s-a_{i}}=s \sum_{i=1}^{n}\left(\frac{1}{s-a_{i}}-\frac{1}{s}\right)=s\left(\sum_{i=1}^{n} \frac{1}{s-a_{i}}-\frac{n}{s}\right)
$$

so the equation becomes

$$
\left(\sum_{i=1}^{n} \frac{1}{s-a_{i}}-\frac{n}{s}\right) x=\left(\sum_{i=1}^{n} \frac{1}{s-a_{i}}-\frac{n}{s}\right) s
$$

From the inequality between the arithmetic mean and the harmonic mean, we get

$$
\frac{n}{\sum_{i=1}^{n} \frac{1}{s-a_{i}}} \leq \frac{\sum_{i=1}^{n}\left(s-a_{i}\right)}{n}
$$

hence

$$
\sum_{i=1}^{n} \frac{1}{s-a_{i}} \geq \frac{n^{2}}{\sum_{i=1}^{n}\left(s-a_{i}\right)}=\frac{n^{2}}{(n-1) s}>\frac{n}{s}, \text { so } \sum_{i=1}^{n} \frac{1}{s-a_{i}}-\frac{n}{s} \neq 0
$$

It follows that the equation has the unique solution $x=s$, i.e., $x=a_{1}+a_{2}+\cdots+a_{n}$. (1p)