30
Differential & Difference Equations Rafael López-Monti GWU Math Camp 2014 Differential & Difference Equations Math Camp, August 2014 Rafael López-Monti Department of Economics – PhD Program George Washington University [email protected] Draft for teaching only, do not cite. Please contact me If you find a typo 1

Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Differential & Difference Equations

Math Camp, August 2014

Rafael López-MontiDepartment of Economics – PhD Program

George Washington University

[email protected]

Draft for teaching only, do not cite. Please contact me If you find a typo 1

Page 2: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

DIFFERENTIAL EQUATIONS:

A Differential equation involves an unknown function, say 𝑦 = 𝑓 𝑥 , and atleast one of its derivatives. Instead of solving for the particular variable x, weneed to find the function that satisfies the differential equation.

Types of Differential Equations (DE):

i. First order DE: equations which involve only the first derivative of thefunction:Ex: 𝑓′(𝑥) = 𝑘𝑓(𝑥) or using the simplified notation, 𝑦′ = 𝑘𝑦 where k is a

constant

ii. Second order DE: those where the highest derivative is the second one :Ex: 𝑦′′ = 𝑘𝑦 or Ex_2: 𝑦′′ + 𝑎𝑦′ + 𝑏𝑦 =0; and 𝑎, 𝑏, 𝑎𝑛𝑑 𝑘 are constants

iii. Nth order DE: those where the highest derivative is the 𝒏𝒕𝒉 one:Ex: 𝑦(𝑛) = 𝑘𝑦 where 𝑘 is a constant

iv. Linear: if it can be written in the form:

𝑦(𝑛) + 𝑎𝑛−1 𝑥 𝑦 𝑛−1 +⋯+ 𝑎1 𝑥 𝑦 = 𝑎0 𝑥 =

𝑖=1

𝑛

𝑎𝑖(𝑥)𝑦(𝑖)

2

Page 3: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

FIRST ORDER LINEAR DIFFERENTIAL EQUATION (FOLDE):In this course we will focus on the FOLDE only. The general case is:

𝒚′ + 𝒂𝟏 𝒙 𝒚 = 𝒂𝟎 𝒙 with 𝒂𝟏 𝒙 ≠ 𝟎 and 𝒂𝟎 𝒙 ≠ 𝟎

In several economic models the independent variable is time (t), andtherefore the derivatives are taken w.r.t. time. In order to distinguish this

particular case, the notation is:𝒅𝒚(𝒕)

𝒅𝒕≡ 𝒚 , from now on we will use time as

the independent variable.

General case: 𝑦 𝑡 = −𝜆(𝑡)𝑦 𝑡 + 𝑓(𝑡) where λ 𝑡 𝑎𝑛𝑑 𝑓 𝑡 arecontinuous functions, rearrange:

𝒚 𝒕 + 𝝀 𝒕 𝒚 𝒕 = 𝒇 𝒕 1

Suppose ∃ 𝑎 𝒇𝒖𝒏𝒄𝒕𝒊𝒐𝒏 𝝁(𝒕) called Integrating Factor, that we use tomultiply both sides of (1):

𝑦 𝑡 𝝁 𝒕 + λ(𝑡)𝝁 𝒕 𝑦 𝑡 = 𝑓 𝑡 𝝁 𝒕We are looking for a function 𝜇(𝑡) such that:

𝜇(𝑡) = λ(𝑡) 𝜇 𝑡 …..why? (2)

3

Page 4: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

…in order to get the product rule:

𝑑

𝑑𝑡𝑦 𝑡 𝜇 𝑡 = 𝑦 𝑡 𝜇 𝑡 + 𝜇(𝑡)𝑦 𝑡 = 𝑓 𝑡 𝜇 𝑡 (3)

How to find 𝜇 𝑡 : divide (2) by 𝜇 𝑡

𝜇(𝑡)

𝜇 𝑡= λ(𝑡)

You can see that the LHS is 𝑑 ln(𝜇 𝑡 )

𝑑𝑡, and by integrating both sides we get:

ln 𝜇 𝑡 + 𝑐 = λ 𝑡 𝑑𝑡, where c is a constant

Equivalently,

𝜇 𝑡 = 𝑒 λ 𝑡 𝑑𝑡−𝑐 = 𝑒−𝑐𝑒 λ 𝑡 𝑑𝑡 = 𝑪𝒆 𝝀 𝒕 𝒅𝒕, where C is a constant

Then, we can find 𝑦 𝑡 by integrating both sides of (3):

𝑦 𝑡 𝜇 𝑡 + 𝑏 = 𝑓 𝑡 𝜇(𝑡)𝑑𝑡

4

Page 5: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Finally, the general solution:

𝒚 𝒕 = 𝒇 𝒕 𝝁(𝒕)𝒅𝒕 + 𝑩

𝝁 𝒕4

where B=-b is a constant and 𝜇 𝑡 = 𝐶𝑒 λ 𝑡 𝑑𝑡

Let’s get rid of one of the constant in (4):

𝑦 𝑡 =𝐶 𝑓 𝑡 𝑒 λ 𝑡 𝑑𝑡𝑑𝑡 + 𝐵

𝐶𝑒 λ 𝑡 𝑑𝑡= 𝑓 𝑡 𝑒 λ 𝑡 𝑑𝑡𝑑𝑡 +

𝐵𝐶

𝑒 λ 𝑡 𝑑𝑡

Thus, the general solution for (1):

𝒚 𝒕 = 𝒇 𝒕 𝝁(𝒕)𝒅𝒕 + 𝑲

𝝁 𝒕(𝟓)

were K is a unique constant and 𝝁 𝒕 = 𝒆 𝝀 𝒕 𝒅𝒕

5

Page 6: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Special case 1: 𝑦 𝑡 = −𝜆𝑦 𝑡 + 𝑓(𝑡) ,where 𝜆 is a constant and 𝑓 𝑡 acontinuous function:

𝒚 𝒕 + 𝝀𝒚 𝒕 = 𝒇 𝒕 (6)

Now substitute in (5):

𝒚 𝒕 = 𝒇 𝒕 𝝁(𝒕)𝒅𝒕 + 𝑲

𝝁 𝒕𝟕

where K is a constant and 𝝁 𝒕 = 𝒆 𝝀𝒅𝒕

Therefore, 𝝁 𝒕 = 𝒆𝝀𝒕

Special case 2: 𝑦 𝑡 = −𝜆𝑦 𝑡 ,where 𝜆 is a constant and 𝑓 𝑡 = 0:

𝒚 𝒕

𝒚 𝒕= −𝝀 (8)

6

Page 7: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Now, 𝑓 𝑡 = 0, and still 𝜇 𝑡 = 𝑒𝜆𝑡. Then, from the general solution:

𝒚 𝒕 =𝑮 + 𝑲

𝒆𝝀𝒕= 𝑩𝒆−𝝀𝒕

where B=G+K is a constant

This special case is known as the constant growth rate (= −𝝀)

The Initial Value Problem:

In most optimization macro models we have initial conditions such as𝑦 0 = 𝑦0. For example the initial capital in the economy might be givenby 𝑘 0 = 𝑘0.Then:

𝑦 𝑡 − 𝜆(𝑡)𝑦 𝑡 = 𝑓 𝑡

𝑦 0 = 𝑦0

An initial value problem is a differential equation along with anappropriate number of initial conditions. We can use the initial conditionto get a particular solution.

7

Page 8: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Example 1: Find the solution to the following FOLDE:

𝒚 𝒕 = −𝟎. 𝟏𝟗𝟔𝒚 𝒕 + 𝟗. 𝟖

Step1: 𝑦 𝑡 + 0.196𝑦 𝑡 = 9.8

Step 2: 𝜇 𝑡 = 𝑒0.196𝑡 𝑎𝑛𝑑 𝜇 𝑡 = (0.196)𝑒0.196𝑡

Step 3: 𝑦 𝑡 𝒆𝟎.𝟏𝟗𝟔𝒕 + 0.198𝑦 𝑡 𝒆𝟎.𝟏𝟗𝟔𝒕 = (9.8)𝒆𝟎.𝟏𝟗𝟔𝒕

Verify 𝑑

𝑑𝑡𝑦 𝑡 𝜇 𝑡 = 𝑦 𝑡 𝑒0.196𝑡 + (0.198)𝑒0.196𝑡𝑦 𝑡 = (9.8)𝒆𝟎.𝟏𝟗𝟔𝒕

Step 4: 𝑦 𝑡 𝑒0.196𝑡 + 𝒄 = (9.8)𝑒0.196𝑡𝑑𝑡 = 9.8 .𝑒0.196𝑡

(0.196)+ 𝑟 = 50. 𝑒0.196𝑡 + 𝒓

Note: we work with indefinite integrals so we add constants

A Cookbook to solve FOLDE:

1) Put the differential equation in the correct initial form as (6).2) Depending on the case, find the integrating factor 𝜇 𝑡 .3) Multiply everything in the differential equation by 𝜇 𝑡 and verify that the

left side becomes the product rule𝑑

𝑑𝑡𝑦 𝑡 𝜇 𝑡 .

4) Integrate both sides.5) Solve for the solution 𝑦 𝑡 .

8

Page 9: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Step 5: 𝑦 𝑡 𝑒0.196𝑡 = 50𝑒0.196𝑡 + 𝑟 − 𝑐 = 50𝑒0.196𝑡 + 𝑐multiply both sides by 𝑒−0.196𝑡, then:

𝐲 𝒕 = 𝟓𝟎 + 𝒄. 𝒆−𝟎.𝟏𝟗𝟔𝒕 , where c is a constant

Example 2: Find the solution to the following FOLDE:

𝑡. 𝑦 𝑡 + 2𝑦 = 𝑡2 − 𝑡 + 1 ; and the initial condition 𝑦 1 =1

2

Step1: Divide both sides by t to get the familiar form:

𝑦 𝑡 +2

𝑡𝑦 𝑡 = 𝑡 − 1 +

1

𝑡

Step 2: 𝜇 𝑡 = 𝑒𝑥𝑝 2

𝑡𝑑𝑡 = 𝑒2 ln 𝑡 = 𝑒ln 𝑡 2

= 𝑡 2 = 𝒕𝟐 and 𝜇 𝑡 = 𝟐𝒕

Step 3: 𝑦 𝑡 𝒕𝟐 +2

𝑡𝒕𝟐𝑦 𝑡 = 𝑡𝒕𝟐 − 1𝒕𝟐 +

1

𝑡𝒕𝟐

𝑦 𝑡 𝑡2 + 2𝑡𝑦 𝑡 = 𝑡3 − 𝑡2 + 𝑡

Verify 𝒅

𝒅𝒕𝒚 𝒕 𝝁 𝒕 = 𝒚 𝒕 𝒕𝟐 + 𝟐𝒕𝒚 𝒕 = 𝒕𝟑 − 𝒕𝟐 + 𝒕

9

Page 10: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Step 4:

𝑡2𝑦 𝑡 + 𝑐 = (𝑡3 − 𝑡2 + 𝑡) 𝑑𝑡 =𝑡4

4−𝑡3

3+𝑡2

2+ b

Step 5: Dividing both sides by 𝒕𝟐

𝒚 𝒕 =𝒕𝟐

𝟒−𝒕

𝟑+𝟏

𝟐+𝐜

𝒕𝟐

Step 6: Evaluate the initial condition 𝒚 𝟏 =𝟏

𝟐to find a particular solution:

𝒚 𝟏 =𝟏𝟐

𝟒−𝟏

𝟑+𝟏

𝟐+

𝐜

𝟏𝟐=𝟏

𝟐⇒ 𝒄 =

𝟏

𝟏𝟐

Then the function that satisfies both the FOLDE and the initial condition is:

𝒚 𝒕 =𝒕𝟐

𝟒−𝒕

𝟑+𝟏

𝟐+

𝟏

𝟏𝟐. 𝒕𝟐

10

Page 11: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

The graph of the solution:

11

Page 12: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

SYSTEM OF FOLDE:

In Economics we usually have problems of variables that move together, forexample the amount you consume today affect your wealth tomorrow:

𝒂 𝒕 = 𝟏 + 𝒓 𝒂 𝒕 − 𝒄 𝒕 𝒄 𝒕 = 𝒄(𝒕)(𝟏 + 𝒓)

The first equation is the asset accumulation, and the second one is called theEuler equation derived form the dynamic optimization problem (r is theinterest rate and there is no depreciation). In order to solve for theconsumption path, we need to solve this system of FOLDE.

In general, let 𝑥1(𝑡), 𝑥2(𝑡), … . . 𝑥𝑛(𝑡) satisfy the system of n FOLDE:

𝑥1 𝒕 = 𝑨𝟏𝟏𝒙𝟏 𝒕 + ⋯+ 𝑨𝟏𝒏𝒙𝒏 𝒕 + 𝒇𝟏 𝒕

⋮ 𝑥𝑛 𝒕 = 𝑨𝒏𝟏𝒙𝟏 𝒕 + ⋯+ 𝑨𝒏𝒏𝒙𝒏 𝒕 + 𝒇𝒏 𝒕

We can express this system in matrix notation :

𝑿 𝒕 = 𝐀𝑿 𝒕 + 𝒇 𝒕 (9)𝑿 𝒕 𝒂𝒏𝒅 𝒇(𝒕) ∈ ℝ𝒏 and 𝐀 is a constant n x n matrix.

12

Page 13: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

If A is a diagonal matrix, i.e. 𝑨𝒊𝒋 = 𝟎 ∀𝑖 ≠ 𝑗, we come back to previous section

with one FOLDE for each 𝑥𝑖 𝑡 , and solve them independently.

However, if A is not diagonal, we have co-movements in X(t) and we need tosolve the system of FOLDE simultaneously.

General Solution:

Recall that we say that A is a diagonalizable matrix if 𝐀 = 𝐕𝐃𝐕−𝟏 where D is adiagonal matrix with the eigenvalues 𝜆 1, 𝜆 2, … , 𝜆 𝑛 of A in the diagonal entriesand V is the matrix whose columns are the eigenvectors 𝜉(1), 𝜉(2),…, 𝜉(𝑛) of A.

13

Remember: The eigenvalues 𝝀 𝟏, 𝝀 𝟐, … , 𝝀 𝒏 are roots of the characteristicpolynomial:

𝒅𝒆𝒕 𝑨 − 𝝀𝑰 = 𝟎, where 𝑰 is the identity matrix

And the eigenvector (𝝃) associated to 𝝀 is the solution to:𝑨 − 𝝀𝑰 𝝃 = 𝟎

Page 14: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Since A is diagonalizable, we can rewrite (9) [ 𝑿 𝒕 = 𝑨𝑿 𝒕 + 𝒇 𝒕 ] as:

𝑿 𝒕 = (𝑽𝑫𝑽−𝟏)𝑿 𝒕 + 𝒇 𝒕

Multiply both sides by 𝑉−1,

𝑽−𝟏 𝑿 𝒕 = 𝑫𝑽−𝟏𝑿 𝒕 + 𝑽−𝟏𝒇 𝒕or

𝑿∗ 𝒕 = 𝑫𝑿∗ 𝒕 + 𝒇∗ 𝒕

Since D is diagonal, this system is reduced to the scalar case with one FOLDEfor each 𝑥1

∗ 𝑡 , 𝑥2∗ 𝑡 , … , 𝑥𝑛

∗(𝑡). Finally, we can recover 𝑿 𝒕 :

𝑿 𝒕 = 𝑽𝑿∗ 𝒕 = 𝑽(𝑽−𝟏𝑿 𝒕 ).

Conclusion:The dynamic of the solution is determined by the nature of the eigenvaluesand the corresponding eigenvectors.

14

Page 15: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

The Homogenous System:If 𝑓 𝑡 = 0, then the system (9) reduces to: 𝑿 𝒕 = 𝐀𝑿 𝒕 , and we getfollowing the general solution:

𝑿∗ 𝒕 = 𝑫𝑿∗ 𝒕In other words, for each independent FOLDE we have (for i=1,2,...,n):

𝒙𝒊∗ 𝒕 = 𝝀𝒊𝒙𝒊

∗ 𝒕

From the previous section, the solution is 𝒙𝒊∗ 𝒕 = 𝒄𝒊𝒆

𝝀𝒊𝒕, so each 𝑥𝑖∗ 𝑡

grows at a constant rate 𝜆𝑖 .

However, we need to recover the original 𝑿 𝒕 by 𝑿 𝒕 = 𝑽𝑿∗ 𝒕 =𝑽(𝑽−𝟏𝑿 𝒕 ), where the columns of V are the eigenvectors 𝜉(1), 𝜉(2),…, 𝜉(𝑛)

for the eigenvalues 𝜆 1, 𝜆 2, … , 𝜆 𝑛

X t = 𝜉(1) … 𝜉(𝑛)𝑐1𝑒

𝜆1𝑡

⋮𝑐𝑛𝑒

𝜆𝑛𝑡

Thus, the general solution of the homogeneous system is:

𝐗 𝒕 = 𝝃(𝟏) 𝒄𝟏𝒆𝝀𝟏𝒕 +⋯+ 𝝃(𝒏) 𝒄𝒏𝒆

𝝀𝒏𝒕

where 𝝃(𝟏) 𝒄𝟏𝒆𝝀𝟏 , … , 𝝃(𝒏) 𝒄𝒏𝒆

𝝀𝒏 are linearly independent vectors

15

Page 16: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

General Case: Consider the following homogeneous system of two-variables:

𝒙𝟏 𝒕 = 𝒂𝒙𝟏(𝒕) + 𝒃𝒙𝟐(𝒕) 𝒙𝟐 𝒕 = 𝒄𝒙𝟏(𝒕) + 𝒅𝒙𝟐(𝒕) (10)

In matrix form: 𝑋 𝑡 = 𝐴𝑋 𝑡 , where the matrix A =𝑎 𝑏𝑐 𝑑

Assume det A ≠ 0, the eigenvalues are the solution to the characteristicpolynomial:

det A − 𝜆𝐼 = 0𝑎 − 𝜆 𝑑 − 𝜆 − 𝑏𝑐 = 0

𝜆2 − 𝑎 + 𝑑 𝜆 + (𝑎𝑑 − 𝑏𝑐) = 0A useful result: 𝜆1. 𝜆2 = 𝑑𝑒𝑡 𝐴 = 𝑎𝑑 − 𝑏𝑐

Recall that the eigenvectors for each 𝜆𝑖 ,𝛼𝑖𝛽𝑖

, are the solution to:

A − 𝜆𝑖𝐼𝛼𝑖𝛽𝑖

= 0 𝑜𝑟𝑎 − 𝜆𝑖 𝑏𝑐 𝑑 − 𝜆𝑖

𝛼𝑖𝛽𝑖

= 0

Thus, by knowing 𝜆𝑖 we can solve the system to get 𝛼𝑖 𝑎𝑛𝑑 𝛽𝑖𝑎 − 𝜆𝑖 𝛼𝑖 + 𝑏𝛽𝑖 = 0𝑐𝛼𝑖 + (𝑑 − 𝜆𝑖)𝛽𝑖 = 0

16

Page 17: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

If the eigenvalues are real and distinct, the general solution will be:

𝒙𝟏(𝒕)𝒙𝟐(𝒕)

= 𝒄𝟏𝜶𝟏𝜷𝟏

𝒆𝝀𝟏𝒕 + 𝒄𝟐𝜶𝟐𝜷𝟐

𝒆𝝀𝟐𝒕 (11)

Where 𝑐1 and 𝑐2 are arbitrary constant.

When both eigenvalues have the same sign: 𝒅𝒆𝒕 𝑨 > 𝟎If both are negative as 𝑡 → ∞, the terms in (11) converge to zero, andsystem (10) is stable. If 𝝀𝟐 < 𝝀𝟏<0, then 𝒆𝝀𝟐𝒕 is negligible compared to 𝒆𝝀𝟏𝒕.In this case the solution is characterized by a node.

Note: If both are positive, the solution is unstable

When both eigenvalues have opposite sign:𝒅𝒆𝒕 𝑨 < 𝟎This means that one part of the solution is stable, while the other isunstable. If 𝝀𝟏 > 𝟎, 𝝀𝟐<0, then 𝒆𝝀𝟏𝒕 is dominant. In this case the solution ischaracterized by a saddle point.

17

Page 18: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

With repeated eigenvalues: 𝝀𝟏 = 𝝀𝟐 = 𝝀Recall we want two linearly independent solutions, however, in this case weget only one of them , 𝒙 𝒕 = 𝒗𝒆𝝀𝒕. Let’s try the following “guess“ for thesecond solution:

𝒙 𝒕 = 𝒕𝒗𝒆𝝀𝒕 +𝒘𝒆𝝀𝒕

Then, it should satisfy 𝑿 𝒕 = 𝐀𝑿 𝒕 ,

𝒗𝒆𝝀𝒕 + 𝝀𝒕𝒗𝒆𝝀𝒕 + 𝝀𝒘𝒆𝝀𝒕 = 𝑨 𝒕𝒗𝒆𝝀𝒕 +𝒘𝒆𝝀𝒕

or𝒗 + 𝝀𝒘 𝒆𝝀𝒕 + 𝝀𝒗𝒕𝒆𝝀𝒕 = 𝑨𝒗𝒕𝒆𝝀𝒕 + 𝑨𝒘𝒆𝝀𝒕

Matching coefficients:i. 𝝀𝒗 = 𝑨𝒗 ⇒ 𝑨 − 𝝀𝑰 𝒗 = 𝟎 , this is satisfied since 𝒗 is actually the

eigenvector of 𝝀ii. 𝒗 + 𝝀𝒘 = 𝑨𝒗 ⇒ 𝑨𝒘− 𝝀𝒘 = 𝒗 ⇒ 𝑨− 𝝀𝑰 𝒘 = 𝒗, this is the way to find

the other eigenvector .Therefore, the general solution with repeated eigenvalues is:

𝒙𝟏(𝒕)𝒙𝟐(𝒕)

= 𝒄𝟏𝒗𝒆𝝀𝒕 + 𝒄𝟐(𝒕𝒗𝒆

𝝀𝒕 +𝒘𝒆𝝀𝒕)

where 𝒄𝟏 and 𝒄𝟐 are arbitrary constants

18

Page 19: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

When both eigenvalues are complex: 𝝀𝟏,𝟐 = 𝒓 ± 𝒌𝒊

By applying our general result we get: 𝑒(𝑟±𝑘𝑖)𝑡. We can use the Euler’sformula:

𝒆(𝑟±𝑘𝑖)𝒕 = 𝒆𝑟𝒕𝒆𝑘𝑖𝒕 = 𝒆𝑟𝒕 𝑐𝑜𝑠(𝒌𝒕) + 𝒊 . 𝑠𝑖𝑛(𝒌𝒕)

Suppose 𝜉 =𝑣11 + 𝑖𝑣12𝑣21 + 𝑖𝑣22

is the associate complex eigenvector with respect

to 𝝀𝟏,= 𝒓 + 𝒌𝒊 . It is possible to split the eigenvector into its real and

complex parts: 𝝃 =𝒗𝟏𝟏𝒗𝟐𝟏

+ 𝒊𝒗𝟏𝟐𝒗𝟐𝟐

Then the general solution would be:

𝒙𝟏(𝒕)𝒙𝟐(𝒕)

= 𝒄𝟏𝒗𝟏𝟏 𝑐𝑜𝑠(𝒌𝒕) − 𝒗𝟏𝟐 𝑠𝑖𝑛(𝒌𝒕)𝒗𝟐𝟏 𝑐𝑜𝑠(𝒌𝒕) − 𝒗𝟐𝟐 𝑠𝑖𝑛(𝒌𝒕)

𝒆𝒓𝒕 + 𝒄𝟐𝒗𝟏𝟏 𝑠𝑖𝑛(𝒌𝒕) + 𝒗𝟏𝟐 𝑐𝑜𝑠(𝒌𝒕)

𝒗𝟐𝟏 𝑠𝑖𝑛 𝒌𝒕 +𝒗𝟐𝟐 𝑐𝑜𝑠(𝒌𝒕)𝒆𝒓𝒕

19

Page 20: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

PHASE DIAGRAM:Even without solving the system explicitly, we can analyze the properties and the dynamic of the system by drawing a phase diagram. Consider:

𝒙𝟏 𝒕 = 𝒂𝒙𝟏 𝒕 + 𝒃𝒙𝟐 𝒕 + 𝒌𝟏

𝒙𝟐 𝒕 = 𝒄𝒙𝟏 𝒕 + 𝒅𝒙𝟐 𝒕 + 𝒌𝟐 (12)

with 𝑎, 𝑏, 𝑐 < 0 𝑎𝑛𝑑 𝑑, 𝑘1, 𝑘2 > 0

Given these assumptions the eigenvalues are of opposite sign: Why..?

From (12), we can compute the loci 𝒙𝟏 = 𝟎 and 𝒙𝟐 = 𝟎:

𝑥1 = 0 ⟹ 𝑎𝑥1 𝑡 + 𝑏𝑥2 𝑡 + 𝑘1 = 0 𝑜𝑟 𝒙𝟐(𝒕) = −𝒂

𝒃𝒙𝟏(𝒕) −

𝒌𝟏𝒃

similarly,

𝑥2 = 0 ⟹ 𝑐𝑥1 𝑡 + 𝑑𝑥2 𝑡 + 𝑘2 = 0 𝑜𝑟 𝒙𝟐(𝒕) = −𝒄

𝒅𝒙𝟏(𝒕) −

𝒌𝟐𝒅

Therefore, 𝑥1 = 0 is an straight line with a negative slope, while 𝑥2 = 0 is anstraight line with positive slope. The intersection of these two lines will giveyou what is called the long-run solution or steady state, denoted by𝑬 = (𝒙𝟏

∗ , 𝒙𝟐∗ )

20

Page 21: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

E

Graphically:

Four areas are defined by the lines: I, II, III, and IV

I

II

III

IV

𝐱𝟐 = 𝟎

𝐱𝟏 = 𝟎

21

Page 22: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

From equation (12) we can analyze the dynamic:

Since 𝑥1 is decreasing in 𝑥2 (b<0), for any point above 𝑥1 = 0 we must have 𝑥1 < 0 (areas I and II), and 𝑥1 > 0 below the line (areas III and IV):

Since 𝑥2 is increasing in 𝑥2 (d>0), for any point above 𝑥2 = 0 locus musthave 𝑥2 > 0 (areas I and IV), and 𝑥2 < 0 below the line (areas II and III).

𝐱𝟐 = 𝟎

𝐱𝟏 = 𝟎

𝐱𝟐 = 𝟎

𝐱𝟏 = 𝟎

22

Page 23: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

These directions together will give you an idea of the dynamic paths givenan initial point. Without solving explicitly, we have derived a saddle-pathsolution for this system.

E

𝐱𝟐 = 𝟎

𝐱𝟏 = 𝟎

𝑺𝒂𝒅𝒅𝒍𝒆 − 𝒑𝒂𝒕𝒉

23

Page 24: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Based on the general solution: 𝑿(𝒕) = 𝒄𝟏𝒗𝟏𝒆𝝀𝟏𝒕 + 𝒄𝟐𝒗𝟐𝒆

𝝀𝟐𝒕, where 𝒗𝟏 and 𝒗𝟐are the eigenvectors, we can have different phase diagrams:

Unstable NodeStable Node

Saddle Path

24

Page 25: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Degenerated Unstable Node

Degenerated Stable Node

Saddle Path

25

Page 26: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Stable Spiral PointCenter

Unstable Spiral Point

26

Page 27: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

DIFFERENCE EQUATIONS: An introduction to first order difference equations

A difference equation is an equation which evolves over discrete timeintervals. It would be a function which tells us what is the value of somevariable 𝑦 in any given period t. In general, we are given a rule of how 𝑦𝑡evolves over one period: for example,

𝒚𝒕+𝟏 = −𝒂𝟏𝒚𝒕

For the aim of this course we will only focus on the first order lineardifference equations with constant coefficients, that is:

𝒂𝟎𝒚𝒕+𝟏 = −𝒂𝟏𝒚𝒕 + 𝒂𝟐, (13)

𝑤ℎ𝑒𝑟𝑒 𝑎0, 𝑎1, 𝑎𝑛𝑑 𝑎2 𝑎𝑟𝑒 𝑐𝑜𝑛𝑠𝑡𝑎𝑛𝑡𝑠

Solving difference equations:

Firstly, put the difference equation (13) in the following standard form:

𝒚𝒕+𝟏 +𝒂𝟏𝒂𝟎

𝒚𝒕 =𝒂𝟐𝒂𝟎

, 𝑎𝑛𝑑 𝑑𝑒𝑓𝑖𝑛𝑒 𝑨 = −𝒂𝟏𝒂𝟎

𝒂𝒏𝒅 𝑩 =𝒂𝟐𝒂𝟎

27

Page 28: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

Then, 𝒚𝒕+𝟏 − 𝑨𝒚𝒕 = 𝑩 ⇒ 𝒚𝒕+𝟏 = 𝑨𝒚𝒕 + 𝑩

Solving by iteration:

𝑦1 = 𝐴y0 + 𝐵𝑦2 = 𝐴y1 + 𝐵 = 𝐴 𝐴y0 + 𝐵 + 𝐵 = 𝐴2y0 + 𝐵(𝐴 + 1)𝑦3 = 𝐴y2 + 𝐵 = 𝐴 𝐴2y0 + 𝐵(𝐴 + 1) + 𝐵 = 𝐴3y0 + 𝐵(𝐴2 + 𝐴 + 1)⋮𝑦𝑡 = 𝐴𝑡y0 + 𝐵(𝐴𝑡−1 + 𝐴𝑡−2 +⋯+ 𝐴2 + 𝐴 + 1)

But 𝐴𝑡−1 + 𝐴𝑡−2 +⋯+ 𝐴2 + 𝐴 + 1 =1−𝐴𝑡

1−𝐴[ Geometric progression]

Therefore,

𝑦𝑡 = 𝐴𝑡y0 + 𝐵1 − 𝐴𝑡

1 − 𝐴

Rearranging in a convenient way:

𝒚𝒕 = 𝑨𝒕 𝒚𝟎 −𝑩

𝟏 − 𝑨+

𝑩

𝟏 − 𝑨(14)

28

Page 29: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

In order to better understand (14) define the steady state (y*) as:

𝒚∗ =𝑩

𝟏 − 𝑨

Then we can express (14) as the dynamic of y to the steady state:

𝒚𝒕 = 𝑨𝒕 𝒚𝟎 − 𝒚∗ + 𝒚∗ 15

As we will see later, we converge to the steady state (𝒚∗) whenever 𝑨 < 𝟏 .

We can generalize this condition by noticing that 𝑨 =𝑑𝑦𝑡+1

𝑑𝑦𝑡.

Then the system is stable if𝑑𝑦𝑡+1

𝑑𝑦𝑡< 1, and unstable if

𝑑𝑦𝑡+1

𝑑𝑦𝑡> 𝟏

Let’s analyze all possible cases….

29

Page 30: Differential & Difference Equations...1) Put the differential equation in the correct initial form as (6). 2) Depending on the case, find the integrating factor . 3) Multiply everything

Differential & Difference Equations – Rafael López-MontiGWU Math Camp 2014

By analyzing the sign and value of A, and the relative values of 𝒚𝟎 𝒂𝒏𝒅 𝒚∗,we can

determine the behavior of the system:

𝒚𝒕 = 𝑨𝒕 𝒚𝟎 − 𝒚∗ + 𝒚∗

Cases Value of A Behavior of 𝒚𝒕

1 A>1The system diverge to +∞ if 𝒚𝟎 > 𝒚∗

or −∞ if 𝒚𝟎 < 𝒚∗

2 A=1 The system will stay at 𝒚𝟎

3 0<A<1The system converges to 𝒚∗. The sequence will monotonically

decrease if 𝒚𝟎 > 𝒚∗, or increase if 𝒚𝟎 < 𝒚∗

4 A=0 The system immediately jump to 𝒚∗

5 -1<A<0The system converges to 𝒚∗. The sequence will oscillate

around the steady state 𝒚∗

6 A=-1Then 𝒚𝑡 = 𝒚𝟎 for even periods or 𝒚𝒕 = 𝟐𝒚∗ − 𝒚𝟎 for odd

periods

7 A<-1The system oscillates with the magnitude of oscillate growing

to infinity over time.

For all cases, If 𝒚∗ = 𝒚𝟎, then 𝒚𝑡 = 𝒚∗ ∀𝒕

30