Summation by parts is the discrete counterpart of integration by parts. Instead of differentiating one factor and integrating the other, we take differences of one sequence and partial sums of the other.
This note revises my original Chinese article. A concise Chinese explanation follows the English proof.
Let a1,…,an and b1,…,bn be real or complex numbers, with n≥1. Define
B0=0,Bi=j=1∑ibj.
Then
i=1∑naibi=anBn+i=1∑n−1(ai−ai+1)Bi.
Since bi=Bi−Bi−1,
i=1∑naibi=i=1∑naiBi−i=1∑naiBi−1=anBn+i=1∑n−1aiBi−i=1∑n−1ai+1Bi.
Combining the last two sums proves the formula. The term involving B0 vanishes. When n=1, the sum from 1 to n−1 is empty and the identity still holds.
Example: the sum of squares
Set ai=bi=i, so Bi=i(i+1)/2 and ai−ai+1=−1. Writing Sn=∑i=1ni2, we obtain
Sn=2n2(n+1)−21i=1∑n−1(i2+i).
The right side still contains a sum of squares, but this is an equation we can solve for Sn. Substitute ∑i=1n−1i2=Sn−n2 and ∑i=1n−1i=n(n−1)/2:
Sn3Sn=2n2(n+1)−2Sn−n2−4n(n−1),=n2(n+1)+n2−2n(n−1).
Therefore
Sn=6n(n+1)(2n+1).
The partial-sum formula is especially useful when the Bi are simple or bounded and the differences ai−ai+1 are easier to handle than the original products.
中文说明
原文发表于我的 Bilibili 专栏。本页修正了原推导中的求和指标与相邻项下标。
令 B0=0、Bi=∑j=1ibj,则 bi=Bi−Bi−1。代入后,把第二个求和的指标平移一位,就得到
i=1∑naibi=anBn+i=1∑n−1(ai−ai+1)Bi.
这就是 Abel 变换,也称分部求和。它把 bi 换成部分和 Bi,同时把 ai 换成相邻项之差;端点项 anBn 不能漏掉。
证明平方和公式时,取 ai=bi=i,利用 Bi=i(i+1)/2,即可得到上面的关于 Sn 的方程。右边再次出现 Sn 并不意味着循环论证:把它移到左边,便能解出 Sn=n(n+1)(2n+1)/6。
另可参看究尽数学的 Abel 公式几何解释。