For any positive numbers $p_k$ how to find the minimum of $\sum\limits_{k=1}^n a_k^2 +(\sum\limits_{k=1}^n a_k)^2$ when $\sum\limits_{k=1}^n p_ka_k=1$?
I saw this problem on my problem book and I tried to solve it. I tried to use Cauchy inequality for $\sum_{k=1}^n a_k^2 $ and I proved that the minimum of $\sum\limits_{k=1}^n a_k^2$ is $\frac{1}{\sum\limits_{k=1}^n \frac{1}{p_k^2}}$ when $a_k =\frac{1}{p_k^2\sum\limits_{k=1}^n\frac{1}{p_k^2}}$ but I couldn't find a way to find the minimum of a$\sum\limits_{k=1}^n a_k^2 +(\sum\limits_{k=1}^n a_k)^2$ . After a lot of time thinking I couldn't do any progress and so I decided to ask here