Chapter 4: Differential Equations - Economics

advertisement
MSc Maths and Statistics 2008
Department of Economics UCL
Chapter 4: Differential Equations
Jidong Zhou
Chapter 4: Differential Equations
1
Introduction
Differential equations are the basic tool for solving (continuous-time) dynamic optimization
problems and analyzing dynamic systems. A differential equation is a relation between a
function and its derivatives.
• An ordinary differential equation describes a relationship between a function of one
variable y(t) and its derivatives. For example,
y 0 (t) = ay(t),
y 00 (t) + ay0 (t) = by(t).
The solution to a differential equation is a function y(t) which satisfies that relationship.
• Differential equations which describe a relationship between a function of several variables and its partial derivatives are called partial differential equation. For example,
∂y(t1 , t2 )
= t2 y(t1 , t2 ).
∂t1
But this course only reviews ordinary differential equations.1
• If a differential equation involves only the first order derivative, we call it a first order
differential equation. If it involves derivatives up to and including the nth derivative,
we call it a nth order differential equation.
• The value that the solution y(t) approaches (if any) as t → ∞ is usually referred to as
the steady state or stationary state.
2
First order differential equations
We deal with the first order differential equation having the form as
y 0 (t) = F (y(t), t).
If F does not explicitly involve t, i.e.,
y0 (t) = F (y(t)),
1
We will also not discuss the issue of existence and uniquess of the solution to ordinary differential equations.
1
MSc Maths and Statistics 2008
Department of Economics UCL
Chapter 4: Differential Equations
Jidong Zhou
we call it an autonomous differential equation. Otherwise, we call it a nonautonomous differential equation. In the following, we introduce several categories of first order differential
equations of which the solutions can be found analytically.
• Separable equations:
If F (y, t) is separable in the sense that
F (y, t) = g(y) · h(t),
then we can solve the differential equation by using the method of separation of variables.
Specifically, we can rewrite the original differential equation y 0 = g(y) · h(t) as
1
dy = h(t)dt.
g(y)
Integrating each side with respect to its own variable yields
Z
Z
1
dy = h(t)dt + k
g(y)
for some constant k. This defines our solution implicitly. Whether an explicit solution
y(t) can be found now depends on the form of g(y).
— the solution with arbitrary constant k is called the general solution.
— we can pin down k if we are told the value of y at some particular point t0 . Once
k is pinned down, the solution is called a particular solution.
• Homogeneous equations:
If
F (y, t) = g
then we say the differential equation
y0 = g
³y´
t
,
³y´
t
is homogeneous. It can be solved by the method of change of variables. Let u = y/t be
a new function. Then
y = ut =⇒ dy = udt + tdu.
Substituting this into the differential equation yields
u+t
1
1
du
= g(u) =⇒
du = dt.
dt
g(u) − u
t
Integrating each side with respect to its own variable gives rise to
Z
1
du = ln t + k
g(u) − u
for some constant k. This defines a solution u(t) implicitly, and then y(t) = u(t)t.
2
MSc Maths and Statistics 2008
Department of Economics UCL
Chapter 4: Differential Equations
Jidong Zhou
Exercise 1 (i) Solving the following differential equations:
(a) (7 + e2t )y 0 + ye2t = 0; (b) yy 0 + tey = 0 with y(1) = 0;
2 +y 2
; (d) y 0 = 7t−3y−7
(c) y 0 = t 2ty
7y−3t+3 .
(ii) Let p(t) be the market price at time t, and the the demand and supply functions at t
are
D(t) = α − βp(t),
S(t) = a + bp(t),
respectively. All parameters are positive and α > a. We also assume that the price is affected
by the demand and supply in the following way:
p0 (t) = k [D(t) − S(t)]
where k is some positive constant. This equation just says that the market price will go up if
the demand exceeds the supply and will go down if the supply exceeds the demand. Solve the
price function p(t) and show that it will approach to the market clearing price as t → ∞.
We now discuss linear first order differential equations.
• Linear first order differential equations with constant coefficients:
y 0 + ay = b
where a 6= 0. This is actually a specific case of separable equations, and so we have
Z
1
1
dy = dt =⇒
dy = t + c
b − ay
b − ay
for some constant c, or more explicitly,
y = ke−at +
b
a
for some constant k.
— for a positive a, the steady state is b/a.
— if we know y(0) = 0, then we can pin down k = −b/a.
• Linear first order differential equations with variable coefficients:
3
MSc Maths and Statistics 2008
Department of Economics UCL
Chapter 4: Differential Equations
Jidong Zhou
— the simple case:
y0 + a(t)y = 0.
It is still a separable equation, and so we have
Z
U
1
dy = −a(t)dt =⇒ ln y = − a(t)dt + c =⇒ y = ke− a(t)dt
y
for some constant k.
— the general case:
y0 + a(t)y = b(t).
It is no longer a separable equation. We need a different method to solve this
equation. Notice that
´
U
U
¤
£
d ³
y(t)e a(t)dt = e a(t)dt y0 (t) + y(t)a(t) .
dt
U
Then multiply each side of the differential equation by e
and so
´
U
U
d ³
y(t)e a(t)dt = b(t)e a(t)dt
dt
−
y(t) = e
U
a(t)dt
for some constant k.
• Bernoulli equations:
∙Z
U
b(t)e
a(t)dt
a(t)dt ,
and we get
¸
dt + k .
y 0 + a(t)y = b(t)y n
where n ≥ 2. We can convert this equation into the above form by changing the variable.
Let u = y 1−n , and simple manipulation can lead to
1
u0 + a(t)u = b(t).
1−n
Exercise 2 Solve the following differential equations and find the steady states (if any):
00
(a) y 0 = y 2 ; (b) ty 0 + (1 − t)y = e2t ; (c) − uu0(x)x
(x) = r.
3
Linear second order differential equations
We first consider the general case and then focus on the differential equations with constant
coefficients.
4
MSc Maths and Statistics 2008
Department of Economics UCL
3.0.1
Chapter 4: Differential Equations
Jidong Zhou
The general case
A second order linear differential equation can be put in the form
y 00 + a(t)y 0 + b(t)y = c(t),
(1)
where a(t), b(t), and c(t) are known functions. (1) is usually called the complete equation.
The corresponding reduced equation is
y 00 + a(t)y 0 + b(t)y = 0.
(2)
The following two theorems are important in solving linear second order differential equations:
• The general solution of the complete equation (1) is the sum of any particular solution
of the complete equation and the general solution of the reduced equation (2).
• Any solution y(t) of the reduced equation can be expressed as a linear combination
y(t) = k1 y1 (t) + k2 y2 (t)
(3)
of two solutions y1 (t) and y2 (t) that are linearly independent.
— y1 (t) and y2 (t) are linearly independent if c1 y1 (t) + c2 y2 (t) = 0 implies c1 = c2 = 0.
— since every solution of the reduced equation is of form (3), we call (3) the general
solution of the reduced equation.
Example 1 Both y1 (t) = e2t and y2 (t) = e−2t satisfy the differential equation
y 00 − 4y = 0.
Since these two solutions are linearly independent, the general solution is
y(t) = k1 e2t + k2 e−2t .
3.0.2
The case with constant coefficients
We first deal with the reduced equation
y00 + ay 0 + by = 0.
(4)
Since the general solution to the linear first order equation y0 + cy = 0 has the form of ke−ct ,
one might guess that a solution to the second order equation would be of the form y = kert
for appropriate constants k and r. If that were true, then k and r must satisfy
kert (r2 + ar + b) = 0,
5
MSc Maths and Statistics 2008
Department of Economics UCL
Chapter 4: Differential Equations
Jidong Zhou
which requires
r2 + ar + b = 0.
This is called the characteristic equation associated with (4). Then we have three cases to
consider:
• Case 1: a2 − 4b > 0
In this case, the characteristic equation has two distinct real roots
√
√
−a + a2 − 4b
−a − a2 − 4b
, r2 =
,
r1 =
2
2
and so er1 t and er2 t are two linearly independent solutions to (4). Therefore, according
to the second theorem in the general case, the general solution of (4) is
y(t) = k1 er1 t + k2 er2 t .
k1 and k2 can be pinned down if we are told the value of y(t0 ) and y 0 (t0 ) at some
particular point t0 .
• Case 2: a2 − 4b = 0
In this case, the characteristic equation has one real root
a
r=− .
2
Hence, we only get one solution ert . But that is not enough to find the general solution.
Fortunately, we can easily verify that
tert
is another particular solution. (Verify it as an exercise.) Therefore, the general solution
of (4) in this case is
y(t) = ert (k1 + k2 t) .
• Case 3: a2 − 4b < 0
In this case, the characteristic equation has two conjugate complex roots
√
√
−a + i a2 − 4b
−a − i a2 − 4b
r1 =
, r2 =
,
2
2
where i is the imaginary number satisfying i2 = −1. If we let
√
a2 − 4b
a
α=− , β=
,
2
2
6
MSc Maths and Statistics 2008
Department of Economics UCL
Chapter 4: Differential Equations
Jidong Zhou
then the general solution can be written as
³
´
y(t) = eαt h1 eiβt + h2 e−iβt .
But we hope to find solutions with real coefficients to a differential equation with real
coefficients. Noticing that eit = cos t + i sin t,2 we can rewrite the general solution as
y(t) = eαt (c1 cos βt + ic2 sin βt) .
It is easy to show that if y(t) = u(t) + iv(t) is a solution to (4), then u(t) and v(t) are
also solutions to (4). Therefore, eαt cos βt and eat sin βt are two linearly independent
(real) solutions, and so we conclude that
y(t) = eαt (k1 cos βt + k2 sin βt)
is the general real solutions to (4).
Example 2 Solve the following differential equations with initial values:
(i) y 00 − y0 − 2y = 0 with y(0) = 3 and y 0 (0) = 0;
(ii) y00 + 2y 0 + 2y = 0 with y(0) = 1 and y 0 (0) = 0.
We then turn to the complete equation:
y 00 + ay 0 + by = c(t),
(5)
where a and b are still constants. According the first theorem we have given in Section 3.0.1,
the solution can be found in two steps. First, find the general solution to the reduced equation
y 00 + ay0 + by = 0. Second, find a particular solution to the complete equation. Then the sum
of the two solutions is the general solution of (5). In this course, we will not further discuss
the technique for finding a particular solution to (5).3
Exercise 3 Solving the following differential equations:
(a) y 00 −3y0 + 94 y = 0; (b) y00 −4y0 +3y = 6; (c) y 00 −3y 0 + 94 y = ex (Hint: guess a particular
solution first and then verify it.)
2
See, for example, pp.883 in Simon&Blume (1994) for a derivation.
You can refer to pp.655 in Simon&Blume (1994). Another reference source is pp.336 in the book “Dynamic
Optimization: The Calculus of Variation and Optimal Control in Economics and Management,” (2nd edition)
by Kamien and Schwartz.
3
7
MSc Maths and Statistics 2008
Department of Economics UCL
4
Chapter 4: Differential Equations
Jidong Zhou
Linear higher order differential equations
Consider a nth order linear differential equation with constant coefficients
y (n) + an−1 y (n−1) + · · · + a1 y0 + a0 y = c(t).
(6)
The corresponding reduced equation is
y (n) + an−1 y (n−1) + · · · + a1 y 0 + a0 y = 0.
Then we have similar results as those developed for linear second order differential equations.
We can find a general solution of the reduced equation first, and then find a particular
solution to the complete equation. The sum of them will be the general solution to the
complete equation. To find the general solution of the reduced equation, we need rely on its
characteristic equation
rn + an−1 rn−1 + · · · + a1 r + a0 = 0.
This equation has exactly n roots (real or complex). Assigning a solution to each root yields
n linearly independent solutions. A linear combination of them with n free constants is the
general solution to the reduced equation.
Example 3 The differential equation
y (4) + 4y(3) + 13y 00 + 36y0 + 36y = 0
has characteristic equation
r4 + 4r3 + 13r2 + 36r + 36 = 0 or (r + 2)2 (r2 + 9) = 0.
It has four roots (two of them are repeated): −2, −2, 3i, −3i. Then the general solution is
y(t) = e−2t (k1 + k2 t) + k3 cos 3t + k4 sin 3t.
• Equivalent systems
We claim that an nth order linear differential equations is equivalent to a certain system
of n first order linear differential equations. For example, given
y 00 + ay 0 + by = c(t),
one can define x(t) = y 0 (t). Then the above second order equation is equivalent to the system:
x0 + ax + by = c(t)
x = y0
8
MSc Maths and Statistics 2008
Department of Economics UCL
Chapter 4: Differential Equations
Jidong Zhou
where each equation is of first order. In general, we can define new unknown functions as
z1 (t) = y 0 (t)
z2 (t) = z10 (t) = y 00 (t)
..
.
0
(t) = y(n−1) (t).
zn−1 (t) = zn−2
Then (6) can be rewritten as
0
+ an−1 zn−1 + · · · + a1 z1 + a0 y = c(t).
zn−1
Now we have n first order linear equations with n unknown functions.4
5
Systems of Ordinary Differential Equations
We mainly focus on systems of linear first order equations.
5.1
An example
We work out an example first:
x0 = x + 4y
y0 = x + y
where x and y are unknown functions of t.
Method of Substitution. From the second equation, we get x = y 0 −y and so x0 = y 00 −y 0 .
Substituting them into the first equation yields
y 00 − y0 = y0 − y + 4y =⇒ y 00 − 2y 0 − 3y = 0.
We have known how to solve this linear second order differential equation. Its characteristic
equation is r2 − 2r − 3 = 0 and so it has two distinct real roots: r1 = 3 and r2 = −1. Hence,
y(t) = k1 e3t + k2 e−t .
We can then solve
x(t) = 2k1 e3t − 2k2 e−t .
Similarly, by introducing a new function μ(t) with μ0 (t) = 1, we can convert every nonautonomous differential equation into a system of autonomous differential equations. This is another motivation to study the
system of differential equations.
4
9
MSc Maths and Statistics 2008
Department of Economics UCL
Chapter 4: Differential Equations
Jidong Zhou
Method of Algebra. For expositional convenience, let z = (x, y)T and
Ã
!
1 4
A=
.
1 1
Then the original system can be written as z0 = Az. Notice that A can be diagonalized.
We first solve its eigenvalues from |A − λI| = 0. Simple calculation shows λ1 = 3 and
λ2 = −1. We then calculate a pair of eigenvectors associated with these two eigenvalues from
(A − λI)v = 0 or Av = λv. Remember that we have many feasible eigenvectors, and we pick
à !
Ã
!
2
−2
v1 =
and v2 =
.
1
1
They are linearly independent. Then construct a matrix
Ã
!
2 −2
P = [v1 v2 ] =
1 1
which is invertible. As the result in the matrix part shows, we must have
Ã
!
3 0
−1
,
P AP = D =
0 −1
and so A = P DP −1 . Then the original system becomes z0 = P DP −1 z or (P −1 z)0 = D(P −1 z).
Since D is a diagonal matrix, it is easy to solve
Ã
!
3t
k
e
1
P −1 z =
.
k2 e−t
Finally,
Ã
x
y
!
=z=P
Ã
k1 e3t
k2 e−t
!
=
Ã
2k1 e3t − 2k2 e−t
k1 e3t + k2 e−t
!
.
This is exactly the same answer as that from the method of substitution.
5.2
The general case
Consider a system of linear first order equations:
y10 = a11 y1 + · · · + a1n yn
..
.
yn0 = an1 y1 + · · · + ann yn
where aij are constants and yi are unknown functions. In principle, using the method of
substitution we can solve it by solving an nth order linear differential equation. But it is not
that convenient when n ≥ 3. Here we will use the method of algebra.
10
MSc Maths and Statistics 2008
Department of Economics UCL
Chapter 4: Differential Equations
Jidong Zhou
Concisely, we can write the system as
y0 = Ay
where y = (y1 · · · yn )T . Let us consider an extreme case first. Suppose A is a diagonal matrix
with aij = 0 for i 6= j. Then the system degenerates to n independent equations yi0 = aii yi ,
and their solutions are yi = ki eaii t .
Now suppose A is not diagonal but it has n distinct real eigenvalues λ1 , · · · , λn . Let
v1 , · · · , vn be the associated real (column) eigenvectors. We know that the matrix P = [v1
· · · vn ] must be invertible since all eigenvectors are linearly independent in this case, and A
can be diagonalized:
P −1 AP = D
where D is a diagonal matrix with λi as its diagonal entries. Thus, A = P DP −1 and so the
original system of differential equations can be written as
Hence,
Finally,
¡ −1 ¢0
¡
¢
P y = D P −1 y .
⎛
⎞
k1 eλ1 t
⎜
⎟
..
⎟.
P −1 y = ⎜
.
⎝
⎠
kn eλn t
⎛
⎞
k1 eλ1 t
⎜
⎟
..
⎟
y = [v1 · · · vn ] ⎜
.
⎝
⎠
λ
t
n
kn e
=
n
X
ki eλi t vi .
i=1
This procedure is still valid even if A has complex eigenvalues or repeated eigenvalues so long
as each eigenvalue of multiplicity l has l linearly independent eigenvectors (and so A is still
diagonalizable). The situation is slightly more complicated if A has repeated eigenvalues with
insufficient linearly independent eigenvectors. (See the details in pp. 681 in Simon&Blume
(1994).)
A more general case is y0 = Ay + b(t). A similar result as previous holds: the general
solution to this system is the sum of the general solution to the reduced system y0 = Ay and
a particular solution to this complete system.
11
MSc Maths and Statistics 2008
Department of Economics UCL
A
Chapter 4: Differential Equations
Jidong Zhou
Appendix: Stability analysis
• Consider an autonomous differential equation y0 = f (y). y ∗ is called a rest point if
f (y ∗ ) = 0. That is, once y reaches y ∗ , y will remain unchanged. A rest point is called
asymptotically stable if the solution y(t) approaches to it as t → ∞; otherwise, it is
asymptotically unstable.
• Suppose y∗ is a rest point of y0 = f (y). If f 0 (y ∗ ) < 0, then y ∗ is asymptotically stable;
if f 0 (y∗ ) > 0, then y ∗ is asymptotically unstable.
— this result is easy to understand: given f 0 (y ∗ ) < 0, if y slightly drifts away, say, to
y ∗ + ε > y ∗ , then f (y ∗ + ε) < 0 since f (y ∗ ) = 0. This means that y 0 < 0 at that
point and so y will go down and back to y ∗ . Thus, y ∗ is stable against any small
perturbation.
— in contrast, given f 0 (y∗ ) > 0, if y slightly drifts away, say, to y ∗ + ε > y∗ , then
f (y ∗ + ε) > 0 and so y 0 > 0 at that point. This means that y will further drift
away and so y ∗ is unstable for any small perturbation.
• Consider an autonomous linear system of differential equations y0 = Ay. Clearly, y = 0
is always a rest point. Then
— if every real eigenvalue of A is negative and every complex eigenvalue has negative
real part, then y = 0 is asymptotically stable.
— if A has a positive real eigenvalue or a complex eigenvalue with positive real part,
then y = 0 is asymptotically unstable.
• For a nonlinear system of differential equations y0 = F (y). If y∗ is a rest point (i.e.,
F (y∗ ) = 0), then stability of the nonlinear system is determined by the matrix DF (y∗ ).
All results for the linear system apply here so long as we replace A by DF (y∗ ).
12
Download