Sei sulla pagina 1di 44

June 16, 2011

Handout: Dierence / Dierential


Equations
L.R. van den Doel
r.vandendoel@roac.nl
Roosevelt Academy Middelburg
Lange Noordstraat 1
NL-4331 CB Middelburg
The Netherlands
http://www.roac.nl
Contents
1 Linear Dierential Equations with Constant Coecients . . . . . . . . . . . . . . . . . . . 1
2 Solving Linear Homogeneous Dierential Equations with Constant Coecients 2
2.1 The Solution of a First-Order Linear Homogeneous Dierential Equation . 3
2.2 The Solution of a Second-Order Linear Homogeneous Dierential Equation 4
3 Solving Inhomogeneous Linear Dierential Equations . . . . . . . . . . . . . . . . . . . . . . 13
4 The Complete Solution of an Inhomogeneous Linear Dierential Equation . . . . 17
5 Linear Dierence Equations with Constant Coecients . . . . . . . . . . . . . . . . . . . . . 19
6 Solving Linear Homogeneous Dierence Equations with Constant Coecients . 19
6.1 Solution of a First-Order Linear Homogeneous Dierence Equation . . . . . . 20
6.2 Solving Second-Order Linear Homogeneous Dierence Equations . . . . . . . . 24
7 Solving Inhomogeneous Linear Dierence Equations . . . . . . . . . . . . . . . . . . . . . . . 33
8 Fibonacci Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
9 Cobweb and First-Order Dierence Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.1 Logistic Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
1. LINEAR DIFFERENTIAL EQUATIONS WITH CONSTANT COEFFICIENTS
1 Linear Dierential Equations with Constant Coecients
Here, we will discuss how to solve a very specic type of dierential equations; namely
rst and second-order linear homogeneneous and inhomogeneous dierential equations
with constant coecients. Two examples of such a type of dierential equation are the
following:
m
d
2
y(t)
dt
2
= b
dy(t)
dt
ky(t) m
d
2
y(t)
dt
2
+ b
dy(t)
dt
+ ky(t) = 0, (1.1)
and
dy(t)
dt
= k(y(t) kT
a
)
dy(t)
dt
ky(t) = kT
a
. (1.2)
The rst example is actually Newtons second law (force equals mass times acceleration
for objects with constant mass) for a spring-mass system: m > 0[kg] is the mass attached
to a spring with spring force constant k > 0[N/m]; the term ky(t) is the spring force,
which is proportional to, but in opposite direction of the extension y(t) of the spring.
The mass m is oscillating under inuence of a drag force b
dy(t)
dt
(b > 0) proportional to,
but in opposite direction of the velocity of the mass, given by
dy(t)
dt
. The last quantity is
the rate-of-change of the extension of the spring y(t). The boxed dierential equation is
a second-order linear homogeneous dierential equation with constant coecients.
Firstly, it is a second-order dierential equation, because the dierential equation
contains the second derivative of the function y(t).
Secondly, it is a linear dierential equation, since it contains only terms involving the
function y(t) and derivatives of that function. This implies that, if y
1
(t) is a solution
of the dierential equation, i.e. y
1
(t) satises
m
d
2
y
1
(t)
dt
2
+ b
dy
1
(t)
dt
+ ky
1
(t) = 0, (1.3)
then c
1
y
1
(t) with c
1
an arbitrary constant also satises the dierential equation,
because
d
dt
c
1
y
1
(t) = c
1
dy
1
(t)
dt
,
d
2
dt
2
c
1
y
1
(t) = c
1
d
2
y
1
(t)
dt
2
. (1.4)
Inserting these in the dierential equation gives
mc
1
d
2
y
1
(t)
dt
2
+ bc
1
dy
1
(t)
dt
+ kc
1
y
1
(t) = 0. (1.5)
After dividing by the constant c
1
, we get the original dierential equation back, i.e.
the dierential equation for which y
1
(t) was a solution. Furthermore, if y
1
(t) and
y
2
(t) are two dierent solutions of the dierential equation, then y
1
(t) +y
2
(t) is also a
solution of the dierential equation. The statement y
1
(t) is a solution of the dierential
equation implies that y
1
(t) satises again
m
d
2
y
1
(t)
dt
2
+ b
dy
1
(t)
dt
+ ky
1
(t) = 0. (1.6)
1
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
Similar for y
2
(t); it satises
m
d
2
y
2
(t)
dt
2
+ b
dy
2
(t)
dt
+ ky
2
(t) = 0. (1.7)
But
d
dt
(y
1
(t) + y
2
(t)) =
dy
1
(t)
dt
+
dy
2
(t)
dt
,
d
2
dt
2
(y
1
(t) + y
2
(t)) =
d
2
y
1
(t)
dt
2
+
d
2
y
2
(t)
dt
2
. (1.8)
Inserting y
1
(t) + y
2
(t) in the dierential equation gives
m
d
2
dt
2
(y
1
(t) + y
2
(t)) + b
d
dt
(y
1
(t) + y
2
(t)) + k(y
1
(t) + y
2
(t)) = 0, (1.9)
but this can be written as
_
m
d
2
y
1
(t)
dt
2
+ b
dy
1
(t)
dt
+ ky
1
(t)
_
+
_
m
d
2
y
2
(t)
dt
2
+ b
dy
2
(t)
dt
+ ky
2
(t)
_
= 0. (1.10)
Both sums between square brackets amount to zero, so the equality holds. Combining
these two results gives the following: a dierential equation is a linear dierential
equation, if, for y
1
(t) and y
2
(t) being solutions of the dierential equation, c
1
y
1
(t) +
c
2
y
2
(t) is also a solution of the dierential equation for every pair of constants c
1
and
c
2
.
Thirdly, the dierential equation under discussion is a homogeneous dierential
equation, since the right-hand side of the dierential equation is zero. One should
rst bring all terms involving y(t) and its derivatives to the left-hand side and all
terms involving t and constants to the right-hand side of the dierential equation.
If the right-hand side is zero, then the dierential equation is homogeneous. If the
right-hand side is not zero, then the dierential equation is inhomogeneous.
Finally, this dierential equation is a dierential equation with constant coecients,
since the parameters m, k, and b are all constants.
In the remainder of this document, we will discuss how to solve this type of dierential
equation.
The second example is Newtons cooling law. The quantity y(t) represents the temper-
ature of, for instance, the coee in a mug. Because the hot coee will release heat to
the environment, the temperature of the coee will go down. The rate-of-change of the
temperature
dy(t)
dt
is proportional to the dierence of the current temperature of the coee
and the ambient temperature, the temperature of the environment T
a
. The proportional-
ity constant is k. The larger the temperature dierence, the faster the coee cools down.
From the discussion so far, it should be clear that this dierential equation is a rst-
order (since only the rst derivative of y(t) is present) linear (only terms involving y(t)
and its derivative) inhomogeneous (since the right-hand of the dierential equation is
not zero) dierential equation with constant coecients (since k is a constant).
2 Solving Linear Homogeneous Dierential Equations with Constant
Coecients
Although rst-order and second-order linear homogeneous dierential equations with
constant coecients are solved in exactly the same way, we will rst discuss how to
2
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
solve rst-order linear homogeneous dierential equations and secondly the second-order
version. Solving inhomogeneous linear dierential equations will be discussed in the next
section.
2.1 The Solution of a First-Order Linear Homogeneous Dierential
Equation
In general we can write a rst-order linear homogeneous dierential equation down as
a
dy(t)
dt
+ by(t) = 0, {a, b} R. (2.1)
This equation tells us that we should be looking for a function y(t), such that when you
multiply the rst derivative of that function by the constant a and you add b times the
original function to that result, it amounts to zero. What is that function?? This is not
so straightforward to answer! But, it suggests that the derivative of the function
dy(t)
dt
is proportional to the function y(t) itself. There is a function with this property: the
exponential function y(t) = Aexp(t). We propose that this function is the solution of
the dierential equation. Setting y(t) = Aexp(t) implies
dy(t)
dt
= Aexp(t) = y(t), (2.2)
such that
a
dy(t)
dt
+ by(t) = 0 ay(t) + by(t) = 0. (2.3)
Dividing by y(t) amounts to the characteristic equation
a + b = 0. (2.4)
Solving this equation for gives =
b
a
and the general solution or family of
solutions is
y(t) = Aexp
_

b
a
t
_
, A R. (2.5)
The value of the constant A can be found by using an initial condition, if given;
y(0) = y
0
. Inserting this initial condition in the solution gives
y(t = 0) = Aexp (0) = A = y
0
. (2.6)
If the initial condition y(0) = y
0
is given, then the solution of the dierential equation is
y(t) = y
0
exp(
b
a
t).
3
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 2.1. Solving a rst-order linear homogeneous dierential equation
Find the exact solution of the following dierential equation:
dy(t)
dt
+ 2y(t) = 0, y(0) = 4. (2.7)
This dierential equation is a rst-order linear homogeneous dierential equation with
constant coecients. Therefore, its solution is of the form y(t) = Aexp(t), such that
the rst derivative of this function becomes y

(t) =
dy(t)
dt
= Aexp(t) = y(t). Insert-
ing this in the dierential equation gives
dy(t)
dt
+ 2y(t) = y(t) + 2y(t) = 0, (2.8)
which amounts to, after dividing by the function y(t), the characteristic equation +2 =
0 or = 2. Hence, y(t) = Aexp(2t). Using the initial condition; y(0) = 4 gives
y(0) = A = 4, such that the exact solution of the dierential equation is y(t) =
4 exp(2t). CHECK: dierentiate this function with respect to t to obtain
dy(t)
dt
=
d
dt
[4 exp(2t)] = 8 exp(2t). (2.9)
Finally, insert the rst derivative and the solution in the dierential equation to get
dy(t)
dt
+ 2y(t) = 8 exp(2t) + 2 4 exp(2t) = 0, (2.10)
which is indeed correct!

2.2 The Solution of a Second-Order Linear Homogeneous Dierential
Equation
A second-order linear homogeneous dierential equation with constant coecients is
dened by
a
d
2
y(t)
dt
2
+ b
dy(t)
dt
+ cy(t) = 0, {a, b, c} R. (2.11)
We argue again that the general form of the solution of such a dierential equation is an
exponential function, since any derivative of an exponential function is proportional to
that exponential function. Thus, writing y(t) = Aexp(t) implies
dy(t)
dt
= Aexp(t) = y(t),
d
2
y(t)
dt
2
=
2
Aexp(t) =
2
y(t). (2.12)
Inserting these in the dierential equation gives
a
2
y(t) + by(t) + cy(t) = 0. (2.13)
Dividing by the function y(t) amounts to the characterisitic equation
a
2
+ b + c = 0. (2.14)
4
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
This equation is quadratic in . Note that a rst-order linear homogeneous dierential
equation amounts to a characteristic equation of rst-degree in , a second-order linear
homogeneous dierential equation amounts to a characteristic equation of second-degree
in , and so forth. The solutions of the characteristic equation are

1,2
=
b

b
2
4ac
2a
. (2.15)
This result suggests that dierent solutions are possible:
If b
2
4ac > 0, then

b
2
4ac is a real number and
1
and
2
are two distinct real
numbers. The general solution of the dierential equation follows then as a linear
combination of two distinct real exponential functions:
y(t) = C
1
exp(
1
t) + C
2
exp(
2
t), {
1
,
2
} R (2.16)
where the values of the constants C
1
and C
2
follow from 2 initial conditions; for
instance y(0) = y
0
and
dy(t)
dt

t=0
= y

0
.
If b
2
4ac = 0, then
1
=
2
= and there is only one distinct root of the char-
acteristic equation. In this case, the general solution of the dierential equation
follows as
y(t) = (C
1
+ C
2
t) exp(t). (2.17)
This solution can be considered as a combination of two identical exponential func-
tions, where one of them is multiplied by t. Again, the values of the constants C
1
and
C
2
follow from 2 initial conditions; for instance y(0) = y
0
and
dy(t)
dt

t=0
= y

0
. Note
that you must use the product rule for dierentiation here in order to get
dy(t)
dt
!
If b
2
4ac < 0, then

b
2
4ac is actually the square-root of a negative number,
which is purely imaginary! Consequently, we can write
1,2
=
r
i
i
, with
r
=
b
2a
the real part of the solution of the characteristic equation and
i
=
1
2a

4ac b
2
the imaginary part of the solution of the characteristic equation. The solutions of
the characteristic equation are two complex numbers, which are each others
complex conjugate. The general solution follows now as
y(t) = C
1
exp[(
r
+ i
i
)t] + C
2
exp[(
r
i
i
)t], {C
1
, C
2
} C. (2.18)
This looks pretty awful; complex exponential functions and complex constants C
1
and C
2
. We are going to simplify this expression. First of all, realize that we will
limit ourselves to real-valued functions y(t); t and y are real numbers and so are the
derivatives of y(t). Furthermore, the constant a, b, and c are also real numbers. in
other words, we must set the imaginary part of the solution equal to zero. Lets rst
expand the exponential function, since exp(a + b) = exp a exp b:
y(t) = C
1
exp
r
t exp i
i
t + C
2
exp
r
t exp(i
i
t) (2.19)
Both terms have an exp
r
t in common; taking this factor apart gives
y(t) = exp
r
t [C
1
exp i
i
t + C
2
exp(i
i
t)] . (2.20)
5
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
Now we can use the Euler formulas and write the complex exponential function as
a cosine and a sine multiplied by i; exp(ix) = cos x i sin x. We will also make
explicit that C
1
and C
2
are complex numbers and write them as C
1
= C
1r
+iC
1i
and
C
2
= C
2r
+iC
2i
, where the index r means the real part and the index i the imaginary
part. Note that C
1r
, C
2r
, C
1i
and C
2i
are all real numbers. We now get the following:
y(t) = exp
r
t [(C
1r
+ iC
1i
)(cos
i
t + i sin
i
t) + (C
2r
+ iC
2i
)(cos
i
t i sin
i
t)] .
(2.21)
The part between square brackets consists of two terms and each term is the product
of two factors of two terms. Expanding all this amounts to eight terms. Here they
are, remember that i
2
= 1:
y(t) = exp
r
t[ C
1r
cos
i
t + iC
1r
sin
i
t
C
1i
sin
i
t + iC
1i
cos
i
t
+ C
2r
cos
i
t iC
2r
sin
i
t
+ C
2i
sin
i
t + iC
2i
cos
i
t] (2.22)
There are four real terms and four imaginary terms; actually, there is a pair of real
cosines and a pair of real sines and there is a pair of imaginary cosines and a pair of
imaginary sines. Collecting these pairs of terms gives
y(t) = exp
r
t [(C
1r
+ C
2r
) cos
i
t + i(C
1r
C
2r
) sin
i
t
+(C
1i
+ C
2i
) sin
i
t + i(C
1i
+ C
2i
) cos
i
t] . (2.23)
Now, we can set the imaginary part equal to zero by setting C
1r
C
2r
= 0 and
(C
1i
+ C
2i
) = 0. Finally, we will replace C
1r
+ C
2r
by A and C
1i
+ C
2i
by B and
obtain the following:
y(t) = exp
r
t (Acos
i
t + B sin
i
t) , (2.24)
where
r
is the real part of the solutions of the characteristic equation and
i
is the
imaginary part of the solutions of the characteristic equation. The constants A and
B follow from the two initial conditions. In the last result, {A, B,
r
,
r
} R.
There is one special case in the previous part and that one is related to a second-order
linear dierential equation of the form
a
d
2
y(t)
dt
2
+ cy(t) = 0, {a, c} R. (2.25)
This dierential equation misses the term containing the rst derivative of y(t); ac-
tually b = 0! The characteristic equation related to this dierential equation reduces
to
a
2
+ c = 0
1,2
=
_

c
a
. (2.26)
6
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
This implies that if a and c have opposite signs, one is negative and the other is
positive, then the square-root amounts to two real numbers
1
=
2
= , which are
each other opposites. The solution is
y(t) = Aexp t + B exp(t). (2.27)
If a and c have the same sign, then the solutions of the characteristic equation are
purely imaginary:

1,2
= i
i
= i
_
c
a
. (2.28)
Comparing this with the result of the previous part

1,2
=
r
i
i
=
b
2a
i
1
2a
_
4ac b
2
(2.29)
shows that the two results are equal by setting b = 0, and consequently by setting

r
= 0. Consequently, the solution of this dierential equation is
y(t) = Acos
i
t + B sin
i
t. (2.30)
Lets summarize what we have so far for a second-order linear homogeneous dierential
equation with constant coecients of the form
a
d
2
y(t)
dt
2
+ b
dy(t)
dt
+ cy(t) = 0, {a, b, c} R. (2.31)
Writing the solution of this dierential equation as y(t) = Aexp t amounts to a charac-
teristic equation
a
2
+ b + c = 0
1,2
=
b

b
2
4ac
2a
. (2.32)
if
1
and
2
are two distinct real numbers, then the general solution is of the form
y(t) = C
1
exp(
1
t) + C
2
exp(
2
t), (2.33)
if
1
=
2
= is only one distinct number, then the general solution is of the form
y(t) = (C
1
+ C
2
t) exp(t). (2.34)
if
1
and
2
are two complex numbers (and each others conjugate) with real part

r
and imaginary part
i
, then the general solution is of the form
y(t) = exp
r
t (Acos
i
t + B sin
i
t) , (2.35)
if b = 0 and
1
=
2
= are two purely imaginary numbers (and each others
conjugate), then the general solution is of the form
y(t) = Acos t + B sin t. (2.36)
7
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
Here are a number of examples dealing with the dierent types of solutions:
Example 2.2. Solving a second-order linear homogeneous dierential equation with
two distinct positive integral roots
Find the exact solution of the following dierential equation:
d
2
y(t)
dt
2
5
dy(t)
dt
+ 6y(t) = 0, y(0) = 1,
dy(t)
dt

t=0
= 1. (2.37)
The general solution of a linear dierential equation is y(t) = Aexp t, and thus
dy(t)
dt
=
Aexp t = y(t), and
d
2
y(t)
dt
2
=
2
Aexp t =
2
y(t). Inserting these in the dierential
equation and dividing by y(t) yields the characteristic equation:

2
5 + 6 = ( 2)( 3) = 0. (2.38)
The roots of this characteristic equation are = 2 and = 3. Hence, the general
solution is
y(t) = Aexp 2t + B exp 3t. (2.39)
The rst derivative of this solution follows as
dy(t)
dt
= 2Aexp(2t) + 3B exp(3t). (2.40)
Inserting the initial conditions y(0) = 1 and y

(0) = 1 yield the following two equations


in terms of A and B:
_
1 = A + B
1 = 2A + 3B
(2.41)
From the rst equation follows B = 1 A. Inserting this in the second equation yields
1 = 2A + 3 3A or A = 2, and hence B = 1. The exact solution is therefore
y(t) = 2 exp 2t exp 3t. (2.42)
Check:
d
2
y(t)
dt
2
= 8 exp 2t 9 exp 3t
5
dy(t)
dt
= 20 exp 2t + 15 exp 3t
+6y(t) = 12 exp 2t 6 exp 3t +
0 = (8 20 + 12) exp 2t + (9 + 15 6) exp 3t
(2.43)

8
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 2.3. Solving a second-order linear homogeneous dierential equation with
two distinct, one positive and one negative, integral roots:
Find the exact solution of the following dierential equation:
d
2
y(t)
dt
2
+
dy(t)
dt
6y(t) = 0, y(0) = 0,
dy(t)
dt

t=0
= 1. (2.44)
The general solution of a linear homogeneous dierential equation is y(t) = Aexp t,
and thus
dy(t)
dt
= Aexp t = y(t), and
d
2
y(t)
dt
2
=
2
Aexp t =
2
y(t). Inserting these
in the dierential equation and dividing by y(t) yields the characteristic equation:

2
+ 6 = ( + 3)( 2) = 0. (2.45)
The roots of this characteristic equation are = 3 and = 2. Hence, the general
solution is
y(t) = Aexp(3t) + B exp(2t). (2.46)
The rst derivative follows as
dy(t)
dt
= 3Aexp(3t) + 2B exp 2t. (2.47)
Inserting the initial conditions y(0) = 0 and y

(0) = 1 yield the following two equations


in terms of A and B:
_
0 = A + B
1 = 3A + 2B
(2.48)
From the rst equation follows B = A. Inserting this in the second equation yields
1 = 3A2A or A =
1
5
, and hence B =
1
5
. The exact solution is therefore
y(t) =
1
5
exp(3t) +
1
5
exp 2t. (2.49)
Check:
d
2
y(t)
dt
2
=
9
5
exp(3t) +
4
5
exp 2t
dy(t)
dt
=
3
5
exp(3t) +
2
5
exp 2t
6y(t) =
6
5
exp(3t)
6
5
exp 2t +
0 =
_

9
5
+
3
5
+
6
5
_
exp 2t +
_
4
5
+
2
5

6
5
_
exp 3t
(2.50)

9
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 2.4. Solving a second-order linear homogeneous dierential equation with
two distinct rational roots:
Find the exact solution of the following dierential equation:
8
d
2
y(t)
dt
2
6
dy(t)
dt
+ y(t) = 0, y(0) = 1,
dy(t)
dt

t=0
= 2 (2.51)
The general solution of a linear homogeneous dierential equation is y(t) = Aexp t,
and thus
dy(t)
dt
= Aexp t = y(t), and
d
2
y(t)
dt2
=
2
Aexp t =
2
y(t). Inserting these
in the dierential equation and dividing by y(t) yields the characteristic equation:
8
2
6 + 1 = 0. (2.52)
The roots of this characteristic equation follow from

1,2
=
6

36 4 8 1
16
=
6 2
16
=
1
2

=
1
4
. (2.53)
Hence, the general solution is
y(t) = Aexp
1
2
t + B exp
1
4
t. (2.54)
The rst derivative of this solution follows as
dy(t)
dt
=
1
2
Aexp
1
2
t +
1
4
B exp
1
4
t. (2.55)
Inserting the initial conditions y(0) = 1 and y

(0) = 2 yield the following two equations


in terms of A and B:
_
1 = A + B
2 =
1
2
A +
1
4
B
(2.56)
From the rst equation follows B = 1 A. Inserting this in the second equation yields
2 =
1
2
A +
1
4

1
4
A or
1
4
A =
7
4
or A = 7, and hence B = 6. The exact solution is
therefore
y(t) = 7 exp
1
2
t 6 exp
1
4
t. (2.57)
Check:
8
d
2
y(t)
dt
2
= 14 exp
1
2
t 3 exp
1
4
t
6
dy(t)
dt
= 21 exp
1
2
t + 9 exp
1
4
t
y(t) = 7 exp
1
2
t 6 exp
1
4
t +
0 = (14 21 + 7) exp
1
2
t + (3 + 9 6) exp
1
4
t
(2.58)

10
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 2.5. Solving a second-order linear homogeneous dierential equation with
with one distinct positive integral root: Find the exact solution of the following dier-
ential equation:
d
2
y(t)
dt
2
6
dy(t)
dt
+ 9y(t) = 0, y(0) = 0,
dy(t)
dt

t=0
= 2 (2.59)
The general solution of a linear homogeneous dierential equation is y(t) = Aexp t,
and thus
dy(t)
dt
= Aexp t = y(t), and
d
2
y(t)
dt
2
=
2
Aexp t =
2
y(t). Inserting these
in the dierential equation and dividing by the function y(t) yields the characteristic
equation:

2
6 + 9 = ( 3)
2
= 0. (2.60)
The root of this characteristic equation is = 3. Hence, the general solution is
y(t) = (A + Bt) exp 3t. (2.61)
The rst derivative of this function, using the product rule for dierentiation, follows
as
y(t) = B exp 3t + 3(A + Bt) exp 3t = (3A + B + 3Bt) exp 3t. (2.62)
Inserting the initial conditions y(0) = 0 and y

(0) = 2 yields the following two equations


in terms of A and B:
_
0 = A
2 = 3A + B
(2.63)
From the rst equation follows A = 0, and from the second equation B = 2. The exact
solution is therefore
y(t) = 2t exp 3t. (2.64)
Check:
d
2
y(t)
dt
2
= (6 exp 3t) + (6 exp 3t + 18t exp 3t)
6
dy(t)
dt
= 6(2 exp 3t + 6t exp 3t)
9y(t) = 9(2t exp 3t) +
0 = 12 exp 3t + 18t exp 3t 12 exp 3t 36t exp 3t + 18t exp 3t
(2.65)

11
2. SOLVING LINEAR HOMOGENEOUS DIFFERENTIAL EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 2.6. Solving a second-order linear homogeneous dierential equation with
two complex roots:
Find the exact solution of the following dierential equation:
d
2
y(t)
dt
2
2
dy(t)
dt
+ 4y(t) = 0, y(0) = 1,
dy(t)
dt

t=0
= 2 (2.66)
The general solution of a linear homogeneous dierential equation is y(t) = Aexp t,
and thus
dy(t)
dt
= Aexp t = y(t), and
d
2
y(t)
dt
2
=
2
Aexp t =
2
y(t). Inserting this in
the dierential equation yields the characteristic equation:

2
2 + 4 = 0. (2.67)
The roots of this characteristic equation follow from

1,2
=
2

4 16
2
= 1 + i

= 1 i

3. (2.68)
Hence, the general solution is
y(t) = C
1
exp((1 + i

3)t) + C
2
exp((1 i

3)t). (2.69)
The real part of this solution is, with new constants A and B:
y(t) = exp t
_
Acos t

3 + B sin t

3
_
. (2.70)
The rst derivative of this solution, using again the product rule for dierentiation
follows as
dy(t)
dt
= exp t
_
Acos t

3 + B sin t

3
_
+ exp t
_
A

3 sin t

3 + B

3 cos t

3
_
(2.71)
Inserting the initial conditions y(0) = 1 and y

(0) = 2 yields the following two equations


in terms of A and B (sin 0 = 0, cos 0 = 1):
_
1 = A
2 = A + B

3
(2.72)
The rst equation gives A = 1. Inserting this in the second equation yields 2 = 1+

3B
or B =
1

3
. The exact solution is therefore
y(t) = exp t
_
cos t

3 +
1

3
sin t

3
_
. (2.73)
By dierentiating this function twice and inserting these results in the dierential equa-
tion, one can check that this is the correct result.

12
3. SOLVING INHOMOGENEOUS LINEAR DIFFERENTIAL EQUATIONS
Example 2.7. Solving a second-order linear homogeneous dierential equation with
two purely imaginary roots:
Find the exact solution of the following dierential equation:
d
2
y(t)
dt
2
+ 4y(t) = 0, y(0) = 1,
dy(t)
dt

t=0
= 2 (2.74)
Note that this is the same dierential equation as in the previous example, except for
the term containing the rst derivative.
The general solution of a linear homogeneous dierential equation is y(t) = Aexp t,
and thus
dy(t)
dt
= Aexp t = y(t), and
d
2
y(t)
dt
2
=
2
Aexp t =
2
y(t). Inserting this in
the dierential equation yields the characteristic equation:

2
+ 4 = 0
2
= 4 = 2i. (2.75)
Hence, the general solution is
y(t) = Acos 2t + B sin 2t. (2.76)
The rst derivative of this solution follows as
dy(t)
dt
= 2Asin 2t + 2B cos 2t (2.77)
Inserting the initial conditions y(0) = 1 and y

(0) = 2 yields the following two equations


in terms of A and B (sin 0 = 0, cos 0 = 1):
_
1 = A
2 = 2A + 2B
(2.78)
The rst equation gives A = 1. Inserting this in the second equation yields 2 = 2+2B
or B = 2. The exact solution is therefore
y(t) = cos 2t + 2 sin 2t. (2.79)
Check:
d
2
y(t)
dt
2
= 4 cos 2t 8 sin 2t
4y(t) = 4 cos 2t + 8 sin 2t +
0 = (4 + 4) cos 2t + (8 + 8) sin 2t
(2.80)

3 Solving Inhomogeneous Linear Dierential Equations
Thus far we have considered rst and second-order linear homogeneous dierential equa-
tions of the form
a
d
2
y(t)
dt
2
+ b
dy(t)
dt
+ cy(t) = 0, {a, b, c} R (3.1)
13
3. SOLVING INHOMOGENEOUS LINEAR DIFFERENTIAL EQUATIONS
and we have discussed how to nd the solution of such a dierential equation. The general
solution, for instance y(t) = Aexp
1
t+B exp
2
t satises the dierential equation, which
means that after inserting this solution in the dierential equation, we get zero equals
zero. Now, we will discuss how to solve an inhomogeneous dierential equation, i.e. a
dierential equation where the right-hand side is not zero, but, for instance, 4 or 4t + 3
or sin 2t or exp(t). What we are going to do is to TRY a solution by inserting it
in the inhomogeneous dierential and see if it holds or not; if it holds then the trial
solution is correct and the trial function is then called the particular solution of the
inhomogeneous dierential equation. If it fails, then we must try another trial function.
The challenge is, obviously, to choose the right trial solution. Here are somes rules of
thumb:
If the right-hand side of the inhomogeneous dierential equation is a constant, then
the particular solution is also a constant.
If the right-hand side of the inhomogeneous dierential equation is proportional to
t, lets say 3t, then try as particular solution y(t) = at + b. If this fails, then try
at
2
+ bt + c. If this fails, then try a general third-degree polynomial as solution, etc.
If the right-hand side of the inhomogeneous dierential equation is an exponential
function, lets say 3 exp(t), then try as particular solution y(t) = a exp(t), such
that the exponents are identical. If this fails, then try (at + b) exp(t). If this fails,
then try (at
2
+ bt + c) exp(t), etc.
If the right-hand side of the inhomogeneous dierential equation is a sine or a cosine,
lets say 2 cos 2t, then try as particular solution y(t) = a cos 2t + b sin 2t.
If the right-hand side of the inhomogeneous dierential equation is t times an expo-
nential function, lets say t exp 2t, then try as particular solution y(t) = (at+b) exp 2t.
If this fails, then try y(t) = (at
2
+ bt + c) exp 2t, etc.
If the right-hand side of the inhomogeneous dierential equation is of the form
exp(t) cos 2t or exp(t) sin 2t, then try as particular solution y(t) = exp(t)(a cos 2t+
b sin 2t).
Below are some examples showing how to nd the particular solution:
Example 3.1. The particular solution of an inhomogeneous dierential equation:
Find the particular solution of the following dierential equation:
2
d
2
y(t)
dt
2
2
dy(t)
dt
+ 2y(t) = 4. (3.2)
The right-hand side of this dierential equation is a constant. TRY as particular so-
lution a constant: y(t) = a, such that
dy(t)
dt
= 0, and
d
2
y(t)
dt
2
= 0. Inserting these in the
dierential equation gives
2a = 4 a = 2. (3.3)
We conclude that the particular solution of this dierential equation is y(t) = 2.

14
3. SOLVING INHOMOGENEOUS LINEAR DIFFERENTIAL EQUATIONS
Example 3.2. The particular solution of an inhomogeneous dierential equation:
Find the particular solution of the following dierential equation:
2
d
2
y(t)
dt
2
2
dy(t)
dt
+ 2y(t) = 3t. (3.4)
The right-hand side of this dierential equation is linear in t. TRY as particular solution
a linear function in t: y(t) = at + b, such that
dy(t)
dt
= a, and
d
2
y(t)
dt
2
= 0. Inserting these
in the dierential equation gives
2 0 2a + 2(at + b) = 3t. (3.5)
Collecting terms involving t and constants gives
(2a 3)
. .
=0
t + (2b 2a)
. .
=0
= 0. (3.6)
since this equation must be true for all values of t. Hence a =
3
2
and b =
3
2
. We conclude
that the particular solution of this dierential equation is
y(t) =
3
2
t +
3
2
. (3.7)

Example 3.3. The particular solution of an inhomogeneous dierential equation:
Find the particular solution of the following dierential equation:
d
2
y(t)
dt
2
+ 2
dy(t)
dt
+ y(t) = t
2
4. (3.8)
The right-hand side of this dierential equation is a polynomial of degree 2 in t. TRY
as particular solution a quadratic polynomial in t: y(t) = at
2
+bt +c, such that
dy(t)
dt
=
2at + b, and
d
2
y(t)
dt
2
= 2a. Inserting these in the dierential equation gives
(2a) + 2(2at + b) + (at
2
+ bt + c) = t
2
4 (3.9)
Collecting terms involving t
2
, t and constants gives
(a 1)
. .
=0
t
2
+ (4a + b)
. .
=0
t + (2a + 2b + c + 4)
. .
=0
= 0. (3.10)
since this equation must be true for all values of t. Hence a = 1 and b = 4 and c = 2.
We conclude that the particular solution of this dierential equation is
y(t) = t
2
4t + 2. (3.11)

15
3. SOLVING INHOMOGENEOUS LINEAR DIFFERENTIAL EQUATIONS
Example 3.4. The particular solution of an inhomogeneous dierential equation:
Find the particular solution of the following dierential equation:
d
2
y(t)
dt
2
+ 2
dy(t)
dt
+ y(t) = 2 exp(t). (3.12)
The right-hand side of this dierential equation is an exponential function. TRY as
particular solution a similar exponential function: y(t) = a exp(t), such that
dy(t)
dt
=
a exp(t) = y(t), and
d
2
y(t)
dt
2
= a exp(t) = y(t). Inserting these in the dierential
equation gives
a exp(t) 2a exp(t) + a exp(t) = 0 = 2 exp(t), (3.13)
which does not hold for all values of t. This trial function fails. Lets TRY y(t) =
(at+b) exp(t), such that, using the product rule for dierentiation,
dy(t)
dt
= a exp(t)
(at+b) exp(t) = (at+ab) exp(t), and
d
2
y(t)
dt
2
= a exp(t)(at+ab) exp(t) =
(at 2a + b) exp(t). Inserting this in the dierential equation gives
(at 2a + b) exp(t) + 2(at + a b) exp(t) + (at + b) exp(t) = 2 exp(t). (3.14)
After dividing by exp(t), this reduces to
(at 2a + b) + 2(at + a b) + (at + b) = 2. (3.15)
Collecting terms involving t and constants gives 0 = 2. In other words, this trial function
also fails. Dont get desperate now. Lets TRY
y(t) = (at
2
+ bt + c) exp(t)
dy(t)
dt
= (2at + b) exp(t) (at
2
+ bt + c) exp(t)
= (at
2
+ (2a b)t + b c) exp(t)
d
2
y(t)
dt
2
= (2at + 2a b) exp(t) (at
2
+ (2a b)t + b c) exp(t)
= (at
2
(4a b)t + 2a 2b + c) exp(t)
(3.16)
Inserting these in the dierential equation gives
(at
2
(4a b)t + 2a 2b + c) exp(t)
+2(at
2
+ (2a b)t + b c) exp(t)
+(at
2
+ bt + c) exp(t) = 2 exp(t).
(3.17)
Dividing by exp(t) gives
(at
2
(4a b)t +2a 2b +c) +2(at
2
+(2a b)t +b c) +(at
2
+bt +c) = 2. (3.18)

16
4. THE COMPLETE SOLUTION OF AN INHOMOGENEOUS LINEAR
DIFFERENTIAL EQUATION
Collecting terms involving t
2
, t and constants gives
(0)t
2
+ (0)t + (2a 2) = 0. (3.19)
This must be zero for all values of t. Hence, a = 1. Finally, we found the particular
solution by trial and error:
y(t) = t
2
exp(t). (3.20)

4 The Complete Solution of an Inhomogeneous Linear Dierential
Equation
The examples in the previous section show that nding the particular solution is really
a matter of trial and error. The particular solution, however, is only part of the solution;
it is not the complete solution! Why not? Well, we can always add zero to the right-hand
side of the dierential equation; it does not change a thing. But then we write zero in the
form of the general solution of the homogeneous form of the inhomogeneous dierential
equation. The solution of the homogeneous form of the dierential equation is called
the complementary solution. Note that the complementary solution contains unknown
constants that are determined by the initial conditions. The particular solution is unique.
The combination of the complementary function and the particular solution forms the
complete solution of the dierential equation. Below follows an example that shows you
how to nd the complete solution of a second-order linear inhomogeneous dierential
equation with constant coecients.
Example 4.1. The complete solution of an inhomogeneous dierential equation:
Find the complete solution of the following inhomogeneous linear dierential equation:
d
2
y(t)
dt
2
5
dy(t)
dt
+ 6y(t) = 4t + 2, y(0) = 1,
dy(t)
dt

t=0
= 1. (4.1)
Lets rst try to nd the particular solution. The right-hand side of the equation is
linear in t. Lets TRY as particular solution a linear function in t: y(t) = at + b, such
that
dy(t)
dt
= a and
d
2
y(t)
dt
2
= 0. Inserting thse in the dierential equation gives
5a + 6(at + b) = 4t + 2 (6a 4)t + (5a + 6b 2) = 0. (4.2)
This must hold for all values of t. Hence, 6a = 4 or a =
2
3
and
10
3
+ 6b 2 = 0 or
6b =
16
3
or b =
16
18
=
8
9
and the particular solution is apparently
y(t) =
2
3
t +
8
9
. (4.3)

17
4. THE COMPLETE SOLUTION OF AN INHOMOGENEOUS LINEAR
DIFFERENTIAL EQUATION
The homogeneous form of the dierential equation is
d
2
y(t)
dt
2
5
dy(t)
dt
+ 6y(t) = 0 (4.4)
The characteristic equation is

2
5 + 6 = ( 2)( 3) = 0 = 2

= 3. (4.5)
The general solution of the homogeneous dierential equation is
y(t) = Aexp 2t + B exp 3t. (4.6)
The complete solution including the two unknown constants is
y(t) = Aexp 2t + B exp 3t +
2
3
t +
8
9
. (4.7)
The rst derivative of this solution follows as
dy(t)
dt
= 2Aexp 2t + 3B exp 3t +
2
3
. (4.8)
Applying the boundary conditions y(0) = 1 and y

(0) = 1 amounts to two equations:


_
A + B +
8
9
= 1
2A + 3B +
2
3
= 1

_
A + B =
1
9
2A + 3B =
1
3
(4.9)
Multiplying the rst equation by 2 and subtracting it from the second equation gives
2A + 3B =
1
3
2A + 2B =
2
9

B =
1
9
(4.10)
Multiplying the rst equation by 3 and subtracting the second equation from it gives
3A + 3B =
1
3
2A + 3B =
1
3

A = 0
(4.11)
Conclusion the complete solution of the second-order linear inhomogeneous dierential
equation is the sum of the complementary function and the particular solution:
y(t) =
1
9
exp 3t +
2
3
t +
8
9
. (4.12)

18
5. LINEAR DIFFERENCE EQUATIONS WITH CONSTANT COEFFICIENTS
5 Linear Dierence Equations with Constant Coecients
In the previous sections, we have discussed linear dierential equations with constant
coecients. We will now focus on linear dierence equations with constant coecients.
A linear dierence equation is an equation of the form
u
n+1
= 3u
n
+ 4n + 2, u
0
= 0. (5.1)
To be more precise, this is a rst-order linear inhomogeneous dierence equation with
constant coecients. Dierence equations are also called recurrence equations. A recur-
rence equation generates a list of numbers, where, as in this case, the next number on the
list depends on the current number on the list and on n. Here, the rst number on the list
is given: u
0
= 0. We can nd the value of u
1
by setting n = 0 in the equation. This yields
u
1
= 3u
0
+4 0 +2 = 2. The value of u
2
follows as, using n = 1, u
2
= 3u
1
+4 1+2 = 12.
Inserting n = 2 gives u
3
= 3u
2
+4 2 +2 = 46. It is clear that the numbers u
n
in the list
are getting larger and larger. Continuing these calculations allows for nding all values
of u
n
, but it requires a lot of work! In order to nd the value of u
20
, we need to nd all
values of the preceding u
n
in the list. The challenge will be to nd a way to solve this
dierence equation, such that we get an expression for u
n
just in terms of n and not in
terms of u
n1
. We will see that the strategy to solve these linear dierence equations is
almost identical to the strategy for solving linear dierential equations.
The order of a linear dierential equation was determined by the types of derivatives
in the dierential equation: a second-derivative gives rise to a second-order dierential
equation. In the case of linear dierence equations, we must consider the largest dierence
of the indices. In the example given above, the index of u
n+1
is n+1 and the index of u
n
is
simply n. Hence, the dierence in indices is one and the dierence equation is rst-order.
The dierence equations
u
n
+ 2u
n1
+ u
n2
= 0, u
n+2
+ 2u
n+1
+ u
n
= 0. (5.2)
are both second-order. The last two dierence equations are also homogeneous, since the
right-hand side of the dierence equation is zero. The rst example given in this section
is an inhomogeneous dierence equation, since it can be written as
u
n+1
3u
n
= 4n + 2, u
0
= 0. (5.3)
The linearity property of linear dierence equations implies that if u
1
[n] and u
2
[n] are two
dierent solutions of the dierence equation, then any linear combination c
1
u
1
[n]+c
2
u
2
[n]
is also a solution of the dierence equation. Note that u
1
[n] and u
2
[n] represent two
discrete functions taking only integral numbers n as input; n = 0, 1, 2, . . .. Note that
the output can be any real number. We will limit ourselves here to real-valued discrete
functions u[n].
6 Solving Linear Homogeneous Dierence Equations with Constant
Coecients
In analogy to solving linear dierential equations, we will rst discuss how to solve rst-
order linear homogeneous dierence equations and secondly how to solve second-order
linear homogeneous dierence equations.
19
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
6.1 Solution of a First-Order Linear Homogeneous Dierence Equation
The general form of a rst-order linear homogeneous dierence equation is
au
n+1
+ bu
n
= 0, {a, b} R. (6.1)
If we write this dierence equation in the form
u
n+1
=
b
a
u
n
, (6.2)
then we see that the next number in the list is simply the current number in the list
times
b
a
. And since that number is also
b
a
times the number before that number, we
get that the next number in the list is
_

b
a
_
2
times the number u
n1
, or
_

b
a
_
3
times
u
n2
or
_

b
a
_
n
times u
1
. This suggests that the general form of the solution of a linear
dierence equation is
u[n] = u
n
= A
n
. (6.3)
Replacing n by n + 1 gives
u[n + 1] = u
n+1
= A
n+1
= A
n
= u
n
. (6.4)
Inserting this in the dierence equation gives
au
n
+ bu
n
= (au[n] + bu[n] =) 0 (6.5)
Dividing by the solution u
n
(or u[n]) amounts to the characteristic equation
a + b = 0. (6.6)
Note that this is the same characteristic equation as the one for a rst-order linear
homogeneous dierential equation. The solution is =
b
a
and the general solution or
family of solutions is
u[n] = u
n
= A
_

b
a
_
n
. (6.7)
The value of the constant A follows from the initial condition u
0
= u[0] = U
0
. Inserting
this in the solution gives
u[0] = U
0
= A
_

b
a
_
0
= A, (6.8)
such that the exact solution becomes
u[n] = u
n
= U
0
_

b
a
_
n
. (6.9)
20
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 6.1. Solving a rst-order linear homogeneous dierence equation
Find the exact solution of the following dierence equation:
u
n+1
+ 2u
n
= 0, u
0
= 4. (6.10)
This dierence equation is a rst-order linear homogeneous dierence equation with
constant coecients. Therefore, its solution is of the form u
n
= A
n
, such that u
n+1
=
A
n
= u
n
. Inserting this in the dierence equation gives
A
n
+ 2A
n
= 0, u
0
= 4. (6.11)
which amounts to, after dividing by the solution u
n
= A
n
, the characteristic equation
+ 2 = 0 or = 2. Hence, u[n] = A(2)
n
. Using the initial condition; u[0] = 4 gives
u[0] = A = 4, such that the exact solution of the dierential equation is u[n] = 4(2)
n
.
CHECK: replace n by n + 1 in the solution to obtain
u
n+1
= 4(2)
n+1
= 4(2)
n
(2) = 8(2)
n
. (6.12)
Finally, insert this and the solution in the dierence equation to get
u
n+1
+ 2u
n
= 0 = 8(2)
n
+ 2 4(2)
n
= 0, (6.13)
which is indeed correct! Compare this with the example of a rst-order linear dierential
equation.

There are some subtle dierences between rst-order linear homogeneous dierence and
dierential equations. The general form of the solution of a dierential equation is
y(t) = Aexp(t) = Ae
t
, whereas the general form of the solution of a dierence equa-
tion is u[n] = A
n
. If is negative, then the solution of the dierential equation is an
exponentially decaying function. The solution of the dierence equation is an oscillating
discrete function. Oscillating means that the sign of the values changes continuously.
Furthermore, if the absolute value of is smaller than one, the solution of the dierence
equation is decaying and if the absolute value of is larger than one, then the solution
of the dierence equation is growing exponentially.
21
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 6.2. Overview of solutions of rst-order linear homogeneous dierence equa-
tions
Here are four dierent rst-order linear dierence equations with their solutions based
on two dierent initial conditions:
u
n+1
+ 2u
n
= 0, u
0
= 1 u[n] = (2)
n
u
n+1
+ 2u
n
= 0, u
0
= 1 u[n] = (2)
n
u
n+1
2u
n
= 0, u
0
= 1 u[n] = 2
n
u
n+1
2u
n
= 0, u
0
= 1 u[n] = 2
n
u
n+1
+
1
2
u
n
= 0, u
0
= 1 u[n] =
_

1
2
_
n
u
n+1
+
1
2
u
n
= 0, u
0
= 1 u[n] =
_

1
2
_
n
u
n+1

1
2
u
n
= 0, u
0
= 1 u[n] =
_

1
2
_
n
= 2
n
u
n+1

1
2
u
n
= 0, u
0
= 1 u[n] =
_

1
2
_
n
= 2
n
(6.14)
Make sure that you understand where these solutions come from. The rst two solu-
tions are oscillating and growing. The third and fourth solution are also growing; the
third positively, the second one negatively. The fth and the sixth solution are again
oscillating, but now decaying. The seventh and the eighth solution are also decaying;
the seventh one with positive values, the last one with negative values. Fig. 6.1 shows
these solutions.

22
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
2 4 6 8 10
n
500
500
1000
2
n
2 4 6 8 10
n
1000
500
500
2
n
2 4 6 8 10
n
200
400
600
800
1000
2
n
2 4 6 8 10
n
1000
800
600
400
200
2
n
2 4 6 8 10
n
0.4
0.2
0.2
0.4
0.6
0.8
1.0

1
2
n
2 4 6 8 10
n
1.0
0.8
0.6
0.4
0.2
0.2
0.4

1
2
n
2 4 6 8 10
n
0.2
0.4
0.6
0.8
1.0
2
n
2 4 6 8 10
n
1.0
0.8
0.6
0.4
0.2
2
n
Fig. 6.1. Dierent possible solutions of rst-order dierence equations.
23
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
6.2 Solving Second-Order Linear Homogeneous Dierence Equations
The general form of a second-order linear homogeneous dierence equation with constant
coecients is
au
n+2
+ bu
n+1
+ cu
n
= 0, {a, b, c} R. (6.15)
Considering the similarities between dierence and dierential equations we have ob-
served so far, we expect that the general form of the solution of a second-order linear
homogeneous dierence equation is
u
n
= A
n
, (6.16)
such that
u
n+1
= A
n+1
= A
n
= u
n
, u
n+2
= A
n+2
=
2
A
n
=
2
u
n
. (6.17)
Inserting these in the dierence equation amounts to
a
2
u
n
+ bu
n
+ cu
n
= 0. (6.18)
Dividing by the solution u
n
gives the characteristic equation
a
2
+ b + c = 0. (6.19)
This characteristic equation is identical to the characteristic equation of the second-order
linear dierential equation. The solutions of the characteristic equation are

1,2
=
b

b
2
4ac
2a
. (6.20)
This result suggests that dierent solutions are to be expected:
If b
2
4ac > 0, then

b
2
4ac is a real number and
1
and
2
are two distinct real
numbers. The general solution of the dierence equation follows then as a linear
combination of two distinct exponential functions:
u[n] = C
1

n
1
+ C
2

n
2
, (6.21)
where the values of the constants C
1
and C
2
follow from 2 initial conditions; for
instance u[0] = U
0
and u[1] = U
1
.
If b
2
4ac = 0, then
1
=
2
= and there is only one distinct root of the
characteristic equation. In this case, the general solution of the dierence equation
follows as
u[n] = (C
1
+ C
2
n)
n
. (6.22)
This solution can be considered as a combination of two identical exponential func-
tions, where one of them is multiplied by n. Again, the values of the constants C
1
and C
2
follow from 2 initial conditions; for instance u[0] = U
0
and u[1] = U
1
.
24
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
If b
2
4ac < 0, then

b
2
4ac is actually the square-root of a negative number,
which is purely imaginary! Consequently, we can write
1,2
=
r
i
i
, with
r
=
b
2a
the real part of the solution of the characteristic equation and
i
=
1
2a

4ac b
2
the imaginary part of the solution of the characteristic equation. The solutions of
the characteristic equation are two complex numbers, which are each others
complex conjugate. The general solution follows now as
u[n] = C
1
(
r
+ i
i
)
n
+ C
2
(
r
i
i
)
n
, {C
1
, C
2
} C. (6.23)
Similar to the second-order linear dierential equation, this does not look very friendly!
But, we can simplify this as follows. We have found the solution of the characteristic
equation in standard form (z = x + iy). Writing the solution in complex exponential
form will solve the problem:

r
i
i
= || exp(i), (6.24)
where || is the absolute value of the two solutions in standard form dened by
|| =
_

2
r
+
2
i
and is the argument of the two solutions, = arctan

i
r

. Since
the two solutions are always each others conjugate, the argument of one is the opposite
of the argument of the other. Inserting this in our solution gives
u[n] = C
1
||
n
exp(in) + C
2
||
n
exp(in) (6.25)
or
u[n] = ||
n
[C
1
exp(in) + C
2
exp(in)] . (6.26)
This solution is now in exactly the same form as we found for the case of the second-
order linear dierential equation. Using exactly the same reasoning, we can write this
solution as
u[n] = ||
n
[Acos(n) + B sin(n)] , {A, B} R. (6.27)
Here is again the solution of the second-order linear dierential equation:
y(t) = exp
r
t (Acos
i
t + B sin
i
t) , (6.28)
where
r
is the real part of the solutions of the characteristic equation and
i
is the
imaginary part of the solutions of the characteristic equation. The constants A and B
follow from the two initial conditions. The structure of the two solutions is identical;
an exponential function multiplied by a linear combination of a cosine and a sine. But
there are some small dierences: the exponential function for the dierence equation
is the absolute value of the solution of the characteristic equation to the power n,
whereas the argument of the exponential function of the solution of the dierential
equation is the real part of the solution of the characteristic equation. Furthermore,
the argument of the cosine and the sine of the solution of the dierence equation is
n times the argument of the solution of the characteristic equation, whereas the
argument of the cosine and the sine of the solution of the dierential equation is the
imaginary part of the solution of the characteristic equation. Finally, for second-
order linear dierential equations there was a special case for b = 0. This is not a
special case for second-order linear dierential equations. The argument, as we will
see in the examples, is

2
, such that the argument of the cosine and the sine is
n
2
and
cos
n
2
and sin
n
2
amount to 1, 0, -1.
25
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
Lets summarize what we have so far for a second-order linear homogeneous dierence
equation with constant coecients of the form
au
n+2
+ bu
n+1
+ cu
n
= 0, {a, b, c} R. (6.29)
Writing the solution of this dierential equation as u
n
= A
n
amounts to a characteristic
equation
a
2
+ b + c = 0
1,2
=
b

b
2
4ac
2a
. (6.30)
if
1
and
2
are two distinct real numbers, then the general solution is of the form
y(t) = C
1

t
1
+ C
2

t
2
, (6.31)
if
1
=
2
= is only one distinct number, then the general solution is of the form
y(t) = (C
1
+ C
2
n)
n
. (6.32)
if
1
and
2
are two complex numbers (and each others conjugate) with absolute
value || and argument , then the general solution is of the form
y(t) = ||
n
(Acos n + B sin n) , (6.33)
if b = 0 and
1
=
2
= are two purely imaginary numbers (and each others
conjugate), then the general solution is of the form
y(t) = ||
n
_
Acos
n
2
+ B sin
n
2
_
, (6.34)
which is an example of the previous solution with =

2
.
Here are a number of examples dealing with the dierent types of solutions:
26
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 6.3. Solving a homogeneous dierence equation with two distinct positive
integral roots:
u
n+2
5u
n+1
+ 6u
n
= 0, u
0
= 1, u
1
= 1. (6.35)
Rewriting the dierence equation as follows
u
n+2
= 5u
n+1
6u
n
, (6.36)
with u
0
= 1, and u
1
= 1 yields u
2
= 1, u
3
= 11, u
4
= 49, and u
5
= 179. The
general solution of a linear homogeneous dierence equation is u
n
= A
n
, and thus
u
n+1
= A
n+1
= u
n
, and u
n+2
= A
n+2
=
2
u
n
. Inserting this in the dierence
equation yields the characteristic equation:

2
5 + 6 = 0. (6.37)
The roots of this characteristic equation are = 2 or = 3. Hence, the general solution
is
u
n
= A(2)
n
+ B(3)
n
. (6.38)
Inserting the initial conditions u
0
= 1 and u
1
= 1 yields the following two equations in
terms of A and B:
_
1 = A + B
1 = 2A + 3B
(6.39)
From the rst equation follows B = 1 A. Inserting this in the second equation yields
1 = 2A + 3 3A or A = 2, and hence B = 1. The exact solution is therefore
u
n
= 2(2)
n
(3)
n
. (6.40)
Checking the result for n = 2 yields u
2
= 8 9 = 1, for n = 3 u
3
= 16 27 = 11,
for n = 4 u
4
= 32 81 = 49.

27
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 6.4. Solving a homogeneous dierence equation with two distinct, one pos-
itive and negative, integral roots:
u
n+2
+ u
n+1
6u
n
= 0, u
0
= 0, u
1
= 1. (6.41)
Rewriting the dierence equation as follows
u
n+2
= u
n+1
+ 6u
n
, (6.42)
with u
0
= 0, and u
1
= 1 yields u
2
= 1, u
3
= 7, u
4
= 13, and u
5
= 55. The
general solution of a linear homogeneous dierence equation is u
n
= A
n
, and thus
u
n+1
= A
n+1
= u
n
, and u
n+2
= A
n+2
=
2
u
n
. Inserting this in the dierence
equation yields the characteristic equation:

2
+ 6 = 0. (6.43)
The roots of this characteristic equation are = 2 or = 3. Hence, the general
solution is
u
n
= A(2)
n
+ B(3)
n
. (6.44)
Inserting the initial conditions u
0
= 0 and u
1
= 1 yields the following two equations in
terms of A and B:
_
0 = A + B
1 = 2A3B
(6.45)
From the rst equation follows B = A. Inserting this in the second equation yields
1 = 2A + 3A or A =
1
5
, and hence B =
1
5
. The exact solution is therefore
u
n
=
1
5
[(2)
n
(3)
n
]. (6.46)
Checking the result for n = 2 yields u
2
=
1
5
(4 9) = 1, for n = 3 u
3
=
1
5
(8 +27) = 7,
for n = 4 u
4
=
1
5
(16 81) = 13.

28
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 6.5. Solving a homogeneous dierence equation with two distinct rational
roots:
8u
n+2
6u
n+1
+ u
n
= 0, u
0
= 1, u
1
= 2 (6.47)
Rewriting the dierence equation as follows
u
n+2
=
3
4
u
n+1

1
8
u
n
, (6.48)
with u
0
= 1, and u
1
= 2 yields u
2
=
11
8
, u
3
=
25
32
, u
4
=
53
128
, and u
5
=
109
512
. The
general solution of a linear homogeneous dierence equation is u
n
= A
n
, and thus
u
n+1
= A
n+1
= u
n
, and u
n+2
= A
n+2
=
2
u
n
. Inserting this in the dierence
equation yields the characteristic equation:
8
2
6 + 1 = 0. (6.49)
The roots of this characteristic equation are

1,2
=
6

36 32
16
=
1
4

=
1
2
. (6.50)
Hence, the general solution is
u
n
= A
_
1
4
_
n
+ B
_
1
2
_
n
. (6.51)
Inserting the initial conditions u
0
= 1 and u
1
= 2 yields the following two equations in
terms of A and B:
_
1 = A + B
2 =
1
4
A +
1
2
B
(6.52)
From the rst equation follows B = 1 A. Inserting this in the second equation yields
2 =
1
4
A +
1
2

1
2
A or A = 6, and hence B = 7. The exact solution is therefore
u
n
= 6
_
1
4
_
n
+ 7
_
1
2
_
n
. (6.53)
Checking the result for n = 2 yields u
2
=
3
8
+
7
4
=
11
8
, for n = 3 u
3
=
3
32
+
7
8
=
25
32
,
for n = 4 u
4
=
3
128
+
7
16
=
53
128
.

29
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 6.6. Solving a homogeneous dierence equation with one distinct positive
integral root:
u
n+2
6u
n+1
+ 9u
n
= 0, u
0
= 0, u
1
= 2 (6.54)
Rewriting the dierence equation as follows
u
n+2
= 6u
n+1
9u
n
, (6.55)
with u
0
= 0, and u
1
= 2 yields u
2
= 12, u
3
= 54, u
4
= 216, and u
5
= 810. The
general solution of a linear homogeneous dierence equation is u
n
= A
n
, and thus
u
n+1
= A
n+1
= u
n
, and u
n+2
= A
n+2
=
2
u
n
. Inserting this in the dierence
equation yields the characteristic equation:

2
6 + 9 = 0 ( 3)
2
= 0. (6.56)
The distinct root of this characteristic equation is = 3. Hence, the general solution is
u
n
= (A + Bn)(3)
n
. (6.57)
Inserting the initial conditions u
0
= 0 and u
1
= 2 yields the following two equations in
terms of A and B:
_
0 = 3A
2 = 3A + 3B
(6.58)
From the rst equation follows A = 0. Inserting this in the second equation yields
B =
2
3
. The exact solution is therefore
u
n
=
2
3
n(3)
n
. (6.59)
Checking the result for n = 2 yields u
2
=
2
3
18 = 12, for n = 3 u
3
=
2
3
81 = 54, for
n = 4 u
4
=
2
3
4 81 = 216.

30
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
Example 6.7. Solving a homogeneous dierence equation with two distinct complex
roots:
u
n+2
2u
n+1
+ 4u
n
= 0, u
0
= 1, u
1
= 2 (6.60)
Rewriting the dierence equation as follows
u
n+2
= 2u
n+1
4u
n
, (6.61)
with u
0
= 1, and u
1
= 2 yields u
2
= 0, u
3
= 8, u
4
= 16, and u
5
= 0. The
general solution of a linear homogeneous dierence equation is u
n
= A
n
, and thus
u
n+1
= A
n+1
= u
n
, and u
n+2
= A
n+2
=
2
u
n
. Inserting this in the dierence
equation yields the characteristic equation:

2
2 + 4 = 0. (6.62)
The roots of this characteristic equation follow from

1,2
=
2

4 16
2
= 1 + i

= 1 i

3. (6.63)
Hence, the general solution is
u
n
= A(1 + i

3)
n
+ B(1 i

3)
n
. (6.64)
The absolute value follows as
|1 + i

3| =
_
1
2
+ (

3)
2
=

1 + 3 =

4 = 2, (6.65)
and the argument follows as
arg{1 + i

3} = arctan

3
1
=

3
. (6.66)
In terms of complex exponential functions this becomes:
u
n
= A(2 exp(i

3
))
n
+ B(2 exp(i

3
))
n
. (6.67)
The real part of this solution is, with new constants A and B:
u
n
= 2
n
_
Acos
_
n
3
_
+ B sin
_
n
3
__
. (6.68)

31
6. SOLVING LINEAR HOMOGENEOUS DIFFERENCE EQUATIONS WITH
CONSTANT COEFFICIENTS
Inserting the initial conditions u
0
= 1 and u
1
= 2 yields the following two equations in
terms of A and B:
_
1 = A
2 = 2(
1
2
A +
1
2

3B)
(6.69)
Inserting the rst equation in the second equation yields 2 = 1 +

3B or B =
1

3
. The
exact solution is therefore
u
n
= 2
n
_
cos
_
n
3
_
+
1

3
sin
_
n
3
_
_
. (6.70)
Checking the result for n = 2 yields
u
2
= 4[cos
_
2
3
_
+
1

3
sin
_
2
3
_
] = 4[
1
2
+
1
2
] = 0 (6.71)
for n = 3
u
3
= 8[cos
_
3
3
_
+
1

3
sin
_
3
3
_
] = 8 (6.72)
and for n = 4
u
4
= 16[cos
_
4
3
_
+
1

3
sin
_
4
3
_
] = 16[
1
2

1
2
] = 16. (6.73)

32
7. SOLVING INHOMOGENEOUS LINEAR DIFFERENCE EQUATIONS
7 Solving Inhomogeneous Linear Dierence Equations
In this section we will discuss how to solve inhomogeneous linear dierence equations.
This discussion is actually very short: inhomogeneous linear dierence equations are
solved in exactly the same way as inhomogeneous linear dierential equations. Thus, you
should rst TRY to nd the particular solution and secondly you should add the com-
plementary function to the particular solution. Recall that the complementary function
is the general solution of the homogeneous form of the dierence equation. Finally, use
the initial conditions to nd the complete solution of the dierence equation. Below are
some worked out examples.
Example 7.1. The particular solution of an inhomogeneous dierence equation:
Find the particular solution of the following inhomogeneous second-order linear dier-
ence equation:
u
n+2
+ 2u
n+1
+ u
n
= n
2
4. (7.1)
The right-hand side of this dierence equation is a polynomial of degree 2 in n. TRY
as particular solution a quadratic polynomial in n: u
n
= u[n] = an
2
+bn+c, such that
u
n+1
= u[n+1] = a(n+1)
2
+b(n+1)+c, and u
n+2
= u[n+2] = a(n+2)
2
+b(n+2)+c.
Inserting these in the dierence equation gives
a(n + 2)
2
+ b(n + 2) + c + 2(a(n + 1)
2
+ b(n + 1) + c) + (an
2
+ bn + c) = n
2
4
(an
2
+ 4an + 4a + bn + 2b + c) + (2an
2
+ 4an + 2a + 2bn + 2b + 2c) + (an
2
+ bn + c) = n
2
4
(4a)n
2
+ (8a + 4b)n + (6a + 4b + 4c) = n
2
4 (7.2)
or
(4a 1)
. .
=0
n
2
+ (8a + 4b)
. .
=0
n + (6a + 4b + 4c + 4)
. .
=0
= 0, (7.3)
since this equation must hold for all values of n. Hence a =
1
4
and b =
1
2
and c =
7
8
.
We conclude that the particular solution of this dierence equation is
u
n
= u[n] =
1
4
n
2

1
2
n
7
8
. (7.4)

33
7. SOLVING INHOMOGENEOUS LINEAR DIFFERENCE EQUATIONS
Example 7.2. The complementary function of an inhomogeneous dierence equation:
Find the complementary function of the following inhomogeneous second-order linear
dierence equation:
u
n+2
+ 2u
n+1
+ u
n
= n
2
4. (7.5)
The homogeneous form of this dierence equation is
u
n+2
+ 2u
n+1
+ u
n
= 0. (7.6)
The corresponding characteristic equation becomes

2
+ 2 + 1 = 0 ( + 1)
2
= 0. (7.7)
The characteristic equation has one distinct root = 1 and the complementary
function is
u
n
= u[n] = (A + Bn)(1)
n
. (7.8)

34
8. FIBONACCI NUMBERS
Example 7.3. The complete solution of an inhomogeneous dierence equation:
Find the complete solution of the following inhomogeneous second-order linear dier-
ence equation:
u
n+2
+ 2u
n+1
+ u
n
= n
2
4. (7.9)
In the previous two examples we found that the particular solution and the comple-
mentary function of this inhomogeneous dierence equation are
u
n
= u[n] =
1
4
n
2

1
2
n
7
8
. (7.10)
and
u
n
= u[n] = (A + Bn)(1)
n
. (7.11)
The complete solution becomes
u
n
= u[n] = (A + Bn)(1)
n
+
1
4
n
2

1
2
n
7
8
(7.12)
Lets assume that the initial conditions are u
0
= 0 and u
1
= 1, then we get the following
two equations in terms of the unknown constants A and B:
u
0
= u[0] = A
7
8
= 0 A =
7
8
. (7.13)
and
u
1
= u[1] = AB +
1
4

1
2

7
8
= 1 B =
24
8
= 3. (7.14)
Finally, the complete solution of the dierence equation is
u
n
= u[n] =
_
7
8
3n
_
(1)
n
+
1
4
n
2

1
2
n
7
8
(7.15)

8 Fibonacci Numbers
The rst two Fibonacci numbers F
n
are F
0
= 0 and F
1
= 1. The other Fibonacci numbers
are simply the sum of the previous two Fibonacci numbers: F
2
= F
1
+ F
0
= 1 + 0 = 1,
F
3
= F
2
+F
1
= 1 +1 = 2, F
4
= F
3
+F
2
= 2 +1 = 3. This generates the following list of
integers:
F
0
= 0, F
1
= 1, F
2
= 1, F
3
= 2, F
4
= 3, F
5
= 5, F
6
= 8, F
7
= 13, F
8
= 21, F
9
= 34, F
10
= 55, . . . .
(8.1)
The Fibonacci numbers are generated by the following linear second-order homogeneous
dierence equation:
F
n+2
= F
n+1
+ F
n
F
n+2
F
n+1
F
n
= 0. (8.2)
The characteristic equation of this dierence equation is

2
1 = 0. (8.3)
35
8. FIBONACCI NUMBERS
The roots of this characteristic equation are

1,2
=
1

5
2

1,2
=
1
2

5
2
. (8.4)
The general form of the solution is
F
n
= A
_
1
2
+

5
2
_
n
+ B
_
1
2

5
2
_
n
. (8.5)
Using F
0
= 0 gives F
0
= 0 = A + B or B = A. Using F
1
= 1 gives
F
1
= 1 =
A
2
+
A

5
2
+
B
2

B

5
2
=
A + B
2
+
(AB)

5
2
= A

5, (8.6)
or A = B =
1

5
. The solution of the dierence equation is
F
n
=
1

5
__
1
2
+

5
2
_
n

_
1
2

5
2
_
n
_
. (8.7)
The positive root of the characteristic equation is called the golden ratio :
=
1
2
+

5
2
1.618033988749894848204587. (8.8)
The golden ratio appears at many dierent places in mathematics. We will mention just
one beautiful example. Note that
_

5
2

1
2
__

5
2
+
1
2
_
= 1

5
2

1
2
=
1

5
2
+
1
2
. (8.9)
Now, we have
=
1
2
+

5
2
= 1 +
_

5
2

1
2
_
= 1 +
1

5
2
+
1
2
, (8.10)
but the denominator of the last fraction can be written as

5
2
+
1
2
= 1 +
1

5
2
+
1
2
, (8.11)
such that we obtain a continued fraction
= 1 +
1
1 +
1
1 +
1
1 +
1
1 +
1
1 + . . .
. (8.12)
36
9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS
For this reason, the golden ratio is sometimes called the most irrational number.
OK, one more example:
=
1
2
+

5
2

2
=
_
1
2
+

5
2
_
2
=
1
4
+

5
2
+
5
4
=
3
2
+

5
2
= 1 + , (8.13)
or
=

1 + , (8.14)
which follows as well from the characteristic equation. Continuing to insert this result
under the square-root gives the representation of as a nested radical
=

_
1 +

_
1 +

_
1 +

1 +
_
1 +
_
1 +

1 + . . . (8.15)
9 Cobweb and First-Order Dierence Equations
The cobweb is a useful graphical tool investigate the properties of rst-order dierence
equations. Lets consider the following rst-order linear dierence equation
u
n+1
=
1
3
u
n
+ 2, u
0
= 10. (9.1)
The number u
0
= 10 serves as input to calculate u
1
from the dierence equation.
The output u
1
=
10
3
+ 2 =
4
3
. The output u
1
serves now as input to obtain u
2
;
u
2
=
4
9
+ 2 =
14
9
, and-so-forth. This process shows that an input yields an output,
then the output becomes the new input, the input generates an output and-so-forth.
The cobweb is a graphical representation of a rst-order dierence equation and is shown
for this example in Fig. 9.1.
10 8 6 4 2 2 4 6 8
input
4
3
2
1
1
2
3
4
output
Fig. 9.1. The cobweb representation of the dierence equation un+1 =
1
3
un + 2 with u0 = 10.
The horizontal axis represents the inputs, the vertical axis represents the outputs.
Furthermore, there is a line output = input, which would be the line y = x in the
standard xy-plane. We can consider this dierence equation now also as the output equals
37
9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS
a third of the input plus two, or writing this as a function of the form output = f(input)
with f(input) =
1
3
input + 2. In other words, the linear rst-order dierence equation
becomes a straight line in the cobweb with slope
1
3
and intercept 2. The vertical dashed
lines in the cobweb show the connection between the input and the corresponding output.
The horizontal lines show the connection between output and the next input; the end-
points of these lines are the line output = input. The cobweb suggests that the outputs
of the dierence equation iterate to the intersection point of the two lines in the cobweb;
this is the point u = u

. This point is also on the line output = input. Inserting


u
n+1
= u
n
= u in the dierence equation gives
u =
1
3
u + 2 u = 3. (9.2)
This point is called the xed point. It is called xed point, because the input u
0
= 3
generates the output u
1
= 3. This xed point is also stable, meaning that wherever we
start on the horizontal axis, we will always iterate towards u = 3. Setting as general form
for the dierence equation
u
n+1
= ku
n
+ a, (9.3)
then we have the following results:
for 1 < k < 1, there is one stable xed point given by u =
a
1k
; wherever we start
we will iterate towards the xed point,
for k < 1 or k > 1, there is one unstable xed point given by u =
a
1k
; wherever
we start we will iterate away from the xed point,
for k = 1, there is no xed point. If a > 0, then we will iterate stepwise towards plus
innity, if a < 0, then we will iterate stepwise towards minus innity,
for k = 1, there is no xed point. We will iterate (oscillate) between two points.
The point u produces u

= u+a. The point u

produces u

+a = (u+a) +a =
u a + a = u.
The dierent types of solutions are shown in Fig. 9.2 and Fig. 9.3.
9.1 Logistic Equation
The logistic equation is a rst-order dierence equation given by
u
n+1
= u
n
(1 u
n
). (9.4)
Note that this dierence equation is not of the form we have been discussing so far. We
will try to get some understanding of this dierence equation by considering its cobweb.
For this dierence equation, the cobweb contains the parabola f(u) = u(1 u), which
has zero-crossings for u = 0 and u = 1. The top of the parabola is located at u =
1
2
.
The coordinate along the vertical axis is f(
1
2
) =

4
. The slope of the parabola at u = 0
is , such that for 1, the only intersection point between the parabola and the line
f(u) = u is u = 0. For > 1, the second intersection point is given by u = u
2
+ u
or u =
1

. Fig. 9.4 shows cobwebs of the logistic equation for various values of .
The cobwebs show that for dierent values of one can obtain xed points, two-cycles,
four-cycles, eight-cycles, and so forth. Locations where xed points changes into two-
cycles are called bifurcation points. Fig. 9.5 shows these bifurcation points of the
38
9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS
4 2 2 4 6
input
3
2
1
1
2
3
4
5
output
4 2 2 4 6
input
3
2
1
1
2
3
4
5
output
un+1 =
3
4
un + 1, u0 = 2 un+1 =
3
4
un + 1, u0 = 2
4 2 2 4 6
input
3
2
1
1
2
3
4
5
output
108642 2 4 6 810
input
10
5
5
10
15
output
un+1 =
4
3
un + 1, u0 = 2 un+1 =
4
3
un + 1, u0 = 2
4 2 2 4 6
input
1
1
2
3
4
5
output
4 2 2 4 6
input
1
1
2
3
4
5
output
un+1 = un + 1, u0 = 2 un+1 = un 1, u0 = 5
Fig. 9.2. These graphs shows dierent types of cobwebs for rst-order linear dierence equations.
39
9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS
4 2 2 4 6
input
4
2
2
4
6
output
un+1 = un + 2, u0 = 3
Fig. 9.3. This graph shows the cobweb of an oscillating rst-order linear dierence equation of the form
un+1 = un+1 + a.
logistic equation as a function of . The vertical axis shows the values of u
n
; if there is
only one value, then that value is a xed point, if there are two values, then those values
form a two cycle, etc.
40
9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS
input
0.2
0.4
0.6
0.8
1
output
input
0.2
0.4
0.6
0.8
1
output
= 2.80 one xed point = 3.05: two cycle
{0.594117, 0.735483}
input
0.2
0.4
0.6
0.8
1
output
input
0.2
0.4
0.6
0.8
1
output
= 3.45 four-cycle: = 3.55: eight cycle
{0.413234, 0.838952, 0.467486, 0.861342} {0.881684, 0.370326, 0.827805, 0.506031,
0.887371, 0.3548, 0.812656, 0.540475}
input
0.2
0.4
0.6
0.8
1
output
input
0.2
0.4
0.6
0.8
1
output
= 3.565 sixteen-cycle: = 3.68: chaos
{0.837168, 0.485973, . . . , 0.376832}
Fig. 9.4. These graphs shows cobwebs of the logistic equation for various values of .
41
9. COBWEB AND FIRST-ORDER DIFFERENCE EQUATIONS
2.8 3 3.2 3.4 3.6 3.8 4

0.2
0.4
0.6
0.8
1
x
n
3.4 3.45 3.5 3.55 3.6
0.3
0.35
0.4
0.45
0.5
0.55
x
n
3.55 3.56 3.57 3.58 3.59 3.6

0.32
0.34
0.36
0.38
0.4
0.42
x
n
3.565 3.57 3.575 3.58

0.33
0.34
0.35
0.36
0.37
x
n
Fig. 9.5. These graphs shows bifurcation plots of the logistic equation at various scales
42

Potrebbero piacerti anche