1.1 Basic Concepts. Modeling: Engineering Problems Physical Problems Economic Problems

You might also like

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

Chapter 1.

First-Order ODEs 1
§1.1 Basic Concepts. Modeling


 engineering problems
physical problems =⇒ mathematical expressions

 economic problems
⇑ modeling[differential equations]
(and we want to solve it.)
• Some applications of Differential Equations(DEs)

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 2

[Basic Concepts]
• differential equation(DE)
- ordinary differential equation(ODE): an equation that contains one or
several derivatives of an unknown function y(x) or y(t).
Ex. y ′ = cos x, y ′′ + 9y = e−2x, y ′y ′′′ − 23 y ′2 = 0.

- partial differential equation(PDE): an equation that contains partial


derivatives of an unknown function of two or more variables.
Ex. For u = u(x, y), uxx + uyy = 0.

• order of a DE: an order of the highest derivatives which occurs in the DE.
-first order ODEs
F (x, y, y ′) = 0 or y ′ = f (x, y) (1)

• solution of an ODE (1) on I = (a, b): a function satisfying the DE (1)


on I. The curve of the solution is called a solution curve.

Example 1. Verification of Solution


Show that y = xc (c an arbitrary constant, x ̸= 0) is a solution of
xy ′ = −y.
Sol. Differentiate y = xc , y ′ = − xc2 and we get xy ′ = − xc = −y.
Thus y is a solution of the ODE.

Example 2. Solution curve


Sketch the solution curve of y ′ = cos x.
Sol. By integration, we have y = sin x+c, where c is an arbitrary constant.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 3

• solution of F (x, y, y ′) = 0.
- general solution: a solution that contains an arbitrary constant c
- particular solution: a solution obtained from the general solution by
assigning definite value to c
- singular solution: a solution that cannot be obtained from the general
solution
Ex. Consider the ODE (y ′)2 − xy ′ + y = 0.
general solution : y = cx − c2,
particular solution : y = 2x − 4,
2
singular solution : y = x4 .

• Initial Value Problem(IVP)


-initial condition(IC)
F (x, y, y ′) = 0 or y ′ = f (x, y) (1)
y(x0) = y0

Example 4. Initial Value Problem


Solve the IVP
y ′ = 3y, y(0) = 5.7.

Sol. The general solution is y(x) = ce3x. From the initial condition we
obtain y(0) = c = 5.7. Hence the IVP has the solution y(x) = 5.7e3x.
This is a particular solution.
Computational Science & Engineering (CSE) T. Jeong
Chapter 1. First-Order ODEs 4

[Modeling]
Example 5. Radioactivity. Exponential Decay
Given an amount of a radioactive substance, say, 0.5g, find the amount
present at any later time.
Physical Information: Experiments show that at each instant a radioactive
substance decomposes at a rate proportional to the amount present.
Sol. [Step 1] Setting up a mathematical model(a differential equation)
Denote by y(t) the amount of substance still present at any time t.
By the physical law, the time rate of change y ′(t) is proportional to y(t).
The model of the process is the IVP:
y ′ = ky, y(0) = 0.5
[Step 2] Mathematical solution
The general solution is
y = cekt.
From the initial condition we get y(0) = c = 0.5. The particular solution
is
y = 0.5ekt.
[Step 3] Interpretation of result
Because k is negative, the initial amount decreases with time and the limit
of y(t) as t → ∞ is zero.

Fig.5. Radioactivity(Exponential decay,


y = 0.5e−kt, with k = 1.5 as an example)

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 5

§1.2 Geometric Meaning of y ′ = f (x, y).


Direction Fields, Euler’s Method
Consider an initial value problem
y ′(x) = f (x, y), y(x0) = y0.
How do you find the solution y of the IVP?

Note 1. f (x, y) is the slope of the solution curve at each point (x, y).
2. The level curves f (x, y) = k = const are called isoclines (curves
of equal inclination).

Example (Direction Fields)


Solve the IVP
y ′ = y + x.

Sol. We can show the directions of solution curves of a given ODE by drawing
short straight-line segments in the xy-plane.

Fig. 7. Direction field of y ′ = y + x, with three approximate solution curve


passing through (0,1), (0.0), (0,-1), respectively

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 6

• Numeric Method by Euler


For given IVP,
y ′ = f (x, y), y(x0) = y0
Euler’s method yields approximate solution values
yn = yn−1 + hf (xn−1, yn−1)
where xn = x0 + nh for the step h.

Fig. 8. First Euler step, showing a solution curve, its tangent at (x0 , y0 ) step h
and increment hf (x0 , y0 ) in the formula for y1

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 7

§1.3 Separable ODEs. Modeling

Note differential of y = h(x):


dy = y ′dx = h′(x)dx
[separable equation]
g(y)y ′ = f (x) or g(y)dy = f (x)dx
By integration, ∫ ∫
g(y)y ′dx = f (x)dx + c
and ∫ ∫
g(y)dy = f (x)dx + c.
method of separating variables

Example 1. A Separable ODE


Solve the ODE
y ′ = 1 + y 2.

Sol. The ODE is separable and


1
dy = dx.
1+ y2
By integration, we have
arctan y = x + c or y = tan(x + c).

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 8

Example 5. Mixing Problem


The tank contains 1000 gal water in which initially 100 lb of salt is dissolved.
• inflow: 10 gal of brine/min (each gallon contains 5 lb of salt).
• outflow: 10 gal of mixture/min.
Find the amount of salt in the tank at any time t.

Sol. [Step 1] Setting up a model


Let y(t) denote the amount of salt in the tank at time t. Then
y ′ = Salt inflow rate − Salt outflow rate
y
= 10 · 5 − 10 ·
1000
= −0.01(y − 5000)
and y(0) = 100.

[Step 2] Solution of the model


dy
= −0.01dt =⇒ ln |y − 5000| = −0.01t + c∗
y − 5000

=⇒ y − 5000 = ec e−0.01t = ce−0.01t.
From the initial condition y(0) = 100, c = −4900. The solution is
y = 5000 − 4900e−0.01t.
See Fig.
Computational Science & Engineering (CSE) T. Jeong
Chapter 1. First-Order ODEs 9

[Extended Method: Reduction to Separable Form]


Certain nonseparable ODEs can be made separable by transformations that
introduce for y a new unknown function.
For example, ( )
y
y′ = f .
x
Set u = xy . Thus
y = ux, y ′ = u′x + u
and
ODE =⇒ u′x + u = f (u) and u′x = f (u) − u
du dx
=⇒ = (separable ODE).
f (u) − u x

Example 8. Reduction to Separable Form


Solve
2xyy ′ = y 2 − x2.

y 2 −x2
Sol. ODE =⇒ y ′ = 2xy
= y
2x
− x
2y
.

y
Set u = x
or y = ux.
2
u′x + u = u
2
− 1
2u
⇒ u′x = − u2u
+1

⇒ 2u
u2 +1
du = − x1 dx

⇒ ln(1 + u2) = − ln |x| + c∗

⇒ 1 + u2 = xc .

c2
∴ x2 + y 2 = cx or (x − 2c )2 + y 2 = 4
.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 10

§1.4 Exact ODEs. Integrating Factors

Note differential (total differential) of u(x, y) :


∂u ∂u
du = dx + dy = uxdx + uy dy.
∂x ∂y
If u(x, y) = c (= const), then
du = 0.
For example, u = x + x2y 3 = c,
du = (1 + 2xy 3)dx + 3x2y 2dy = 0
′ 1 + 2xy 3
[ ⇐⇒ ODE y = − ].
3x2y 2
Definition (Exact ODE)
The first-order ODE
M (x, y)dx + N (x, y)dy = 0
is called an exact differential equation if the differential form
M (x, y)dx + N (x, y)dy is exact, that is,
M (x, y)dx + N (x, y)dy = du = uxdx + uy dy
for some u(x, y).
Note Suppose that M and N have continuous first partial derivatives.
Then,
M (x, y)dx + N (x, y)dy = 0 is exact. ⇐⇒ My = Nx.
Proof
(=⇒) Suppose that the ODE M (x, y)dx + N (x, y)dy = 0 is exact.
By definition, ux = M and uy = N for some u(x, y). Thus
My = uxy = uyx = Nx.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 11

(⇐=) Suppose that My = Nx.


We have to find u(x, y) such that ux = M, uy = N .
By integration, we have
∫ ∫
d
u= M dx + k(y) and N = uy = M dx + k′(y).
dy

∫ ∫( ∫ )
Thus k (y) = N − dy M dx and k(y) =
d
N − dy M dx dy+c,
d

and
∫ ∫ ( ∫ )
d
u(x, y) = M dx + N− M dx dy + c.
dy
Then u(x, y) satisfies ux = M and uy = N .

Example 1. An Exact ODE


Solve
cos(x + y)dx + (3y 2 + 2y + cos(x + y))dy = 0.

Sol. Let M = cos(x + y) and N = 3y 2 + 2y + cos(x + y).


Since
My = − sin(x + y) = Nx,
the ODE is exact and so ∃ u(x, y) such that
ux = M and uy = N.
By integration, we obtain

u= M dx + k(y) = sin(x + y) + k(y)

and
uy = cos(x + y) + k′(y) = N = 3y 2 + 2y + cos(x + y).
Hence k′(y) = 3y 2 + 2y, k(y) = y 3 + y 2 + c∗ and so u(x, y) =
sin(x + y) + y 3 + y 2 + c∗. The solution is
sin(x + y) + y 3 + y 2 = c.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 12

Example 2. An Initial Value Problem


Solve the IVP
(cos y sinh x + 1)dx − sin y cosh xdy = 0, y(0) = 0.

Sol. Let
M = cos y sinh x + 1 and N = − sin y cosh x.
Since
My = − sin y sinh x = Nx,
the ODE is exact and ∃ u(x, y) such that
ux = M and uy = N.
By integration, we obtain

u= M dx + k(y) = cos y cosh x + x + k(y).

⇒ uy = − sin y cosh x + k′(y) = N = − sin y cosh x

⇒ k′(y) = 0, k(y) = c∗

⇒ u(x, y) = cos y cosh x + x + c ∗ .


The general solution is
cos y cosh x + x = c.
From the initial condition, c = 1. The solution of the IVP is
cos y cosh x + x = 1.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 13

Example 3. In the case of Nonexactness


Solve
−ydx + xdy = 0.

Sol. Let M = −y and N = x. Since


My = −1 ̸= 1 = Nx,
the ODE is not exact. Hence we must solve the ODE by another method.

For example,

dy dx
ODE =⇒ = (separable)
y x

=⇒ ln |y| = ln |x| + c∗

=⇒ y = cx.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 14

[Reduction to Exact Form. Integrating Factors]


Definition
If P (x, y)dx + Q(x, y)dy = 0 is not exact but
F (x, y)P (x, y)dx + F (x, y)Q(x, y)dy = 0
is exact, then F (x, y) is called an integrating factor of the ODE.

Example 4. Integrating Factor


Solve
−ydx + xdy = 0.

Sol. Let P = −y and Q = x. Since


Py = −1 ̸= 1 = Qx,
the ODE is not exact.
Take F = 1/x2. Then
−ydx + xdy
F P dx + F Qdy =
x2
y
= du = 0, where u = .
x
The general solution is
y
u= =c or y = cx.
x
Note Other integrating factors are
1 1 1
2
, , , ··· .
y xy x2 + y 2

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 15

[How to find Integrating Factors F (x, y)]


Let F (x, y) be an integrating factor(I.F.) of P dx + Qdy = 0.
That is, P dx + Qdy = 0 is not exact and F P dx + F Qdy = 0 is
exact. Thus
∂ ∂
(F P ) = (F Q),
∂y ∂x
Fy P + F Py = FxQ + F Qx (∗)

(1) Let F = F (x). Then Fy = 0 and

(∗) =⇒ F Py = F ′Q + F Qx,
1 dF 1
= (Py − Qx)
F dx Q

∴ F (x) = e R(x)dx

where R(x) = Q1 (Py − Qx).


1 dF
Since depends only on x, so does R. If R does not depend only on
F dx
x, then try F = F (y).

(2) Let F = F (y). Then Fx = 0 and

(∗) =⇒ F ′P + F Py = F Qx,
1 dF 1
= (Qx − Py )
F dy P

R∗ (y)dy
∴ F (y) = e ,
where R∗(y) = 1
P
(Qx − Py ) .

If R∗ does not depend only on y, then try to find another integrating factor
or another method.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 16

Example 5.
Solve the IVP
( x+y )
e + ye dx + (xey − 1) dy = 0,
y
y(0) = −1.

Sol. Let P = ex+y + yey and Q = xey − 1. Since


Py = ex+y + yey + ey ̸= Qx = ey ,
the ODE is not exact.
Notice that
1 1
R= (Py − Qx) = (ex+y
+ yey
),
Q xey − 1
1 1
R∗ = (Qx − Py ) = (−ex+y
− ye y
) = −1.
P ex+y + ye y

∗ R∗ (y)dy
Hence we take the integrating factor F (y) = e = e−y .

Multiplying F ∗(y) = e−y , we get


( )
(ex + y) dx + x − e−y dy = 0.
Since the ODE is exact, ∃u such that
ux = ex + y, uy = x − e−y .
=⇒ u = ex + xy + k(y), uy = x + k′(y)
=⇒ k′(y) = −e−y , k(y) = e−y + c∗.
Thus u = ex + xy + e−y + c∗ and the general solution is
ex + xy + e−y = c.
From y(0) = −1, c = 1 + e. The solution is
ex + xy + e−y = 1 + e.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 17

§1.5 Linear ODEs. Bernoulli Equation.


Population Dynamics
y ′ + p(x)y = r(x) : first-order linear ODE.
(In engineering, r(x): input, and y(x) : output or response.)

d
Note Let L = dx
+ p(x). Then we write the ODE as
Ly = r.
The ODE satisfies
L(c1y1 + c2y2) = c1L(y1) + c2L(y2). (linearity)
• Homogeneous Linear ODE (r(x) = 0)
y ′ + p(x)y = 0: first-order homogeneous linear ODE.
dy
=⇒ = −p(x)dx (separable ODE)
y
∫ ∗

− p(x)dx
ln |y| = − p(x)dx + c ∴ y(x) = ce .
Note y = 0 : trivial solution.
• Nonhomogeneous Linear ODE (r(x) ̸= 0)
y ′ + p(x)y = r(x): first-order nonhomogeneous linear ODE
=⇒ (py − r)dx + dy = 0
P = py − r, Q = 1, Py = p ̸= 0 = Qx.
The ODE is not exact.

Take R(x) = 1
Q
(Py − Qx) = p(x), and I.F. F (x) = e pdx
.
∫ ∫ ∫
pdx pdx ′
Multiplying I.F. F (x) = e (y + py) = e pdxr.
, we have e
∫ ∫ ∫
∫ ∫
(e pdxy)′ = e pdxr =⇒ e pdxy = e pdxrdx + c
(∫ ) ∫
∴ y = e−h ehrdx + c , h = p(x)dx.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 18

Note 1. y = e−h ehrdx + ce−h, c depends on an initial condition.
Total Output=Response to the Input r
+ Response to the Initial Data.
2. In case r = 0.
y = ce−h is the general solution of the ODE y ′ + py = 0.

Example 1. First-Order ODE, Initial Value Problem


Solve
y ′ + y tan x = sin 2x, y(0) = 1.

Sol. (Using a formula) ∫ ∫


h = p(x)dx = tan xdx = ln | sec x|,
(∫ ) (∫ )
−h h
y = e e rdx + c = cos x sec x sin 2xdx + c

= cos x( 2 sin xdx + c) = cos x(c − 2 cos x).

Since y(0) = 1, c = 3. The solution is y = 3 cos x − 2 cos2 x.

(A direct calculation) ∫ ∫
F = e p(x)dx = e tan xdx = sec x.

ODE =⇒ sec x y ′ + y sec x tan x = sec x sin 2x.

(y sec x)′ = 2 sin x.

The general solution is y = cos x(c − 2 cos x).

Since y(0) = 1, c = 3. The solution is y = 3 cos x − 2 cos2 x.

Notice that 3 cos x is the response to the initial data,


and −2 cos2 x is the response to the input r(x) = sin 2x.
Computational Science & Engineering (CSE) T. Jeong
Chapter 1. First-Order ODEs 19

[Reduction to Linear Form. Bernoulli Equation]


y ′ + p(x)y = g(x)y a (a ∈ R) : Bernoulli Equation
• In case a = 0, y ′ + p(x)y = g(x): linear.
• In case a = 1, y ′ + (p(x) − g(x))y = 0: linear and homogeneous.
• In case a ̸= 0, 1, y ′ + p(x)y = g(x)y a: nonlinear. The ODE can
be reduced to linear form.

Set u = [y(x)]1−a. Then

u′ = (1 − a)y −ay ′ = (1 − a)y −a(gy a − py)


= (1 − a)(g − pu).
The ODE is reduced to liner form.
u′ + (1 − a)pu = (1 − a)g.
The solution is
(∫ )
y 1−a = u = e−h eh(1 − a)gdx + c

where h = (1 − a) p dx.

Example 4. Logistic Equation


Solve the Bernoulli equation, known as the logistic equation
y ′ = Ay − By 2.

Sol. Set u = y −1. Then u′ = −y −2y ′ = −Ay −1 + B = −Au + B,


and
u′ + Au = B.
−At
∫ At
The solution is u = e (B e dt + c) = ce−At + B/A
and so
1
y = −At .
ce + B/A

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 20

[Population Dynamics] The logistic equation


B
y ′ = Ay − By 2 = Ay[1 − y]
A
plays an important role in population dynamics.
In Example 4, the solution is
1
y= .
ce−At + B
A

• When B = 0, y = 1c eAt: exponential growth, as for a small popula-


tion in a large country. (Malthus’s Law)
• When B ̸= 0,
• if y < A/B, then y ′ > 0: population keeps growing as along as
y < A/B.
• if y > A/B, then y ′ < 0: population keeps decreasing as along
as y > A/B.
The term −By 2 is a ”braking term” that prevents the population from
growing without bound.

Fig.21. Logistic population model.


Curves (9) in Example 4 with A/B = 4.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 21

Definition
• An autonomous ODE (t does not occur explicitly)
y ′ = f (y)
has constant solutions, called equilibrium solutions or equilibrium
points. These are determined by the zeros of f (y), because f (y) =
0 ⇒ y ′ = 0. The zeros are called critical points of y ′ = f (y).
• An equilibrium solution is called stable if solutions close to it for some
t remain close to it for all further t. It is called unstable if solutions
initially close to it do not remain close to it as t increases.

Note In Example 4, let A = 4B. If


Ay − By 2 = By(4 − y) = 0
then y = 0, 4 (equilibrium solutions). y = 0 is an unstable equilibrium
solution, and y = 4 is a stable one.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 22

§1.6 Orthogonal Trajectories


• The angle of intersection between two curves is the angle between the
tangents of the curves at the intersection point.
• For a given one-parameter family of curves G(x, y, c) = 0, if
F (x, y, c∗) = 0 ⊥ G(x, y, c) = 0
then the curves F (x, y, c∗) = 0 are called orthogonal trajectories.
Example
Find orthogonal trajectories of the curves
1
x2 + y 2 = c.
2

Sol. Differentiating 12 x2 + y 2 = c, we have x + 2yy ′ = 0. Hence the


ODE of the given curves is
x
y ′ = f (x, y) = − .
2y
The orthogonal trajectories are obtained from the ODE
1 2ỹ
ỹ ′ = − = .
f (x, ỹ) x
Solve ODE by separating variables, integrating, and taking exponents:
ỹ = c∗x2

Fig. 24. Electrostatic field between two ellipses.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 23

§1.7 Existence and Uniqueness of Solutions for IVPs


An initial value problem
y ′ = f (x, y), y(x0) = y0 (1)
may have no solution, precisely one solution, or more than one solution.

Case 1. |y ′| + |y| = 0, y(0) = 1 has no solution.

Case 2. y ′ = 2x, y(0) = 1 has only one solution y = x2 + 1.

Case 3. xy ′ = y−1, y(0) = 1 has infinitely many solutions, y = 1+cx.

Under what conditions does an IVP of the form (1) have at least one solution
or at most one solution?

Theorem 1. Existence Theorem


Let f (x, y) be continuous in some rectangle
R : |x − x0| < a, |y − y0| < b
and bounded in R; that is, ∃ a number K such that
|f (x, y)| ≤ K, ∀ (x, y) ∈ R.
Then the IVP (1) has at least one solution y(x). This solution exists at
least for all x ∈ [x0 − α, x0 + α] with α = min{a, Kb }.

Theorem 2. Uniqueness Theorem


Let f and fy be continuous for all (x, y) ∈ R and bounded, say,
|f (x, y)| ≤ K, |fy (x, y)| ≤ M, ∀ (x, y) ∈ R.
Then the IVP (1) has at most one solution y(x).
Thus, by Existence Theorem, the IVP has precisely one solution. This solu-
tion exists at least for all x ∈ [x0 − α, x0 + α] with α = min{a, Kb }.

Computational Science & Engineering (CSE) T. Jeong


Chapter 1. First-Order ODEs 24

[Understanding these theorems]

Example 1. Choice of a Rectangle


Consider the IVP
y ′ = 1 + y 2, y(0) = 0
and take R : |x| < 5, |y| < 3. Then a = 5, b = 3, and
|f (x, y) = |1 + y 2| ≤ K = 10, |fy | = 2|y| ≤ M = 6,
b
∴ α = min{a = 5, = 0.3} = 0.3.
K
Note that α = 0.3 < a = 5 and the solution y = tan x is discontinuous
at ±π/2 = ±1.507... in the interval |x| < 5.
Example 2. Nonuniqueness
The IVP √

y = |y|, y(0) = 0
has the two solutions {
x2/4 if x ≥ 0
y ≡ 0 and y∗ =
−x2/4 if x < 0

although f (x, y) = |y| is continuous for all y.
Note that for y1 = 0, y2 > 0,
|f (x, y2) − f (x, y1)| 1
=√ ⇔ |fy |
|y2 − y1| y2
is not bounded on the neighborhood of (0, 0).

Computational Science & Engineering (CSE) T. Jeong

You might also like