# Math Help - Sum of squared dot products, seeking proof for maximisation

1. ## Sum of squared dot products, seeking proof for maximisation

Hi, I'm not sure if this is the right topic to post this in, so please let me know if there is another place I am better off asking. But for now, I have a set of vectors $\{ \mathbf{a}_i \}$ indexed by i, and my problem is that I am trying to find a proof that the function
$\sum_i (\mathbf{a}_i\cdot\mathbf{b})^2$ is maximised when $\mathbf{b}=\sum_i \mathbf{a}_i$ or when $\mathbf{b} \parallel \sum_i \mathbf{a}_i$ (because I only care about vectors with a norm of 1).

Just to clarify, I am sure that this is true, I just don't have a clean proof of it.