Chapter 1 First Order ODE (Part II)
Chapter 1 First Order ODE (Part II)
Definition
Direction Field
The following example will illustrate the basic idea about sketching direction
fields.
y'
(b) 20 Note that the values of y′ do not
depend on t.
12
10
0 t
………………………..........................................................................................
1
First-order Ordinary Differential Equations (Part ii)
The arrows in the direction field give tangent lines to solution curves, and
indicate where solution is increasing or decreasing (as well as how much the
increment). The horizontal solution curves are called equilibrium solutions.
Definition
Equilibrium Solutions
dy
(b) Note that by setting =0,
dt
2.4 − 0.2 y = 0
y = 12
As can be seen from the direction field, the equilibrium solution appears
to be y(t) = 12 as t → ∞ , to which all other solutions converge.
(c)
For y > 12, the slopes are negative and hence the solutions decrease;
For y < 12, the slopes are positive and hence the solutions increase.
…………………………………………………....……Try Question 1, Exercise 1G
2
First-order Ordinary Differential Equations (Part ii)
(c) DEplot(diff(y(t),t)=2.4-
0.2*y(t), y(t), t=0..10,
y=0..20, [[y(0)=0],
[y(0)=5],[y(0)=12],[y(0)=15
],[y(0)=20]],linecolor=blue
, color=black);
3
First-order Ordinary Differential Equations (Part ii)
Check:
(b) When t = 0 , y = y0 ,
y0 = ba + Ce a ( 0) ⇒ C = y0 − ba
b b
∴ y= + y0 − e at
a a
4
First-order Ordinary Differential Equations (Part ii)
dy b
(c) By setting = ay − b ≡ 0 , the equilibrium solution is y (t ) = .
dt a
(d) The solution behaviour is divided into the following cases.
(i) If y0 = ba , then y is constant, with y (t ) = ba .
(ii) If y0 > ba and a > 0 , then y increases exponentially without bound.
(iii) If y0 > ba and a < 0 , then y decays exponentially to ba .
(iv) If y0 < ba and a > 0 , then y decreases exponentially without bound.
(v) If y0 < ba and a < 0 , then y increases asymptotically to ba .
…………………………………………………....……Try Question 4, Exercise 1G
Exercise 1G
1. Draw the direction field for the given differential equations. Based on
the direction field and its equilibrium solution(s) of y as t → ∞ , describe
the dependency of its solution on the initial value of y at t = 0.
(a) y′ = 5 − 2 y (b) y ′ = 5 + 2 y
(c) y ′ = − y (3 − y ) (d) y ′ = y ( y − 1.5) 2
dy
2. Write down a differential equation of the form = ay + b , a and b are
dt
real numbers, whose solutions have the required behavior as t → ∞.
(b) All solutions approach y = 4
(b) All other solutions diverge from y = 4
(c) All solutions approach y = 3/5
(d) All other solutions diverge from y = 1/2
5
First-order Ordinary Differential Equations (Part ii)
Answers to Exercise 1G
1. (a) (b)
For y > 2.5, the slopes are negative and For y > -2.5, the slopes are positive and
hence the solutions decrease; For y < 2.5, hence the solutions increase; For y < -2.5,
the slopes are positive and hence the the slopes are negative and hence the
solutions increase; The equilibrium solutions decrease; All solutions appear to
solution appears to be y(t) = 2.5, to which diverge away from equilibrium solution
all other solutions converge. y(t) = -2.5
(c) (d)
Note that y ′ = 0 for y = 0 and y = 3. The Note that y ′ = 0 for y = 0 and y = 1.5. The
two equilibrium solutions are y(t) = 0 and two equilibrium solutions are y(t) = 0 and
y(t) = 3; For y > 3, the solutions with initial y(t) = 1.5; For y > 1.5, the solutions with
values greater than 3 diverge from the initial values greater than 1.5 diverge from
solution y(t) = 3; For 0 < y < 3, the slopes the solution y(t) = 1.5; For 0 < y < 1.5, the
are negative and hence the solutions with slopes are positive and hence the solutions
initial values between 0 and 3 all decrease with initial values between 0 and 1.5 all
towards the solution y(t) = 0; For y < 0, the increase towards the solution y(t) = 1.5;
slopes are positive and hence the solutions For y < 0, the slopes are negative and
with initial values less than 0 approach the hence the solutions with initial values less
solution y(t) = 0. than 0 diverge from the solution y(t) = 0.
6
First-order Ordinary Differential Equations (Part ii)
− pt − pt
4. (a) y (t ) = p + Ce or y (t ) = 1p (q − Ce ) , where C is an
q
(b)
arbitrary constant.
(c) (i) As p increases, the equilibrium solution gets closer to
y(t) = 0; The convergence rate of all solutions, i.e. p is
also increases.
(ii) As q increases, the equilibrium solution y(t) = q/p
becomes larger; The convergence rate remains the
same.
(iii) If both p and q increase (but q/p = constant), then the
equilibrium solution y(t) = q/p remains the same; The
convergence rate of all solutions increases.
_______________________________________________________________
Theorem
The Existence and Uniqueness of Solutions for
First-order Linear Ordinary Differential Equation
7
First-order Ordinary Differential Equations (Part ii)
dy 1
(a) Rewrite the differential equation as + y = 2 x 2 , the function
dx x
p ( x) = 1x is continuous everywhere except x = 0 . Since the initial
condition is specified at x = 1 , the given initial value problem has a
unique solution on the interval x > 0 .
(b) Same as Part (a), but since the initial condition is specified at x = −2 , the
given initial value problem has a unique solution on the interval x < 0 .
cos x
(c) The function p ( x) = cot x = is discontinuous at x = 0 or x = π (of
sin x
course there is many other discontinuous points for this p (x) ). Since
0 < π2 < π , the initial value problem has a unique solution on the interval
0< x<π .
We have seen that the intervals in which the unique solution for the
initial value problem of first-order linear ordinary differential equation is
certain to exist, not only depend on the continuity of the function p(x) and q(x),
but also the initial value of x (i.e. x0 ). It means that we could not simply
choose any values for the initial condition in order to obtain the particular (or
specific) solution of a first-order ordinary differential equation.
Theorem
The Existence and Uniqueness of Solutions for
First-order Non-linear Ordinary Differential Equation
8
First-order Ordinary Differential Equations (Part ii)
x +1 ∂f ( x + 1)(2 − 2 y )
(c) The function f ( x, y ) = and its derivatives =
y − 2y 2
∂y ( y 2 − 2 y) 2
is not continuous at y 2 − 2 y = 0 . Thus, the unique solution exists on
rectangular region not intersected by lines y = 0 or y = 2 on xy-plane.
…………………………………………………....……Try Question 2, Exercise 1H
Besides the theory that describes the existence and uniqueness of the
solution for first-order linear and non-linear ordinary differential equations are
different, the linear differential equations have explicitly defined solutions
while the nonlinear differential equations typically do not have. In other
words, the nonlinear differential equations may or may not have implicitly
defined solutions.
Exercise 1H
9
First-order Ordinary Differential Equations (Part ii)
2. State the region(s) in the xy-plane where the theorem existence and
uniqueness guarantee a unique solution through any given initial point in
the region.
(a) y′ = e x y − y 3 (b) y′ = 2 y1/ 2
(c) ( x + 1) y′ = y1 / 3 (d) y′ = xy 2 − 1 /(3 y + x)
dy 25 − x 2 − y 2
(e) = (f) y′ = ( x 2 + y 2 ) 3 / 2
dx x + y +1
dy x− y dy 1 + x 2
(g) = (h) =
dx 2 x + 5 y dx 3 y − y 2
(i) y′ = 1 − x 2 − y 2
3. Solve the initial value problem and determine the interval in which the
solution exists.
(a) 2 y′ + y 3 = 0 , y (0) = −1 (b) y ′ = y 2 , y (0) = 1
(c) y ′ = y 2 , y (2) = 1 (d) yy′ = − x , y (0) = 1
Answers to Exercise 1H
1
1. (a) 0 < x < 5 [Rewrite the DE as y′ + y = 0 . The coefficient 1 / x( x − 5) is
x( x − 5)
continuous everywhere except at x = 0, 5. Since the initial condition is specified at
x = 3 , this assures the existence of a unique solution on the interval 0 < x < 5 .]
2x x2
(b) −2 < x < 2 [Rewrite the DE as y′ + y= . The coefficient 2 x /( 4 − x 2 ) and
4−x 2
4 − x2
function x 2 /( 4 − x 2 ) is discontinuous at x = ±2 . Since the initial condition is specified
at x = 1 , the IVP has a unique solution on the interval (−2, 2) .]
(c) −∞ < x < ∞ [Rewrite the DE as y′ − xy = 0 . The coefficient − x is continuous
everywhere. The IVP has a unique solution on the interval (−∞, ∞) .]
(d) x > 0 [Rewrite the DE as y′ − 1x y = 0 . The coefficient − 1x is continuous everywhere
for x > 0 or x < 0 . Since the initial condition is specified at x = 1 (> 0) , the IVP has a
unique solution on the interval (0, ∞) .]
(e) x < 0 [Rewrite the DE as y′ − 1x y = 0 . The coefficient − 1x is continuous everywhere
for x > 0 or x < 0 . Since the initial condition is specified at x = −1 (< 0) , the IVP has
a unique solution on the interval (−∞, 0) .]
(f) − π2 < x < π
2 [The function e x / cos 2 x is discontinuous at x = − π2 or x = π
2 etc.. Since
− π2 < 0 < π
2 , the IVP has a unique solution on the interval (− π2 , π2 ) . ]
(g) − π2 < x < π
2 [The function tan x is discontinuous at odd multiples of π
2 . Since
− π2 < 0 < π
2 , the IVP has a unique solution on the interval (− π2 , π2 ) .]
(h) π
2 < x < 32π [The function tan x is discontinuous at odd multiples of π
2 . Since
π
2 < π < 32π , the IVP has a unique solution on the interval ( π2 , 32π ) . ]
10
First-order Ordinary Differential Equations (Part ii)
∂f
2. (a) Any rectangular region. [The function f = e x y − y 3 and its derivatives = e x − 3y 2
∂y
continuous everywhere.]
(b) Any rectangular region y > 0 . [The function f = 2 y1/ 2 continuous everywhere, its
∂f 1
derivatives = continuous for all x and y > 0 .]
∂y y
(c) Any rectangular region not intersected by line x = −1 or y = 0 . [The function
∂f 1
f = y1 / 3 /( x + 1) and its derivatives = continuous for all region except
∂y 3( x + 1) y 2 / 3
x + 1 = 0 or y = 0 .]
(d) Any rectangular region except intersected by straight line y = − x / 3 . [The function
∂f 3
f = xy 2 − 1 /(3 y + x) and its derivatives = 2 xy + continuous for all
∂y (3 y + x) 2
region except 3 y + x = 0 .]
(e) Any rectangular region lying wholly inside the circle x 2 + y 2 = 25 and not containing
25 − x 2 − y 2
any part of line y = − x − 1 . [The function f = continuous for all region
x + y +1
∂f x 2 − yx − y − 25
x 2 + y 2 ≤ 25 but not for y + x + 1 = 0 ; Its derivatives =
∂y 25 − x 2 − y 2 ( x + y + 1) 2
continuous for all region x 2 + y 2 < 25 but not for y + x + 1 = 0 .]
(f) Any rectangular region. [The function f = ( x 2 + y 2 )3 / 2 and its derivatives
∂f
= 3 y x 2 + y 2 continuous everywhere.]
∂y
x− y
(g) Any rectangular region not intersected by line y = −0.4 x . [The function f =
2x + 5 y
∂f −7 x
and its derivatives= not continuous at 2 x + 5 y = 0 .]
∂y (2 x + 5 y ) 2
(h) Any rectangular region not intersected by the lines y = 0 or y = 3 . [The function
1+ x2 ∂f (1 + x 2 )(2 y − 3)
f = and its derivatives = not continuous at
3y − y2 ∂y (3 y − y 2 ) 2
3 y − y 2 = 0 .]
(i) Any rectangular region x 2 + y 2 < 1 . [The function f = 1 − x 2 − y 2 continuous when
∂f −y
1 − x2 − y2 ≥ 0 and its derivatives = continuous when
∂y 1 − x2 − y 2
1 − x 2 − y 2 > 0 .]
3. (a) y ( x) = 1 / x + 1 ; x > −1
(b) y ( x) = 1 /(1 − x) ; x < 1 [The solution y ( x) = 1 /(1 − x) in not continuous at x = 1 , since
the initial condition is specified at x = 0 , the interval of existence of this solution is
(−∞, 1) .]
(c) y ( x) = 1 /(3 − x) ; x < 3 [The solution y ( x) = 1 /(3 − x) in not continuous at x = 3 , since
the initial condition is specified at x = 2 , the interval of existence of this solution is
x < 3 .]
(d) y ( x) = 1 − x 2 ; −1 < x < 1
11
First-order Ordinary Differential Equations (Part ii)
Procedure
Three Main Steps in Mathematical Modelling
In this section, we will focus more on the step 1 and 2 above, with
those the mathematical models can be expressed in first-order ordinary
differential equations.
Exercise 1I
2. Free fall equation: Given that the force of gravity (acting downward) is
mg, and the force of air resistance (acting upward) is γ v, where m =
mass, g = gravity and v = velocity.
12
First-order Ordinary Differential Equations (Part ii)
13
First-order Ordinary Differential Equations (Part ii)
dy
= α y (1 − y ), y (0) = y0 ,
dt
where α is a positive proportionality factor, and y0 is the initial
proportion of infectious individuals.
(a) Find the equilibrium points for the differential equation and
determine whether each is asymptotically stable or unstable.
(b) Show that the solution for the initial value problem is given by
y 0 eα t
y (t ) = .
1 − y 0 + y 0 e αt
(c) Show that y (t ) → 1 as t → ∞ , which means that ultimately the
disease spreads through the entire population.
10. A tank originally contains 100 liter (l) of plain water. Then, water
containing 0.5 g of chemical material per liter is poured into the tank at a
14
First-order Ordinary Differential Equations (Part ii)
rate of 2 l/min, the mixture is allowed to leave at the same rate. After 10
min the process is stopped and plain water is poured into the tank at a
rate of 2 l/min, with the mixture again leaving at the same rate. Find the
amount of chemical material in the tank at the end of an additional 10
min.
Answers to Exercise 1I
dP
1. (a) = 480 − 0.5 P (mg/hr) (b) 960 mg (within a few fours)
dt
dv dv
2. (a) m = mg − γ v (b) = 9.8 − 0.2 v ; equilibrium solution, v (t ) = 49
dt dt
(c) (i) v(0) = 0 ; v = 49 (1 − e −2t ) (ii) ≈ 10.51 seconds (iii) 43.01 m/second
3. (a) r = ln 2 per month (b) r = (30 / N ) ln 2 per month
dy
4. (a) = 0.6 y − 360 , y (0) = y0 (b) For y0 > 600 , the slopes are positive and hence the
dt
solutions increase; For y0 < 600 , the slopes are negative and hence the solutions
decrease; All solutions appear to diverge away from unstable equilibrium solution
y(t) = 600.
(2 − t ) 2 , 0 ≤ t ≤ 2
5. (a) h(t ) = (2 − t ) 2 (b) The bucket is empty. (c) h(t ) =
0, t>2
6. (a) The equilibrium points are at y(t) = 0 (unstable) and y(t) = 1 (asymptotically stable).
dp
7. (a) = rP , P(0) = P0 ; Its solution: P(t ) = P0 e rt
dt
dp
(c) = 0.09902P − 20 000 , P(0) = 200 000 ; P(t ) = 201 979.4 − 1 979.4 e 0.09902t
dt
1
dy y − t
8. (a) + = 10 , y (0) = 4 (b) y (t ) = 200 − 196 e 20 (c) 68.62 g (d) y = 200 g
dt 20
t
dy y −
9. (a) =− , y (0) = 200 (b) y (t ) = 200 e 100
dt 100
(c) 1% of its original value = 2 g; When y = 2 g, t ≈ 460.5 min
dy y
10. 7.42 g [Two IVPs involved. First, solve for = 1− , y (0) = 0 , at t = 10, we obtained
dt 50
dy y
y (10) = 50 − 50e −0.2 ; Second, solve for =− , y (10) = 50 − 50e −0.2 , at t = 20,
dt 50
we obtained y (20) = 50(e 0.2 − 1)e −0.4 ≈ 7.42 .]
dy r
11. (a) + y = 0.25r , y (0) = y0 (b) y (t ) = 25(1 − e − rt / 100 ) + y0e − rt / 100
dt 100
(c) yL = lim y (t ) = 25 gram (d) T ≈ 130.4 min (e) r ≈ 8.69 gram/min
t →∞
15
First-order Ordinary Differential Equations (Part ii)
Definition
Autonomous Equations
(a) (b)
Direction fields of y′ = ry where (a) r = 2 , (b) r = −2
As can be seen from the direction fields above, for r = 2 ( > 0 ) , the
population have an exponential growth (i.e. y′ is positive); for
16
First-order Ordinary Differential Equations (Part ii)
Definition
Logistic Equation
The logistic equation, as given in (2) is often written in the following form
dy y
= r 1 − y ,
dt K
r
where K = . The constant r is called the intrinsic growth rate, and K
a
represents the carrying capacity (or saturation level) of the population.
17
First-order Ordinary Differential Equations (Part ii)
y
− ln 1 − + ln y = rt + C
K
y
ln = rt + C
1− y / K
y
= Ce rt
1− y / K
y0
At t = 0 , y = y0 , we have C =
1 − y0 / K
y y0 rt
Thus, = e
1 − y / K 1 − y0 / K
y K − y
Rearranging, y = K −0y0 e rt ×
K K
Ky0e rt y e rt
y= − 0 y
K − y0 K − y0
y e rt Ky0e rt
1 + 0 y =
K − y0 K − y0
Ky0e rt K − y0 y e rt
y=
÷ + 0
K − y0 K − y0 K − y0
Ky0e rt K − y0 ÷ e rt
y= ×
K − y0 K − y0 + y0e rt ÷ e rt
y0 K
∴ y (t ) =
y0 + ( K − y0 ) e − rt
…………………………………………………………………………………..
Definition
Equilibrium Solutions for Autonomous Equations
18
First-order Ordinary Differential Equations (Part ii)
dy
(a) By letting = f ( y ) , find the maximum or minimum point(s), if any,
dt
for f(y).
(b) Sketch the graph of f ( y ) versus y.
(c) Perform the test for concavity and determine the inflection point(s), if
any.
(d) Based on the information obtained in Part (b) and (c), sketch the solution
curves y for different initial conditions.
Solution:
y
(a) f ( y ) = r 1 − y --- (*), differentiate with respect to y,
K
y 1 r
f ′( y ) = r 1 − + y − = ( K − 2 y )
K K K
r K
Let f ′( y ) = 0 ⇒ ( K − 2 y) = 0 ∴ y =
K 2
K K ( K / 2) K rK
When y = , f = r 1 − =
2 2 K 2 4
Since eq. (*) is a quadratic equation with a = − Kr (< 0) , thus the critical
K rK
point , is a maximum point.
2 4
f (y)
(b) (K/2, rK/4) From this graph, we know that
rK/4 - Graph of y increasing when
0< y<K
- Graph of y decreasing when y > K
- Slope of y approximate 0 when
y
0 K/2 K y ≈ 0 or K
dy
(c) Since = f ( y) ,
dt
d 2 y d dy d d dy
2
= = f ( y) = f ( y) × = f ′( y ) × f ( y )
dt dt dt dt dy dt
19
First-order Ordinary Differential Equations (Part ii)
Exercise 1J
Answers to Exercise 1J
1. (a) 10 (b) 20 (c) 5 [ Since K = 10, the graph of y is steepest at K/2 ]
y0 K
2. (a) By using the solution y (t ) = , where y0 = y (0) ,
y 0 + ( K − y0 ) e −rt
since r = 1 and K = 20, substituting the given initial conditions
y0 = 5, 10, 20, 30 , we obtain the following results:
20 20
For y0 = 5 , y (t ) = −t
; For y0 = 10 , y (t ) = ;
1 + 3e 1 + e −t
20
First-order Ordinary Differential Equations (Part ii)
60
For y0 = 20 , y(t ) = 20 ; For y0 = 30 , y (t ) = .
3 − e −t
(b) See figure. Carrying capacity (or saturation level) is y = K = 20.
(c) There are 2 equilibrium points, i.e. y = 0 (unstable) and y = 20 (asymptotically stable).
3. ≈ 1.046 × 10 7
4. (a) 69.31 years (b) 175.78 years
Formula
Euler’s Method
Truncate the Taylor’s series after two terms, we obtained
y ( xi +1 ) = y ( xi ) + hy ′( xi ) .
It is called Euler’s method (or first-order Taylor series method). Or, we
write in more simpler notation as
y i +1 = y i + hf ( xi , y i ) .
Example 1.28………………………………………………………………...
Solve the following first-order initial value problem (IVP) at x = 0 (0.2) 1 by
Euler’s method.
2 y ′ + 3 y = e 2 x , with initial condition y (0) = 1 .
3x
1 6 −
Given the exact solution is y ( x) = e 2 x + e 2 .
7 7
Solution:
Step 1: Write in the form of y ′ = f ( x, y ) .
e2x − 3y e2x − 3y
From 2 y ′ + 3 y = e 2 x , hence y ′ = or f ( x, y ) = .
2 2
21
First-order Ordinary Differential Equations (Part ii)
y 0 = y ( x 0 ) = y (0) = 1
y2
y1 y3 y4 y5
y0
h = 0.2
x
x0 = 0 x1 = 0.2 x 2 = 0.4 x3 = 0.6 x 4 = 0.8 x5 = 1
Exercise 1K
Solve the following first-order initial value problem (IVP) by Euler’s method
with step size h = 0.2 . Find its absolute errors.
22
First-order Ordinary Differential Equations (Part ii)
1 1 4
Given that the exact solution is y ( x) = sin 2 x − cos 3 x + .
2 3 3
2
y y
4. y′ = 1 + + , in interval 1 ≤ x ≤ 2 with initial condition y (1) = 0 ;
x x
Given that the exact solution is y ( x) = x tan(ln x) .
Answers to Exercise 1K
1. 3.
i xi yi exact error i ti yi exact error
0 0 0 0 0 0 0 0.333 0.333 0
1 0.2 0.000 0.027 0.027 1 0.2 0.000 0.163 0.163
2 0.4 0.073 0.151 0.078 2 0.4 0.120 0.205 0.085
3 0.6 0.309 0.496 0.187 3 0.6 0.320 0.377 0.057
4 0.8 0.911 1.331 0.420 4 0.8 0.600 0.646 0.046
5 1.0 2.310 3.219 0.909 5 1.0 0.960 1.002 0.042
2. 4.
i xi yi exact error i xi yi exact error
0 0 1 1.000 0 0 1.0 0 0 0
1 0.2 1.200 1.253 0.053 1 1.2 0.200 0.221 0.021
2 0.4 1.497 1.571 0.074 2 1.4 0.439 0.490 0.051
3 0.6 1.823 1.875 0.052 3 1.6 0.721 0.813 0.092
4 0.8 2.090 2.079 0.011 4 1.8 1.052 1.199 0.147
5 1.0 2.219 2.118 0.101 5 2.0 1.437 1.661 0.224
5. Exact solution, y ( x) = x + 2 − e − x
i xi exact yi (h = 0.1) error yi (h = 0.05) error
0 0 1 1 0 1 0
1 0.1 1.195 1.200 0.005 1.198 0.003
2 0.2 1.381 1.390 0.009 1.386 0.005
3 0.3 1.559 1.571 0.012 1.566 0.007
4 0.4 1.730 1.744 0.014 1.738 0.008
5 0.5 1.893 1.910 0.017 1.902 0.009
The solutions with step size h = 0.05 is more accurate than solutions with step size h = 0.1.
_______________________________________________________________
23