[Math] Maximize product with sum constraint

optimization

Suppose I have $N$ numbers $x_i \geq 1$, $i = 1, … ,N$, and want to solve the following:
\begin{align}
{\text{maximize}} &\hspace{3mm}& \prod_{i=1}^N x_{i} \\
\text{subject to} &\hspace{3mm}& \sum_{i=1}^N x_{i} = A
\end{align} where $A$ is any constant

Is it true that the solution will be when all $x_i$ are equal? If so, what is the proof?

Best Answer

Suppose any pair $x_i$ and $x_j$ are different and let $x_m$ be their arithmetic average so $x_i=x_m+d$ and $x_j = x_m-d$ for some $d\not = 0 $.

Then $x_i+x_j = x_m+x_m$ and $x_i \times x_j = x_m^2 -d^2 \lt x_m \times x_m$, so you can maintain the overall sum and increase the overall product by replacing $x_i$ and $x_j$ by $x_m $ and $x_m$, at least when all the terms are positive. So for a given sum, the product is maximised when all the terms are equal.

But if you are allowed negative terms this may not work, and there may be no upper bound. Can you see why?