Difference Equations¶
Motivation: arises from discretization of ODEs/PDEs.
Discrete Calculus¶
Difference¶
Discrete Integral¶
- \(D(f_n + g_n) = D f_n + D g_n\)
- \(D(f_n g_n) = f_{n+1} D g_n + g_n D f_n\)
- \(D\left(\frac{f_n}{g_n}\right) = \frac{g_n D f_n - f_n D g_n}{g_n g_{n+1}}\)
| Continuous | Discrete |
|---|---|
| \(y = x^k\) | \(f_n = n(n+1)\ldots(n+k-1)\) |
| \((x^k)' = k x^{k-1}\) | \(\begin{aligned} D f_n &= (n+1)\ldots (n+k) - n(n+1)\ldots (n+k-1) \\ &= k \underset{k-1 \text{ terms}}{\underbrace{(n+1)\ldots (n+k-1)}} \end{aligned}\) |
| \(\int x^k \mathrm{d}x = \frac{x^{k+1}}{k+1} + c\) | \(\sum_{j=n_0}^n j(j+1)\ldots (j+k-1)\) |
Difference Equations¶
\(N\)-th order difference equation:
- \(D^k a_n\) depends on \(a_n, a_{n+1}, \ldots, a_{n+k}\)
We can omit the \(D\) operator and rewrite it in algebraic form:
- \(a_{n+1} = D a_n + a_n\)
- \(a_{n+2} = D^2 a_n + 2 D a_n + a_n\)
similar to ODEs, we have
- General solutions: $$ a_n = a(n; \underset{\text{general const.}}{\underbrace{c_1, c_2, \ldots, c_N}}) $$
Factorial
general solution:
Gamma function
Definition:
Integration by parts gives
extends to \(\mathbb{C}\) except at \(z = 0, -1, -2, \ldots\)
First Order¶
Homogeneous¶
take natural log on both sides:
thus,
the general solution is
Inhomogeneous¶
For ODEs like
\[ y' = p(x) y + q(x) \]we have the multiplying factor \(e^{\int p(x) \mathrm{d}x}\).
- summing factors
Higher Order¶
Linear dependency of \(N\) solutions by Wronskian
Abel's formula
- IVP:
- BVP: \(a_n\) at \(N\) different \(n\) values
Constant coeff. Linear Homogeneous¶
Recall for linear homogeneous ODEs with constant coeff., we use \(y = e^{r x}\) ansatz.
For difference equations, we use the ansatz
- for single root \(r\): \(a_n = r^n\)
- for multiple root \(r\) of multiplicity \(m\): \(a_n = n^k r^n, k = 0, 1, \ldots, m-1\)
Euler eq. (equidimensional eq.)¶
ODE:
\[ x^N y^{(N)} + p_{N-1} x^{N-1} y^{(N-1)} + \ldots + p_1 x y' + p_0 y = 0 \]
\(x^N \leftrightarrow n(n-1)\ldots(n-N+1) = \Gamma(n+N) / \Gamma(n)\)
Difference Euler eq.:
Try the ansatz \(a_n = \frac{\Gamma(n+r)}{\Gamma(n)}\).
Inhomogeneous Linear Eq.¶
- Variation of parameters
- Reduction of order
Generating Functions¶
Given \(a_n\) (integer function), we can construct
converges near \(x_0\).
e.g.
Let \(F(x) = \sum_{n=0}^{\infty} a_n x^n\). Then