= Second-order difference equation
{title2=$x_{n+1}=F(x_n,x_{n-1})$}
A <second-order difference equation> determines the next member of a sequence from its two preceding values, for example $x_{n+1}=a x_n+b x_{n-1}$. Two initial values are generally needed. Although the state is written with one scalar sequence, the update becomes a first-order <discrete dynamical system> on pairs:
$$
\begin{pmatrix}x_{n+1}\\x_n\end{pmatrix}=\begin{pmatrix}a&b\\1&0\end{pmatrix}\begin{pmatrix}x_n\\x_{n-1}\end{pmatrix}.
$$
Trying $x_n=r^n$ gives the <characteristic equation> $r^2-ar-b=0$, whose roots determine growth, decay and alternating behavior. For $x_{n+1}=2\cos\theta\,x_n-x_{n-1}$ with $0<\theta<\pi$, the roots are $e^{\pm i\theta}$ and the real solutions oscillate. This is useful when a model has memory of a previous step, or when discretizing a second-order <equation of motion>.
Back to article page