3. Given numbers $x_{1}, \ldots, x_{n} \in\left(0, \frac{\pi}{2}\right)$. Find the maximum value of the expression

$$
A=\frac{\cos ^{2} x_{1}+\ldots+\cos ^{2} x_{n}}{\sqrt{n}+\sqrt{\operatorname{ctg}^{4} x_{1}+\ldots+\operatorname{ctg}^{4} x_{n}}}
$$
Answer: $\frac{\sqrt{n}}{4}$.

Solution. Note that for any $a_{1}, \ldots, a_{n}$

$$
\left(\sum_{k=1}^{n} a_{k}\right)^{2} \leqslant n \sum_{k=1}^{n} a_{k}^{2}
$$

From this, by the inequality for the harmonic mean and the arithmetic mean,

$$
\frac{1}{\sqrt{n}+\sqrt{\operatorname{ctg}^{4} x_{1}+\ldots+\operatorname{ctg}^{4} x_{n}}} \leqslant \frac{1}{\sqrt{n}+\frac{1}{\sqrt{n}} \sum_{k=1}^{n} \operatorname{ctg}^{2} x_{k}}=\frac{\sqrt{n}}{\sum_{k=1}^{n} \frac{1}{\sin ^{2} x_{k}}} \leqslant \frac{1}{n \sqrt{n}} \sum_{k=1}^{n} \sin ^{2} x_{k}
$$

Then by the Cauchy inequality,

$$
A \leqslant \frac{\left(\sum_{k=1}^{n} \sin ^{2} x_{k}\right) \cdot\left(\sum_{k=1}^{n} \cos ^{2} x_{k}\right)}{n \sqrt{n}} \leqslant \frac{1}{4 n \sqrt{n}}\left(\sum_{k=1}^{n} \sin ^{2} x_{k}+\sum_{k=1}^{n} \cos ^{2} x_{k}\right)^{2}=\frac{\sqrt{n}}{4}
$$

Equality is achieved when $x_{1}=\ldots=x_{n}=\frac{\pi}{4}$.