I am wondering what is the easiest/best way to find the values of $x_i$ that maximize the expression $\sum_{i=1}^N a_i \ln (x_i)$ under the constraints $\sum_{i=1}^Nx_i = 1$ and $ 0\leq x_i \leq 1$
Do I have to use Lagrange multipliers? Is there an easier way?
By using the Lagrange multiplier and setting the derivative of the Lagrangian $\sum_i a_i\ln x_i + \lambda(1-\sum_i x_i)$ to 0 I arrive at the following conclusion:
\begin{align} x_i=\frac{a_i}{\lambda} \forall i \in \{1, \ldots, N \} \end{align}
How would I proceed from that?
Update: solution
By enforcing $\sum_i x_i = 1$ it follows that $\sum_i \frac{a_i}{\lambda} = 1$ which leads to $\lambda = \sum_i a_i$ and $x_i = \frac{a_i}{\sum_j a_j}$
Solution
By enforcing $\sum_i x_i = 1$ it follows that $\sum_i \frac{a_i}{\lambda} = 1$ which leads to $\lambda = \sum_i a_i$ and $x_i = \frac{a_i}{\sum_j a_j}$