sigma notation- squaring the entire sum Could someone please tell me how to expand this?
$\bigg(\sum_{i=1}^ne^{at_i-\frac{1}{2}\sigma^2t_i+\beta t_i}\bigg)^2$
i know the general formula goes something like this:
$\bigg(\sum_{i=1}^na_i\bigg)^2 = \sum_{i=1}^n\sum_{j=1}^na_ia_j$
but where does that j term come from?
 A: You can't call both indexes $i$. It's the same as asking why you can't call two different sequences' terms $a_i$ - if you then tried to talk about the value of $a_1$, nobody would know which one you mean. 
A: The index variables $i$ and $j$ are so-called bound variables. This means that their scope (i.e. range of validity) is determined by their sigma-operator $\sum$ and the operator precedence rules.

Some valid representations are:
  \begin{align*}
\left(\sum_{i=1}^n a_i\right)^2&=\left(\color{blue}{\sum_{i=1}^n a_i}\right)\left(\color{green}{\sum_{i=1}^n a_i}\right)=\left(\color{blue}{\sum_{i=1}^n a_i}\right)\left(\
\color{green}{\sum_{j=1}^n a_j}\right)\tag{1}\\
&=\sum_{i=1}^n\left(a_i \sum_{j=1}^{n}a_j\right)\tag{2}\\
&=\sum_{i=1}^n\sum_{j=1}^{n}a_ia_j=\sum_{1\leq i,j\leq n}a_ia_j\tag{3}\\
&=2\sum_{1\leq i <j\leq n}a_ia_j+\sum_{k=1}^na_k^2\tag{4}
\end{align*}

Comment:


*

*In (1) we present the scope of each of the index variables somewhat more clearly by using inside parenthesis the colors green and blue. Although each of the representations is perfectly valid we usually prefer the right-most before the middle one, since different variable names enhance readability.

*In (2) we apply the distributive law. Here we have to distinguish the indices by different names, since now they have overlapping scope within the parentheses.

*In (3) we multiply out and have again overlapping scope. The right hand double sum is another convenient presentation.

*In (4) we use symmetry (commutativity) of the product $a_{i}a_j=a_ja_i$ and the order relation of the indices. We could also use e.g. an index name $i$ as bound  variable and write $\sum_{i=0}^{n}a_i^2$ as right hand sum, since there is no overlapping scope with the left-hand double sum. As before, it's preferable to use different names to enhance readability. 
Multiplying out $\left(\sum_{i=1}^ne^{at_i-\frac{1}{2}\sigma^2t_i+\beta t_i}\right)^2$ typically follows (3) or (4) whichever is more convenient for further calculations resp. simplifications. 
