How prove this identity $\sum\limits_{i=1}^{n}\sum\limits_{j=1}^{n}\min{\{i,j\}}(a_{i}-a_{i+1})(b_{j}-b_{j+1})=\sum\limits_{i=1}^{n}a_{i}b_{i}$? Show that this  identity;
$$\sum_{i=1}^{n}\sum_{j=1}^{n}\min{\{i,j\}}(a_{i}-a_{i+1})(b_{j}-b_{j+1})=\sum_{i=1}^{n}a_{i}b_{i}$$
where $a_{i},b_{i}\in R,(i=1,2,\cdots,n),a_{n+1}=b_{n+1}=0$
It seem can use integral to show it?  And maybe other methods also can solve it?
 A: Split into two cases:
$$ \sum_{i=1}^n \sum_{j=1}^i j(a_i-a_{i+1})(b_j-b_{j+1}) + \sum_{j=2}^n \sum_{i=1}^{j-1} i(a_i-a_{i+1})(b_j-b_{j+1}) \\
= \sum_{i=1}^n (a_i-a_{i+1}) \sum_{j=1}^i j(b_j-b_{j+1}) + \sum_{j=2}^n (b_j-b_{j+1}) \sum_{i=1}^{j-1} i(a_i-a_{i+1}) $$
(note the sums are in a different order in each term). Consider the inner sum in the first term:
$$ \sum_{j=1}^i j(b_j-b_{j+1}) = \sum_{j=1}^i \sum_{k=1}^j (b_j-b_{j+1}) = \sum_{k=1}^i \sum_{j=k}^i (b_j-b_{j+1}), $$
introducing a new sum and changing the order of summation. But the inner sum telescopes, to $b_k-b_{i+1}$, so the first sum is now
$$ \sum_{i=1}^n (a_i-a_{i+1}) \sum_{k=1}^i (b_k-b_{i+1}) = \sum_{i=1}^n (a_i-a_{i+1}) \sum_{k=1}^i b_k - \sum_{i=1}^n i(a_i-a_{i+1})b_{i+1} \\
 =\sum_{k=1}^n b_k \sum_{i=k}^n (a_i-a_{i+1}) - \sum_{i=1}^{n-1} i(a_i-a_{i+1})b_{i+1} $$
The first sum telescopes again, to $\sum_{k=1}^n b_k (a_k-a_{n+1}) = \sum_{k=1}^n b_k a_k$ since $a_{n+1}=0$.
We apply a similar procedure to the second sum:
$$ \sum_{i=1}^{j-1} i(a_i-a_{i+1}) = \sum_{i=1}^{j-1}\sum_{k=1}^i (a_i-a_{i+1}) = \sum_{k=1}^{j-1} \sum_{i=k}^{j-1} (a_i-a_{i+1}) = \sum_{k=1}^{j-1} (a_k-a_j), $$
so the second sum becomes
$$ \sum_{j=2}^n (b_j-b_{j+1}) \sum_{k=1}^{j-1} (a_k-a_j) = \sum_{j=2}^n (b_j-b_{j+1}) \sum_{k=1}^{j-1} a_k - \sum_{j=2}^n (j-1)(b_j-b_{j+1})a_j \\
= \sum_{k=1}^{n-1} a_k  \sum_{j=k+1}^{n} (b_j-b_{j+1}) - \sum_{j=2}^n (j-1)a_j(b_j-b_{j+1}), $$
and the first sum telescopes to $ \sum_{k=1}^{n-1}a_k b_{k+1} $. So we are left with the total sum being equal to
$$ \sum_{k=1}^n b_k a_k + \sum_{k=1}^{n-1}a_k b_{k+1} - \sum_{k=1}^{n-1} k(a_k-a_{k+1})b_{k+1} - \sum_{k=1}^n (k-1)a_k(b_k-b_{k+1}), $$
re-indexing the sums. The last three terms are
$$ \sum_{k=1}^{n-1}a_k b_{k+1} - \sum_{k=1}^{n-1} ka_k b_{k+1} - \sum_{k=1}^{n-1} k a_{k+1} b_{k+1} - \sum_{k=2}^n (k-1)a_k b_k + \sum_{k=1}^{n-1} (k-1)a_k b_{k+1} =0, $$
and the result follows.
