I'm trying to find the $p_i$ and $\lambda$ values that maximize the function $$f(p_1, ..., p_n, \lambda) = \prod_{i=1}^n p_i + \lambda \left(\sum_{i=1}^n p_i - c\right)$$ such that $p_i > 0$ and $\sum_{i=1}^n p_i = c$.
Using Lagrange multiplier, we have $$log f(p_1, ..., p_n, \lambda) = \sum_{i=1}^n log p_i + \lambda \left(\sum_{i=1}^n p_i - c\right)$$ I first try to solve for $p_i$ $$\frac{\partial log f}{\partial p_i} = \frac{1}{p_i} + \lambda $$ I set the above expression to 0 and solve for $p_i$ $$\Rightarrow p_i = -\frac{1}{\lambda}$$. Using the constraint, $\sum_{i=1}^n p_i = c$, we have that $$\sum_{i=1}^n p_i = -\sum_{i=1}^n \frac{1}{\lambda} = c$$ $$\Rightarrow \lambda = -\frac{n}{c} $$ $$\Rightarrow p_i = \frac{c}{n}$$
However, I don't think this is correct. $\lambda = (-\frac{c}{n})^{n-1}$ is a maximum of the function $f$, not $\lambda = -\frac{n}{c}$.
If $p_i = \frac{c}{n}$, then the product would be $\left( \frac{c}{n}\right)^n$.
We know the result is correct from AM-GM inequality.
Edit:
Suppose we work with the original function directly, taking partial derivative with $p_i$ gives us
$$\prod_{j \ne i}p_j + \lambda =0$$
Multiply $p_i$ gives us $$\prod_{j=1}^n p_j =-\lambda p_i$$
Hence all the $p_i$ are equal and hence $$-{p_1}^{n-1}=\lambda$$
or $$-\left( \frac{c}{n}\right)^{n-1}=\lambda$$