An identity for the product of two finite sum I found this formula in this Wikipedia page:
 $$\left(\sum_{k=0}^{n}a_{k}\right)\left(\sum_{k=0}^{n}b_{k}\right)=\sum_{k=0}^{2n}\sum_{i=0}^{k}a_{i}b_{k-i}-\sum_{k=0}^{n-1}\left(a_{k}\sum_{i=n+1}^{2n-k}b_{i}+b_{k}\sum_{i=n+1}^{2n-k}a_{i}\right)$$ but there is no reference. 

Is there someone who knows a reference in some book? And if not, how can we prove it?

I tried to write the terms as a $2n\times2n$ matrix (since the "convolution term" are all in the diagonal) but I didn't see how to find it.
 A: 
Here we start with the left-most double sum of the right-hand side. We obtain
\begin{align*}
\color{blue}{\sum_{k=0}^{2n}\sum_{i=0}^{k}a_{i}b_{k-i}}
&=\sum_{0\leq i\leq k\leq 2n}a_i b_{k-i}=\sum_{i=0}^{2n}\sum_{k=i}^{2n}a_ib_{k-i}\tag{1}\\
&=\sum_{i=0}^{2n}\sum_{k=0}^{2n-i}a_ib_k\tag{2}\\
&=\sum_{i=0}^na_i\left(\sum_{k=0}^nb_k+\sum_{k={n+1}}^{2n-i}b_k\right)+\sum_{i=n+1}^{2n}a_i\sum_{k=0}^{2n-i}b_k\tag{3}\\
&=\left(\sum_{i=0}^na_i\right)\left(\sum_{k=0}^nb_k\right)+\sum_{i=0}^{n-1}a_i\sum_{k={n+1}}^{2n-i}b_k+\sum_{i=n+1}^{2n}a_i\sum_{k=0}^{2n-i}b_k\tag{4}\\
&=\left(\sum_{k=0}^na_k\right)\left(\sum_{k=0}^nb_k\right)+\sum_{k=0}^{n-1}a_k\sum_{i={n+1}}^{2n-k}b_i+\sum_{k=0}^{n-1}b_k\sum_{i=n+1}^{2n-k}a_i\tag{5}\\
&\color{blue}{=\left(\sum_{k=0}^na_k\right)\left(\sum_{k=0}^nb_k\right)
+\sum_{k=0}^{n-1}\left(a_k\sum_{i={n+1}}^{2n-k}b_i+b_k\sum_{i=n+1}^{2n-k}a_i\right)}
\end{align*}
  and the claim follows.

Comment:


*

*In (1) we exchange the sums and provide a representation in the middle to better see the index range.

*In (2) we shift the index of the inner sum and start with $k=0$.

*In (3) we split the outer sum into two parts and furthermore split the inner sum of the left one into two parts. This way we subdivide the big triangle $$\{(i,k):0\leq i\leq 2n,0\leq k\leq 2n-i\}$$ into three parts. The $(n\times n)$-square $\{(i,k):0\leq i,k\leq n\}$ and the triangles
$\{(i,k):0\leq i\leq n-1,n+1\leq k\leq 2n-i\}$ and $\{(i,k):n+1\leq i\leq 2n,0\leq k\leq 2n-i\}$.

*In (4) we multiply out, obtain the left-most double sum summing over a square region, while the other double sums sum over a triangle region each. In the middle double sum we set the upper limit of the outer sum to $n-1$ since the inner sum with $i=n$ is empty.

*In (5) we exchange the order of the sums in the right-most double sum. In the middle double sum we simply exchange the index notation $i$ with $k$.
A: The set of lattice points $\{(i,j) : 0\le i,\; 0\le j,\; 0\le i+j\le2n\}$ forms an equilateral right triangle. It is partitioned into three parts.

*

*A inscribed square $\{(i,j) : 0\le i,j\le n\},$

*A right triangle $\;\{(i,j) : 0\le i\le n-1,\;n+1\le j\le2n-i\},$

*A right triangle $\{(i,j) : 0\le j\le n-1,\;n+1\le i\le 2n-j\}.$
The formula essentially states that $\sum_{i,j}\; a_ib_j$ summed over the square is the sum over the big triangle minus the sum of the two smaller triangles. Here is the matrix for $n=4$:
$$ 
\begin{bmatrix}
 1 & 1 & 1 & 1 & 1 & 2 & 2 & 2 & 2 \\
 1 & 1 & 1 & 1 & 1 & 2 & 2 & 2 & 0 \\
 1 & 1 & 1 & 1 & 1 & 2 & 2 & 0 & 0 \\
 1 & 1 & 1 & 1 & 1 & 2 & 0 & 0 & 0 \\
 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\
 3 & 3 & 3 & 3 & 0 & 0 & 0 & 0 & 0 \\
 3 & 3 & 3 & 0 & 0 & 0 & 0 & 0 & 0 \\
 3 & 3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\end{bmatrix} $$
