Unit #15 : Differential Equations
Goals:
• To introduce the concept of a differential equation.• Discuss the relationship between differential equations and slope fields.• Discuss Euler’s method for solving a differential equation numerically.• Discuss the method of separation of variables to solve a differential equation
exactly.
Differential Equations Intro - 1
Differential Equations
A differential equation (DE) is an equation involving the derivative(s) of an un-known function. Many of the laws of nature are easily expressed as differentialequations.For example, here is one way to define the exponential function:
dy
dt= y
Write this mathematical formula as a sentence, and then find a “solution” tothe equation.
Differential Equations Intro - 2
How can the solution you found be altered and still satisfy the DEdy
dt= y?
Differential Equations Intro - 3
Making a further alteration to the function y = et, find a family of functionsall of which satisfy the DE
dy
dt= ky.
Differential Equations Intro - 4
The differential equationdy
dt= ky, when expressed as an English sentence, says
that
the rate at which y changes is proportional to the magni-tude of y.
• If k > 0, this is one way of characterizing exponential growth.• If k < 0, the rate of change becomes negative and we are dealing with expo-
nential decay.
Second-Order Differential Equations - 1
If a DE involves the second derivative of a function, it is called a second orderdifferential equation.
Try to think of two functions that satisfy the differential equation
d2y
dt2= −y.
Second-Order Differential Equations - 2
d2y
dt2= −y
Try to combine these two functions to get even more solutions for this DE.
Sources of Differential Equations - 1
Sources of Differential EquationsWe study differential equations primarily because many natural laws and theoriesare best expressed in this format.Translate the following sentence into an equation:
The rate at which the potato cools off is proportionalto the difference between the temperature of the potatoand the temperature of the air around the potato.
Sources of Differential Equations - 2
Translate the following sentence into an equation:
The rate at which a rumour spreads is proportional to theproduct of the people who have heard it and those whohave not.
Sources of Differential Equations - 3
Translate the following sentence into an equation:
The rate at which water is leaking from the tank is pro-portional to the square root of the volume of water inthe tank.
(a)dV
dt=√V
(b)dV
dt= k√V
(c)
√dV
dt= V
(d)
√dV
dt= kV
Sources of Differential Equations - 4
Translate the following sentence into an equation:
As the meteorite plummets toward the Earth, its accel-eration is inversely proportional to the square of its dis-tance from the centre of the Earth.
(a)dr
dt= kr2
(b)dr
dt=
k
r2
(c)d2r
dt2= kr2
(d)d2r
dt2=
k
r2
The previous examples indicate how easily differential equations can be constructed.Unfortunately, starting with those equations, we have a lot of work to do beforewe can predict will happen given the equation.
Slope Fields - 1
Slope Fields
Consider the differential equation
dy
dx= cosx .
Recall how we would use this derivative information to sketch y:
dy
dxvalues give the slopes of the graph of y
Said another way, we are looking for a function y(x) which has, at each point, aslope given by cos(x).
Give the most general function y that satisfiesdy
dx= cos(x).
Slope Fields - 2
We are now going to introduce an alternate way to get to this solution throughgraphical techniques. These are an extension of our slope interpretation.
Example: Below is a slope field graph for the DEdy
dx= cos(x). How was
it constructed?
0 1 2 3 4 5 6 7 8 9
−3
−2
−1
0
1
2
3
Sketch the functions y found earlier on the slope field.
Slope Fields - 3
Slope fields are especially useful when we study more general differential equations,which can be written in the form
d
dxy = f (x, y).
Examples are
dy
dx= −x
y,
dy
dx= xy, and
dy
dx= y − x .
Note: These forms cannot be directly integrated to find y(x).
Try to solve for y givendy
dx=
1
2(x− y)
Slope Fields - 4
Sketch the slope field for the differential equationdy
dx=
1
2(x− y), and sketch
two solutions.
1
2
−1
−2
1 2−1−2
x
y
This sketch gives an idea of the form of y which satisfiesdy
dx=
1
2(x− y), without
needing to solve for y as a function.
Slope Fields - Logistic Growth - 1
Example: (Logistic Growth) The growth of a population is often modeledby the logistic differential equation. For example, if bacteria are grown on apetri dish which really cannot support a bacterial culture larger than L, thena useful differential equation model for the population is
dP
dt= k P (L− P ) ,
where P (t) is the size of the culture at time t.
For what values of P is the function k P (L− P ) zero?
(a) P = 0
(b) L = 0
(c) P = 0, L
(d) L = 0, P
Slope Fields - Logistic Growth - 2
dP
dt= k P (L− P )
For what values of P is the function k P (L− P ) largest?
(a) P = 0
(b) P = L
(c) P = 2L
(d) P =L
2
Slope Fields - Logistic Growth - 3
Sketch the slope field associated with the differential equation
dP
dt= k P (L− P ).
On the slope field, draw several solutions using different initial conditions.
Euler’s Method - 1
Euler’s Method
We can extend the idea of a slope field (a visual technique) to Euler’s method (anumerical technique). Euler’s method can be used to produce approximations ofthe curve y(x) that satisfy a particular differential equation. Here is the idea:
Knowing where you are in x and y, you look at the slope field at yourlocation, set off in that direction for a small distance, look again and adjustyour direction, set off in that direction for a small distance, etc.
Euler’s Method - 2
Algorithmically,
• Start at a point (xi, yi)
• Compute the slope there, using the DE dydx
= f (xi, yi)
• Follow the slope for a step of ∆x:– xi+1 = xi + ∆x
– yi+1 = yi +dy
dx∆x︸ ︷︷ ︸
∆y
Euler’s Method - 3
Follow this procedure for the differential equationdy
dx= x + y with initial con-
dition y(0) = 0.1. Use ∆x = 0.1.
x y slope ∆y = slope ·∆x
0 0.1 0.1 (0.1)(0.1) = 0.01
0.1 0.11
0.2
0.3
0.4
Euler’s Method - 4
Here is a picture of the slope field fordy
dx= x + y. On this slope field, sketch
what you have done in creating the table of values. From the picture, wouldyou say the values for y(x) in your table are over-estimates or under-estimatesof the real y values?
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
−1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
Separation of Variables - 1
Separation of Variables
We have now considered both visual and approximate techniques for solving dif-ferential equations, which can be obtained with no calculus. The problem withthose approaches is that they do not result in formulas for the function y that wewant to identify.We (at last!) proceed to calculus-based techniques for finding a formula for y.
Consider the differential equationdy
dx= k y.
Treating dx and dy as separable units, transform the equation so that onlyterms with y are on the left, and only terms with x are on the right.
Place an integral sign in front of each side.
Separation of Variables - 2
Evaluate the integrals.
Solve for y.
The solution gives a family of functions, one for each value of the integrationconstant. k is also a parameter, of course, but it is presumed to be specified in thedifferential equation.
Separation of Variables - 3
As soon as we are given an initial value, say y(0) = 10, the solution becomesunique.Find the specific solution with initial value y(0) = 10.
If y0 > 0, this function describes exponential growth (k > 0) or decay (k < 0).
Separation of Variables - 4
Use the method of separation of variables to solve the differential equation
dR
dx= 2R + 3,
and find the particular solution for which R(0) = 0.
Classifying Differential Equations - 1
Classifying Differential EquationsFor any differential equation which is separable, we can at least attempt to find asolution using anti-derivatives. For equations which are not separable, we’ll needother techniques. It is important, as a result, to be able to tell the difference!Indicate which of the following differential equations are separable. For thosewhich are separable, set up the appropriate integrals to start solving for y.
• dydx
= x2
• dydx
=ey
x
Classifying Differential Equations - 2
• dydx
= x + y
• dydx
= cos(x) cos(y)
Classifying Differential Equations - 3
• dydx
= cos(xy) A. Separable B. Not separable
• dydx
= ex + ey A. Separable B. Not separable
• dydx
= e(x+y) A. Separable B. Not separable
Classifying Differential Equations - 4
Note: all the original anti-derivatives we studied in first term are of the formdy
dx= f (x) and so y = F (x) =
∫f (x) dx.
E.g.dy
dx= x2
dy
dx= x cos(5x)
dy
dx=
x
1 + x2
These are all immediately separable.
The challenge is that most interesting scientific laws expressed in differential equa-tion form aren’t that easy to work with.