Summation by Parts (Abel Transformation)

An introduction to summation by parts and its role as the discrete analogue of integration by parts.

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.

Formula and proof

Let a1,,ana_1,\ldots,a_n and b1,,bnb_1,\ldots,b_n be real or complex numbers, with n1n\ge1. Define

B0=0,Bi=j=1ibj.B_0=0,\qquad B_i=\sum_{j=1}^{i}b_j.

Then

i=1naibi=anBn+i=1n1(aiai+1)Bi.\boxed{\sum_{i=1}^{n}a_ib_i =a_nB_n+\sum_{i=1}^{n-1}(a_i-a_{i+1})B_i.}

Since bi=BiBi1b_i=B_i-B_{i-1},

i=1naibi=i=1naiBii=1naiBi1=anBn+i=1n1aiBii=1n1ai+1Bi.\begin{aligned} \sum_{i=1}^{n}a_ib_i &=\sum_{i=1}^{n}a_iB_i-\sum_{i=1}^{n}a_iB_{i-1}\\ &=a_nB_n+\sum_{i=1}^{n-1}a_iB_i -\sum_{i=1}^{n-1}a_{i+1}B_i. \end{aligned}

Combining the last two sums proves the formula. The term involving B0B_0 vanishes. When n=1n=1, the sum from 11 to n1n-1 is empty and the identity still holds.

Example: the sum of squares

Set ai=bi=ia_i=b_i=i, so Bi=i(i+1)/2B_i=i(i+1)/2 and aiai+1=1a_i-a_{i+1}=-1. Writing Sn=i=1ni2S_n=\sum_{i=1}^{n}i^2, we obtain

Sn=n2(n+1)212i=1n1(i2+i).S_n=\frac{n^2(n+1)}2-\frac12\sum_{i=1}^{n-1}(i^2+i).

The right side still contains a sum of squares, but this is an equation we can solve for SnS_n. Substitute i=1n1i2=Snn2\sum_{i=1}^{n-1}i^2=S_n-n^2 and i=1n1i=n(n1)/2\sum_{i=1}^{n-1}i=n(n-1)/2:

Sn=n2(n+1)2Snn22n(n1)4,3Sn=n2(n+1)+n2n(n1)2.\begin{aligned} S_n&=\frac{n^2(n+1)}2-\frac{S_n-n^2}{2}-\frac{n(n-1)}4,\\ 3S_n&=n^2(n+1)+n^2-\frac{n(n-1)}2. \end{aligned}

Therefore

Sn=n(n+1)(2n+1)6.\boxed{S_n=\frac{n(n+1)(2n+1)}6.}

The partial-sum formula is especially useful when the BiB_i are simple or bounded and the differences aiai+1a_i-a_{i+1} are easier to handle than the original products.

中文说明

原文发表于我的 Bilibili 专栏。本页修正了原推导中的求和指标与相邻项下标。

B0=0B_0=0Bi=j=1ibjB_i=\sum_{j=1}^{i}b_j,则 bi=BiBi1b_i=B_i-B_{i-1}。代入后,把第二个求和的指标平移一位,就得到

i=1naibi=anBn+i=1n1(aiai+1)Bi.\sum_{i=1}^{n}a_ib_i =a_nB_n+\sum_{i=1}^{n-1}(a_i-a_{i+1})B_i.

这就是 Abel 变换,也称分部求和。它把 bib_i 换成部分和 BiB_i,同时把 aia_i 换成相邻项之差;端点项 anBna_nB_n 不能漏掉。

证明平方和公式时,取 ai=bi=ia_i=b_i=i,利用 Bi=i(i+1)/2B_i=i(i+1)/2,即可得到上面的关于 SnS_n 的方程。右边再次出现 SnS_n 并不意味着循环论证:把它移到左边,便能解出 Sn=n(n+1)(2n+1)/6S_n=n(n+1)(2n+1)/6

另可参看究尽数学的 Abel 公式几何解释