# 2.1: Difference Equations

Differential equation are great for modeling situations where there is a continually changing population or value. If the change happens incrementally rather than continuously then differential equations have their shortcomings. Instead we will use difference equations which are recursively defined sequences. Examples of incrementally changes include salmon population where the salmon spawn once a year, interest that is compound monthly, and seasonal businesses such as ski resorts.

Definition: First Order Difference Equation

A *first order difference equation* is a recursively defined sequence in the form

\[y_{n+1} = f(n,y_n) \;\;\; n=0,1,2,... \]

What makes this first order is that we only need to know the most recent previous value to find the next value. It also comes from the differential equation

\[ y' = g(n,y(n)) \]

Recalling the limit definition of the derivative this can be written as

\[ \lim_{h\rightarrow 0}\frac{y\left ( n+h \right ) - y\left ( n \right )}{h} \]

if we think of \(h\) and \(n\) as integers, then the smallest that \(h\) can become without being 0 is 1. The differential equation becomes

\[ y(n+1) - y(n) = g(n,y(n)) \]

\[ y(n+1) = y(n) +g(n,y(n)) \]

Now letting

\[ f(n,y(n)) = y(n) +g(n,y(n)) \]

and putting into sequence notation gives

\[ y^{n+1} = f(n,y_n) \]

If the first order difference depends only on yn (autonomous in Diff EQ language), then we can write

\[ y_1 = f(y_0), y_2 = f(y_1) = f(f(y_0)), \]

\[ y_3 = f(y_2) = f(f(f(y_0))) = f ^3(y_0) \]

In general,

\[ y+n = f^n(y_0) \]

Solutions to a finite difference equation with

\[ y_{n+1} = y_n \]

Are called *equilibrium solutions*. We find them by setting

\[ y_n = f(n,y_n) \]

An finite difference equation is called *linear* if f(n,y_{n}) is a linear function of y_{n}.

Example

Each year, 1000 salmon are stocked in a creak and the salmon have a 30% chance of surviving and returning to the creak the next year. How many salmon will be in the creak each year and what will be population in the very far future?

#### Solution

This is a linear finite difference equation with

\[ y _{n+1} = 0.3y_n + 1000 \]

We have

\[y_0 = 1000, \;\;\; y_1 = 0.3 y_0 + 1000, \;\;\; y_2 = 0.3 y_1 + 1000 = 0.3(0.3y_0 +1000)+ 1000 \]

\[y_3 = 0.3y_2 + 1000 = 0.3( 0.3(0.3y_0 +1000)+ 1000 )+1000 = 1000 + 0.3(1000) + 0.3^2(1000) + 0.3^3 y_0 \]

In general,

\[y_n = 1000 (1 + 0.3 + 0.3^2 + 0.3^3 + ... + 0.3^{n-1}) + 0.3^n y_0 \]

The first term is a geometric series, so the equation can be written as

\[ y_n = \dfrac{1000(1 - 0.3^n)}{1 - 0.3} + 0.3^ny_0 \]

Notice that the limiting population will be \(\dfrac{1000}{7} = 1429\) salmon.

More generally for the linear first order difference equation

\[ y_{n+1} = ry_n + b \]

The solution is

\[ y_n = \dfrac{b(1 - r^n)}{1-r} + r^ny_0 \]

Recall the logistics equation

\[ y' = ry \left (1 - \dfrac{y}{K} \right ) \]

After some work, it can be modeled by the finite difference logistics equation

\[ u_{n+1} = ru_n(1 - u_n) \]

The equilibrium can be found by solving

\[ u_n = ru_n(1 - u_n) \]

A quadratic that has solution

\[ u_n = 0 or u_n = \frac{r - 1}{r} \]

To determine the stability of the equilibrium points, look at values of \(u_n\) very close to the equilibrium value. For the first point, \( u_n \) is much larger than \( (u_n)^2 \), so the logistics equation can be approximated by

\[u_{n+1} = ru_n(1-u_n) = ru_n - ru_n^2 \approx ru_n \]

For \(|r| < 1\), this converges to 0, thus the equilibrium point is stable.

For the other equilibrium value, write

\[ u_n = \frac{r - 1}{r} + v_n \]

So that the equilibrium value becomes

\[ v_n = 0 \]

We can now substitute into the difference equation and chop off the nonlinear term to get

\[ v_{n+1} = (2 - r)v_n \]

This converges to 0 for

\[|2 - r| < 1\]

or

\[1 < r < 3\]

So the equilibrium point is stable in this range.

At \(r = 1\), we say that there is an *exchange of stability*. For \(r > 3\), the sequence exhibits strange behavior. In particular for \(3 < r < 3.57\) the sequence is periodic, but past this value there is chaos.

### Contributors

- Larry Green (Lake Tahoe Community College)