DynMacTh Annex 1

12
George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1 Ordinary Differential Equations In this mathematical annex, we define and analyze the solution of linear first and second order differential equations. Knowledge of the properties of differential equations is indispensable for analyzing problems in continuous time in dynamic macroeconomics. 1 We shall start with some definitions, and will then proceed to examine solution methods of first and second order differential equations, with both constant and variable coefficients. A1.1 Definitions A differential equation is a mathematical equation derived from an unknown function of one or more variables, which connects the function itself, and its derivatives of various degrees. While the solution of a simple equation or a system of equations, is to find a constant or a set of constants that satisfy these equations, the solution of a differential equation or a system of differential equations is to find functions, which, along with their derivatives, satisfy the differential equation or the system of differential equations. The equations we shall consider are all function of time t, which is assumed a continuous variable. For example, the solution to the differential equation, (A1.1) is a function y(t), the first derivative of which is equal to a. The general solution to this differential equation is the function, (A1.2) where c is an arbitrary constant. y (t ) = dy dt = a y(t ) = at + c The properties and the solution methods of differential equations are presented in a number of textbooks on 1 mathematics for economists. See Chiang (1974) and Simon and Blume (1994) for two of the best such textbooks. For a more advanced treatment of differential equations, see Boyce and DiPrima (1977).

Transcript of DynMacTh Annex 1

Page 1: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015

Mathematical Annex 1

Ordinary Differential Equations

In this mathematical annex, we define and analyze the solution of linear first and second order differential equations. Knowledge of the properties of differential equations is indispensable for analyzing problems in continuous time in dynamic macroeconomics. 1

We shall start with some definitions, and will then proceed to examine solution methods of first and second order differential equations, with both constant and variable coefficients.

A1.1 Definitions

A differential equation is a mathematical equation derived from an unknown function of one or more variables, which connects the function itself, and its derivatives of various degrees.

While the solution of a simple equation or a system of equations, is to find a constant or a set of constants that satisfy these equations, the solution of a differential equation or a system of differential equations is to find functions, which, along with their derivatives, satisfy the differential equation or the system of differential equations. The equations we shall consider are all function of time t, which is assumed a continuous variable.

For example, the solution to the differential equation,

! (A1.1)

is a function y(t), the first derivative of which is equal to a.

The general solution to this differential equation is the function,

! (A1.2)

where c is an arbitrary constant.

y•(t) = dy

dt= a

y(t) = at + c

The properties and the solution methods of differential equations are presented in a number of textbooks on 1

mathematics for economists. See Chiang (1974) and Simon and Blume (1994) for two of the best such textbooks. For a more advanced treatment of differential equations, see Boyce and DiPrima (1977).

Page 2: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

A particular solution can be found using a boundary condition. For example, if we know that y at t=0 is equal to y0 (the boundary condition), then a particular solution is given by determining c as c= y0.

Another example is the differential equation,

! (A1.3)

whose solution is,

! (A1.4)

where b and c are two arbitrary constants.

A solution of a differential equation is a function y(t), which, along with its derivatives, satisfies the differential equation. A general solution is the full set of solutions of a differential equation. A particular solution requires the determination of the arbitrary constant or constants of integration.

Differential equations are classified by their order, which is none other than the order of the highest derivative that appears in the equation. For example, (A1.1) is a first-order differential equation, whereas (A1.3) is a second-order differential equation.

A differential equation is linear if the unknown function y(t) and and its derivatives are linear. Otherwise it is nonlinear.

A differential equation can be solved by a method which is known as separation of variables, if it can be written as the equation of a term which contains only y, to a term which contains only t. For example, the equation,

! (A1.5)

can be written as,

! (A1.6)

The variables are separated, and the solution is,

! (A1.7)

where c is an arbitrary constant.

Finally, a differential equation,

y••(t) = d

2ydt 2

= a

y(t) = a2t 2 + bt + c

g(y)y•= f (t)

g(y)dy = f (t)dt

g(y)dy = f (t)dt + c∫∫

!2

Page 3: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

! (A1.8)

which is equivalent to,

! (A1.9)

is called exact, if there is a function U(t,y) which satisfies,

! (A1.10)

A differential equation is exact if it constitutes exactly the total differential of a function.

A1.2 First Order Linear Differential Equations

First order linear differential equations are distinguished between equations with constant coefficients, and equations with variable coefficients.

A1.2.1 Constant Coefficients A first order linear differential equation with constant coefficients takes the form,

! (A1.11)

where a and b are given constants.

In order to find the function y(t) which satisfies (A1.11), note that,

! (A1.12)

If the differential equation (A1.11) is multiplied by ! , its left hand side is an exact differential equation, i.e the total differential of a function with respect to t.

! is called the integrating factor.

Multiplying both sides by dt, we get,

!

whose integral is,

!

where c is the constant of integration.

f (t, y) + g(t, y) dydt

= 0

f (t, y)dt + g(t, y)dy = 0

dU ≡Utdt +Uydy ≡ fdt + gdy

y•(t) + ay(t) = b

d(eat y(t))dt

= aeat y(t) + eat y•(t) = eat y

•(t) + ay(t)⎡

⎣⎢⎤⎦⎥

eat

eat

d eat y(t)( ) = beatdt

eat y(t) = eat ba+ c

!3

Page 4: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

Multiplying both sides by ! we get,

! (A1.13)

as the family of functions which satisfy the differential equation (A1.11). This family is called the general solution of (A1.11).

In order to determine the constant of integration c we need the value of the function at some point in time. For example, if we know that at the point in time t=0,

!

then we know that,

! , which implies ! .

The particular solution of the differential equation (A1.11) which satisfies ! is,

! (A1.14)

In conclusion, in order to solve a linear first-order differential equation with constant coefficients, we multiply by the integrating factor and take the integral. To calculate the constant of integration we use the value of the function at some point. The point that we use is called an initial condition or, more generally, a boundary condition.

A1.2.2 Variable Right Hand Side

If the right hand side of (A1.11) is not constant, but a known function of time, the solution method is similar. We multiply by the integrating factor and take the integral.

For example, in the differential equation,

! (A1.15)

multiplying by the integration factor and separating the variables, we get,

! (A1.16)

Taking the integral of both sides of (A1.16),

! (A1.17)

e−at

y(t) = ba+ ce−at

y(0) = y0

y0 =ba+ c c = y0 −

ba

y(0) = y0

y(t) = y0e−at + (1− e−at ) b

a=ba+ (y0 −

ba)e−at

y•(t) + ay(t) = beλt

d eat y( ) = be(a+λ )tdt

eat y(t) = ba + λ

e(a+λ )t + c

!4

Page 5: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

Dividing both sides by the integration factor, we get the solution,

! (A1.18)

(A1.18) is the family of functions satisfying(A1.15). The unknown constant c can again be determined by a boundary condition.

A1.2.3 Variable Coefficients

The general form of a first order linear differential equation is,

! (A1.19)

where a(t) and b(t) are known functions, and we seek the function y(t).

The integrating factor in this case is, ! as,

! (A1.20)

Thus, multiplying (A1.19) with this integrating factor, and taking the integral, we get,

! (A1.21)

Dividing (A1.21) by the integrating factor, we finally get,

! (A1.22)

where c is the constant of integration.(A1.22) is the general solution of (A1.19). A particular solution requires a boundary condition that will determine the unknown constant c.

Note, that it is not advised to apply the solution (A1.22) in any equation. It is simpler in many cases to multiply by the integrating factor and take the integral.

A1.2.4 Homogeneous and Non-homogeneous Differential Equations

If b=0 in (A1.11), the differential equation to be solved is called homogeneous. Otherwise, it is called non-homogeneous.

The general solution of a differential equation consists of the sum of the general solution to the relevant homogeneous differential equation, i.e setting b=0 and solving, and a particular solution to the general equation (A1.11).

y(t) = ba + λ

eλt + ce−at

y•(t) + a(t)y(t) = b(t)

e a(t )dt∫

d(y(t)e a(t )dt∫ )dt

= e a(t )dt∫ y•(t) + a(t)y(t)⎡

⎣⎢⎤⎦⎥

y(t)e a(t )dt∫ = b(t)e a(t )dt∫ dt∫ + c

y(t) = e− a(t )dt∫ b(t)e a(t )dt∫ dt∫ + e− a(t )dt∫ c

!5

Page 6: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

For example, the general solution to the homogeneous equation,

! (A1.23)

derived from (A1.11) is,

! (A1.24)

A particular solution, setting for example ! , is,

! (A1.25)

Consequently, the general solution of the non-homogeneous differential equation (A1.11) is the sum of (A1.24) and (A1.25), i.e the general solution of the relevant homogeneous differential equation, sometimes called the complementary function, plus the particular solution for a constant y, otherwise known as the particular integral.

This methodology is not as necessary for solving first order linear differential equations, but becomes very useful for differential equations of higher order than one.

In many economic applications, we are interested in the behavior of the solution of a differential equation as the independent variable, usually time, tends to infinity. The value to which the solution converges is referred to as a stationary state, or steady state, or equilibrium state.

For example, from (A1.13), which is the general solution of (A1.11), for a > 0, we get,

!

The particular integral of the differential equation (A1.11) can therefore be interpreted economically as the equilibrium state, or the steady state, which is the state towards which the variable y converges as times goes to infinity.

A1.3 Second Order Linear Differential Equations

A second order linear differential equation has the form,

! (A1.26)

where a(t), b(t), h(t) are known functions, and what is sought is the function y(t).

(A1.26) is referred to as the complete equation and in non-homogeneous. Related to (A1.26) is a homogeneous differential equation, in which h(t)=0.

y•(t) + ay(t) = 0

y(t) = ce−at

y•(t) = 0

y_=ba

limt→∞

y(t) = limt→∞

ba+ ce−at⎛

⎝⎜⎞⎠⎟=ba

y••(t) + a(t)y

•(t) + b(t)y(t) = h(t)

!6

Page 7: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

! (A1.27)

which is sometimes called the reduced equation. The full equation is non-homogeneous, while the reduced equation is homogeneous. The reduced equation is of interest because of the following two theorems.

Theorem 1: The general solution of the complete equation (A1.26) is the sum of any particular solution of the complete equation, and the general solution of the reduced equation (A1.27).

Theorem 2: Any solution y(t) of the reduced equation (A1.27) on ! can be expressed as a linear combination, ! , ! of any two particular solutions ! which are linearly independent.

A1.3.1 Homogeneous Equations with Constant Coefficients

We now examine the differential equation (A1.26), with constant coefficients, that is, a(t)=a, b(t)=b. We also assume that h(t)=0. The differential equation thus takes the form,

! (A1.28)

Inspired by the general solution of the first order linear differential equation with constant coefficients, we try the general solution,

!

with unknown constants c and r. This solution implies that,

! και !

Substituting in (A1.28) we get,

! (A1.29)

For a non zero c, our trial solution satisfies (A1.28) only if r is a root of the second order equation,

! (A1.30)

Equation (A1.30) is called the characteristic equation of (A1.28). It has two roots, which can be found from,

! (A1.31)

We distinguish between three cases:

y••(t) + a(t)y

•(t) + b(t)y(t) = 0

t0 ≤ t ≤ t1y(t) = c1y1(t) + c2y2 (t) t0 ≤ t ≤ t1 y1, y2

y••(t) + a y

•(t) + by(t) = 0

y(t) = cert

y•(t) = rcert y

••(t) = r2cert

cert (r2 + ar + b) = 0

r2 + ar + b = 0

r1,r2 =−a ± a2 − 4b

2

!7

Page 8: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

Case 1: !

In this case the roots are real and distinct. The general solution of (A1.28) takes the form,

! (A1.32)

where ! are the roots of the characteristic equation (A1.30), and ! are arbitrary constants.

Case 2: !

In the case the roots are a pair of complex conjugates,

! ,

where, ! και ! .

The general solution in this case is,

! (A1.33)

where ! are arbitrary constants.

Case 3: !

In this case the two roots are the same, and equal to -a/2. One can show that the general solution of (A1.28) in this case, takes the form,

! (A1.34)

where ! is the double root of the characteristic equation (A1.30), and ! are arbitrary constants.

A1.3.2 Non Homogeneous Equations with Constant Coefficients

We have already derived the solution of any homogeneous second order linear differential equation with constant coefficients. In order to find the solution of a non homogeneous equation, we need a particular solution of the complete equation.

If the complete equation is of the form,

! (A1.35)

then a particular solution is the constant function,

a2 > 4b

y(t) = c1er1t + c2e

r2 t

r1,r2 c1,c2

a2 < 4b

r1,r2 = − a2± i 4b − a2

2=α ± iβ

α = −a2

β = 4b − a2

2

y(t) = eα t (k1 cosβt + k2 sinβt)

k1,k2

a2 = 4b

y(t) = c1ert + c2te

rt = ert (c1 + c2t)

r = −a / 2 c1,c2

y••(t) + a y

•(t) + by(t) = h

!8

Page 9: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

!

The full solution is thus the sum of the general solution to the homogeneous equation, plus the particular solution to the complete equation.

For differential equation with variable coefficients, more advanced methods, such as the method of undetermined coefficients, and the method of variation of parameters can be utilized.

A1.4 A Pair of First Order Linear Differential Equations

We finally examine a case with extensive applications in economics, a pair of first order linear differential equations of the form,

! (A1.36)

!

where ! are given constants, and ! are given functions.

The solution of the system of differential equations (A1.36) will be two functions x(t) and y(t), that satisfy both differential equations.

The homogeneous system that corresponds to (A1.36) is given by,

! (A1.37)

!

A solution method is the method of substitution. Substituting y(t) and its derivatives in the equation determining x(t), we end up with a second order linear differential equation that contains only x(t) and its derivatives.

! (A1.38)

(A1.38) is a linear homogeneous second order differential equation, with characteristic equation,

! (A1.39)

If the roots of (A1.39) are real and distinct, the solution of (A1.38) is given by,

! (A1.40)

Solving the first equation of (A1.37) with respect to y(t), we get,

y_=hb

x•(t) = a1x(t) + b1y(t) + p(t)

y•(t) = a2x(t) + b2y(t) + g(t)

a1,a2 ,b1,b2 p(t),g(t)

x•(t) = a1x(t) + b1y(t)

y•(t) = a2x(t) + b2y(t)

x••(t) − (a1 + b2 )x

•(t) + (a1b2 − b1a2 )x(t) = 0

r2 − (a1 + b2 )r + (a1b2 − a2b1) = 0

x(t) = c1er1t + c2e

r2 t

!9

Page 10: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

!

Substituting the solution (A1.40) for x(t) and its first derivative, we get,

! (A1.41)

Consequently, the solution of the system (A1.37) consists of equations (A1.40) and (A1.41), if the roots of (A1.39) are real and distinct. We can solve the system in an analogous way if we have complex or repeated roots.

However, there is a second and more direct solution method of the homogeneous system (A1.37). Our experience with first order differential equation, suggests that we use the pair,

!

as particular solutions for (A1.37). Substituting those in (A1.37) we get,

! (A1.42) !

Dividing both equations by ! we can rewrite the system (A1.42) as,

! (A1.43)

For (A1.43) to hold, the determinant of the matrix of coefficients must be zero.

! (A1.44)

Calculating the determinant, we get a second order equation in r.

! (A1.45)

which is referred to as the characteristic equation of the system (A1.37). (A1.45) is exactly the same as (A1.39), the equation we ended up using the method of substitution.

The two roots are given by,

y(t) = 1b1

x•(t) − a1x(t)

⎛⎝

⎞⎠

y(t) = 1b1(r1 − a1)c1e

r1t + (r2 − a1)c2er2 t( )

x(t) = Aert , y(t) = Bert

rAert = a1Aert + b1Be

rt

rBert = a2Aert + b2Be

rt

ert

a1 − r b1a2 b2 − r

⎝⎜⎜

⎠⎟⎟AB

⎛⎝⎜

⎞⎠⎟=00

⎛⎝⎜

⎞⎠⎟

a1 − r b1a2 b2 − r

= 0

r2 − (a1 + b2 )r + (a1b2 − a2b1) = 0

!10

Page 11: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

! (A1.46)

Note, for future use, that,

! (A1.47) !

If the roots are real, and ! , then, the general solution of the homogeneous system (A1.37) is given by,

! (A1.48) !

where, ! are determined by boundary conditions, the roots are determined by (A1.46), and ! are determined by (A1.42) as,

! and !

The solution is exactly the same as (A1.40) and (A1.41).

In the case of complex or repeated roots, the solution is analogous.

Having found the general solution to the homogeneous system (A1.37), it remains to find a particular solution in (A1.36), using for example the method of variation of parameters. For the special case where p and g are constants, a special solution with constant x and y can be found, by solving the system of equations,

!

!

These points can be regarded as equilibrium points. Whether the system converges to equilibrium depends on whether both roots are real and smaller than zero. In this case the equilibrium is a fixed node. Where we have a positive and a negative root, the equilibrium is called a saddle point. The negative root corresponds to the predetermined variable, and the positive root corresponds to the non predetermined variable.

r1,r2 =(a1 + b2 ) ± (a1 + b2 )

2 − 4(a1b2 − a2b1)2

r1 + r2 = a1 + b2

r1r2 = a1b2 − a2b1

r1 ≠ r2

x(t) = A1er1t + A2e

r2 t

y(t) = B1er1t + B2e

r2 t

A1,A2B1,B2

B1 =r1 − a1b1

A1 B2 =r2 − a1b1

A2

a1xs + b1ys + p = 0

a2xs + b2ys + g = 0

!11

Page 12: DynMacTh Annex 1

George Alogoskoufis, Dynamic Macroeconomic Theory, 2015 Mathematical Annex 1

References

Boyce W.E. and DiPrima R.C. (1977), Elementary Differential Equations and Boundary Value Problems, New York, Wiley.

Chiang A. (1974), Fundamental Methods of Mathematical Economics, New York, McGraw Hill. Simon C.P and Blume L. (1994), Mathematics for Economists, New York, Norton.

!12