Maximize product with constraint

optimization

$A_i$ and $x_i$ are positive numbers, I want to solve the following:

\begin{align}
{\text{maximize}} &\hspace{3mm}& \prod_{i=1}^N (1 + A_{i}x_{i}) \\
\text{subject to} &\hspace{3mm}& \sum_{i=1}^N x_{i} = 1
\end{align}

I was trying to guess the pattern of ${x_i}$ by simplifying the problem with only two terms. I get $$x_0 = \frac{A_1 – A_0 + A_0A_1}{2A_0A_1}, \qquad x_1 = \frac{A_0 – A_1 + A_0A_1}{2A_0A_1}$$ but I cannot generalize the solution further.

Best Answer

Let $$f(x_1,\dots x_n)=\prod_{i=1}^N (1 + A_{i}x_{i})$$ and $$g(x_1,\dots,x_n)= \sum_{i=1}^N x_{i} -1$$

Using Lagrange multipliers, any extremum of $f$ under the constraint that $g(x_1,\dots,x_n)=0$ will be reached at a point $(x_1,\dots,x_n)$ such that $\nabla f(x_1,\dots,x_n)=\lambda \nabla g(x_1,\dots, x_n)$ for some $\lambda\in\mathbb R$.

So, computing the partial derivatives, for all $k$, $$\frac{\partial f}{\partial x_k}(x_1,\dots,x_n)=A_k\prod_{i\neq k}(1+A_ix_i)=\lambda = \lambda \frac{\partial g}{\partial x_k}(x_1,\dots,x_n)$$ Thus, for all $l$ and $k$, $$A_k(1+A_lx_l)=A_l(1+A_kx_k)$$ In other words $$x_l-x_k=\frac 1 {A_k} - \frac 1{A_l}$$ So if you sum over all $k$ and use the fact that $g(x_1,\dots,x_n)=1$: $$nx_l-1=\left(\sum_{k=1}^n\frac 1 {A_k}\right)-\frac n{A_l}$$

Finally $$\boxed{ x_l=\frac 1 n \left(\sum_{k=1}^n\frac 1 {A_k}\right)-\frac 1 {A_l}+\frac 1 n }$$

Related Question