You are on page 1of 175

Mathematical Modeling

Mathematical modeling is the process of describing a phenomenon from everyday


life in mathematical formalism.
We build a mathematical model by identifying the quantities to be studied and the
mathematical relationships among them.
The steps in building a model involve:
1. Stating the underlying assumptions.
2. Identifying the relevant variables and parameters.
3. Using the assumptions in the first step to formulate equations relating the
variables in the second step.

A mathematical model expressed as a differential equation


Mathematical models that are expressed as differential equations involve
assumptions about derivatives. In other words, the assumptions often include
phrases such as the rate of change of . . . or the rate of increase of . . . .
You should also watch for the words velocity and acceleration.
Example. Consider the motion of a skydiver falling through the air before she
opens her parachute.
We assume that her motion is subject to two forces:
1. the force due to gravity, and
2. a drag force due to the atmosphere.

The variables that measure the quantities in our models fall into three basic types:
1. the independent variable,
2. the dependent variable or variables, and
3. often the parameters.
In this course the independent variable almost always measures time.
Each dependent variable measures a quantity that is a function of the independent
variable.
Parameters are quantities that do not change with time (or with the independent
variable) but that can be adjusted, perhaps by natural causes or by a scientist
running the experiment.

Example. Consider the motion of a skydiver falling through the air before she
opens her parachute.
Independent variable: t for time (measured in seconds)
Dependent variable: v for velocity (measured in meters per second)
Parameters:
1. g is the gravitational constant (measured in meters per second squared)
2. m is the mass of the skydiver (measured in kilograms)
3. k is the drag coefficient (measured in kilograms per meter)

The model is based on Newtons second law of motion


Force = mass acceleration.
In this model, we are assuming that there are two forces acting on the
skydiverthe force due to gravity and the drag force. Combined they are
mg

kv 2 ,

where m, g, and k are the parameters that weve already discussed.


Since acceleration is the derivative of velocity, the product of mass and
acceleration is
dv
.
m
dt
Newtons second law yields the model
mg

kv 2 = m

dv
.
dt

This equation is a first-order, ordinary differential equation. We want to find a


function or functions v (t) that satisfy the equation. It is customary to write the
equation as
dv
= mg kv 2 .
m
dt

Modeling the growth of a population


p
300
250
200
150
100
50

1850

1900

1950

U.S. Census 17902010

2000

Malthusian Growth Model


Population, when unchecked, increases in a geometrical ratio.
(Thomas Malthus, An Essay on the Principle of Population, 1798.)
Assumption: Growth rate of the population is proportional to the population.
Variables:

Analytic technique for solving the differential equation:

p
300
250
200
150
100
50

1850

1900

1950

2000

Logistic Population Model


The logistic population model assumes that the relative growth rate decreases
linearly as the population increases.

Qualitative Analysis of the Logistic Population Model


We have


dp
p
=kp 1
.
dt
N
What can we say about the long-term behavior of the solutions?
Qualitative analysis:

dp
dt

dp
dt

p=N

p
p=0

Qualitative analysis (continued):


dp
dt

dp
dt

p=N

p
p=0

Estimate of relative growth rate at 1800:


Year

U.S. Population

1790
1800
1810

3.9
5.3
7.2

We can repeat this computation to produce approximations to the relative growth


rates for 18002000:
Year
1790
1800
1810
1820
1830
1840
1850
1860
1870
1880
1890
1900

U.S. Pop
3.9
5.3
7.2
9.6
12.9
17.1
23.2
31.4
38.6
50.2
63.0
76.3

Rel Growth
0.03113
0.02986
0.02969
0.02907
0.03012
0.03082
0.02452
0.02435
0.02430
0.02071
0.01900

Year
1910
1920
1930
1940
1950
1960
1970
1980
1990
2000
2010

U.S. Pop
92.0
105.7
122.8
131.7
151.3
179.3
203.3
226.5
248.7
281.4
308.7

Rel Growth
0.01598
0.01457
0.01059
0.01082
0.01573
0.01450
0.01161
0.01002
0.01104
0.01066

rel growth rate


0.03

0.02

0.01

p
50

100

150

200

250

300

relative growth rates versus population

350

rel growth rate


0.03

0.02

0.01

p
50

100

150

200

250

300

350

Using this statistical analysis, we obtain the differential equation


dp
= p (0.0280801 0.0000821116 p) .
dt
Assuming these numbers, what are the values of k and N?

General Observations About First-Order Differential Equations


Here are six questions or comments that I would like to discuss informally before
we start our more detailed study of differential equations:
1. What is a first-order differential
equation

dy
= f (t, y ) ?
dt

2. What does it mean to solve the initial-value problem


dy
= f (t, y ),
dt
A solution to the initial-value problem is a
differentiable function y (t) defined on some
interval a < t < b containing t0 such that
(a)

y (t0 ) = y0 ?
y

dy
= f (t, y (t))
dt
for all t in the interval a < t < b and

(b) y (t0 ) = y0 .

3. Be careful about notation: The distinction between the independent and the
dependent variables is important.
Example 1.

dy
= 2t
dt

Example 2.

dy
= 2y
dt

The solutions to this equation are

The solutions to this equation are

y (t) = t 2 + c,

y (t) = y0 e2t ,

where c is an arbitrary constant.

where y0 is an arbitrary constant.

4. What does the term general solution mean?


(
All possible solutions to
general solution =

all possible initial-value problems


Example 1.

dy
= 2t
dt

The general solution of this equation is y (t) = t 2 + c, where c is an arbitrary


constant.

Example 2.

dy
= 2y
dt

The general solution of this equation is y (t) = y0 e2t , where y0 is an arbitrary


constant.

5. We should never get a wrong answer in this course.


By differentiating, we can verify statements such as All functions of the form
y (t) = y0 e2t , where y0 is an arbitrary constant, are solutions to the differential
equation dy /dt = 2y .

Is the function y (t) = y0 e2t + 1 a solution of the equation dy /dt = 2y ?

6. Even some relatively simple looking differential equations have solutions that
cannot be expressed in terms of the functions that we know and love.
y

Example. Consider the initial-value


problem
dy
= y 3 + t 2,
dt

y (0) = 0.

The graph on the right is a very good


approximation to the graph of the
solution of the initial-value problem.

-2

-1

-1

-2

Separable Differential Equations


Lets begin by recalling the method of substitution for calculating indefinite
integrals (also called antiderivatives):
Z 

Example 1.
cos t 2 dt is hard.
If we ask a computer algebra system such as WolframAlpha to compute this
integral, we get an answer thats expressed in terms of the Fresnel C function.
Thats not one of the functions that we tend to encounter in standard calculus
courses.

Example 2.

Z 


cos t 2 (2t) dt is easier.

Abstract notation: Let u = t 2 . Then du = 2t dt.


Z 
Z

2
cos t (2t) dt = (cos u) du
= (sin u) + k


= sin t 2 + k .

A differential equation
dy
= f (t, y )
dt
is separable if it can be written in the form
dy
= (f1 (t)) (f2 (y )) .
dt
A separable differential equation can be solved using the method of substitution
by separating variables:

 
1
dy
= f1 (t)
f2 (y )
dt

Example 1.

dy
= 2ty 2
dt

Example 2.

dy
= y3 + t2
dt

Example. Lets separate variables on the differential equation

dy
= 2ty 2 .
dt

Recall the No wrong answers principle: Lets apply it to the family of functions
y (t) =

t2

1
.
+k

The differential equation is


dy
= 2ty 2 .
dt

Example.

dy
= 2ty 2
dt

For the initial condition y (0) =

1
2

we have k = 2, and the solution is


y (t) =

1
t2 + 2

with a domain of < t < .


For the initial condition y (0) = 21 we have k = 2, and the solution is
y (t) =

with a domain of 2 < t < 2.

t2

1
2

Example.

dy
= 2ty 2
dt

For the initial condition y (0) = 12 , the solution is


y (t) =

t2

1
+2

with a domain of < t < .


For the three initial conditions y (2) = 12 , y (0) = 12 , and y (2) = 12 , the formula
for the solution is
1
y (t) = 2
.
t 2

For the first initial condition, the domain


of the solution
is

<
t
<

2. For the

second initial condition, the


domain
is

2
<
t
<
2,
and
for
the
third
initial

condition, the domain is 2 < t < .

What is the general solution of the differential equation

dy
= 2ty 2 ?
dt

Newtons law of cooling: The rate of cooling of an object is proportional to the


difference between the current temperature and the ambient temperature.
Suppose a cup of hot chocolate is initially 70 C and is left in a room with an
ambient temperature of 20 C. Suppose that at time t = 0 it is cooling at a rate of
5 per minute. How long does it take the hot chocolate to cool to a temperature of
40 C?
Lets express this scenario as an initial-value problem.

Separate variables in the differential equation

dT
= 0.1(T 20).
dt

Use the solution T (t) = 20 + 50e0.1t to find t such that T (t) = 40.

80

80

60

60

40

40

20

20

10

20

30

10

20

30

Slope Fields
A slope field in the ty -plane is a
picture of a first-order differential
equation

dy
= f (t, y ).
dt

The right-hand side f (t, y ) of the differential equation defines a slope field, and the
graph of a solution must be everywhere tangent to it.

Example. Consider the initial-value problem


(t, y )

f (t, y )

y 0 (t)

(0, 2)



2
1,
3

8
9

8
9



2
1,
3

8
9

8
9

dy
= 2ty 2 ,
dt

y (0) = 2.

Example.

dy
=y t
dt

y
3

General solution:
y (t) = 1 + t + ket

-3

-3

Important special cases


1.

dy
= f (t)
dt

Example.

dy
= cos t
dt

y
2

General solution:

y (t) = (sin t) + k
where k is an arbitrary
constant

-6

-3

3
-1

-2

2.

dy
= f (y )
dt

(autonomous)

Example.

dy
= y (1
dt

y)

One solution:
1

et
y (t) =
1 + et
Note that y (0) = 12 .

-8

-4

-1

Slope Field A

Slope Field B

-3

-2

-1

-3

-2

-1

-1

-1

-2

-2

-3

-3

Slope Field C

Slope Field D

-3

-2

-1

-3

-2

-1

-1

-1

-2

-2

-3

-3

3.

4.

5.

6.

dy
=y +1
dt

Slope Field C

dy
=1y
dt
dy
= y2 + y
dt
dy
= y (y 2 1)
dt

Slope Field D

-3

-2

-1

-3

-2

-1

-1

-1

-2

-2

-3

-3

1.

2.

7.

8.

dy
=t 1
dt

Slope Field A

dy
=t +1
dt
dy
=y t
dt
dy
=y +t
dt

Slope Field B

-3

-2

-1

-3

-2

-1

-1

-1

-2

-2

-3

-3

Eulers method
In Module 2, we discussed the following example to illustrate the fact that some
solutions cannot be expressed in terms of the typical functions that are used in
calculus.
y

Example. Consider the initial-value


problem
dy
= y 3 + t 2,
dt

y (0) = 0.

The graph on the right is a very good


approximation to the graph of the
solution of the initial-value problem.

-2

-1

-1

-2

If we dont know a formula for the solution, how did we obtain the graph?

Example. Consider the initial-value


problem
dy
= y2
dt

t,

y ( 1) =

1
.
2

The graph on the right was


obtained using a sophisticated
numerical solver.

-2

10

-3

Lets see what Eulers method does in this case. At first well use a ridiculously
large step size so that that we can distinguish between the actual solution and
the approximation produced by the algorithm.

tk

yk

1.0

0.50

mk

0.5

1
2
3

-1.0

-0.5

0.5

4
-0.5

1.0

tk

yk

1.0

0.50

mk

0.5

1.250

1
2
3

-1.0

-0.5

0.5

4
-0.5

1.0

tk

yk

1.0

0.50

0.5

0.12

mk

0.5

1.250

2
3

-1.0

-0.5

0.5

4
-0.5

1.0

tk

yk

1.0

0.50

1.250

0.5

0.12

0.516

mk

0.5

2
3

-1.0

-0.5

0.5

4
-0.5

1.0

tk

yk

1.0

0.50

1.250

0.5

0.12

0.516

0.0

0.38

mk

0.5

-1.0

-0.5

0.5

4
-0.5

1.0

tk

yk

1.0

0.50

1.250

0.5

0.12

0.516

0.0

0.38

0.147

0.5

0.46

mk

0.5

-1.0

-0.5

0.5

4
-0.5

1.0

Here is a general picture of the algorithm and the associated notation:


Eulers method applied
to the initial-value
problem

dy
= f (t, y ), y (t0 ) = y0
dt
using the step size t.

y0

t0

t1

t2

t3

t4

Lets look more closely at one step of Eulers method and the key triangle:












The error in Eulers method


Eulers method is the most basic fixed-step-size algorithm for the numerical
approximation of solutions.

We say that it is a first-order algorithm because the error in the approximation is


proportional to the first power of the step size. More precisely, we have
error C (t)1
where C is a constant that depends only on the right-hand side of the differential
equation and the length of the interval over which the solution is approximated.
In practice, if we halve the step size (and double the number of steps), we typically
halve the error.

Dont try this at the office!


For numerical work where a high degree of accuracy is essential, Eulers method
is not the algorithm of choice. There are algorithms that usually are more accurate
and that require fewer calculations to attain that accuracy.
The higher-order Runge-Kutta methods are usually more efficient and more
accurate than Eulers method. They use the right-hand side of the differential
equation evaluated at more than one point to compute the approximate value of
the solution at the next step. For example, the classical Runge-Kutta method (also
referred to as RK4) uses a weighted average of four values to calculate the
approximation at the next step.
RK4 has order 4. That is, if we double the number of steps, the error usually
improves by a factor of 16 (= 24 ).

Note the repeated use of the word usually on the last slide. There are
initial-value problems that are not amenable to any fixed-step-size algorithm.
Example. Consider the initial-value
problem

y
3
2

dy
= et sin y ,
dt

y (0) = 5.

The graph on the right was


obtained using Eulers method
with a step size of t = 0.05.

0
-
-2
-3

The numerical solvers that are implemented in sophisticated mathematical


computer programs such as MATLAB, Mathematica, and Maple use a combination
of techniques to deal with the challenges that certain initial-value problems pose.
In particular, they repeatedly adjust the step size throughout the calculation to
maintain a desired accuracy.
Example. Heres an accurate
approximation to the graph of the
solution of
dy
= et sin y ,
dt

y (0) = 5.

y
2

It was produced with an industrial


strength solver.
0

Existence and Uniqueness of Solutions


Before we discuss the Existence and Uniqueness Theorems, lets consider three
differential equations to illustrate the notion of the domain of a differential equation.
Example 1.

y
2

dy
= y3 + t2
dt

-2

-1

-1

-2

Example 2.

y
2

dy
= y2
dt
1

Note that this differential


equation is autonomous.
-2

-1

-1

-2

Example 3.

y
2

dy
y
=
dt
t
1

-2

-1

-1

-2

Existence Theorem. Suppose f (t, y ) is a


continuous function in a rectangle of the form

y
d

{(t, y ) | a < t < b, c < y < d}


in the ty -plane. If (t0 , y0 ) is a point in this
rectangle, then there exists an  > 0 and a
solution y (t) to the initial-value problem
dy
= f (t, y ),
dt

y (t0 ) = y0

on the interval t0  < t < t0 + .

Whats the significance of the  in the Existence Theorem?


Example.

dy
= 1 + y 2,
dt

y (0) = 0

Example.

y
3

dy
= 1 + y 2,
dt

y (0) = 0
2

- 2

-1

-2

-3

The Uniqueness Theorem


Before we discuss the Uniqueness Theorem, lets consider an example that lacks
uniqueness.
Example. Consider the initial-value problem

dy
= 3 y sin 2t,
dt

y (0) = 0

and the three functions


r
y1 (t) = 0 for all t,

y2 (t) =

8
sin3 t,
27

r
and

y3 (t) =

Claim: All three of these functions solve the initial-value problem.

8
sin3 t.
27

1
2

-2

1
2

-2

- 12

y1 (t) = 0 for all t

1
2

- 12

y2 (t) =

8
27

q
8
y3 (t) = 27
sin3 t

sin3 t for all t

1
2

-
- 12

-2

-2

- 12

all three graphs

Uniqueness Theorem. Suppose f (t, y ) and f /y are continuous functions in a


rectangle of the form
{(t, y ) | a < t < b, c < y < d}
in the ty -plane. If (t0 , y0 ) is a point in this rectangle and if y1 (t) and y2 (t) are two
functions that solve the initial-value problem
dy
= f (t, y ),
dt

y (t0 ) = y0

for all t in the interval t0  < t < t0 +  (where  is some positive number), then
y1 (t) = y2 (t)
for t0  < t < t0 + . That is, the solution to the initial-value problem is unique.

Example. If we avoid the t-axis when


considering the differential equation

y
2

dy
= 3 y sin 2t,
dt
1

then solutions are unique.

-2

Applications of the Uniqueness Theorem


The Uniqueness Theorem has many useful consequences. Here are three
examples:
dy
Example 1.
= 2ty 2
dt

Example 2.

dy
= y(1
dt

y)

-8

-4

-1

Example 3.

dy
= et sin y
dt

y
2p

Autonomous Differential Equations and Their Phase Lines


Recall that a first-order differential equation with independent variable t and
dependent variable y is autonomous if
dy
= f (y ).
dt
That is, the rate of change of y (t) depends only on the value of y .
Examples of autonomous equations: exponential growth models, radioactive
decay, and the logistic population model.
An example of a nonautonomous equation is
dv
= kv + a sin bt.
dt
This differential equation is related to simple models of voltage in an electric circuit
(k , a, and b are parameters).

Recall that every autonomous equation is separable, but the integrals may be
impossible to calculate in terms of standard functions.
Basic Fact: Given the graph of one solution to an autonomous equation, we can
get the graphs of many other solutions by translating that graph left or right.
Example.

y
2

dy
= y (1 y )
dt
1

-8

-4

-1

The slope field has so much redundant information that we can replace it with the
phase line.
Example.

y
2

dy
= y (1 y )
dt
1

-8

-4

-1

Example. Sketch the phase line for


dy
= y 2 cos y .
dt

y 2 cosHyL
12

source

6
s y = 3
2
?

sink
-5

node
source

y=

6
s y =0
6
s y =
2

sink
-12

y=

3
2

y
6

source

6
s y = 3
2
?

sink
-6

node
source

y=

6
s y =0
6
s y =

3
2

sink
-6

y=

Example. Sketch the phase line for


dy
= f (y )
dt
where f (y ) is given by the graph

Logistic Population Model With Constant Harvesting


We have already studied the logistic model of population growth

dp
p
=kp 1
dt
N
where k is a growth-rate parameter and N is the carrying capacity. Lets modify
this equation to account for the harvesting of fish.

A one-parameter family of differential equations


Example. Consider the one-parameter family
dy
dt
1
4

dy
= y (1 y ) a.
dt

1
dy
= y (1 y )
Example. Consider
dt
8


1
a=
.
8

dy
dt
1
4

?
s

s
?

a=0

a=

1
8

1
dy
= y (1 y )
Example. Consider
dt
4


1
a=
.
4

dy
dt
1
4

?
s

?
s

6
s

s
?
?

a=0

a=

1
8

a=

1
4

dy
3
Example. Consider
= y (1 y )
dt
8


3
a=
.
8

dy
dt
1
4

?
s

?
s

?
s

6
s

?
?

a=0

a=

1
8

a=

1
4

a=

3
8

Phase lines for


dy
dt

dy
= y(1
dt

y)

1
4

a and the bifurcation diagram

?
s

6
s

a=0

?
s

6
s

a=

1
8

a=

1
4

a=

3
8

We can summarize the behavior of this one-parameter family of differential


equations using a bifurcation diagram.
Equilibrium points:

y
1

1
4

For the one-parameter family of differential equations


dy
= y (1
dt

y)

a,

we say that
1. All of the systems (differential equations and their phase lines) with a < 1/4
are qualitatively equivalent, and
2. all of the systems with a > 1/4 are qualitatively equivalent.
3. The value a = 1/4 is a bifurcation value for this one-parameter family.
Note: Some one-parameter families of differential equations have more than one
bifurcation value.


p
dp
= kp 1
Bifurcation diagram for
C
dt
N
dp
dt

Bifurcation diagram for


Equilibrium points:


p
dp
= kp 1
C
dt
N

p
N

kN
4

Linear differential equations


Lets begin by considering a mixing problem:

A 200 liter tank initially contains 100 liters of salt water containing 1000 grams of
salt. Suppose salt water that contains 35 grams of salt per liter is pumped into the
tank at the rate of 4 liters per minute, while a well-mixed solution leaves the tank at
a rate of 2 liters per minute. How much salt is in the tank when the tank fills up?
ds
= (rate in) (rate out)
dt

A 200 liter tank initially contains 100 liters of salt water containing 1000 grams of
salt. Suppose salt water that contains 35 grams of salt per liter is pumped into the
tank at the rate of 4 liters per minute, while a well-mixed solution leaves the tank at
a rate of 2 liters per minute. How much salt is in the tank when the tank fills up?
ds
= (rate in) (rate out)
dt
= 140

s
50 + t

A first-order differential equation


dy
= f (t, y )
dt
with independent variable t and dependent variable y is linear if it can be written
as
dy
= a(t)y + b(t).
dt
In other words, right-hand side of the equation is a linear function in the dependent
variable.

Linear:

dy
dy
= f (t, y ) can be written as
= a(t)y + b(t)
dt
dt

dy
= (cos t)y
dt

dy
= t cos y
dt

dy
= y t2
dt

dy
= y2 t
dt

The linear differential equation


dy
= a(t)y + b(t)
dt
is homogeneous if b(t) = 0 for all t. Otherwise, it is nonhomogeneous. (Some
people use the term inhomogeneous.)
dy
= (cos t)y
dt

dy
= y t2
dt

ds
s
= 140
dt
50 + t

Homogeneous Linear Differential Equations


Where have we seen homogeneous linear differential equations before?
dy
= a(t) y
dt

Example.

dy
ty
=
dt
1 + t2

y
5

-3

-5

Linearity Principles
Why are linear equations so much more amenable to analytic techniques than
nonlinear equations? One reason is that their solutions satisfy important linearity
principles.
Lets begin with homogeneous linear equations:
The Linearity Principle for Homogeneous Equations. If yh (t) is a solution of a
homogeneous linear differential equation
dy
= a(t)y ,
dt
then any constant multiple yk (t) = k yh (t) of yh (t) is also a solution. In other
words, given a constant k 6= 1 and a nonzero solution yh (t), we obtain another
solution by multiplying yh (t) by k .

Example.

dy
ty
=
dt
1 + t2

y
5

General solution:
y (t) =

k
1 + t2

-3

where k is any constant


-5

There are at least two ways to prove the Linearity Principle for homogeneous
equations. Heres one: Assuming that yh (t) is one solution to the equation and
yk (t) = k yh (t), we have

Note that the Linearity Principle is not true for nonlinear equations. For example,
consider the nonlinear equation
dy
= y 2.
dt
We can check that the function y1 (t) =

But the function y2 (t) = 2y1 (t) =

1
is a solution:
1t

2
is not a solution:
1t

The Extended Linearity Principle for First-Order Equations


Consider a first-order, nonhomogeneous, linear equation
dy
= a(t) y + b(t)
dt
and its associated homogeneous equation

dy
= a(t) y .
dt

1. If yh (t) is any solution of the homogeneous equation and yp (t) (p for


particular solution) is any solution of the nonhomogeneous equation, then
yh (t) + yp (t) is also a solution of the nonhomogeneous equation.
2. Suppose yp (t) and yq (t) are two solutions of the nonhomogeneous equation.
Then yp (t) yq (t) is a solution of the associated homogeneous equation.
Therefore, if yh (t) is nonzero, kyh (t) + yp (t) is the general solution of the
nonhomogeneous equation.

We can paraphrase the Extended Linearity Principle by saying that:


The general solution of a nonhomogeneous linear equation consists of
the sum of any particular solution of the nonhomogeneous equation and
the general solution of the associated homogeneous equation.

The general solution


Any
particular
solution
General

of the associated
solution of the
of a
+
=
homogeneous
nonhomogeneous
nonhomogeneous

equation
linear
equation
linear
equation

Example.

dy
ty
2t 2 + 1
=
+
dt
1 + t 2 4t 2 + 4

Example.

y
5

2t 2 + 1
dy
ty
+
=
dt
1 + t 2 4t 2 + 4

General solution:
y (t) =

-3

t
k
+
4
1 + t2
-5

What is the long-term behavior of the solutions?

The Method of the Lucky Guess

The Extended Linearity Principle provides one way to solve nonhomogeneous


equations:
The Method of the Lucky Guess:
1. Solve the associated homogeneous equation.
2. Guess one solution to the nonhomogeneous equation.
How do we go about guessing a solution? This question is best answered by
doing a few typical examples.

Example 1.

dy
= 2y + 3et/2
dt

1. General solution of the associated homogeneous equation:

2. Particular solution of the nonhomogeneous equation:

Want such that yp (t) = et/2 is a solution to


dyp
?
+ 2yp = 3et/2 .
dt

Example 1.

y
8

dy
= 2y + 3et/2
dt

6
4

General solution:
2

y (t) = 2et/2 + k e2t


-3

-2

-1

1
-2

What is the long-term behavior of the solutions?

Example 2.

dy
= y + 2 cos 4t
dt

1. General solution of the associated homogeneous equation:

2. Particular solution of the nonhomogeneous equation:

Want and such that yp (t) = cos 4t + sin 4t is a solution to


dyp
?
+ yp = 2 cos 4t.
dt

Want and such that


(

+ 4 = 2
4 + = 0.

Example 2.
dy
= y + 2 cos 4t
dt
General solution:
y (t) =

2
8
cos 4t +
sin 4t
17
17
+ k et

y
2

-1
-2

What is the long-term behavior of the solutions?

Example 3.

dy
= 3y + 2e3t
dt

1. General solution of the associated homogeneous equation:

2. Particular solution of the nonhomogeneous equation (trick question):

Example 3.

y
4

dy
= 3y + 2e3t
dt

General solution:
-1

y (t) = 2te3t + ke3t


-2

-4

What is the long-term behavior of the solutions?

The Magic Function


For this method we rewrite the nonhomogeneous equation
dy
= a(t)y + b(t)
dt

as

dy
+ g(t)y = b(t).
dt

In other words, g(t) = a(t). There is no mathematical significance to this step. It


just avoids an annoying minus sign in one of the formulas.
Now for some magic:

We want a function (t) such that




dy
? d
+ g(t) y =
((t) y ) .
(t)
dt
dt

Summary: Given a linear differential equation of the form


dy
+ g(t) y = b(t),
dt
the integrating factor (magic function) is (t) = e(
the differential equation by (t) yields

g(t) dt )

d
((t) y ) = (t) b(t).
dt

. Multiplying both sides of

Example.

dy
y
= + t cos t
dt
t

y
30

-10

10

-30

General solution: y (t) = t sin t + kt

Recall Example 3 from Module 9.2.


Example 3.

dy
= 3y + 2e3t
dt

Now that we know the secret of the magic function we can solve the mixing
problem from the beginning of Module 9.1.
A 200 liter tank initially contains 100 liters of salt water containing 1000 grams of
salt. Suppose salt water that contains 35 grams of salt per liter is pumped into the
tank at the rate of 4 liters per minute, while a well-mixed solution leaves the tank at
a rate of 2 liters per minute. How much salt is in the tank when the tank fills up?
ds
s
= 140
,
dt
50 + t

s(0) = 1000

Comparing the methods


Now we have two methods for solving nonhomogeneous linear equations. How do
we decide which method to use?
Method of integrating factors (the magic function):
1. In theory, it always works.
2. But you must calculate two integrals.
Method of undetermined coefficients (the lucky guess):
1. Tends to be faster than the method of integrating factorsmostly algebra.
2. Note that the examples that we considered were all of the form
dy
= a(t)y + b(t)
dt
where a(t) was a constant function (constant-coefficient case). What types
of functions b(t) did we consider?

Simple mass-spring system

We model the motion of a mass-spring


system using Newtons second law
F = ma

S
P

l
tia
en s
er on
iff ti
D ua
q
E

b
u
P

g
in
sh
li

and Hookes law. Hookes law asserts


that the restoring force of a spring is
linearly proportional to its displacement
from its rest position.

d/ De

ar
Blanch

vaney/

Halll

l
tia
en s
er on
iff ti
D ua
q
E

evaney

ard /D

Blanch

W
P

b
u
P

g
in
sh
li

Hookes law: the restoring force of a spring is linearly proportional to its


displacement from its rest position.

/Halllll

Using Newtons second law F = ma and Hookes law,


we get

General second-order, autonomous differential equation


In general, a second-order autonomous equation has
I

one independent variable (often t) and

one dependent variable (often x or y ).

d 2x
It has the form
=f
dt 2





dx
d 2y
dy
x,
or
= f y,
.
dt
dt
dt 2

Other examples:
d 2x
dx
(1 x 2 )
+x =0
dt
dt 2
d 2x
dx
+b
+ kx + x 3 = 0
2
dt
dt

Predator-prey system
We begin our discussion of first-order systems of equations with the most basic
predator-prey system. The prey are often referred to as rabbits and the predators
are often referred to as foxes. The most basic predator-prey system is based on
the following four assumptions:
I

If no foxes are present, the rabbits reproduce at a rate proportional to their


population, and they are not affected by overcrowding.

The foxes eat the rabbits, and the rate at which the rabbits are eaten is
proportional to the rate at which the foxes and rabbits interact.

Without rabbits to eat, the fox population declines at a rate proportional to


itself.

The rate at which foxes are born is proportional to the number of rabbits eaten
by foxes which, by the second assumption, is proportional to the rate at which
the foxes and rabbits interact.

Lets build a model based on these four assumptions.


Variables:

If no foxes are present, the rabbits reproduce at a rate proportional to their


population, and they are not affected by overcrowding.

The foxes eat the rabbits, and the rate at which the rabbits are eaten is
proportional to the rate at which the foxes and rabbits interact.

Without rabbits to eat, the fox population declines at a rate proportional to


itself.

The rate at which foxes are born is proportional to the number of rabbits eaten
by foxes which, by the second assumption, is proportional to the rate at which
the foxes and rabbits interact.

These two differential equations taken together form the predator-prey system
dR
= aR bRF
dt
dF
= cF + dRF
dt
where a, b, c, and d are positive parameters.

General 2D, first-order, autonomous system of differential equations


In general, a first-order autonomous system has
I

one independent variable (often t) and

two dependent variables.

If the dependent variables are x and y , the first-order system has the form
dx
= f (x, y )
dt
dy
= g(x, y ).
dt

Lets discuss some terminology for systems of differential equations, and well do
that using the predator-prey system with the parameters a = 2, b = 1.2, c = 1,
and d = 0.9.
Initial condition:
Solution to an initial-value problem:

We will use a computer to approximate the solution to the predator-prey system


with the parameters given above and the initial condition
(R0 , F0 ) = (1.0, 0.5).

More terminology:
I

component graphs
=

More terminology:
I

phase plane
=

More terminology:
I

solution curve in phase plane


=

More terminology:
I

equilibrium solutions: Solutions for which both component functions are


constant for all t.

Example. For the predator-prey system


dR
= aR bRF
dt
dF
= cF + dRF ,
dt
the initial condition (R0 , F0 ) = (0, 0) corresponds to the equilibrium solution
(R(t), F (t)) = (0, 0) for all t.

Example. Lets compute


all equilibrium solutions
for any predator-prey
system of the form
dR
= aR bRF
dt
dF
= cF + dRF
dt
where a, b, c, and d are
positive parameters.

More terminology:
F
I

phase portrait
4

Reduction of order
Although these two systems seem quite different, they have more in common than
you might think at first. In particular, the mass-spring system can also be written
as a first-order system by introducing the new variable v (which is just dy /dt).
We get

In what ways is the mass-spring system similar to the predator-prey system?


The predator-prey system is a pair
of coupled first-order autonomous
differential equations
dR
= aR bRF
dt
dF
= cF + dRF .
dt
An initial condition is a pair (R0 , F0 )
of population values.

The mass-spring system can


also be expressed as a pair of
coupled first-order autonomous
differential equations
dy
=v
dt
dv
k
= y.
dt
m
An initial condition for the
mass-spring system is also a
pair (y0 , v0 ).

Since the mass-spring system can be expressed as a system, all of the terms that
we discussed for the predator-prey system apply to the mass-spring system as
well:
I

component graphs

solution curve

phase plane

equilibrium solutions

phase portrait

Mass-spring versus predator-preyone difference


One way that the two systems differ is by the fact that we can find formulas for the
solutions of the mass-spring system but not for the predator-prey system. In fact,
when we considered the special case of the mass-spring system where k = m,
the equation simplified to
d 2y
= y ,
dt 2
and we guessed the solutions
y1 (t) = sin t,

y2 (t) = 2 sin t,

and y3 (t) = cos t.

The equivalent system


dy
=v
dt
dv
= y
dt
has one (y (t), v (t)) pair of
solutions for each solution
to the second-order
equation.

1. y1 (t) = sin t

2. y2 (t) = 2 sin t

3. y3 (t) = cos t

What are the initial conditions for these solutions?

The vector field for the simple mass-spring system


Example. Consider the
simple mass-spring
system
dy
=v
dt
dv
= y.
dt
Lets rewrite this system
in vector notation.

Consider the solution (y3 (t), v3 (t)) = (cos t, sin t) that we discussed in the
previous module. Lets express it in vector notation:

Lets discuss the geometric


interpretation of

dY
= F(Y)
dt
where
F(Y) = F

y
v

v
y

Summary for the simple mass-spring system:

Vector notation for an autonomous system


Consider the system
dx
= f (x, y )
dt
dy
= g(x, y ).
dt
We use the right-hand side of this
system to form a vector field
!


f (x, y )
x
F
=
y
g(x, y )
in the xy -plane.

We also use x(t) and y (t) to form a


vector-valued function
!
x(t)
Y(t) =
.
y (t)
Then the (scalar) system of differential
equations can be rewritten as one
vector differential equation
dY
= F(Y).
dt

Example. Consider the system


dx
= y
dt
dy
= x 0.3y .
dt
The vector field associated with this
system is
!


y
x
F(Y) = F
=
.
y
x 0.3y

x, y

A Population Model for Two Competing Species


Consider the system

dx
= 2x 1
dt

dy
= 3y 1
dt

x
2
y
3

xy
2xy .

We think of x and y as representing the populations of two species that compete


for the same resource, and since x and y represent populations, we focus our
attention on the solutions whose initial conditions lie in the first quadrant.

Lets begin by calculating the equilibrium points:

x, y

t
x, y

The damped harmonic oscillator

We start with the mass-spring system and add a term that models damping.
Assumption: The damping force is proportional to the speed of the mass and it
acts as a restoring force.

Damped harmonic oscillator: The second-order equation


m

d 2y
dy
+b
+ ky = 0
2
dt
dt

and its equivalent first-order system


dy
=v
dt
k
b
dv
= y v.
dt
m
m

Guessing solutions to the damped harmonic oscillator


There is a guessing technique for the damped harmonic oscillator
m

d 2y
dy
+ ky = 0.
+b
2
dt
dt

Example. Consider the harmonic oscillator

d 2y
dy
+ 2y = 0.
+3
2
dt
dt

You might also like