Find min of $\frac{\left( \sum kx_k \right) \left( \sum x^2_k \right)}{\left( \sum x_k \right)^3}$ With $n \ge 2$ and $x_1,\ x_2,\ \dots,\ x_n > 0$. Find the minimum of:
$$ M = \frac{(x_1 + 2 x_2 + ...+ nx_n)( x^2_1 + x^2_2 +...+x^2_n)} {\left( x_1 + x_2 +...+ x_n \right)^3}$$

For specific $n$, for example, $n = 3$, I can get: $\min \{M\} = \frac{2}{27}(10 - \sqrt 2)$
But in above generalized problem, how can I solve that ? Can I get the result by using sage or mathematica ?
 A: This is not a separate answer, but rather a (too long) comment in response to the answers by
(1) Sergio Parreiras
and (2) user58697 .
To make their answers complete, MAPLE still is not strictly needed but quite useful.
Following steps as pointed out by user58697 results in the following quadratic equation:
$$
n^2(n^2-2n+1)a^2 - 4n^2(n-1)a + (4n^2-2n-2) = 0
$$
Solutions are in a simple closed form:
$$
a = \frac{4n \pm 2\sqrt{2n+2}}{2(n-1)n} \quad \Longrightarrow \quad \min \{M\} = \\
\min{\left(\frac{(2n-\sqrt{2n+2}+2)(2n+\sqrt{2n+2})}{9n(n-1)}\,,\,
           \frac{(2n+\sqrt{2n+2}+2)(2n-\sqrt{2n+2})}{9n(n-1)}\right)}
$$
Giving e.g. for $n=3$:
$$
a = 1\pm\frac{\sqrt{8}}{6}
$$
And for the corresponding function values:
$$
f(a=1-\sqrt{8}/6) = -\frac{2(-4+\sqrt{2})(+3+\sqrt{2})}{27} \approx 0.8454973007 \\
f(a=1+\sqrt{8}/6) = -\frac{2(+4+\sqrt{2})(-3+\sqrt{2})}{27} = \frac{2}{27}(10-\sqrt{2}) \approx 0.6359841806
$$
The latter outcome quite in agreement with the OP's solution.
EDIT. Further simplification leads to this final expression for the minimum:
$$\min\{M\} = \frac{2(n+1)(2n-1)-2\sqrt{2n+2}}{9n(n-1)}$$
A: Maple is not needed. Subtracting FOCs for $i$ and $i+1$ gives $\sum x_k^2 + 2(x_i - x_{i+1}) \sum kx_k = 0$. Since neither sum depends on $i$, you may conclude that $x_i - x_{i+1}$ is a constant, that is $x$s form an arithmetic progression, $x_k = a + bk$.
Let $S_m = \sum k^m$, i.e. ($S_0 = n, S_1 = \frac{n(n-1)}{2}, S_2 = \frac{n(n+1)(2n+1)}{6}$)
Now,
$$\sum kx_k = \sum k(a + bx_k) = S_1a + S_2b$$
$$\sum x_k^2 = \sum a^2 + 2abk + b^2k^2 = S_0a^2 + 2S_1ab + S_2b^2$$
That is,
$$f(x) = (S_1a + S_2b)(na^2+2S_1ab + S_2b^2)$$
And since $\sum x_k = 1$, $$S_0a + S_1b = 1$$
Substituting $b = \frac{1 - S_0a}{S_1}$ shows that $f$ is a cubic polynomial of $a$, so $\frac{df}{da} = 0$ is a quadratic equation.
A: Let $$f(\mathbf{x})=\frac{(x_1 + 2 x_2 + ...+ nx_n)( x^2_1 + x^2_2 +...+x^2_n)} {\left( x_1 + x_2 +...+ x_n \right)^3}$$.


*

*$f$ is homegeous of degree zero: $f(\alpha\mathbf{x})=f(\mathbf{x})$ for all $\alpha>0$.

*Without any loss of generality we can assume $\sum_{i=1}^n x_i=1$.

*$\min\limits_{\mathbf{x}} (x_1 + 2 x_2 + ...+ nx_n)( x^2_1 + x^2_2 +...+x^2_n)$ subject to  $\sum_{i=1}^n x_i=1$.

*First order condition wrt $x_i$: $i\,(x^2_1 + x^2_2 +...+x^2_n)+2x_i(x_1 + 2 x_2 + ...+ nx_n)=\lambda$. FOC

*You can use Mathematica (see Reduce) to solve the system of FOC.

*But probability better to try to simplify FOCs before using Mathematica: $$\dfrac{i+1}{i}(\lambda-2x_{i+1}((x_1 + 2 x_2 + ...+ nx_n)=\lambda-2x_{i}((x_1 + 2 x_2 + ...+ nx_n)$$

*For $i=N$ you can not simplify FOC. Don't forget to include $\sum x_i=1$ as well. You need $N+1$ equations since you are also solving for $\lambda$.

*For $N=4$, using Maple I got : 



x[1] = (1/2)RootOf(10_Z^2-20*_Z+9), 
x[2] = 1/6+(1/6)RootOf(10_Z^2-20*_Z+9),
x[3] = -(1/6)RootOf(10_Z^2-20*_Z+9)+1/3
Or [x[1] = .3418861170, x[2] = .2806287057, x[3] = .2193712943]
of course that x[4] = 1-x[1]-x[2]-x[3]

