Professional Documents
Culture Documents
MT1186 Chapter 8 Differential Equations
MT1186 Chapter 8 Differential Equations
Differential equations
Essential reading
Binmore and Davies (2002) Sections 12.1–12.4 and parts of Chapter 14.
Further reading
Adams and Essex (2010) Sections 3.7 and 7.9, parts of Sections 17.1–17.2,
17.4–17.6.
303
8. Differential equations
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.
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,
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.
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.
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
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 ,
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)?
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
y(x) = −3 + cx2 ,
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,
y(x) = (x + c) ex ,
Activity 8.5 Verify that the ODE in Example 8.7 is not separable.
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
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) ,
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
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.
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.
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.
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
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
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),
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
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
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
Thus, yp (x) = 5 e3x is the sought after particular integral and the general solution to
our non-homogeneous second-order ODE is
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),
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
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
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
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
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
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.
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
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
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
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.
319
8. Differential equations
Activity 8.8 Show that any separable first-order ODE of the form
f 0 (x) = λf (x),
f (x) = A eλx ,
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.
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
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
is the particular solution of this system of first-order ODEs given the conditions
y1 (0) = 2 and y2 (0) = 1.
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.)
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.
ln |q| = ln |p|−r + c,
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
Activity 8.10 How does the demand function found in Example 8.15 behave as
p → 0+ and as p → ∞?
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.
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.
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?
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:
324
8.5. Solutions to activities
Solutions to activities
Solution to activity 8.1
Looking at the given ODEs, we see that:
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,
y(x) = x2 + x − 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
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 ,
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 ,
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).
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
326
8.5. Solutions to activities
y + 3 = ± ec x 2 =⇒ y = −3 ± ec x2 ,
y(x) = −3 + Ax2 ,
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
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
is the particular solution of this system of first-order ODEs given the conditions
y1 (0) = 5 and y2 (0) = −2.
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.
328
8.5. Solutions to activities
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 ,
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
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
is the particular solution of this system of first-order ODEs given the conditions
y1 (0) = 5 and y2 (0) = −2.
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:
330
8.5. Solutions to activities
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
Exercise 8.4
8 The functions f (t) and g(t) are related by the first-order ODEs
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.
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
k 2 − 5k + 6 = 0 =⇒ (k − 2)(k − 3) = 0,
(−α 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,
−β − 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
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.
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
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
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.
p dq 2p2
8 −
q dp
= 2
p +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