# 差分方程

## 1. 差分的定义

### 1.1 前向差分

$\begin{array}{c} x_k = x_0 + kh \quad (k = 0,1,\cdots,n) \\ \Delta f(x_k) = f(x_{k+1}) - f(x_k) \end{array}$

### 1.2 逆向差分

$\begin{array}{c} x_k = x_0 + kh \quad (k = 0,1,\cdots,n) \\ \nabla f(x_k) = f(x_{k}) - f(x_{k-1}) \end{array}$

### 1.3 中心差分

$\begin{array}{c} x_k = x_0 + kh \quad (k = 0,1,\cdots,n) \\ \delta f(x_k) = f(x_{k+\frac{1}{2}}) - f(x_{k-\frac{1}{2}}) \end{array}$

【注】：一阶差分的差分为二阶差分，二阶差分的差分为三阶差分，以此类推。记 ${\Delta^nf(x_k)}$${\nabla^nf(x_k)}$${\delta^nf(x_k)}$ 分别为 ${f(x)}$$n$ 阶前向/逆向/中心差分。$n$ 阶前向差分、逆向差分、中心差分公式分别为：

$\begin{array}{c} \Delta^nf(x_k) = \Delta\{\Delta^{n-1}f(x_k)\} = \Delta^{n-1}f(x_{k+1}) - \Delta^{n-1}f(x_k) \\ \nabla^nf(x_k) = \nabla\{\nabla^{n-1}f(x_k)\} = \nabla^{n-1}f(x_{k}) - \nabla^{n-1}f(x_{k-1}) \\ \delta^nf(x_k) = \delta\{\delta^{n-1}f(x_k)\} = \delta^{n-1}f(x_{k+\frac{1}{2}}) - \delta^{n-1}f(x_{k-\frac{1}{2}}) \end{array}$

## 2. 差分的性质

• ${\Delta C = \nabla C = \delta C = 0}$
• 线性：如果 $a$$b$ 均为常数，则

$\begin{array}{c} \Delta(af + bg) = a\Delta f + b\Delta g \\ \nabla(af + bg) = a\nabla f + b\nabla g \\ \delta(af + bg) = a\delta f + b\delta g \end{array}$

• 乘法定则：

$\begin{array}{c} \Delta(fg) = f\Delta g + g\Delta f + \Delta f\Delta g \\ \nabla(fg) = f\nabla g + g\nabla f - \nabla f\nabla g \\ \delta(fg) = f\delta g + g\delta f \end{array}$

• 除法定则：

$\begin{array}{c} \Delta(\frac{f}{g}) = \frac{1}{g} det \left[ \begin{matrix} \Delta f & \Delta g \\ f & g \end{matrix} \right] det \left[ \begin{matrix} g & \Delta g \\ -1 & 1 \end{matrix} \right]^{-1} = \frac{g\Delta f - f\Delta g}{g \cdot {(g + \Delta g)}} \\ \nabla(\frac{f}{g}) = \frac{1}{g} det \left[ \begin{matrix} \nabla f & \nabla g \\ f & g \end{matrix} \right] det \left[ \begin{matrix} g & \nabla g \\ 1 & 1 \end{matrix} \right]^{-1} = \frac{g\nabla f - f\nabla g}{g \cdot {(g - \nabla g)}} \\ \delta(\frac{f}{g}) = \frac{1}{g} det \left[ \begin{matrix} \delta f & \delta g \\ f & g \end{matrix} \right] det \left[ \begin{matrix} g & \delta g \\ 0 & 1 \end{matrix} \right]^{-1} = \frac{g\delta f - f\delta g}{g^2} \end{array}$

• 级数：

$\begin{array}{c} \sum_{n=a}^b\Delta f(n) = f(b+1) - f(a) \\ \sum_{n=a}^b\nabla f(n) = f(b) - f(a-1) \\ \sum_{n=a}^b\delta f(n) = f(b+\frac{1}{2}) - f(a-\frac{1}{2}) \end{array}$