Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

Chapter 8

Differential equations

Essential reading

(For full publication details, see the introduction.)

Binmore and Davies (2002) Sections 12.1–12.4 and parts of Chapter 14.

Anthony and Biggs (1996) Chapters 27 and 28.

Further reading

Simon and Blume (1994) Sections 24.1–24.3 and Section 25.2–25.3.

Adams and Essex (2010) Sections 3.7 and 7.9, parts of Sections 17.1–17.2,
17.4–17.6.

Aims and objectives

The objectives of this chapter are as follows. 8


To see different types of differential equation and solve them using the given
methods.

To use differential equations to solve problems from economics-based subjects.


Specific learning outcomes can be found near the end of this chapter.

8.1 Introduction: What is a differential equation?


A differential equation is an equation which contains at least one derivative of an
unknown function. In this course, we will be concerned with ordinary differential
equations (or ODEs), i.e. those which involve functions of only one independent
variable.1 It is often convenient to classify ODEs according to how the highest order
derivative it contains appears in it. That is, we say that the

order of an ODE is given by the order of the highest-order derivative it contains.


1
If the differential equation involves a function with more than one independent variable, then it
would contain at least one partial derivative of the function and we would have a partial differential
equation.

303
8. Differential equations

degree of an ODE is given by the algebraic degree of the highest-order derivative


it contains.
On the whole, we will be concerned with ODEs which are first or second-order and of
the first degree.

Activity 8.1 Determine the order and degree of the following ODEs involving the
unknown function, y(x).
 2
dy d2 y
(a) =x .
dx dx2
 2 2
dy dy
(b) =x .
dx dx2
 2 2
d3 y dy
(c) 3
=x .
dx dx2

Given an ODE, we usually want to solve it. That is, we want to find the unknown
function in a form which does not involve any derivatives, and when we have found the
function in this form we call it a solution to the ODE. In general, we will find that any
given ODE has many solutions and so we get a general solution, i.e. we find the
unknown function up to some arbitrary constants that are not determined by the ODE
itself. Let’s look at a very simple example of an ODE (i.e. one that can be solved by
direct integration) to see how things work.
8
dy
Example 8.1 Solve the ODE = 2x + 1.
dx
This is a first-order ODE of degree one and it is very easy to solve because we can
just integrate both sides to see that
Z Z
dy
dx = (2x + 1) dx =⇒ y = x2 + x + c,
dx
where c is an arbitrary constant. As the independent variable is x and the dependent
variable is y, the unknown function here is y(x), this gives us

y(x) = x2 + x + c.

We call this the general solution to the ODE as any solution to the ODE will have
this form and each of these solutions arises from a different value of the arbitrary
constant, c.

In addition to an ODE, we may also be given conditions which give us extra


information about the function we are interested in. Given this information, we can find
a particular solution, i.e. a solution to the ODE that also satisfies the given conditions.

304
8.1. Introduction: What is a differential equation?

Example 8.2 Find the solution to the ODE in Example 8.1 that also satisfies the
condition y(0) = 1.

We know that all solutions to the ODE in the previous example have the form

y(x) = x2 + x + c.

If, in addition, we want a solution that satisfies the condition y(0) = 1, we can set
x = 0 in both sides of this expression and use the condition to get

y(0) = 02 + 0 + c =⇒ 1 = c.

That is, if we want to satisfy the condition y(0) = 1 as well, we must take c = 1 in
the general solution. Consequently,

y(x) = x2 + x + 1,

is the particular solution to the ODE given that y(0) = 1.

Of course, it should be clear from this example that, when we apply different conditions
to the general solution, we can get different values of c and hence different particular
solutions.

Activity 8.2 Find the particular solutions to the ODE in Example 8.1 that satisfy
the conditions (a) y(0) = 0, (b) y(0) = −1 and (c) y(2) = 7.

Indeed, we solved simple ODEs that looked like this when we considered marginal
functions in Section 5.4.1. Further, as the following example shows, we can also solve 8
simple higher-order ODEs by direct integration.

d2 y
Example 8.3 Solve the ODE = 6x + 2.
dx2
This is a second-order ODE of degree one and, once again, we can begin to solve it
by integrating both sides to see that
Z 2 Z
dy dy
2
dx = (6x + 2) dx =⇒ = 3x2 + 2x + c,
dx dx
but this does not give us a solution as we still have a derivative in our expression.
However, if we integrate both sides again, we get
Z Z
dy
dx = (3x2 + 2x + c) dx =⇒ y = x3 + x2 + cx + d,
dx
where d is another arbitrary constant. As the independent variable is x and the
dependent variable is y, the unknown function here is y(x), this gives us
y(x) = x3 + x2 + cx + d.
This is the general solution to the ODE as any solution to the ODE will have this
form and each of these solutions arises from different values of the arbitrary
constants, c and d.

305
8. Differential equations

Of course, if we find that there are several arbitrary constants in the general solution of
an ODE, such as c and d in the general solution to the second-order ODE in
Example 8.3, we will need more conditions in order to determine these constants and
hence find a particular solution.

Example 8.4 Find the particular solution to the ODE in Example 8.3 that
satisfies the conditions y(0) = 1 and y 0 (0) = 2.

We know that all solutions to the ODE in the previous example have the form

y(x) = x3 + x2 + cx + d.

If, in addition, we want a solution that satisfies the condition y(0) = 1, we can set
x = 0 in both sides of this expression and use the condition to get

y(0) = 03 + 02 + c(0) + d =⇒ 1 = d.

We also know that


y 0 (x) = 3x2 + 2x + c,
and so, if we want a solution that satisfies the condition y 0 (0) = 2, we can set x = 0
in both sides of this expression and use the condition to get

y 0 (0) = 3(02 ) + 2(0) + c =⇒ 2 = c.

Thus, we see that


y(x) = x3 + x2 + 2x + 1,
8 is the particular solution to the ODE given that y(0) = 1 and y 0 (0) = 2.

More generally, we won’t be able to solve ODEs by direct integration and so the
procedure for solving an ODE will usually involve identifying its type and applying the
relevant method. In what follows, we shall see how the form of an ODE allows us to
choose the method that will enable us to solve it in cases where direct integration can’t
be used.

8.2 First-order ODEs


In this section we will consider some methods that will allow us to solve certain
first-order ODEs of degree one. That is, certain ODEs that have the form

dy
= f (x, y),
dx

where f (x, y) is some given function of the independent variable, x, and the dependent
variable, y.

306
8.2. First-order ODEs

8.2.1 Separable first-order ODEs


A first-order ODE of degree one that can be written in the form
dy
M (x) = N (y) ,
dx
is called a separable ODE. This is because, in such cases, we have been able to
‘separate’ the variables so that all occurrences of x occur on the left-hand-side and all
occurrences of y occur on the right-hand-side. ODEs of this type can be solved by
integrating both sides to get
Z Z Z Z
dy
M (x) dx = N (y) dx =⇒ M (x) dx = N (y) dy,
dx
using the integration by substitution formula from Section 5.2.3. If we now determine
these integrals, we will find the general solution to the ODE.

dy
Example 8.5 Find the general solution to the ODE = 2x(y − 1).
dx
This ODE is separable as it can be written as
1 dy
2x = ,
y − 1 dx

with M (x) = 2x and N (y) = (y − 1)−1 . Using the method described above, we write
this as
Z Z
dy
2x dx = and determine the integrals to get x2 + c = ln |y − 1|, 8
y−1
where c is an arbitrary constant. Taking exponentials of both sides, this gives us
2 +c 2
|y − 1| = ex = ec ex .

Now, both sides of this expression are non-negative because of the modulus on the
left-hand-side and the exponentials on the right-hand-side. This means that, if we
want to remove the modulus, we must allow the possibility that y − 1 is a negative
quantity, i.e. we have
2 2
y − 1 = ± ec ex =⇒ y = 1 ± ec ex .

Then, as the independent variable is x and the dependent variable is y, the unknown
function here is y(x), so this gives us the general solution
2
y(x) = 1 + A ex ,

where A ∈ R is an arbitrary constant.2

Of course, having found the general solution to the ODE in this example, we can also
find particular solutions if we are given some conditions.
2
Here we have replaced ± ec with a new constant A ∈ R which can take any value.

307
8. Differential equations

Activity 8.3 Find the particular solutions to the ODE in Example 8.5 given the
conditions (a) y(0) = 2 and (b) y(0) = 0.

What value of y(1) will give the same particular solution as the one you found in
part (a)?

8.2.2 Linear first-order ODEs


A first-order ODE of degree one that can be written in the form
dy
+ P (x)y(x) = Q(x),
dx
is called a linear ODE. The procedure for solving such an ODE involves finding an
integrating factor, µ(x), given by
R
P (x) dx
µ(x) = e ,
R
where, here, P (x) dx is just any antiderivative of P (x). Once we have this, we
multiply both sides of the ODE by the integrating factor to get
dy
µ(x) + µ(x)P (x)y(x) = µ(x)Q(x). (8.1)
dx
Now, observe that
   
dµ d R
P (x) dx
R
P (x) dx
= e = e P (x) = µ(x)P (x),
dx dx
8
if we use the chain rule3 and so, using the product rule, we have
 
d dy dµ dy
µ(x)y(x) = µ(x) + y(x) = µ(x) + µ(x)P (x)y(x),
dx dx dx dx

which is the left-hand-side of (8.1). As such, we can write (8.1) as


  Z
d
µ(x)y(x) = µ(x)Q(x) =⇒ µ(x)y(x) = µ(x)Q(x) dx,
dx
and if we determine the integral on the right-hand-side, we can then find the general
solution to the ODE.

3
When using the chain rule here, we should find that
Z
d
P (x) dx = P (x).
dx
To see why, note that if c is an arbitrary constant and F (x) is an antiderivative of P (x), i.e. F 0 (x) = P (x),
we have
Z Z  
d d
P (x) dx = F (x) + c =⇒ P (x) dx = F (x) + c = F 0 (x) = P (x),
dx dx
as expected.

308
8.2. First-order ODEs

dy
Example 8.6 Find the general solution of the ODE x − 2y = 6.
dx
This ODE is linear as it can be written as
dy 2 6
− y= ,
dx x x
with P (x) = −2/x and Q(x) = 6/x. Using the method above, we start by finding the
integrating factor, µ(x), by determining the integral
Z Z
2
P (x) dx = − dx = −2 ln |x| + c,
x

and so we see that −2 ln x is an antiderivative of −2/x. This means that the


integrating factor is
−2
µ(x) = e−2 ln x = eln x = x−2 ,
and so we have
Z Z
µ(x)y(x) = µ(x)Q(x) dx =⇒ x y(x) = 6x−3 dx =⇒ x−2 y(x) = −3x−2 + c,
−2

where c is an arbitrary constant. As such, we find that

y(x) = −3 + cx2 ,

is the general solution to our linear ODE.

Activity 8.4 Observe that the ODE in Example 8.6 can also be written as
8
2 1 dy
= .
x y + 3 dx
Verify that the answer we found in that example is correct by solving this separable
ODE using the method in Section 8.2.1.

Let’s now consider another example where the ODE is linear, but not separable.

dy
Example 8.7 Find the general solution of the ODE = y + ex .
dx
This ODE is linear as it can be written as
dy
− y = ex ,
dx
which is linear with P (x) = −1 and Q(x) = ex . Using the method above, we start by
finding the integrating factor, µ(x), by determining the integral
Z Z
P (x) dx = −1 dx = −x + c,

309
8. Differential equations

and so we see that −x is an antiderivative of −1. This means that the integrating
factor is
µ(x) = e−x ,
and so we have
Z Z
−x
µ(x)y(x) = µ(x)Q(x) dx =⇒ e y(x) = dx =⇒ e−x y(x) = x + c,

where c is an arbitrary constant. As such, we find that

y(x) = (x + c) ex ,

is the general solution to our linear ODE.

Activity 8.5 Verify that the ODE in Example 8.7 is not separable.

8.3 Second-order ODEs


In this section we will consider a method that will allow us to solve certain second-order
ODEs where all occurrences of y and its derivatives are of degree one. In particular, we
will be concerned with such ODEs that have the form
d2 y dy
a + b + cy = f (x),
dx2 dx
where a, b and c are constants and f (x) is some given function of the independent
8 variable, x. ODEs of this form are often said to have ‘constant coefficients’ referring to
the constants multiplying y and its derivatives on the left-hand-side. The method for
solving such second-order ODEs is as follows.

8.3.1 Homogeneous second-order ODEs


If the function, f (x), on the right-hand-side of our second-order ODE with constant
coefficients is zero, i.e. if our ODE has the form

d2 y dy
a 2
+b + cy = 0,
dx dx
we say that it is homogeneous.4 To solve such an ODE, let’s suppose that any solution
must have the form
y(x) = A ekx , (8.2)
where k is a number to be determined and A is an arbitrary constant. Differentiating
this twice, we find that

dy d2 y
= Ak ekx and = Ak 2 ekx ,
dx dx2
4
Note that this is a different use of the word ‘homogeneous’ to the one in Section 5.3.4. That is, this
is an homogeneous equation whereas in Section 5.3.4 we had homogeneous functions.

310
8.3. Second-order ODEs

and substituting this into the equation we get


a(Ak 2 ekx ) + b(Ak ekx ) + c(A ekx ) = 0.
Now, we can cancel the A as it is arbitrary and the ekx as it is always non-zero, which
leaves us with the auxiliary equation
ak 2 + bk + c = 0.
If we solve the auxiliary equation, we can determine the values of k in (8.2) that yield
solutions. Of course, when solving a quadratic equation such as this, there are three
different cases that can arise, i.e. we can get:

Two real solutions: If the solutions are k = α and k = β, then we get solutions of
the form
y(x) = A eαx and y(x) = B eβx ,
where A and B are arbitrary constants. As such, we find that
y(x) = A eαx +B eβx ,
is the general solution of the second-order ODE.
One real solution: If the solution is k = α (twice), then we get solutions of the form
y(x) = A eαx and y(x) = Bx eαx ,
where A and B are arbitrary constants. As such, we find that
y(x) = (A + Bx) eαx ,
is the general solution of the second-order ODE.

No real solutions: If the solutions are k = γ ± δ −1, then, using material which is 8
beyond the scope of this course,5 we find that
 
γx
y(x) = e A cos(δx) + B sin(δx) ,

is the general solution of the second-order ODE.


Let’s illustrate these three cases by looking at some examples.

Example 8.8 Find the general solution of the ODE y 00 − y 0 − 2y = 0.

As the right-hand-side of this second-order ODE with constant coefficients is zero, it


is homogeneous. Its auxiliary equation is given by

k2 − k − 2 = 0 =⇒ (k − 2)(k + 1) = 0,

and so we have two real solutions given by k = 2 and k = −1. As such, the theory
above dictates that
y(x) = A e2x +B e−x ,
where A and B are arbitrary constants, is the general solution to this homogeneous
second-order ODE.
5
If you are interested, this case involves complex numbers which are discussed in Chapter 13 of
Binmore and Davies (2002). If you read this, you will then be able to understand the discussion of this
type of solution in Section 14.5 of Binmore and Davies (2002).

311
8. Differential equations

Example 8.9 Find the general solution of the ODE y 00 + 4y 0 + 4y = 0.

As the right-hand-side of this second-order ODE with constant coefficients is zero, it


is homogeneous. Its auxiliary equation is given by

k 2 + 4k + 4 = 0 =⇒ (k + 2)2 = 0,

and so we have one real solution given by k = −2. As such, the theory above
dictates that
y(x) = (A + Bx) e−2x ,
where A and B are arbitrary constants, is the general solution to this homogeneous
second-order ODE.

Example 8.10 Find the general solution of the ODE y 00 − 2y 0 + 2y = 0.

As the right-hand-side of this second-order ODE with constant coefficients is zero, it


is homogeneous. Its auxiliary equation is given by
√ √
k 2 −2k+2 = 0 =⇒ (k−1)2 +1 = 0 =⇒ k−1 = ± −1 =⇒ k = 1± −1,

and so we get no real solutions for k. As such, the theory above dictates that we take
γ = 1 and δ = 1, so that
 
x
y(x) = e A cos(x) + B sin(x) ,

8 where A and B are arbitrary constants, is the general solution to this homogeneous
second-order ODE.

8.3.2 Non-homogeneous second-order ODEs


If the function, f (x), on the right-hand-side of our second-order ODE with constant
coefficients is non-zero, i.e. it has the form

d2 y dy
a 2
+b + cy = f (x),
dx dx
with f (x) 6= 0, then we say that it is non-homogeneous. To solve such an ODE, we use
the following method.

We solve the corresponding homogeneous ODE, to find the function, yc (x), which is
often called the complementary function. That is, we solve

d2 yc dyc
a 2
+b + cyc = 0,
dx dx
using the auxiliary equation, as in Section 8.3.1, to find yc (x).

We then seek a function, yp (x), which is often called the particular integral, that
satisfies the non-homogeneous ODE. That is, we want to find a function, yp (x),

312
8.3. Second-order ODEs

that satisfies
d2 y p dyp
a 2
+b + cyp = f (x),
dx dx
and we will see how to do this in a moment.
Then, having found the complementary function and a particular integral, the
general solution to our non-homogeneous ODE is given by
y(x) = yc (x) + yp (x).
That is, the general solution we seek, y(x), is the sum of the two functions we have
found.
In particular, observe that the complementary function will contain the two arbitrary
constants that make y(x) a general solution whereas the particular integral guarantees
that y(x) will give us the correct right-hand-side, i.e. f (x), when we substitute it into
the ODE.

Finding particular integrals

To find the particular integral for a given second-order ODE, we look at f (x) and start
by taking yp (x) to be a general function of the same form. For instance, if we find that

f (x) = a for some constant a we take yp (x) = α.


f (x) = a + bx for some constants a and b we take yp (x) = α + βx.
f (x) = a + bx + cx2 for some a, b and c we take yp (x) = α + βx + γx2 .
et cetera. 8
f (x) = a erx for some constant a we take yp (x) = α erx .
f (x) = (a + bx) erx for some constants a, b and r we take yp (x) = (α + βx) erx .
et cetera.
f (x) = a sin(rx) for some constants a and r we take yp (x) = α sin(rx) + β cos(rx).
f (x) = a cos(rx) for some constants a and r we take yp (x) = α sin(rx) + β cos(rx).
et cetera.
Then, by substituting the appropriate general function into our non-homogeneous
second-order ODE, we can find the values of the relevant ‘Greek letters’ and this will
then give us the specific function, yp (x), that will play the role of the particular integral
in our solution.

Applying the method

Let’s consider an example to see how we would go about determining the particular
integral in some of the cases listed above and how we would use this to find the general
solution of a non-homogeneous second-order ODE.

313
8. Differential equations

Example 8.11 In Example 8.8 we saw that the general solution to the
homogeneous second-order ODE y 00 − y 0 − 2y = 0 was given by

y(x) = A e2x +B e−x ,

where A and B are arbitrary constants. Find the general solution to the
non-homogeneous second-order ODE

y 00 − y 0 − 2y = f (x),

when (a) f (x) = 8, (b) f (x) = 6x and (c) f (x) = 20 e3x .

We know that the complementary function, yc (x), for this non-homogeneous


second-order ODE is given by the general solution to the homogeneous second-order
ODE. As such, we know that

yc (x) = A e2x +B e−x ,

where A and B are arbitrary constants. Our first task is to find the particular
integral, yp (x), for each choice of f (x). Once we have this, we can then find the
general solution, y(x), of the relevant non-homogeneous second-order ODE by
simply taking y(x) = yc (x) + yp (x).

For (a), we have f (x) = 8 and so we take yp (x) = α where α is a constant that has
to be determined. To find α, we note that yp0 (x) and yp00 (x) are both zero which
means that substituting them into the non-homogeneous second-order ODE, we get

0 − 0 − 2α = 8 =⇒ α = −4.
8 Thus, yp (x) = −4 is the sought after particular integral and the general solution to
our non-homogeneous second-order ODE is

y(x) = A e2x +B e−x −4,

using y(x) = yc (x) + yp (x).

For (b), we have f (x) = 6x and so we take yp (x) = α + βx where α and β are
constants that have to be determined. To find α and β, we note that yp0 (x) = β and
yp00 (x) = 0 which means that substituting them into the non-homogeneous
second-order ODE yields

0 − β − 2(α + βx) = 6x =⇒ −2βx − (2α + β) = 6x.

Now these two expressions must be the same and so, looking at the coefficient of x
on both sides, we see that β must be −3. Similarly, looking at the constant term on
both sides we see that −2α − β must be zero, so as β = −3, this means that α must
be 3/2. Thus, yp (x) = 32 − 3x is the sought after particular integral and the general
solution to our non-homogeneous second-order ODE is
3
y(x) = A e2x +B e−x + − 3x,
2
using y(x) = yc (x) + yp (x).

314
8.3. Second-order ODEs

For (c), we have f (x) = 20 e3x and so we take yp (x) = α e3x where α is a constant
that has to be determined. To find α, we note that yp0 (x) = 3α e3x and yp00 (t) = 9α e3x
which means that substituting them into the non-homogeneous second-order ODE
yields

9α e3x −3α e3x −2(α e3x ) = 20 e3x =⇒ 4α e3x = 20 e3x =⇒ α = 5.

Thus, yp (x) = 5 e3x is the sought after particular integral and the general solution to
our non-homogeneous second-order ODE is

y(x) = A e2x +B e−x +5 e3x ,

using y(x) = yc (x) + yp (x).

A complication

Although we won’t spend much time on such things, observe that if the function, f (x),
in our non-homogeneous second-order ODE prompts us to try a particular integral,
yp (x), that is ‘part’ of the complementary function — i.e. we can find values of the
arbitrary constants in yc (x) that make yc (x) = yp (x) — we have to be more subtle when
we choose our particular integral. However, this subtlety usually involves doing nothing
more than multiplying what we’d normally choose to be our particular integral by x.
Let’s return to our previous example to see how this works.

Example 8.12 Following on from Example 8.11, find the general solution to the
non-homogeneous second-order ODE
8
00 0
y − y − 2y = f (x),

when f (x) = 18 e2x .

We know that the complementary function, yc (x), for this non-homogeneous


second-order ODE is given by

yc (x) = A e2x +B e−x ,

where A and B are arbitrary constants. Our task is to find the particular integral,
yp (x), in the case where f (x) = 18 e2x so that we can deduce the relevant general
solution.

Note: Here we would normally try yp (x) = α e2x but this is ‘part’ of the
complementary function since, taking A = α and B = 0, we have yp (x) = yc (x)! To
see why this is a problem, let’s try and find α. Here yp0 (x) = 2α e2x and
yp00 (x) = 4α e2x which means that substituting them into the non-homogeneous
second-order ODE, we get

4α e2x −2α e2x −2(α e2x ) = 18 e2x .

But now, the left-hand-side turns out to be zero,6 meaning that this equation for α
has no solutions! That is, we can’t determine α if we use this general form for yp (x)!

315
8. Differential equations

Thus, the particular integral in this case can’t have the general form yp (x) = α e2x as
we can’t find an α that will make it work.

So, following the advice above, we try the next best thing which is our original
choice multiplied by x. That is, we try yp (x) = αx e2x where α is a constant that has
to be determined. To find α, we note that writing yp (x) as (αx)(e2x ) we can use the
product rule to get

yp0 (x) = (α)(e2x ) + (αx)(2 e2x ) = (α + 2αx)(e2x ),

and
yp00 (x) = (2α)(e2x ) + (α + 2αx)(2 e2x ) = (4α + 4αx)(e2x ).
So, substituting these into the non-homogeneous second-order ODE, we get

(4α + 4αx)(e2x ) − (α + 2αx)(e2x ) − 2(αx)(e2x ) = 18 e2x =⇒ 3α e2x = 18 e2x ,

which means that α can now be determined and is actually equal to 6. Thus,
yp (x) = 6x e2x is the sought after particular integral and so the general solution to
our non-homogeneous second-order ODE is

y(x) = A e2x +B e−x +6x e2x ,

using y(x) = yc (x) + yp (x).

8
8.4 Systems of first-order ODEs

We now turn our attention to systems of first-order ODEs. For instance, we may be
asked to find the functions y1 (x) and y2 (x) that simultaneously satisfy the ODEs

dy1 dy2
= f1 (y1 , y2 , x) and = f2 (y1 , y2 , x),
dx dx

where we are given the functions f1 and f2 . Generally, y1 and y2 will appear on the
right-hand-sides of both these first-order ODEs and, in such cases, we say that they are
coupled as we can’t solve one of them without using information contained in the other.
We shall look at two procedures for solving such systems of first-order ODEs, the first
will involve rewriting the system of first-order ODEs as a second-order ODE which can
then be solved using the method outlined in the previous section whereas the second will
involve writing the system of first-order ODEs in matrix form and using diagonalisation.

6
Actually, this shouldn’t be a surprise since, taking A = α and B = 0 in our complementary function,
we still have a solution to the homogeneous second-order ODE and so putting this into the left-hand-side
must yield zero!

316
8.4. Systems of first-order ODEs

8.4.1 Solving by reduction to a second-order ODE


A simple system of coupled first-order ODEs will only involve linear combinations of
y1 (x) and y2 (x) on the right-hand-side, i.e. it will have the form
dy1 dy2
= ay1 (x) + by2 (x) and = cy1 (x) + dy2 (x),
dx dx
for some constants a, b, c and d. Our first procedure for solving this involves
differentiating the first equation (say) with respect to x so that we get
d2 y1 dy1 dy2
= a + b ,
dx2 dx dx
and then, using the second equation, we find that
d2 y1 dy1
2
=a + b (cy1 (x) + dy2 (x)) ,
dx dx
which means that we have
d2 y1 dy1
2
−a − bcy1 (x) − bdy2 (x) = 0.
dx dx
Now, the first equation can be rearranged to give
dy1
by2 (x) = − ay1 (x),
dx
and so, if we substitute this in, we end up with
d2 y 1 dy1
− (a + d) + (ad − bc)y1 (x) = 0,
dx2 dx
which is an homogeneous second-order ODE with constant coefficients which we can 8
solve using the method in Section 8.3.1 to find y1 (x). Of course, having done this, we
can then use the first of the original equations (say) to find y2 (x).
Let’s look at an example to see how this works.

Example 8.13 Use a second-order differential equation to find the functions y1 (x)
and y2 (x) that satisfy the system of first-order ODEs given by

dy1 dy2
= 7y1 − 15y2 and = 2y1 − 4y2 ,
dx dx
with the conditions y1 (0) = 2 and y2 (0) = 1.

We will solve this by rewriting this system as a second-order ODE in y1 (x). To do


this we note that, rearranging the first ODE gives us
 
1 dy1
y2 = 7y1 − , (8.3)
15 dx

and if we differentiate this with respect to x we get


 
dy2 1 dy1 d2 y1
= 7 − .
dx 15 dx dx2

317
8. Differential equations

Consequently, if we substitute these two expressions into the second ODE, we get
   
1 dy1 d2 y1 4 dy1
7 − = 2y1 − 7y1 − ,
15 dx dx2 15 dx

and this can be rearranged to get

d2 y1 dy1
2
−3 + 2y1 = 0,
dx dx
which is our sought after second-order ODE in y1 (x). As it is an homogeneous
second-order ODE with constant coefficients, this can be solved using the method in
Section 8.3.1. The auxiliary equation is

k 2 − 3k + 2 = 0 =⇒ (k − 1)(k − 2) = 0,

which has two real solutions given by k = 1 and k = 2 which means that the general
solution for y1 (x) is
y1 (x) = A ex +B e2x ,
for arbitrary constants A and B. To find the general solution for y2 (x), we note that
using (8.3) and the fact that

y10 (x) = A ex +2B e2x ,

we get
   
1  x 2x
  x 2x
 1 x 2x
y2 (x) = 7 A e +B e − A e +2B e = 6A e +5B e ,
15 15
8
in terms of the same arbitrary constants A and B as before. Thus, the general
solution to this system of first-order ODEs is
2 B
y1 (x) = A ex +B e2x and y2 (x) = A ex + e2x ,
5 3
for arbitrary constants A and B.

However, we are also given the conditions y1 (0) = 2 and y2 (0) = 1 which imply that

2 B
2=A+B and 1 = A + .
5 3
Solving these two equations simultaneously, say by multiplying the first equation by
five and the second equation by fifteen so that we can subtract one from the other to
see that A = 5 and then, the first equation gives B = −3. Consequently, we find that

y1 (x) = 5 ex −3 e2x and y2 (x) = 2 ex − e2x ,

is the particular solution of this system of first-order ODEs given the conditions
y1 (0) = 2 and y2 (0) = 1.

318
8.4. Systems of first-order ODEs

Activity 8.6 Use a second-order differential equation to find the functions y1 (x)
and y2 (x) that satisfy the system of first-order ODEs given by

dy1 dy2
= 2y1 + 4y2 and = 3y1 + 3y2 ,
dx dx
with the conditions y1 (0) = 5 and y2 (0) = −2.

8.4.2 Solving by using diagonalisation


If we consider our simple system of coupled first-order ODEs again, i.e.
y10 (x) = ay1 (x) + by2 (x) and y20 (x) = cy1 (x) + dy2 (x),
for some constants a, b, c and d. Our second procedure for solving this involves writing
this in matrix form as  0    
y1 (x) a b y1 (x)
= ,
y20 (x) c d y2 (x)
which we can write as y 0 = Ay if we take the matrix A and the vectors y 0 and y to be
   0   
a b 0 y1 (x) y1 (x)
A= , y = and y = .
c d y20 (x) y2 (x)
Now, as in Section 7.3, let’s assume that we can diagonalise the matrix A, that is we can
find an invertible matrix P and a diagonal matrix D such that P−1 AP = D. This means
that we can introduce two new functions u1 (x) and u2 (x) to form the vector u where
 
u1 (x)
u=
u2 (x)
and y = Pu, 8
the idea being that, if we can find u, we can use this to find y . How does this help?
Well, if we have
y = Pu =⇒ y 0 = (Pu)0 = Pu 0 ,
(see Activity 8.7) and so we have
y 0 = Ay =⇒ Pu 0 = APu =⇒ u 0 = P−1 APu =⇒ u 0 = Du,
and, as D is diagonal, these equations are easier to solve. To see why consider that
 0    
u1 (x) λ1 0 u1 (x)
= ,
u02 (x) 0 λ2 u2 (x)
now gives us two uncoupled first-order ODEs, namely
u01 (x) = λ1 u1 (x) and u02 (x) = λ2 u2 (x),
which are simple separable ODEs that give us
u1 (x) = A eλ1 x u2 (x) = B eλ2 x ,
for arbitrary constants A and B (see Activity 8.8). Of course, now that we have found
these functions, we can write down u and find y by using y = Pu.

319
8. Differential equations

Activity 8.7 Suppose that P is the matrix


 
a b
P= ,
c d

and that u is the vector given above. Show that (Pu)0 = Pu 0 .

Activity 8.8 Show that any separable first-order ODE of the form

f 0 (x) = λf (x),

always has a solution of the form

f (x) = A eλx ,

for some arbitrary constant A.

Let’s look at an example to see how this works.

Example 8.14 Use diagonalisation to find the functions y1 (x) and y2 (x) that
satisfy the system of first-order ODEs given by
dy1 dy2
= 7y1 − 15y2 and = 2y1 − 4y2 ,
dx dx
with the conditions y1 (0) = 2 and y2 (0) = 1.

8 This system of first-order ODEs can be written as


 0    
y1 (x) 7 −15 y1 (x)
= or y 0 = Ay ,
y20 (x) 2 −4 y2 (x)

and, as we saw in Activity 7.42, we can diagonalise the matrix A by taking


   
5 3 1 0
P= and D = ,
2 1 0 2

so that P−1 AP = D. We now set y = Pu so that we have

y 0 = Ay =⇒ Pu 0 = APu =⇒ u 0 = P−1 APu =⇒ u 0 = Du,

and this gives us  0    


u1 (x) 1 0 u1 (x)
= .
u02 (x) 0 2 u2 (x)
From this we get the first-order ODEs

u01 (x) = u1 (x) and u02 = 2u2 (x),

which, following Activity 8.8, give us the general solutions

u1 (x) = A ex and u2 (x) = B e2x ,

320
8.5. Applications of ODEs

for some arbitrary constants A and B. Then, using y = Pu, we then get
      
y1 (x) 5 3 A ex 5A ex +3B e2x
= = ,
y2 (x) 2 1 B e2x 2A ex +B e2x

and so the general solution to this system of first-order ODEs is

y1 (x) = 5A ex +3B e2x and y2 (x) = 2A ex +B e2x ,

for some arbitrary constants A and B.

However, we are also given the conditions y1 (0) = 2 and y2 (0) = 1 which imply that

2 = 5A + 3B and 1 = 2A + B.

Solving these two equations simultaneously, say by multiplying the second equation
by three and subtracting one from the other, we see that A = 1 and then, the second
equation gives B = −1. Consequently, we find that

y1 (x) = 5 ex −3 e2x and y2 (x) = 2 ex − e2x ,

is the particular solution of this system of first-order ODEs given the conditions
y1 (0) = 2 and y2 (0) = 1.

Notice that this agrees with what we found in Example 8.13.

Activity 8.9 Use diagonalisation to find the functions y1 (x) and y2 (x) that satisfy
the system of first-order ODEs given by
8
dy1 dy2
= 2y1 + 4y2 and = 3y1 + 3y2 ,
dx dx
with the conditions y1 (0) = 5 and y2 (0) = −2.
(Hint: Refer to Activity 7.43 for a diagonalisation.)

8.5 Applications of ODEs


Differential equations are used widely in economics-based subjects and, in Section 4.4.1,
we saw a very simple application when we considered marginal functions. Here, we will
consider a few more examples that are a bit more sophisticated.

8.5.1 Determining demand functions from elasticities


In Section 3.3.3, we saw that the elasticity of demand, ε(p), is defined by
p dq
ε(p) = − ,
q dp
where q = q D (p) is the demand function. If we know the elasticity of demand, we can
use this and our knowledge of ODEs to determine the demand function.

321
8. Differential equations

Example 8.15 Suppose that the elasticity of demand is a constant, i.e. ε(p) = r for
all p and r is a positive constant. Find the demand function if q D (1) = 2.

Using the definition of the elasticity of demand, this gives us


p dq 1 dq r
− =r =⇒ =− ,
q dp q dp p
and so this is a separable first-order ODE. Solving this using the method in
Section 8.2.1, we write this as
Z Z  
1 r
dq = − dp and determine the integrals to get ln |q| = −r ln |p| + c,
q p

where c is an arbitrary constant. Then, rewriting this as

ln |q| = ln |p|−r + c,

we can take exponentials of both sides, to get


−r +c
q = eln |p| = ec p−r ,

where we can remove the modulus signs since, economically, q and p are both
positive. Then, using the fact that q D (1) = 2, we see that ec = 2 and so
2
q = q D (p) = ,
pr

8 is the sought after demand function.

Activity 8.10 How does the demand function found in Example 8.15 behave as
p → 0+ and as p → ∞?

8.5.2 Continuous price adjustment


Suppose that the price of some commodity varies continuously with time and that its
initial price is not equal to its equilibrium price. We might expect that, as time
progresses, the price of the commodity will tend to its equilibrium price but to be sure,
we need to have a model of how the price of the commodity is varying with time. One
such model involves looking at how the rate of change of the price of the commodity is
related to the excess of demand over supply.
Suppose that the price of the commodity as a function of time is p(t) and that the
market for this commodity is governed by the demand function, q D (p), and the supply
function, q S (p). This means that, at any time, t, as the price is p(t), the quantity being
demanded is given by q D (p(t)) and the quantity being supplied is given by q S (p(t)). As
such, we can define the excess of demand over supply to be the function of p(t) given by
∆(p(t)) = q D (p(t)) − q S (p(t)),
i.e. the difference between these two quantities. Clearly, this means that if p(t) is such

322
8.5. Applications of ODEs

that:

∆(p(t)) > 0, demand outstrips supply and so the price should rise, i.e. p0 (t) > 0.

∆(p(t)) = 0, demand equals supply and we should have equilibrium, i.e. p0 (t) = 0.

∆(p(t)) < 0, supply outstrips demand and so the price should fall, i.e. p0 (t) < 0.
This suggests that the rate of change of the market price with time, i.e. p0 (t), should be
given by some function f of the excess of demand over supply, ∆(p(t)), i.e. we have a
model where
dp
= f (∆(p(t))) with ∆(p(t)) = q D (p(t)) − q S (p(t)).
dt
Then, by solving this first-order ODE, we can find out how the market price varies with
time and hence assess the stability of the market by considering what it does as t → ∞.
To see how this works, let’s consider an example.

Example 8.16 A market is governed by the demand and supply functions

q D (p) = 5 − 2p and q S (p) = 3p − 1,

respectively. If the rate of change of the market price is given by three times the
excess of demand over supply, find the ODE that describes how p(t) changes with
time.

We start by calculating the excess of demand over supply which is given by

∆(p(t)) = q D (p(t)) − q S (p(t)) = [5 − 2p(t)] − [3p(t) − 1] = 6 − 5p(t). 8


We then know that the rate of change of demand over supply is given by three times
the excess, i.e.
 
dp 6
= 3∆(p(t)) = 3[6 − 5p(t)] = −15 p(t) − .
dt 5

This is a separable first-order ODE and we can easily solve it using the method in
Section 8.2.1.

Activity 8.11 Solve the separable first-order ODE found in Example 8.16 and use
it to determine how the market price changes over time if the initial price is p(0).
How does the market price behave in the long-term?

8.5.3 Market trends


In some markets, the equilibrium price will change with time and so it is useful for
consumers to try and anticipate trends. That is, the consumer will keep an eye on the
current equilibrium price, but they will also look at the rate at which the price is rising
or falling and whether this rate of change is speeding up or slowing down. We can
represent these three considerations mathematically by using p(t), p0 (t) and p00 (t)

323
8. Differential equations

respectively and, by considering how these affect the quantity being supplied or
demanded, we can model how the price itself is varying with time by using an ODE.
Let’s look at an example.

Example 8.17 Suppose that the demand for a certain commodity is given by

dp d2 p
q D (p) = 9 − 2p + 6 −2 2,
dt dt
and that supply is determined by

dp d2 p
q S (p) = −3 + 4p − − 2.
dt dt
Find the ODE that determines the equilibrium price at any time t ≥ 0.

Here we have linear supply and demand functions which have been modified to take
a trend into account. To find the equilibrium price at any time t ≥ 0, we need to
determine the function, p(t), that makes the amount supplied equal to the amount
demanded, i.e.

dp d2 p dp d2 p
−3 + 4p(t) − − 2 = 9 − 2p(t) + 6 − 2 2 .
dt dt dt dt
But, rearranging this, we get the non-homogeneous second-order ODE with constant
coefficients given by
d2 p dp
2
− 7 + 6p(t) = 12,
dt dt
8 which we can solve using the method in Section 8.3.2.

Activity 8.12 Solve the second-order ODE found in Example 8.17 and use it to
determine how the equilibrium price changes if p(0) = 7 and p0 (0) = 15. How does
this equilibrium price behave in the long-term?

Learning outcomes
At the end of this chapter and having completed the relevant reading and activities, you
should be able to:

identify and solve separable and linear first-order ODEs;

identify and solve homogeneous and non-homogeneous second-order ODEs with


constant coefficients;

solve coupled systems of first-order ODEs;

solve problems from economics-based subjects that involve applications of ODEs.

324
8.5. Solutions to activities

Solutions to activities
Solution to activity 8.1
Looking at the given ODEs, we see that:

(a) is second-order of first degree,

(b) is second-order of second degree, and

(c) is third-order of first degree.


Here we find the highest order derivative to determine the order and then the algebraic
degree (or ‘power’) of this derivative determines the degree.

Solution to activity 8.2


We have the general solution
y(x) = x2 + x + c,
and we want to find the particular solutions corresponding to:

y(0) = 0. So, setting x = 0 in both sides of this expression and using the condition,
we get
y(0) = 02 + 0 + c =⇒ 0 = c,
which means that we must take c = 0 in the general solution to see that

y(x) = x2 + x,

is the particular solution to the ODE given that y(0) = 0.


8
y(0) = −1. So, setting x = 0 in both sides of this expression and using the
condition, we get
y(0) = 02 + 0 + c =⇒ −1 = c,
which means that we must take c = −1 in the general solution to see that

y(x) = x2 + x − 1,

is the particular solution to the ODE given that y(0) = −1.

y(2) = 7. So, setting x = 2 in both sides of this expression and using the condition,
we get
y(2) = 22 + 2 + c =⇒ 7 = 6 + c,
which means that we must take c = 1 in the general solution to see that

y(x) = x2 + x + 1,

is the particular solution to the ODE given that y(2) = 7. Observe that this is the
same particular solution as the one we found with y(0) = 1 in Example 8.2 but that
it arises from a condition that specifies information about y(x) at a different value
of x.

325
8. Differential equations

Solution to activity 8.3


We have the general solution
2
y(x) = 1 + A ex ,
and we want to find the particular solutions corresponding to:

y(0) = 2. So, setting x = 0 in both sides of this expression and using the condition,
we get
y(0) = 1 + A e0 =⇒ 2 = 1 + A,
which means that we must take A = 1 in the general solution to see that
2
y(x) = 1 + ex ,

is the particular solution to the ODE given that y(0) = 2.

y(0) = 0. So, setting x = 0 in both sides of this expression and using the condition,
we get
y(0) = 1 + A e0 =⇒ 0 = 1 + A,
which means that we must take A = −1 in the general solution to see that
2
y(x) = 1 − ex ,

is the particular solution to the ODE given that y(0) = 0.


If we want a value of y(1) that will give us the same particular solution as the one found
in (a), i.e.
8 2
y(x) = 1 + ex ,
we put x = 1 into both sides of this expression to get

y(1) = 1 + e1 = 1 + e .

That is, the condition y(1) = 1 + e gives us the same particular solution as the one we
found in (a).

Solution to activity 8.4


Here we have to solve the separable first-order ODE

2 1 dy
= ,
x y + 3 dx

with M (x) = 2/x and N (y) = (y + 3)−1 . Using the method in Section 8.2.1, we write
this as
Z Z
2 dy
dx = and determine the integrals to get 2 ln |x| + c = ln |y + 3|,
x y+3

where c is an arbitrary constant. Taking exponentials of both sides we get


2
|y + 3| = e2 ln |x|+c = ec eln |x| = ec |x|2 .

326
8.5. Solutions to activities

Now, |x|2 = x2 and removing the modulus on the left-hand-side, we get

y + 3 = ± ec x 2 =⇒ y = −3 ± ec x2 ,

and so, as before, the general solution is

y(x) = −3 + Ax2 ,

where A ∈ R is an arbitrary constant.

Solution to activity 8.5


The given ODE can be left as it is or rearranged to give
1 dy
= 1,
y + ex dx
but, either way, it is not separable because we can’t ‘separate’ the variables.

Solution to activity 8.6


We will solve this by rewriting this system as a second-order ODE in y1 (x). To do this
we note that, rearranging the first ODE gives us
 
1 dy1
y2 = − 2y1 , (8.4)
4 dx
and if we differentiate this with respect to x we get
 
dy2 1 d2 y1 dy1
= −2 .
dx 4 dx2 dx 8
Consequently, if we substitute these two expressions into the second ODE, we get
   
1 d2 y1 dy1 3 dy1
−2 = 3y1 + − 2y1 ,
4 dx2 dx 4 dx
and this can be rearranged to get
d2 y1 dy1
2
−5 − 6y1 = 0,
dx dx
which is our sought after second-order ODE in y1 (x). As it is an homogeneous
second-order ODE with constant coefficients, this can be solved using the method in
Section 8.3.1. The auxiliary equation is

k 2 − 5k − 6 = 0 =⇒ (k + 1)(k − 6) = 0,

which has two real solutions given by k = −1 and k = 6 which means that the general
solution for y1 (x) is
y1 (x) = A e−x +B e6x ,
for arbitrary constants A and B. To find the general solution for y2 (x), we note that
using (8.4) and the fact that

y10 (x) = −A e−x +6B e6x ,

327
8. Differential equations

we get
   
1     1
y2 (x) = −A e−x +6B e6x − 2 A e−x +B e6x = − 3A e −x
+4B e 6x
,
4 4
in terms of the same arbitrary constants A and B as before. Thus, the general solution
to this system of first-order ODEs is
3
y1 (x) = A e−x +B e6x and y2 (x) = − A e−x +B e6x ,
4
for arbitrary constants A and B.

However, we are also given the conditions y1 (0) = 5 and y2 (0) = −2 which imply that
3
5=A+B and − 2 = − A + B.
4
Solving these two equations simultaneously, say by subtracting one from the other, we
see that 7 = 7A/4 which gives A = 4 and then, the first equation gives B = 1.
Consequently, we find that

y1 (x) = 4 e−x + e6x and y2 (x) = −3 e−x + e6x ,

is the particular solution of this system of first-order ODEs given the conditions
y1 (0) = 5 and y2 (0) = −2.

Solution to activity 8.7


We have     
a b u1 (x) au1 (x) + bu2 (x)
8 Pu =
c d u2 (x)
=
cu1 (x) + du2 (x)
,

and, by definition, (Pu)0 is the what we get from differentiating both of the entries in
this vector, i.e.
   0 
0 [au1 (x) + bu2 (x)]0 au1 (x) + bu02 (x)
(Pu) = = .
[cu1 (x) + du2 (x)]0 cu01 (x) + du02 (x)
However, we can also see that
  0   0 
0 a b u1 (x) au1 (x) + bu02 (x)
Pu = = ,
c d u02 (x) cu01 (x) + du02 (x)
and, putting these two results together, we see that
 0 
0 au1 (x) + bu02 (x)
(Pu) = = Pu 0 ,
cu01 (x) + du02 (x)
as required.

Solution to activity 8.8


To solve the separable first-order ODE
Z Z
df df
= λf (x) we write it as = λ dx,
dx f

328
8.5. Solutions to activities

and determine the integrals to get

ln |f | = λx + c =⇒ |f | = eλx+c = ec eλx .

Now, we remove the modulus bars and compensate for this loss by replacing ec (which
must be positive) with the arbitrary constant A (which can be negative), to get

f (x) = A eλx ,

which is the general solution.

Solution to activity 8.9


The system of first-order ODEs can be written as
 0    
y1 (x) 2 4 y1 (x)
= or y 0 = Ay ,
y20 (x) 3 3 y2 (x)

and, as we saw in Activity 7.43, we can diagonalise the matrix A by taking


   
4 1 −1 0
P= and D = ,
−3 1 0 6

so that P−1 AP = D. We now set y = Pu so that we have

y 0 = Ay =⇒ Pu 0 = APu =⇒ u 0 = P−1 APu =⇒ u 0 = Du,

and this gives us  0    


u1 (x) −1 0 u1 (x) 8
= .
u02 (x) 0 6 u2 (x)
From this we get the first-order ODEs

u01 (x) = −u1 (x) and u02 = 6u2 (x),

which, following Activity 8.8, give us the general solutions

u1 (x) = A e−x and u2 (x) = B e6x ,

for some arbitrary constants A and B. Then, using y = Pu, we then get
     −x   
y1 (x) 4 1 Ae 4A e−x +B e6x
= = ,
y2 (x) −3 1 B e6x −3A e−x +B e6x

and so the general solution to this system of first-order ODEs is

y1 (x) = 4A e−x +B e6x and y2 (x) = −3A e−x +B e6x ,

for some arbitrary constants A and B.

However, we are also given the conditions y1 (0) = 5 and y2 (0) = −2 which imply that

5 = 4A + B and − 2 = −3A + B.

329
8. Differential equations

Solving these two equations simultaneously, say by subtracting one from the other, we
see that A = 1 and then, the first equation gives B = 1. Consequently, we find that

y1 (x) = 4 e−x + e6x and y2 (x) = −3 e−x + e6x ,

is the particular solution of this system of first-order ODEs given the conditions
y1 (0) = 5 and y2 (0) = −2.

Notice that this agrees with what we found in Activity 8.6.

Solution to activity 8.10


In Example 8.15, we found that q D (p) = 2/pr where r is a positive constant. As such,
we can see that q D (p) → ∞ as p → 0+ and q D (p) → 0 as p → ∞.

Solution to activity 8.11


Using the method in Section 8.2.1, we write the ODE as
Z Z
dp 6
= (−15) dt and determine the integrals to get ln p − = −15t + c,
p − 65 5

where c is an arbitrary constant. Taking exponentials of both sides, this gives us




p − 6 = e−15t+c = ec e−15t .
5

Now, we remove the modulus bars and compensate for this loss by replacing ec (which
must be positive) with the arbitrary constant A (which can be negative), to get
8 6
p(t) = + A e−15t ,
5
which is the general solution. Then, given that the initial price is p(0), we see that
6 6
p(0) = + A e0 =⇒ A = p(0) − ,
5 5
and so, we have the particular solution
 
6 6 −15t
p(t) = + p(0) − e ,
5 5

which tells us how the market price changes over time if the initial price is p(0). In
particular, if we have a p(0) such that:

p(0) > 6/5, since e−15t → 0 as t → ∞, p(t) will decrease to 6/5.

p(0) = 6/5, we find that p(t) = 6/5 for all t ≥ 0.

p(0) < 6/5, since e−15t → 0 as t → ∞, p(t) will increase to 6/5.


Indeed, as you should be able to verify, 6/5 is the equilibrium price for this market and
so, in this case, regardless of the choice of p(0), the market is either in equilibrium or
tends to equilibrium in the long-term.

330
8.5. Solutions to activities

Solution to activity 8.12


To solve the non-homogeneous second-order ODE with constant coefficients given by
d2 p dp
2
− 7 + 6p(t) = 12,
dt dt
we note that:

The corresponding homogeneous second-order ODE is


d2 p dp
2
− 7 + 6p(t) = 0,
dt dt
and so the auxiliary equation is
k 2 − 7k + 6 = 0 =⇒ (k − 1)(k − 6) = 0,
which has two real solutions given by k = 1 and k = 6. Consequently, the
complementary function for p(t) is
p(t) = A et +B e6t ,
where A and B are arbitrary constants.
The right-hand-side is a constant and this suggests we try a particular integral of
the form p(t) = α. We differentiate this twice to get p0 (t) = 0 and p00 (t) = 0 so that,
on substituting these into our equation, we get
6α = 12 =⇒ α = 2.
Consequently, we see that p(t) = 2 is the particular integral for p(t).
8
The general solution is then given by the sum of its complementary function and
its particular integral, i.e. we have
p(t) = A et +B e6t +2,
where A and B are arbitrary constants.
Then given the initial condition p(0) = 7 we have
7=A+B+2 =⇒ A + B = 5,
and since
p0 (t) = A et +6B e6t ,
the other initial condition, p0 (0) = 15, gives us
15 = A + 6B.
Solving these equations, say by subtracting one from the other, we get 5B = 10 which
gives us B = 2 and so, from the first equation, A = 3. Consequently, the particular
solution we seek is
p(t) = 3 et +2 e6t +2,
and this describes how the equilibrium price changes with time. Indeed, in the
long-term, as both 3 et and 2 e6t tend to infinity as t → ∞, we see that p(t) → ∞ too.

331
8. Differential equations

Exercises
Exercise 8.1
Find the general solution of the ODE
dy xy √
+ = 1 + x2 .
dx 1 + x2
What is the particular solution if y(0) = 1?

Exercise 8.2
Use the substitution w(t) = y 0 (t) to show that the ODE
d2 y 3 dy
− = −3.
dt2 t dt
can be written as a linear ODE in terms of w(t). Solve this linear ODE for w(t) and
hence find the general solution of the original ODE.

Exercise 8.3
Find the particular solution of the ODE

y 00 (t) − 5y 0 (t) + 6y(t) = 10 sin t,

given that y(0) = 0 and y 0 (0) = 1.

Exercise 8.4
8 The functions f (t) and g(t) are related by the first-order ODEs

f 0 (t) = 3f (t) − g(t) and g 0 (t) = 3g(t) − f (t).

If f (0) = 2 and g(0) = 0, use a second-order differential equation to find these functions.

Exercise 8.5
The elasticity of demand for a good is given by
2p2
ε(p) = ,
p2 + 1
and q = 4 when p = 1. Find the demand function, q D (p).

Solutions to exercises
Solution to exercise 8.1
We solve this linear first-order ODE using the method in Section 8.2.2. Here
P (x) = x/(1 + x2 ) and we start by seeing that the integral
Z Z
x
P (x) dx = dx = 12 ln |1 + x2 | + c,
1 + x2

332
8.5. Solutions to exercises

1
where we have implicitly used the substitution u = 1 + x2 . So, as 2
ln(1 + x2 ) is an
antiderivative of x/(1 + x2 ), the integrating factor is
1 2
√ √
µ(x) = e 2 ln(1+x ) = eln 1+x2
= 1 + x2 .

Then, as Q(x) = 1 + x2 , we have
Z
µ(x)y(x) = µ(x)Q(x) dx

√ Z
=⇒ y(x) 1 + x = (1 + x2 ) dx
2

√ x3
=⇒ y(x) 1 + x2 = x + + c,
3
where c is an arbitrary constant. As such, we find that
x x3 c
y(x) = √ + √ +√ ,
1 + x2 3 1 + x2 1 + x2
is the general solution of the given ODE.

If y(0) = 1, this gives us c = 1, and so


3x + x3 + 3
y(x) = √ ,
3 1 + x2
is the sought after particular solution.

Solution to exercise 8.2 8


Given that w(t) = y 0 (t), we have w0 (t) = y 00 (t), and so the given ODE, i.e.
d2 y 3 dy dw 3
− = −3 becomes − w(t) = −3,
dt2 t dt dt t
which is the sought after linear ODE for w(t).

We solve this ODE using the method in Section 8.2.2. Here P (t) = −3/t and we start
by seeing that the integral
Z Z
3
p(t) dt = − dt = −3 ln |t| + c,
t
and so −3 ln t is an antiderivative of −3/t which means that the the integrating factor,
µ(t), is given by
−3
µ(t) = e−3 ln t = eln(t ) = t−3 .
Then, as Q(t) = −3, we have
Z Z
−3 3
µ(t)w(t) = µ(t)Q(t) dt =⇒ t w(t) = −3t−3 dt =⇒ t−3 w(t) = t−2 + c,
2
where c is an arbitrary constant. As such, we see that
3t
w(t) = + ct3 ,
2
333
8. Differential equations

is the general solution for w(t).

Then, as w(t) = y 0 (t), we see that


Z Z  
3t 3 c
y(t) = w(t) dt = + ct dt = t2 + t4 + d,
3
2 4 4
where d is another arbitrary constant. This is the general solution of the original ODE.

Solution to exercise 8.3


The given ODE is a non-homogeneous second-order ODE with constant coefficients and
we solve it using the method of Section 8.3.2. In particular:

The corresponding homogeneous second-order ODE is

y 00 (t) − 5y 0 (t) + 6y(t) = 0,

and so the auxiliary equation is

k 2 − 5k + 6 = 0 =⇒ (k − 2)(k − 3) = 0,

which has two real solutions given by k = 2 and k = 3. Consequently, the


complementary function, yc (t), is

yc (t) = A e2t +B e3t ,

for arbitrary constants A and B.


The right-hand-side of the given ODE is 10 sin t and this suggests that we try a
8 particular integral of the form

yp (t) = α sin t + β cos t.

We differentiate this twice to get

yp0 (t) = α cos t − β sin t and yp00 (t) = −α sin t − β cos t,

so that, on substituting these into the given ODE, we get

(−α sin t − β cos t) − 5(α cos t − β sin t) + 6(α sin t + β cos t) = 10 sin t.

Then, equating the coefficients of the terms on both sides we see that, from the
sin t term, we get

−α + 5β + 6α = 10 =⇒ α + β = 2,

and, from the cos t term, we get

−β − 5α + 6β = 0 =⇒ α = β,

and so, solving these two equations simultaneously, we find that α = 1 and β = 1.
Consequently, we see that
yp (t) = sin t + cos t,
is the particular integral.

334
8.5. Solutions to exercises

The general solution is then given by the sum of its complementary function and
its particular integral, i.e. we have

y(t) = A e2t +B e3t + sin t + cos t,

where A and B are arbitrary constants.


We can now use the initial condition y(0) = 0 to see that

0=A+B+0+1 =⇒ A + B = −1,

and, as
y 0 (t) = 2A e2t +3B e3t + cos t − sin t,
the initial condition y 0 (0) = 1 gives us

1 = 2A + 3B + 1 − 0 =⇒ 2A + 3B = 0.

Solving these equations simultaneously then gives us A = −3 and B = 2 which means


that
y(t) = −3 e2t +2 e3t + sin t + cos t,
is the sought after particular solution.

Solution to exercise 8.4


To solve the given system of first-order ODEs we will rewrite it as a second-order ODE
in f (t). To do this we note that, rearranging the first ODE gives us
df
g = 3f − (8.5)
dt 8
and if we differentiate this with respect to t we get
dg df d2 f
=3 − 2.
dt dt dt
Consequently, if we substitute these two expressions into the second ODE, we get
 
df d2 f df
3 − 2 = 3 3f − − f,
dt dt dt
and this can be rearranged to get
d2 f df
2
−6 + 8f = 0,
dt dt
which is our sought after second-order ODE in f (t). As it is an homogeneous
second-order ODE with constant coefficients, this can be solved using the method of
Section 8.3.1. The auxiliary equation is

k 2 − 6k + 8 = 0 =⇒ (k − 2)(k − 4) = 0,

which has two real solutions given by k = 2 and k = 4 which means that the general
solution for f (t) is
f (t) = A e2t +B e4t ,

335
8. Differential equations

for arbitrary constants A and B. To find the general solution for g(t), we note that
using (8.5) and the fact that

f 0 (t) = 2A e2t +4B e4t ,

we get
g(t) = 3[A e2t +B e4t ] − [2A e2t +4B e4t ] = A e2t −B e4t ,
in terms of the same arbitrary constants A and B as before. Thus, the general solution
to this system of first-order ODEs is

f (t) = A e2t +B e4t and g(t) = A e2t −B e4t ,

for arbitrary constants A and B.

However, we are also given the conditions f (0) = 2 and g(0) = 0 which imply that

2=A+B and 0 = A − B.

Solving these two equations simultaneously then gives us A = 1 and B = 1 which means
that
f (t) = e2t + e4t and g(t) = e2t − e4t ,
are the sought after functions.

Solution to exercise 8.5


Using the definition of elasticity with q = q D (p) and the given expression we have

p dq 2p2
8 −
q dp
= 2
p +1
,

and this can be written as


1 dq 2p
=− 2 ,
q dp p +1
which is a separable ODE. So, using the method of Section 8.2.1, we write this as
Z Z
dq 2p
=− dp and determine the integrals to get ln |q| = − ln |p2 + 1| + c,
q p2 + 1

where c is an arbitrary constant.7 Taking exponentials on both sides, this gives us


2 +1)+c 2 +1)−1 ec
q = e− ln(p = ec eln(p = ec (p2 + 1)−1 = ,
p2 + 1

where we can remove the modulus signs since, economically, q is positive and p2 + 1 is
always positive too. Then, using the fact that q = 4 when p = 1, we see that ec = 8 and
so
8
q = q D (p) = 2 ,
p +1
is the sought after demand function.

7
Here we have implicitly used the substitution u = 1 + p2 to determine the integral on the
right-hand-side.

336

You might also like