Maximum of $(1-x_1)(1-x_2)...(1-x_n)$ Given $n$ positive reals $x_1,x_2,...,x_n$ such that $x_1+x_2+...+x_n=L$, what is the maximum value of the expression: $$(1-x_1)(1-x_2)...(1-x_n)$$ and for which $n$-tuple is obtained?
I guess the maximum is achieved when $x_1=x_2=...=x_n=\frac{L}{n}$ and I tried to show that for any deviation from this the given expression would be greater than $\left(1-\frac{L}{n}\right)^n$ but I failed. I also thought of applying $AM-GM$ or similars but the problem is that the given numbers aren't necessary positive. How can I do that?
Thanks
 A: Using Lagrange multipliers.
$$
L = \Pi_{k=1}^n(1-x_k) + \lambda\left(\sum_{k=1}^n x_k - L\right)
$$
so the stationary points are determined as the solutions for
$$
\frac{\partial L}{\partial x_k} = -\frac{\Pi_{k=1}^n(1-x_k)}{1-x_k}+\lambda = 0
$$
or calling $\Lambda = \frac{\lambda}{\Pi_{k=1}^n(1-x_k)}$
$$
x_k = 1-\frac{1}{\Lambda}
$$
and substituting into $\sum_{k=1}^n x_k - L=0$ gives
$$
\Lambda = \frac{n}{n-L}
$$
and thus
$$
x_k = \frac Ln
$$
defines a stationary point. Now we should qualify this point as a maximum point.
NOTE
There is a number $\gamma_n$ such that for $0\lt L\le \gamma_n$ the solution is $x_k = \frac Ln$ but for $\lambda_n \le L$ the solution is any pair $x_j=\frac L2, x_k = \frac L2$ with the others $x_i = 0,\ \ \forall i \ne \{j, k\}$. Now the quest is for $\gamma_n$
Diverse solutions appear depending on the values for $L, n$. To give an example, for $n=8$ we have the possibilities
$$
\cases{
\left(1-\frac L8\right)^8=\left(1-\frac L2\right)^2 \to L_1^* = 2.45996\\
\left(1-\frac L2\right)^2=\left(1-\frac L4\right)^4 \to L_2^* = 13.6569\\
\left(1-\frac L4\right)^4=\left(1-\frac L6\right)^6 \to L_2^* = 22.8871\\
}
$$
so for $0<L<L_1^*$ we have as solution all $x_k = \frac L8$. For $L_1^*< L< L_2^*$ we have as solutions $x_i=x_j = \frac L2$ for $i\ne j$. For $L_2^*< L< L_3^*$ we have as solutions $x_i=x_j=x_k=x_m = \frac L4$ with $i\ne j\ne k\ne m$ and finally for $L_3^* < L$ we have as solutions $x_i=x_j=x_k=x_m= x_p=x_q = \frac L6$ with $x_i\ne x_j\ne x_k\ne x_m\ne x_p\ne x_q$
