2. Given $x, y, z > 0$, find the maximum value of the expression

$$
A=\frac{(x-y) \sqrt{x^{2}+y^{2}}+(y-z) \sqrt{y^{2}+z^{2}}+(z-x) \sqrt{z^{2}+x^{2}}+\sqrt{2}}{(x-y)^{2}+(y-z)^{2}+(z-x)^{2}+2}
$$
Answer: $\frac{1}{\sqrt{2}}$.

Solution. If $x \geqslant y$, then

$$
\sqrt{x^{2}+y^{2}} \leqslant \sqrt{2 x^{2}}=x \sqrt{2} \quad \text { and } \quad(x-y) \sqrt{x^{2}+y^{2}} \leqslant \sqrt{2}\left(x^{2}-x y\right),
$$

and when $x < y$,

$$
\sqrt{x^{2}+y^{2}} < \sqrt{2 x^{2}}=x \sqrt{2} \quad \text { and } \quad(x-y) \sqrt{x^{2}+y^{2}}<\sqrt{2}\left(x^{2}-x y\right) .
$$

In both cases, the inequality $(x-y) \sqrt{x^{2}+y^{2}} \leqslant \sqrt{2}\left(x^{2}-x y\right)$ holds. Evaluating the other two terms in the numerator $A$ similarly, we get

$$
A \leqslant \sqrt{2} \cdot \frac{x^{2}+y^{2}+z^{2}-x y-y z-z x+1}{(x-y)^{2}+(y-z)^{2}+(z-x)^{2}+2}=\frac{1}{\sqrt{2}} \cdot \frac{(x-y)^{2}+(y-z)^{2}+(z-x)^{2}+2}{(x-y)^{2}+(y-z)^{2}+(z-x)^{2}+2}=\frac{1}{\sqrt{2}}
$$

Equality is achieved when $x=y=z=1$.