I am trying to understand this proof. Rather an important part of the proof. I have already shown this is true for $n=2$ and am assuming the $a_n$ case is true.
$$(a_1^2 +a_2^2 +\ldots +a_n^2) \le (a_1 +a_2 +\ldots +a_n)^2$$ Want to show that \begin{align} (a_1^2 +a_2^2 +\ldots +a_n^2 +a_{n+1}^2) & \le (a_1 +a_2 +\ldots +a_n +a_{n+1})^2 \\ &= (a_1^2 +a_2^2 +\ldots +a_n^2) +a_{n+1}^2 \\ & \le ((a_1 +a_2 +\ldots +a_n) +(a_{n+1}))^2 \\ & = (a_1^2 +a_2^2 +\ldots +a_n^2 + a_{n+1}^2) \\ & \le (a_1 +a_2 +\ldots +a_n)^2 +2(a_1 +a_2 +\ldots +a_n)(a_{n+1}) +(a_{n+1})^2 \end{align} and here is the part I am not understanding. For some reason the proof moves some of the terms over and I cannot identify what is being replaced or why. My guess is that the terms that moves are the ${n+1}$ terms. But, I am not certain.
$$a_1^2+a_n^2+a_{n+1}^2+\ldots+2(a_1+a_2+\ldots+a_n)(a_{n+1}) \le (a_1+a_2+\ldots+a_n)^2$$