find the maximum of the value $\left(\sum_{i=1}^{n}ia_{i}\right)\left(\sum_{i=1}^{n}\frac{a_{i}}{i}\right)^2$ let $a_{i}\ge 0$ and such $$a_{1}+a_{2}+\cdots+a_{n}=1$$
find the maximum of the value
$$\left(\sum_{i=1}^{n}ia_{i}\right)\left(\sum_{i=1}^{n}\dfrac{a_{i}}{i}\right)^2$$
I  try to use 
From Pólya-Szegö’s inequality, we have for $0 < m_1 \leqslant u_k \leqslant M_1$ and $0 < m_2 \leqslant v_k \leqslant M_2$, 
$$\left(\sum u_k^2 \right) \left( \sum v_k^2 \right) \leqslant \frac14 \left( \sqrt{\frac{M_1 M_2}{m_1m_2}} + \sqrt{\frac{m_1 m_2}{M_1 M_2}} \right)^2 \left( \sum u_k v_k\right)^2$$
But I can't it.Thanks

Alternative solution
Problem: Let $a_i\ge 0, \forall i$ with $a_1 + a_2 + \cdots + a_n = 1$. Prove that the maximum of
$$\left(\sum_{i=1}^n i a_i\right)\left(\sum_{i=1}^n \frac{a_i}{i}\right)^2$$
is $\frac{4(n+1)^3}{27n^2}$.
We may use the approach in my answer to this equation:
An upper bound of product of two inner products
Consider the optimization problem
$$\max_{a_i\ge 0, \forall i; \ \sum_{i=1}^n a_i = 1} \left(\sum_{i=1}^n i a_i\right)\left(\sum_{i=1}^n \frac{a_i}{i}\right)^2.$$
Let $(a_1^\ast, a_2^\ast, \cdots, a_n^\ast)$ be a global maximizer.
We claim that if $1 < k < n$, then $a_k^\ast = 0$.
Indeed, if $a_k^\ast > 0$, let
$$a_1' = a_1^\ast + (1 - y) a_k^\ast, \quad a_k' = 0, \quad a_n' = a_n^\ast + y a_k^\ast$$
where $\frac{k-1}{n-1} < y < \frac{n}{k}\cdot \frac{k-1}{n-1}$. We have
$$a_1' + a_k' + a_n' = a_1^\ast + a_k^\ast + a_n^\ast,$$
and
\begin{align}
&a_1' + ka_k' + na_n' - (a_1^\ast + ka_k^\ast + na_n^\ast)\\
=\ & (n-1)\left(y - \frac{k-1}{n-1}\right) a_k^\ast\\
>\ & 0,
\end{align}
and
\begin{align}
&a_1' + \frac{a_k'}{k} + \frac{a_n'}{n} - \left(a_1^\ast + \frac{a_k^\ast}{k}
+ \frac{a_n^\ast}{n}\right)\\
=\ & \frac{n-1}{n}\left(\frac{n}{k}\cdot \frac{k-1}{n-1} - y\right)a_k^\ast\\
>\ & 0.
\end{align}
However, this contradicts the optimality of $(a_1^\ast, a_2^\ast, \cdots, a_n^\ast)$.
Now, since $a_2^\ast = a_3^\ast = \cdots = a_{n-1}^\ast = 0$, we have
\begin{align}
&\left(\sum_{i=1}^n i a_i^\ast\right)\left(\sum_{i=1}^n \frac{a_i^\ast}{i}\right)^2\\
=\ & (a_1^\ast + n a_n^\ast)\left(a_1^\ast + \frac{a_n^\ast}{n}\right)^2\\
=\ & (1 - a_n^\ast + na_n^\ast)\left(1 - a_n^\ast + \frac{a_n^\ast}{n}\right)^2\\
=\ & \frac{1}{2n^2}[2 + 2(n-1)a_n^\ast][n - (n-1)a_n^\ast]^2\\
\le\ & \frac{1}{2n^2} \left(\frac{2 + 2(n-1)a_n^\ast + n - (n-1)a_n^\ast
+ n - (n-1)a_n^\ast}{3}\right)^3\\
=\ & \frac{4(n+1)^3}{27n^2}
\end{align}
with equality if $a_n^\ast = \frac{n-2}{3(n-1)}$, where we have used AM-GM inequality.
Thus, the desired maximum is $\frac{4(n+1)^3}{27n^2}$
at $a_1 = \frac{2n-1}{3(n-1)}, a_2 = a_3 = \cdots = a_{n-1} = 0, a_n = \frac{n-2}{3(n-1)}$.
