Find the greatest value of $E=\frac{a_1}{1+a_1^2}+\frac{a_2}{1+a_2^2}+\ldots+\frac{a_n}{1+a_n^2}$

inequalitysolution-verification

Let $ n $ $(n\geq2)$ be an integer. Find the greatest possible value of the expression $$E=\frac{a_1}{1+a_1^2}+\frac{a_2}{1+a_2^2}+\ldots+\frac{a_n}{1+a_n^2}$$ if the positive real numbers $a_1,a_2,\ldots,a_n$ satisfy $a_1+a_2+\ldots+a_n=\frac{n}{2}$. What are the values of $a_1,a_2,\ldots,a_n$ when the greatest value is achieved?


I want to know if my solution is correct.
My solution: Note that the expression $$E=\frac{a_1}{1+a_1^2}+\frac{a_2}{1+a_2^2}+\ldots+\frac{a_n}{1+a_n^2}$$ is homogeneous. Without the restriction $a_1+a_2+\ldots+a_n=\frac{n}{2}$, the highest value of $E$ is $\frac {n}{2}$ achieved when $a_1=a_2=…=a_n=1$ (can ve shown by AM-GM). Now, as the expression is homogeneous, we can scale down all $a_i$ to half. So $a_1,…,a_n=\frac{1}{2}$, so now $a_1+a_2+\ldots+a_n=\frac{n}{2}$, and $E= \frac{2n}{5}$ which would be it's maximum value. And we are done. I checked the answer and indeed it's $\frac{2n}{5}$, but they used a different solution. Is this solution correct?

Best Answer

As pointed out in the comments, your solution does not work because the expression is not homogenous.

Another way to see that this reasoning is incorrect, is to extrapolate your reasoning to the case of $ \sum a_i >> n$. Specifically, consider

If $a+b = 10$, what is the maximum of $ \frac{ a}{ 1+a^2} + \frac{b}{1+b^2}$?

If your assumption about scaling is correct, then we'd say that the maximum occurs at $ a = b = 5$, with value of $ 2 \times \frac{5}{1+25} < \frac{1}{2} $. But clearly, if we had $ a = 1$, the value is at least $\frac{1}{2}$, so the $ a= b = 5$ does not achieve the maximum.

The conclusion (max occurs when all values are equal) is true when the sum is low enough.
When the sum is large, this no longer works. The reason behind that is convexity.
The second derivative of $\frac{x}{1+x^2}$ is $\frac{2x(x^2-3)}{(x^2+1)^3}$, which is positive for $x > \sqrt{3}$.
So, if $\sum a_i = An$ for $ A > \sqrt{3}$, then for $f(a_i, a_2, \ldots, a_n) = \sum_{i=1}^n \frac{a_i}{1+a_i^2}$,
$$f(A, A, \ldots , A, A) < f(A, A, \ldots, A, 2A - \sqrt{3}, \sqrt{3}) < \ldots < f( nA - (n-1)\sqrt{3}, \sqrt{3}, \sqrt{3}, \ldots , \sqrt{3}, ).$$ In fact, we can conclude that at the maximum (for any sum), at most 1 value will be $ > \sqrt{3}$ (since otherwise we can replace $a_i, a_j$ with $ \sqrt{3}, a_i + a_j - \sqrt{3} $).


Generalizing your question, we can show

Given positive $a_i$ such that $ \sum a_i = A n$ for $ A \leq 1$, then $ \sum \frac{a_i}{1+a_i^2}$ is maximized when $a_i $ are all equal to $ \frac{ \sum a_i } { n}$.

One way to show this is the tangent line method:
Prove that for $ 0 < A \leq 1$ (representing $ \frac{\sum a_i}{n}$) and $ b \geq 0$, we have $$ \frac{b}{1+b^2} \leq \frac{A}{1+A^2} + \frac{1-A^2}{(1+A^2)^2} (b-A). $$ The RHS is the value of the tangent line at $ (A, \frac{A}{1+A^2})$ to $ y = \frac{x}{1+x^2}$, evaluated at $b$.
If you expand and simplify the inequality, with some work it becomes $(A-b)^2[ (A^2 - 1)b - 2A ] \leq 0$, so it's true in our given domain.

Now, summing up across $ b = a_i$, and using $ \sum a_i = nA$, we get

$$ \sum \frac{a_i}{1+a_i^2} \leq n\times \frac{A}{1+A^2} + \frac{1-A^2}{(1+A^2)^2} \sum (a_i-A) = n\times \frac{A}{1+A^2}.$$

Notes

  • Consider the tangent line inequality for a fixed $A = \frac{1}{2}$. We have $\frac{b}{1+b^2} \leq \frac{2}{5} + \frac{12}{25} ( b - \frac{1}{2}) \Leftrightarrow \frac{(1-2b)^2(3b+4) } { 25(b^2 + 1 ) } \geq 0$. You can recognize the general form, and proving it just requires you to be careful with the algebra.
  • We can't simply use Jensen's inequality, because the second derivative is positive at large values.
  • Conversely, if $ \sum a_i = na$ with $ a> 1$, then there is a large enough $N$, such that for any $ n> N$, the maximum occurs when not all of the values are equal. With more work, we can show is that all but 1 value are equal.