M1120 DEs (I) Lecture

You might also like

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

Math1120 - Mathematics II

Differential Equations (I): Introduction

§1 Introduction

Most of the equations that we have come across so far in our mathematical
“upbringing” have imposed conditions that a number is required to satisfy.

Example 1: Let x be a real number. Solve


x3  x 2  2 x  2  0 .

By factoring the left hand side we obtain


x 2 ( x  1)  2( x  1)  0
( x 2  2)( x  1)  0
x  1, 2,  2

.
Thus we have found the numbers that satisfy the conditions imposed by the equation.
Notice that we can check our answers by substituting back into the original equation.
For example, when x  1 ,
lhs  (1)3  (1) 2  2(1)  2  0  rhs .
By way of terminology, we would say that x  1 is a solution to the equation whereas
the set of all solutions is x  1, 2,  2 . An equivalent terminology (which we will use
subsequently) is x  1 is a particular solution whereas x  1, 2,  2 is the general
solution for this equation.

Example 2: Let x be a real number. Solve


x  tan( x) .

The strategy that we used for solving the equation in Example 1 won’t work for
this equation. In fact we cannot write down the solution (or solutions) to this equation
in closed form. Thus we adopt the strategy of finding an approximation to the solutions.

We could do this geometrically by plotting the graphs of y  x and y  tan( x)


and looking at the points of intersection.

Page 1
Differential Equations (I) - Lecture Notes

Figure 1
As can be seen in Figure 1, there will be an infinite number of solutions to this
equation. One solution is x  0 . There is another solution between x  4 and x  5 and
so on.

Another way of approximating the solution would be numerically. We could use


Newton’s method for example. Starting with an initial guess of x0  4.5 our next guess
is
f ( x0 ) tan(4.5)  4.5
x1  x0   4.5  4.4936
f ( x0 ) sec 2 (4.5)  1 (to 4 d.p.),
and so on.

Mathematical models in science and engineering often throw up a situation where


information about a function's derivative (or derivatives) is known. From here, we usually
want to deduce information about the function itself.

Example 3: It has been observed that an object cools at a rate proportional to the
difference between the object's temperature and ambient temperature. Write down an
equation that conveys this observation.

Let T (t ) be the temperature of the object at time t after we begin the observation.
Also let Ta be the ambient temperature. Then
dT
 k (T  Ta )
dt
where k is a constant.

As illustrated in Example 3, we were able to write the information known about the
situation in terms of an equation involving the function and the derivative of the function
even though we didn’t know what the actual function was. Such an equation is called a
differential equation (DE). Having determined the differential equation, we now want to find
a function that satisfies the equation, i.e. we want to find a solution to the DE.

Example 3: (cont.) Assuming that the ambient temperature is fixed, what can we say
happens to the temperature of the body over time?

Page 2
Math1120 - Mathematics II

Solutions to the DE for the temperature of the cooling body are of the form
T (t )  Ae  kt  Ta
where A is an arbitrary constant. Even though we haven’t yet looked at the method for
finding this solution we can check that it is correct by substituting back into the original
equation. Here
dT d
lhs    Ae  kt  Ta    kAe  kt
dt dt
and
rhs   k (T  Ta )   k ( Ae  kt  Ta  Ta )   kAe  kt
.

Once we know the function itself we can now answer questions concerning the
temperature of the cooling body over time. For example we see that over time, the
temperature of the body starts out at A  Ta and falls exponentially toward Ta . See
Figure 2.

Figure 2

Example 4: A population of bacteria reproduces at a rate proportional to the population.


If the population of bacteria is N 0 at the beginning of the study, predict the behaviour
of this population over time.

Let N (t ) be the number of bacteria present at time t after the study begins. Then
dN
 kN
dt ,
where k is some positive constant. Thus, even though we don’t know what the actual
function, N (t ) , is we have written a differential equation that the function must satisfy.
Note that we also know that the function must satisfy N (0)  N 0 .

Example 5: An object is dropped from a hot air balloon above the surface of the earth.
Assuming that the only forces acting on the object are gravity (acting down) and air
resistance (acting up) determine the velocity of the object as a function of time.

Page 3
Differential Equations (I) - Lecture Notes

Let v(t ) be the velocity of the object at time t seconds after it was dropped and let
the downward direction be the positive direction. Now, Newton’s second law of motion
says that the acceleration, a, of a body and the net force, F, acting on that body are
related according to
F  ma
where m is the mass of the body. Also we know that
dv
a
dt .
The net force on the free falling object will be
F  FG  FR
where FG  mg is the force due to gravity (g is gravitational constant) and FR is the
force due to the air resistance. Assuming that FR is proportional to the square of the
2
speed of the object, we have FR   kv , where the (positive) constant of proportionality
k will depend on the shape of the object (amongst other things). Thus, from Newton’s
second law, the function v(t ) satisfies
dv
m  mg  kv 2
dt , v(0)  0
This is a differential equation involving the (as yet unknown) function v(t ) .

As these examples illustrate, differential equations can be used to model real world
systems. In these models the differential equation captures the interaction of the quantities in
the system. The solution to the differential equation describes the behaviour of the system.

In this strand of Math1120 we are going to look at techniques for finding solutions to
differential equations. There is no one technique that will solve all differential equations and
there are differential equations for which we can only approximate solutions. However, the
methods that have been developed usually work for a particular type or class of differential
equation. Thus it is important to be able to classify our differential equations into these
various classes. We will learn how to do this as we go along. As a first step in this direction
we need some basic definitions and terminology.

An equation that involves an unknown function, y  y ( x ) , derivatives of that function


and the independent variable x is called a differential equation (DE).

The order of a DE is the order of the highest derivative that appears in the equation.

A particular solution for the DE is a function y  y ( x ) that satisfies the equation.

The general solution of the DE is a description of all possible solutions.

Example 6: What is the order of each the following of the DEs? Using your knowledge
of the basic functions of science and engineering try to guess a solution to each DE.
(a) y  x
(b) y    y

Page 4
Math1120 - Mathematics II

(c) y    x
(d) y    y
(e) y   2 y  0

(a) Because this equation only involves the first derivative of the function it is a first
order differential equation. Next, since the differential equation is of the form
dy
 f ( x)
dx
we can solve it by simple anti-differentiation. Thus
1
y ( x )   x dx  x 2  C
2 .
Note that this solution is the general solution to the DE, it is a description of all
possible solutions to the equation. As shown in Figure 3, when we graph all of the
functions in this general solution they fill the entire plane but there are no points
of intersection.

Figure 3

A solution with a given value of C would be a particular solution of the DE, for
example
1
y ( x)  x 2  1
2 .
This particular solution is highlighted in Figure 3.

(b) Again this is a first order DE since the highest derivative in the equation is a first
derivative. In this case we can’t solve the equation via anti-differentiation.
However, given that the equation says that the function must be such that its
derivative must be equal to the negative of itself it would be reasonable to guess
x
that the function must be an exponential function. For y ( x)  e we can see that
y  e x  y ,
x
and so try instead y ( x)  e . Then
y   e  x   y
and so we have found a (particular) solution.

Page 5
Differential Equations (I) - Lecture Notes

(c) This DE contains a second derivative and hence is of order 2. Again we can find a
solution by simple anti-differentiation. Since
d2y
 x
dx 2
by anti-differentiating we obtain
dy 1
   x dx   x 2  A
dx 2
and on anti-differentiating again
1 1
y ( x)    x 2  A dx   x 3  Ax  B
2 6 .
This is the general solution to the DE. Notice that this 2nd order DE has two
arbitrary constants in its general solution.

(d) This DE is also a 2nd order DE but we can’t get the solution by anti-
differentiation. Thus (at this stage) we have to try to guess. What function is the
negative of its second derivative? We could try an exponential function (as we
did in part (b), i.e.
y ( x  e x .
x
Then y   e  y which isn’t quite what we wanted. Another possible candidate
would be the sine or cosine function. So let us now try
y ( x)  sin( x) .
Then y    sin( x )   y which is what we wanted and so we have found a
solution.

(e) This DE contains both the first and second derivative. However since the highest
derivative is the second derivative this equation is a 2nd order DE. The most
obvious candidate for a solution to this DE would be an exponential function so
let’s try
y ( x)  e 2 x .
2x 2x
In this case y   2e and y   4e and hence y   2 y  0 . Thus we have found
one solution to the DE.

In general a differential equation will have infinitely many solutions. These solutions
take the form of a family of functions containing some arbitrary constants. In practical
problems, we usually want to select one function out of this infinite family of functions. We
do this by specifying additional data, often in the form of initial values for the function and, if
appropriate, its derivatives. We call such a problem an initial-value problem.

Example 7: The differential equation y    y has the general solution


y  Ae  x .
Confirm that this is a solution and then solve the initial-value problem
y    y , y (0)  5

Page 6
Math1120 - Mathematics II

x
To confirm that all of the functions y  Ae are solutions we just need to show
that these functions satisfy the equation. Now
lhs  y   Ae  x   y  rhs ,
and so they are solutions.
To solve the initial-value problem we have to find the value of A that ensures that
the solution satisfies the initial condition. Now if y (0)  5 then
5  Ae 0  A .
Thus the solution to the initial-value problem is
y ( x)  5e  x .

Example Tasks

ET 1: Determine the value (if any) of the constants A and B such that
y ( x)  A cos(4 x )  B sin(4 x )
is a solution to the DE
y   2 y  sin(4 x) .

ET 2: Guess a solution to the DE y   2 y  0 .


§2 Direction Fields and Euler’s Method

So far, the only methods that we have seen for actually solving a DE are anti-
differentiation and guess and check. Clearly, these methods are very limited in their scope.
Before looking at some methods for finding solutions to DEs in closed form, we will look at
two methods by which we can approximate solutions to first order DEs, i.e. to DEs of the
form
y   f ( x, y ) .

§2.1 Direction Fields

The first method that we will look at aims to “draw” the solutions to the DE. If y ( x ) is
x , y 
the solution to the DE that passes through the point 0 0 then the slope of the tangent to
y ( x ) at  x0 , y0  is f ( x0 , y0 ) . So if we draw a small line segment passing through the point
 x0 , y0 
with slope f ( x0 , y0 ) (i.e. a small part of the tangent line) this will approximate the
graph of the solution at this point. A plot showing these small line segments for many points
is called a direction field for the DE.

Example 8: Sketch the direction field for the DE


3y  y  x .
Use this direction field to sketch the graph of the solution to the DE satisfying the
initial condition y (0)  2 .

Rearranging this first order DE in the form y   f ( x, y ) gives

Page 7
Differential Equations (I) - Lecture Notes

x y
y 
3 ,
x y
f ( x, y ) 
i.e 3 . Now, at the point  0, 2  the slope of the tangent to y ( x ) will be
02 2
f (0, 2)  
3 3
So draw a small segment of the line passing through the point
 0, 2 with slope  2 3 ,
as shown in Figure 4.

Figure 4

Repeating for many points


 x, y  in the plane gives the direction field for the DE
shown in Figure 5.

Figure 5

Page 8
Math1120 - Mathematics II

Notice that from this direction field we can see the general shape of the family of
solutions to the DE. We can also sketch any particular solution that we want. The
particular solution satisfying y (0)  2 has been constructed in Figure 5.

Example 9: Sketch the direction field for the DE


dy
 y (1  y )
dt
Describe the long term behaviour of the solutions to this DE.
Note: A first order DE is called autonomous if it is of the form
dy
 f ( y)
dt
.
and so this is an example of a first order autonomous DE.

Notice that for this DE the functions


y ( x )  0 and y ( x )  1
are solutions and that for these solutions y  0 . (These solutions are called steady state
solutions since y does not vary along these solutions.) Notice also that at any point
whose y coordinate is greater than 1, y  0 . Similarly for those points with y
coordinate satisfying 0  y  1 , y  0 and for those points with y coordinate satisfying
y  0 , y  0 , These observations allow us to very quickly make a sketch of the
direction field. The direction field for this DE is shown in Figure 6.
From the direction field we can see that the behaviour of the solution for large
values of x depends on the initial condition that the solution satisfies. If y (0)  0 then
y   as x   whereas if y (0)  0 then y  1 as x   .

Figure 6

Page 9
Differential Equations (I) - Lecture Notes

§2.2 Euler's method

The second method that we will look at aims to approximate the solution to the initial-
value problem
y   f ( x, y ) , y ( x0 )  y0

numerically, (i.e to produce a table of values for the function). Given a point
 xn , yn  on the
x , y 
graph of the solution y ( x ) , Euler’s method approximates the next point n1 n1 on the
graph of y ( x ) using the linear approximation
y  f ( xn , yn )x .

Thus if xn 1  xn  x , where  x is small, then


yn 1  yn  f ( xn , yn )x .

Euler’s Method (for solving the initial-value problem y   f ( x, y ) , y ( x0 )  y0 )

• Choose a step size  x



x , y 
Begin at the point 0 0 .

x , y  x , y 
Move from one point n n on the solution to the next point n1 n1 on the
solution by:
xn 1  xn  x
yn 1  yn  f ( xn , yn )x
Note that the accuracy of Euler’s method will depend on both the step size used and the
distance from the initial known point on the solution.

Example 11: Consider the initial-value problem:


y  y , y (0)  1 ,
Estimate y (1) using Euler’s method with step size
(a) x  1
(b) x  0.5
(c) x  0.25

Here f ( x, y )  y .
(a)
 x , y   (0,1) . Then with x  1 we have
Let 0 0
x1  x0  x  0  1  1
y1  y0  f ( x0 , y0 )x
 1  f (0,1)  1
 11
2
Thus the Euler estimate is y (1) 2.

Page 10
Math1120 - Mathematics II

(b) Again, begin with 0 0


 x , y   (0,1) . Using x  0.5 we will need two iterations to
reach x  1 . The first iteration gives
x1  x0  x  0  0.5  0.5
y1  y0  f ( x0 , y0 )x
 1  f (0,1)  0.5
 1.5
Now complete the second iteration
x2  x1  x  0.5  0.5  1
y2  y1  f ( x1 , y1 ) x
 1.5  f (0.5,1.5)  0.5
 1.5  1.5  0.5
 2.25
Thus the Euler estimate is (1)  2.25 .
y

(c) With x  0.25 we will need 4 iterations to reach x  1 . We can conveniently


summarise the calculations via a table.

n xn yn f ( xn , yn ) f ( xn , yn )x
0 0 1 1 0.25
1 0.25 1.25 1.25 0.3125
2 0.5 1.5625 1.5625 0.390625
3 0.75 1.953125 1.953125 0.48828125
4 1 2.44140625

Thus the Euler estimate is y (1)  2.4414 (to 4 d.p.)


x
Note that the exact solution to this initial-value problem is y  e and hence
y (1)  e  2.7183 (to 4 d.p.) Figure 7 shows how the Euler solution with Δ = 0.25
compares with the exact solution.

Page 11
Differential Equations (I) - Lecture Notes

Figure 7

Example 12: Consider the DE


y   y  x 2 , (1) = 2
Use Euler’s method with x  0.5 to estimate y (3) .

Using the table layout:

n xn yn f ( xn , yn ) f ( xn , yn )x
0 1 2 3 1.5
1 1.5 3.5 5.75 2.875
2 2 6.375 10.375 5.1875
3 2.5 11.5625 17.8125 8.9063
4 3 20.4688

Thus the Euler estimate is y (3)  20.4688 (to 4 d.p.)


Example Tasks

ET 1: At time t the population density of the Striped Dingbat is modelled by the


function P (t ) . This function satisfies the DE
dP
 kP (C  P )
dt
where k and C are positive constants.
(a) Find all steady-state solutions to this DE.
(b) By considering the direction field, explain how this model predicts the long-term
Striped Dingbat population.
ET 2: The direction field for the DE
 1
y  x  y    y 2
 2
is shown below. Sketch the solution satisfying the initial condition
(a) y (0)  0.5
(b) y (0)  0.5

Page 12
Math1120 - Mathematics II

ET 3: Consider the initial-value problem


y   xy  x , y (0)  1
y  0.3
Use Euler’s method with x  0.1 to estimate

Page 13

You might also like