# Summation notation rule

Sorry if this sounds elementary, but I have problems with the following in a text I am reading:

$$\left(\sum_{k=0}^{n} C_k\phi_k(x)\right)^2 = \sum_{k=0}^{n}\sum_{l=0}^{n}C_k C_l\langle\phi_k,\phi_l\rangle$$

where $C_j$ are scalars and $\phi_j$ are basis for polynomials. But that is not important, I have problem with the summation itself. Is there any summation rule that expands the expression on the left into the one on the right ?

Thanks

Yes. \begin{align} &\left(\sum_{k=0}^n a_k\right)^2 = \left(\sum_{k=0}^n a_k\right)\cdot\left(\sum_{k=0}^n a_k\right) \\ &= (a_0+a_1+\dots + a_n)\left(\sum_{k=0}^n a_k\right) \\ &=a_0\left(\sum_{k=0}^n a_k\right)+a_1\left(\sum_{k=0}^n a_k\right)+\dots+a_n\left(\sum_{k=0}^n a_k\right) \\ &=\left(\sum_{l=0}^na_l\left(\sum_{k=0}^n a_k\right)\right) = \left(\sum_{l=0}^n\left(\sum_{k=0}^n a_ka_l\right)\right) \end{align}