Discrete equation

Discrete solution of a differential equation open_in_new

Consider discretising the equation at points $\se{x_n}$ spaced by $h$ and take $y_n = y(x_n)$. We can estimate the derivative by the forward Euler scheme $$ \frac{dy}{dx}\Big|_{x_n} \approx \frac{y_{n+1} - y_n}{h}. $$

For second-order derivative, $$\begin{align*} \frac{d^2y}{dx^2}\Big|_{x_n} &\approx \frac{dy/dx\big|_{x_{n+1}} - dy/dx\big|_{x_n}}{h} \\ &= \frac{y_{n+2} - 2y_{n+1} + y_n}{h^2}. \end{align*}$$

Example of a discrete solution

Second-order linear discrete equations with constant coefficients open_in_new

Consider the equation $$ ay_{n+2} + by_{n+1} + cy_n = f_n. $$

The complementary function has the form $y_n^{(c)} = k^n$ where the characteristic equation is $$ ak^2 + bk + c = 0. $$

  • If the roots $k_1 \neq k_2$, then $$ y_n^{(c)} = Ak_1^n + Bk_2^n. $$

  • If the roots $k_1 = k_2 = k$, then $$ y_n^{(c)} = (A + Bn) k^n. $$

Example (Fibonacci sequence)

For particular integral, guess the following:

$f_n$

$y_n^{(p)}$

$k^n$

$Ak^n$ if not complementary

$k^n$

$Ank^n$ if complementary

$n^p$

degree $p$ polynomial in $n$