I am having a little issue with this problem. I know that if we were to only have $$\sum_{i=1}^{n}a_i^2$$ subject to $$\sum_{i=1}^{n}a_i=1$$ then we can use Lagrange multipliers, and we get $a_i=1/n$ for all $i$.
In this case we have that the $\sigma_{i}$'s are known constants, but they are not necessarily equal to each other, so I cannot really do anything else with those.
I know the answer is $$a_i=\frac{(1/\sigma_i^2)}{\sum_{i=1}^{n}(1/\sigma_i^2)}$$
but I have tried to use this and have not had any luck thus far.
Any help given is much appreciated. Thank you.
Solve the first-order condition
$$\frac{\partial}{\partial a_j} \left(\sum_{i=1}^n a_i^2 \sigma_i^2 - \lambda(\sum_{i=1}^n a_i -1) \right) = 0$$
to obtain $$a_j = \frac{\lambda}{2\sigma_j^2}$$
Next solve for the multiplier $\lambda$ using the constraint $\sum_{i=1}^n a_i = 1$.