# 代數/本書課文/求和/錯位相減法

## 含公比數列

${\displaystyle S_{n}=\sum _{k=1}^{n}p(k)q^{k-1}}$
${\displaystyle qS_{n}=\sum _{k=1}^{n}p(k)q^{k}}$
{\displaystyle {\begin{aligned}(1-q)S_{n}&=\sum _{k=1}^{n}p(k)q^{k-1}-\sum _{k=1}^{n}p(k)q^{k}\\~&=\sum _{k=0}^{n-1}p(k+1)q^{k}-\sum _{k=1}^{n}p(k)q^{k}\\~&=\sum _{k=1}^{n}[p(k+1)-p(k)]q^{k}+p(1)-p(n+1)q^{n}\\S_{n}&={\frac {q}{1-q}}\sum _{k=1}^{n}[p(k+1)-p(k)]q^{k-1}+{\frac {p(1)-p(n+1)q^{n}}{1-q}}\end{aligned}}}

 例子：等比數列求和${\displaystyle S_{n}=\sum _{k=1}^{n}q^{k-1}}$ ${\displaystyle qS_{n}=\sum _{k=1}^{n}q^{k}}$ ${\displaystyle (q-1)S_{n}=q^{n}-1,S_{n}=\sum _{k=1}^{n}q^{k-1}={\frac {q^{n}-1}{q-1}}}$
 例子：差比數列求和${\displaystyle S_{n}=\sum _{k=1}^{n}[a+d(k-1)]r^{k-1}}$ 代入上述結論： {\displaystyle {\begin{aligned}S_{n}&={\frac {r}{1-r}}\sum _{k=1}^{n}dr^{k-1}+{\frac {a-(a+dn)r^{n}}{1-r}}\\~&={\frac {dr(1-r^{n})}{(1-r)^{2}}}+{\frac {a-(a+dn)r^{n}}{1-r}}\end{aligned}}}

## 倒序求和

${\displaystyle S_{n}=\sum _{k=1}^{n}x_{k}=\sum _{k=1}^{n}x_{n+1-k}}$
${\displaystyle x_{k}+x_{n+1-k}}$為常數，即可求出${\displaystyle 2S_{n}}$

 例子：等差數列求和 ${\displaystyle S_{n}=\sum _{k=1}^{n}a+d(k-1)=\sum _{k=1}^{n}a+d(n-k)}$ ${\displaystyle 2S_{n}=\sum _{k=1}^{n}2a+d(n-1)=2an+dn(n-1)}$ ${\displaystyle S_{n}=an+d{\frac {n(n-1)}{2}}}$