Ibubqnhc 0 Ilmj 3 N Ymlj TIF

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

Chapter 2.

Second-Order Linear ODEs 1


§2.1 Homogeneous Linear ODEs of Second Order
y ′′ + p(x)y ′ + q(x)y = r(x) (1)
y ′′ + p(x)y ′ + q(x)y = 0 (2)
y(x0) = K0, y ′(x0) = K1 (3)
Some Concepts
• If r(x) = 0 in (1), then (1) reduces to (2), called homogeneous.
• If r(x) ̸= 0, then (1) is called nonhomogeneous.
• Solution of the ODE (1) on the open interval I: a function satisfying
the ODE on I.
• c1y1 + c2y2 : linear combination of y1 and y2
• linear, nonlinear
d2 d
Set L = dx 2 + p(x) dx + q(x), then we write the ODE (1) as

L(y) = r.
Note that the ODE satisfies the linearity
L(c1y1 + c2y2) = c1L(y1) + c2L(y2).
Otherwise, it is called nonlinear.
Ex. 1. xy ′′ + y ′ + xy = 0 : homogeneous linear ODE
2. y ′′y + y ′2 = 0 : nonlinear ODE
Theorem 1. Superposition Principle
For a homogeneous linear ODE (2), if y1, y2 are solutions of (2) on the open
interval I, then y = c1y1 + c2y2 is again a solution of (2) on I, where
c1, c2 are arbitrary constants.
Proof. Let y1 and y2 be solutions of (2) on I. Set y = c1y1 +c2y2. Then
y ′′ + py ′ + qy = (c1y1 + c2y2)′′ + p(c1y1 + c2y2)′ + q(c1y1 + c2y2)
= c1(y1′′ + py1′ + qy1) + c2(y2′′ + py2′ + qy2)
= c10 + c20 = 0.
Hence y = c1y1 + c2y2 is a solution of (2) on I.
Computational Science & Engineering (CSE) T. Jeong
Chapter 2. Second-Order Linear ODEs 2

Example 1. Superposition of Solutions


y1 = cos x, y2 = sin x are solutions of the homogeneous linear ODE
y ′′ + y = 0
for all x.
y1 + y2 = cos x + sin x, 2y1 = 2 cos x
are solutions of the ODE. Moreover, for arbitrary constants c1, c2,
y = c1 cos x + c2 sin x
is again a solution of the ODE.

Example 2. A nonhomogeneous Linear ODE


y1 = 1 + cos x and y2 = 1 + sin x are solutions of the nonhomoge-
neous linear ODE
y ′′ + y = 1
for all x. But
y1 + y2 = 2 + cos x + sin x, 2y1 = 2 + 2 cos x
are not solutions of the ODE.

Example 3. A nonlinear ODE


y1 = x2 and y2 = 1 are solutions of the nonlinear ODE
y ′′y − xy ′ = 0
for all x. But
y1 + y2 = x2 + 1, − y1 = −x2
are not solutions of the ODE.

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 3

Definition (General Solution, Basis, Particular Solution)


• y1 and y2 are called linearly independent on an open interval I if
k1y1(x) + k2y2(x) = 0, ∀x ∈ I ⇒ k1 = k2 = 0.
• y1 and y2 are called linearly dependent on an interval I if
k1y1(x) + k2y2(x) = 0, ∀x ∈ I for k1, k2 not both zero.
Namely, if k1 ̸= 0 or k2 ̸= 0, then y1 and y2 are proportional,
k2 k1
y1 = − y2 or y2 = − y1, ∀x ∈ I.
k1 k2
• If y1 and y2 are solutions of the ODE (2) on an open interval I that are
not proportional(linearly independent), the solution
y = c 1 y1 + c 2 y2
is a general solution of the ODE on I (c1, c2 arbitrary constants).
These y1, y2 are called a basis(or a fundamental system) of solutions
of (2) on I.
• A particular solution of (2) on I is obtained if we assign specific values
to c1 and c2 in the general solution y = c1y1 + c2y2.
Example 6. Basis, General Solution, Particular Solution
Solve
y ′′ − y = 0, y(0) = 6, y ′(0) = −2.

Sol. y1 = ex, y2 = e−x are solutions of the ODE(Why!).


Since y1/y2 = e2x ̸= const, y1 and y2 are linearly independent(form a
basis) for all x. Hence the general solution is
y = c1ex + c2e−x.
From the initial condition, y(0) = c1 +c2 = 6, y ′(0) = c1 −c2 = −2,
c1 = 2, c2 = 4. The solution is y = 2ex + 4e−x(particular solution).

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 4

[Find a basis if one solution is known. Reduction of order]


y ′′ + p(x)y ′ + q(x)y = 0 (4)
Assume that y1 is a solution of (4) on I.
A second linearly independent solution y2 of (4) on I ?

[Method of Reduction of order]


Put y2 = uy1. Substitute y2 = uy1 and
y2′ = u′y1 + uy1′ , y2′′ = u′′y1 + 2u′y1′ + uy1′′
into (4), we have
(u′′y1 + 2u′y1′ + uy1′′) + p(u′y1 + uy1′ ) + quy1
= u′′y1 + u′(2y1′ + py1) + u(y1′′ + py1′ + qy1) = 0.
Since y1′′ + py1′ + qy1 = 0, we get
u′′y1 + u′(2y1′ + py1) = 0.
Set U = u′. Then
( ′ ) ( )
2y dU 2y1′
U′ + 1
+ p U = 0 and =− + p dx.
y1 U y1
Integration gives

ln |U | = −2 ln |y1| − p dx

and ∫
1 − p dx
U = 2
e .
y1
Since U = u′, we obtain
∫ ∫
1 − ∫ p dx
u= U dx = 2
e dx.
y1

1 − ∫ p dx
∴ y2 = y1 u = y1 2
e dx
y1

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 5

Example 7. Reduction of Order if a Solution is known. Basis


Find a basis of solutions of
(x2 − x)y ′′ − xy ′ + y = 0.

Sol. Inspection shows that y1 = x is a solution.


To get a second (linearly independent) solution, set
y2 = uy1 = ux.
The ODE is written
′′ 1 ′ 1
y − y + y = 0.
x−1 x2 − x
Using the formula (of reduction of order), we have

1 − ∫ p dx
u = e dx
y12

1 ∫ 1 dx
= 2
e x−1 dx
∫ x
|x − 1|
= 2
dx
∫ x
x−1
= 2
dx (∗)
x
1
= ln |x| + ,
x
and
y2 = x ln |x| + 1.
(∗) We need no constant of integration because we want to obtain a par-
ticular solution.
Since y1 = x and y2 = x ln |x| + 1 are linearly independent,
y2 1
= ln |x| + ̸= const,
y1 x
they form a basis of solutions.
Computational Science & Engineering (CSE) T. Jeong
Chapter 2. Second-Order Linear ODEs 6

§2.2 Homogeneous linear ODEs with constant coeffi-


cients
Consider second-order homogeneous linear ODEs with constant coefficients
a and b,
y ′′ + ay ′ + by = 0. (1)
Note The solution of the ODE y ′ + ky = 0 is an exponential function
y = ce−kx.
Substituting y = eλx into (1), we obtain
(λ2 + aλ + b)eλx = 0, ∀x ∈ R.
Let λ = λ1, λ2 be solutions of the characteristic equation
λ2 + aλ + b = 0.
Case I. Two distinct real roots λ1 and λ2.
Because eλ1x/eλ2x is not constant, y1 = eλ1x and y2 = eλ2x are linearly
independent solutions of the ODE. The general solution of the ODE is
y = c1eλ1x + c2eλ2x.
Example 2. Case of Distinct Real Roots
Solve
y ′′ + y ′ − 2y = 0, y(0) = 4, y ′(0) = −5.

Sol. characteristic equation : λ2 + λ − 2 = 0, λ = 1, −2.


general solution : y = c1ex + c2e−2x
From the initial conditions,
y(0) = c1 + c2 = 4, y ′(0) = c1 − 2c2 = −5,
we have c1 = 1, c2 = 3. The (particular) solution is
y = ex + 3e−2x.

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 7

a2
Case II. Real double root λ = − a2 (λ2 + aλ + 4
= 0)
a
y1 = e− 2 x, y2 =?
Let y2 = uy1. Using the formula (of reduction of order), we have

1 − ∫ p dx
u = 2
e dx
∫ y1
= eaxe−ax dx
= x.
a
Thus y2 = xe− 2 x. Because y2/y1 is not constant, they form a basis. The
general solution of the ODE is
y = (c1 + c2x)e−ax/2.

Example 3. Case of a Double Root


Solve
y ′′ + 6y ′ + 9y = 0.

Sol. characteristic equation : λ2 + 6λ + 9 = 0, λ = −3(double root)


general solution : y = (c1 + c2x)e−3x.

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 8

Case III. Complex roots λ1 = − 12 a + iω and λ2 = − 12 a − iω.


Note Euler formula eit = cos t + i sin t
∑∞ n ∑∞ 2n ∞

it (it) (it) (it)2n+1
e = = +
n=0
n! n=0
(2n)! n=0
(2n + 1)!

∑ ∞

(−1)nt2n (−1)nt2n+1
= +i
n=0
(2n)! n=0
(2n + 1)!

= cos t + i sin t.
We have two solutions of the ODE
1
y1 = eλ1x = e− 2 ax(cos wx + i sin wx),
1
y2 = eλ2x = e− 2 ax(cos wx − i sin wx).
Since the ODE is linear and homogeneous,
1 1
(y1 + y2) = e− 2 ax cos wx,
2
1 1
(y1 − y2) = e− 2 ax sin wx
2i
1 1
are also solutions of the ODE. Since [e− 2 ax cos wx]/[e− 2 ax sin wx] is
not constant, they form a basis. The (real) general solution of the ODE is
1
y = e− 2 ax (A cos ωx + B sin ωx) .
Note The (complex) general solution of the ODE is
1 1
y = c1e(− 2 a+iω)x + c2e−( 2 a+iω)x.

Example 5. Case of Complex Roots


Solve
y ′′ + 0.4y ′ + 9.04y = 0.

Sol. characteristic equation : λ2 + 0.4λ + 9.04 = 0, λ = −0.2 ± 3i.

general solution : y = e−0.2x (A cos 3x + B sin 3x) .

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 9

§2.4 Modeling of Free oscillations of a Mass-spring


system
[Setting up the model]

• Newton’s second law : Force = Mass × Acceleration = my ′′.


Hook’s law: F0 = −ks0 where k > 0 is the spring constant.
• In static equilibrium, −ks0 + mg = 0.
• From the position y = 0, we pull the body downward(displacement y).
By Hooke’s law this causes an upward force F1 in the spring,
F1 = −ky (restoring force).
[Undamped System : my ′′ + ky = 0]
The restoring force F1 = −ky is the only force causing the motion.
my ′′ = −ky ⇒ my ′′ + ky = 0.
characteristic equation : mλ2 + k = 0

λ2 + ω02 = 0, ω0 = m k
, λ = ±iω0
∴ y(t) = A cos ω0t + B sin ω0t.
The corresponding motion is called a harmonic oscillation.

Since the trigonometric functions have the period , the frequency
ω0
ω0
(or natural frequency) is . (cycles/sec = hertz(Hz))

Computational Science & Engineering (CSE) T. Jeong
Chapter 2. Second-Order Linear ODEs 10

Note 1. Alternative representation of the solution is


y(t) = A cos ω0t + B sin ω0t
A B
= C[cos ω0t + sin ω0t ]
C C
= C[cos ω0t cos δ + sin ω0t sin δ]
= C cos(ω0t − δ)

where the amplitude C = A2 + B 2, phase angle δ = arctan B
A
.

y ′ (0)
2. From the initial conditions, A = y(0), B = ω0
.

When B = 0, δ = 0.

3. Fig. 34 shows typical forms of the solution, according to the positive


initial displacement y(0) and initial velocities y ′(0).

Fig. 34. Typical harmonic oscillations with the same y(0) = A


and different initial velocity y ′ (0) = ωB

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 11

Example 1. Undamped Motion. Harmonic Oscillation


• If an iron ball of weight W=98nt stretches a spring 1.09m, how many
cycles per minute will this mass-spring system execute?
• What will its motion be if we pull down the weight an additional 16cm
and let it start with zero initial velocity?
Sol. By Hooke’s law,
98
98 = 1.09k ⇒ k= = 90[kg/sec2] = 90[nt/meter].
1.09
The mass is m = W/g = 98/9.8 = 10 kg.
√κ
ω0 3
∴ frequency: = m = [Hz]
2π 2π 2π

harmonic oscillation
y(t) = A cos ω0t + B sin ω0t
= A cos 3t + B sin 3t
y(0) = A = 0.16,
y ′(0) = 3B = 0 ⇒ B = 0
∴ y(t) = 0.16 cos 3t

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 12

[Damped System]

Fig. 36. Damped system

A damping force is F2 = −cy ′, c(> 0) = damping constant.


my ′′ = −ky − cy ′ =⇒ my ′′ + cy ′ + ky = 0
λ2 + c
λ + k
= 0, λ1 = −α + β, λ2 = −α − β,
m m √
where α = 2m , β = 2m c2 − 4mk.
c 1

Case I(Overdamping, c2 > 4mk): distinct real roots λ1, λ2


y(t) = c1e−(α−β)t + c2e−(α+β)t

Fig. 37. Typical motions in the overdamped case


(a) Positive initial displacement (b) Negative initial displacement

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 13

Case II(Critical damping, c2 = 4mk): real double root


y(t) = (c1 + c2t)e−αt

Fig. 38. Critical damping

Case III(Underdamping, c2 < 4mk): complex conjugate roots


∗ ∗ 1 √
β = iω , where ω = 4mκ − c2 (> 0)
2m
y(t) = e−αt (A cos ω ∗t + B sin ω ∗t) = Ce−αt cos(ω ∗t − δ),

where C = A2 + B 2, tan δ = B/A.
ω∗
Note that the frequency is and ω ∗ −→ ω0 as c −→ 0, and y(t)

approaches zero as t → ∞.

Fig. 39. Damped oscillation in the case of underdamping

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 14

§2.5 Euler-Cauchy Equations


• Euler-Cauchy equation
x2y ′′ + axy ′ + by = 0
Substituting y = xm, we get [m(m − 1) + am + b]xm = 0.
The auxiliary equation is
m2 + (a − 1)m + b = 0,
and the roots are m = m1, m2. We have two solutions
y 1 = x m1 , y2 = xm2 .
Case I. Two distinct real roots : m1, m2.
Because y2/y1 is not constant, they form a basis. The general solution is
y = c 1 x m1 + c 2 x m2 .
Example 1.
Solve x2y ′′ + 1.5xy ′ − 0.5y = 0.
Sol. m2 + 0.5m − 0.5 = 0, m = 0.5, −1.
The general solution is

y = c1 x + c2x−1.
Case II. Real double root : m1 = m2 = 12 (1 − a)
1
y1 = x 2 (1−a), y2 =?
Let y2 = uy1.
a b
x2y ′′ + axy ′ + by = 0 =⇒ y ′′ + y′ +
y = 0.
x x2
Using the formula (of reduction of order), we have
∫ ∫
1 − ∫ p dx a−1 −a
u= e dx = x x dx = ln x.
y12
1
Thus y2 = x 2 (1−a) ln x. Because y2/y1 is not constant, they form a
basis. The general solution is
1
y = (c1 + c2 ln x)x 2 (1−a).

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 15

Example 2.
Solve x2y ′′ − 5xy ′ + 9y = 0.
Sol. m2 − 6m + 9 = 0, m = 3.
The general solution is
y = (c1 + c2 ln x)x3.
Case III. Complex roots m1 = 12 (1 − a) + ωi, m2 = 12 (1 − a) − ωi.
We have two solutions
1
y1 = xm1 = x 2 (1−a)eiω ln x
1
= x 2 (1−a)[cos(ω ln x) + i sin(ω ln x)],
1
y2 = xm2 = x 2 (1−a)e−iω ln x
1
= x 2 (1−a)[cos(ω ln x) − i sin(ω ln x)].
Since the ODE is linear and homogeneous,
1 1
(y1 + y2) = x 2 (1−a) cos(ω ln x),
2
1 1
(y1 − y2) = x 2 (1−a) sin(ω ln x)
2i
are also solutions of the ODE.
1 1
Since [x 2 (1−a) cos(ω ln x)]/[x 2 (1−a) sin(ω ln x)] is not constant, they
form a basis. The (real) general solution is
1
y = x 2 (1−a)[A cos(ω ln x) + B sin(ω ln x)].
Note The (complex) general solution is
1 1
y = c1x 2 (1−a)+ωi + c2x 2 (1−a)−ωi.
Example 3. Case of Complex Roots
Solve
x2y ′′ + 0.6xy ′ + 16.04y = 0.

Sol. m2 − 0.4m + 16.04 = 0, m = 0.2 ± 4i.


The general solution is
y = x0.2 [A cos(4 ln x) + B sin(4 ln x)] .
Computational Science & Engineering (CSE) T. Jeong
Chapter 2. Second-Order Linear ODEs 16

§2.6 Existence and uniqueness of solutions. Wronskian


{
y ′′ + p(x)y ′ + q(x)y = 0, (1)
y(x0) = K0, y ′(x0) = K1. (2)

Theorem 1. (Existence and Uniqueness Theorem for IVP)


If p(x) and q(x) are continuous on an open interval I and x0 ∈ I,
then the IVP of (1) and (2) has a unique solution y(x) on I.
[Recall]
• y1 and y2 are called linearly independent on an interval I if
k1y1(x) + k2y2(x) = 0, ∀x ∈ I ⇒ k1 = k2 = 0.
• y1 and y2 are called linearly dependent on an interval I if for some
number k, l
y1 = ky2 or y2 = ly1, ∀x ∈ I.

Theorem 2.
Let p(x) and q(x) in (1) be continuous on I. Then
1. two solutions y1, y2 of (1) on I are linearly dependent on I
y 1 y2
if and only if W (y1, y2) ≡ ′ ′ = y1y2′ − y2y1′ = 0
y 1 y2
at some x0 ∈ I, (W (y1, y2) : Wronskian).

2. If W = 0 at an x0 ∈ I, then W ≡ 0 on I.
Hence, if ∃ x1 ∈ I at which W is not 0, then y1 and y2 are linearly
independent on I.
Proof. 1.(⇒) Let y1, y2 be linearly dependent on I.
If y1 = ky2 holds, then
W (y1, y2) = y1y2′ − y2y1′
= ky2y2′ − ky2y2′
= 0.

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 17

(⇐) Let W (y1, y2) = 0 for some x = x0 ∈ I.


We consider the linear system in the unknowns k1, k2
{
k1y1(x0) + k2y2(x0) = 0
. (3)
k1y1′ (x0) + k2y2′ (x0) = 0
matrix form [ ][ ] [ ]
y1(x0) y2(x0) k1 0
= .
y1′ (x0) y2′ (x0) k2 0
Since
y1(x0) y2(x0)
′ ′ = y1(x0)y2′ (x0) − y2(x0)y1′ (x0)
y1(x0) y2(x0)
= W (y1(x0), y2(x0)) = 0,
∃ not all zero k1 and k2, say, k12 + k22 ̸= 0.
Then for these constants k1, k2,
ỹ(x) = k1y1(x) + k2y2(x)
is a solution of (1) and ỹ(x0) = ỹ ′(x0) = 0 from (3).
Notice that
ŷ(x) ≡ 0
is also a solution of (1) and ŷ(x0) = ŷ ′(x0) = 0.
By the uniqueness theorem of solutions, ỹ = ŷ, that is,
k2 k1
k1y1 + k2y2 = 0, ∀ x ∈ I and y1 = − y2 or y2 = − y1.
k1 k2
Therefore y1 and y2 are linearly dependent on I.

2. Let W (x0) = 0 at x0 ∈ I. By part (⇐), y1 and y2 are linearly


dependent on I. Hence W ≡ 0 on I.
Example 1.
cos ωx sin ωx
W (cos ωx, sin ωx) = = ω.
−ω sin ωx ω cos ωx
cos ωx and sin ωx are linearly independent ⇔ ω ̸= 0

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 18

Theorem 3. (Existence of a General Solution)


If p(x), q(x) are continuous on I, then (1) has a general solution on I.

Proof. By Existence and Uniqueness Theorem for IVP, the ODE (1) has
a solution y1(x) on I satisfying the IC
y1(x0) = 1, y1′(x0) = 0
and a solution y2(x) on I satisfying the IC
y2(x0) = 0, y2′(x0) = 1.
Since
W (y1, y2) = y1(x0)y2′ (x0) − y2(x0)y1′ (x0) = 1
these solutions are linearly independent on I. They form a basis of solutions
of (1) on I, and
c 1 y1 + c 2 y2
with arbitrary constants c1, c2 is a general solution of (1) on I.

Theorem 4. ( A general solution includes all solutions)


If p(x) and q(x) are continuous an open interval I, then every solution
y = Y (x) of (1) is of the form
Y (x) = C1y1(x) + C2y2(x)
where y1, y2 is any basis of solutions of (1) on I and C1, C2 are suitable
constants.
Hence the ODE (1) does not have singular solutions(solutions not ob-
tained from a general solution).

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 19

§2.7 Nonhomogeneous ODEs


y ′′ + p(x)y ′ + q(x)y = r(x). (1)
y ′′ + p(x)y ′ + q(x)y = 0. (2)
Definition
A general solution of the nonhomogeneous ODE (1) on an open interval is
a solution of the form
y(x) = yh(x) + yp(x).
Here, yh = c1y1 + c2y2 is a general solution of the homogeneous ODE
(2) and yp is any solution of the nonhomogeneous ODE (1).
Theorem 1.
• solution of (1)+ solution of (2)= solution of (1).
• solution of (1)− solution of (1)= solution of (2).
Theorem 2.
Let p, q, r in (1) be continuous on some open interval I.
Every solution of (1) is obtained by assigning suitable values to c1, c2 in a
solution of the form y(x) = yh(x) + yp(x).
Here, yh is a general solution of (2) and yp is any solution of (1).
[Method of Undetermined Coefficients]
Choice Rules for yp
(a) Basic rule
r(x) yp(x)
keγx Ceγx
kxn(n = 0, 1, · · · ) Knxn + Kn−1xn−1 + · · · + K1x + K0
k cos ωx, k sin ωx K cos ωx + M sin ωx
keαx cos ωx, keαx sin ωx keαx(K cos ωx + M sin ωx)
(b) Modification rule : Multiply by x or x2, · · ·
(c) Sum rule : r(x) = r1(x) + r2(x) ⇒ yp,1 + yp,2

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 20

Example 1.
Solve y ′′ + y = 0.001x2, y(0) = 0, y ′(0) = 1.5.
Sol. Step 1. y ′′ + y = 0 ⇒ yh = A cos x + B sin x
Step 2. Put yp = K2x2 + K1x + K0.
yp = 0.001x2 − 0.002
Step 3. y = yh + yp = A cos x + B sin x + 0.001x2 − 0.002
y(0) = 0, y ′(0) = 1.5 =⇒ A = 0.002, B = 1.5
y = 0.002 cos x + 1.5 sin x + 0.001x2 − 0.002.

Example 2.
Solve y ′′ + 3y ′ + 2.25y = −10e−1.5x.
Sol. Step 1. y ′′ +3y ′ +2.25y = 0, λ2 +3λ+2.25 = 0, λ = −1.5.
yh = (c1 + c2x)e−1.5x
Step 2. yp = Cx2e−1.5x (why!)
yp = −5x2e−1.5x
Step 3. y = yh + yp = (c1 + c2x − 5x2)e−1.5x

Example 3.
Solve the ODE
y ′′ + 2y ′ + 0.75y = 2 cos x − 0.25 sin x + 0.09x,
y(0) = 2.78, y ′(0) = −0.43.
Sol. Step 1. y ′′ +2y ′ +0.75y = 0, λ2 +2λ+0.75 = 0, λ = − 12 , − 32
yh = c1e−x/2 + c2e−3x/2
Step 2. yp = yp1 + yp2
Letting yp1 = K cos x + M sin x and yp2 = K1x + K0
yp = sin x + 0.12x − 0.32
Step 3. y = yh + yp
= c1e−x/2 + c2e−3x/2 + sin x + 0.12x − 0.32
From the initial conditions, c1 = 3.1, c2 = 0, and the solution of IVP is
y = 3.1e−x/2 + sin x + +0.12x − 0.32.

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 21

§2.8 Modeling: Forced Oscillations. Resonance

Fig. 53. Mass on a spring

′′ ′
my
| + {z + ky} = r(t)
cy (1)
|{z}
internal force external force
• my ′′ + cy ′ + ky = 0: free motion.
• r(t) ̸= 0 ⇒ (1): forced motion with forcing function r(t) (input
or driving force).
• y(t): output or response of the system to the driving force.

[Solving the Nonhomogeneous ODE]


Consider the ODE with a periodic external force r(t) = F0 cos ωt.
my ′′ + cy ′ + ky = F0 cos ωt (2)
Put yp(t) = a cos ωt + b sin ωt.
Substituting yp, yp′ , yp′′ into (2), we get
[(k−mω 2)a+ωcb] cos ωt+[−ωca+(k−mω 2)b] sin ωt = F0 cos ωt
or
(k − mω 2)a + ωcb = F0,
−ωca + (k − mω 2)b = 0.

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 22

If (k − mω 2)2 + ω 2c2 ̸= 0,
(k − mω 2)F0 ωcF0
a= , b= .
(k − mω 2)2 + ω 2c 2 (k − mω 2)2 + ω 2 c2

If k/m = ω0(> 0), then k = mω02 and we obtain
m(ω02 − ω 2)F0 ωcF0
a= , b= .
m2(ω02 − ω 2)2 + ω 2c 2 m2(ω02 − ω 2)2 + ω 2c2
The general solution of the ODE (2) is
y = y h + yp
where yh is a general solution of the homogeneous equation and yp is a
particular solution of (2).
[Case 1. Undamped Forced Oscillations. Resonance]
If c = 0(undamped), then a = F0/[m(ω02 − ω 2)], b = 0.
Hence
F0 F0
yp(t) = cos ωt = cos ωt.
m(ω02 − ω 2) k[1 − (ω/ω0)2]
In equations above, we must assume that ω 2 ̸= ω02;
ω
physically, frequency 2π [cycles/sec] of the driving force
̸= natural frequency ω0/(2π)[cycles/sec] of the system.
The general solution of the ”undamped system” is
F0
y(t) = C cos(ω0t − δ) + cos ωt.
m(ω02 − ω 2)
Resonance.
The maximum amplitude of yp is (put cos ωt = 1)
F0 1
a0 = ρ where ρ = .
k 1 − (ω/ω0) 2
If ω → ω0, then ρ → ∞ and a0 → ∞.
This excitation of large oscillations by matching input and natural frequencies
(ω = ω0) is called resonance. ρ: resonance factor.
ρ/k = a0/F0: ratio of the amplitudes of yp and of the input F0 cos ωt.

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 23

Fig. 54. Resonance factor ρ(ω)

If ω = ω0, then the nonhomogeneous ODE becomes


F0
y ′′ + ω02y = cos ω0t.
m
From the Modification Rule
F0
yp(t) = t(a cos ω0t + b sin ω0t) = t sin ω0t.
2mω0

Fig. 55. Particular solution in the case of resonance

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 24

[Case 2. Damped Forced Oscillations]


• If the damping is not negligibly small, we have c > 0 and a damping
term cy ′. Then the general solution yh of the homogeneous ODE (1)
and (2) approaches zero as t → ∞, that is, the transient solution
y = yh+yp approaches the steady-state solution yp as t → ∞.
• Amplitude of the Steady-State Solution. Practical Resonance
The amplitude will always be finite. But it may have a maximum for
some ω depending on the damping constant c. This may be called
practical resonance.
• Let yp(t) = a cos ωt + b sin ωt = C ∗ cos(ωt − η).
C ∗ is called the amplitude of yp and η the phase angle or phase
lag. Here,
√ F0

C = a2 + b2 = √ ,
m (ω0 − ω ) + ω c
2 2 2 2 2 2

b ωc
tan η(ω) = = .
a m(ω02 − ω 2)

• Let R = m2(ω02 − ω 2)2 + ω 2c2. Then
( )
dC ∗ 1 −3/2
= F0 − R [2m2(ω02 − ω 2)(−2ω) + 2ωc2] = 0
dω 2
⇒ c2 = 2m2(ω02 − ω 2) (ω02 = k/m) (3)
⇒ 2m2ω 2 = 2m2ω02 − c2 = 2mk − c2.

• c2 > 2mk ⇒ (3) has no real solution.


c2 < 2mk ⇒ (3) has a real solution ω = ωmax, where
c2
2
ωmax = ω02 − ,
2m2
∗ 2mF0 2mF0
C (ωmax) = √ = √ .
c 4m2ω02 − c2 c 4mk − c2

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 25

Example
• Take m = 1, k = 1, hence ω0 = 1, and various values of the
damping constant c.
• Fig. 56 shows the amplification C ∗/F0 as a function of ω.
• Fig. 57 shows the phase angle η:

ω < ω0 ⇒ η < (π/2); ω > ω0 ⇒ η > (π/2).

Fig. 57. Amplification C ∗ /F0 as a function of ω for m = 1, k = 1,


and various values of the damping constant c

Fig. 58. Phase lag η as a function of ω for m = 1, k = 1,


thus ω0 = 1 and various values of the damping constant c

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 26

§2.9 Modelling: Electric Circuits


• Kirchhoff’s Voltage Law (KVL). The voltage impressed on a
closed loop is equal to the sum of the voltage drops across the
other elements of the loop.

Fig. 61. RLC-circuit

Fig. 62. Elements in an RLC-circuit

• Voltage Drops.
RI: Voltage drop for a resistor of resistance R ohms (Ω) (Ohm’s law).
LI ′: Voltage drop for an inductor of capacitance L henrys (H).
Q
: Voltage drop for a capacitor of capacitance C farads(F).
C ∫
Here Q coulombs is the charge on the capacitor; Q(t) = I(t)dt.
• According to KVL we have the ”integro-differential equation”

1
LI ′ + RI + Idt = E(t) = E0 sin ωt.
C
Differentiating the above equation, we obtain
1
LI + RI + I = E ′(t) = E0ω cos ωt.
′′ ′
(1)
C

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 27

[Solving the ODE (1) for the current.]


A general solution of (1) is the sum
I = Ih + Ip
where Ih is a general solution of the homogeneous equation and Ip is a
particular solution of (1).
Let Ip = a cos ωt + b sin ωt. Then
Lω 2(−a) + Rωb + a/C = E0ω (Cosine terms)
Lω 2(−b) + Rω(−a) + b/C = 0 (Sine terms)
Introducing the reactance
1
S = ωL − ,
ωC
we get −Sa + Rb = E0, − Ra − Sb = 0 and
−E0S E0 R
a= 2 , b = .
R + S2 R2 + S 2
Then
Ip(t) = I0 sin(ωt − θ)
where
√ E0 a S
I0 = a2 + b2 = √ , tan θ = − = .
2
R +S 2 b R
√ √
The quantity +R2 S2
is called impedance. Note that R2 + S 2 =
E0/I0 is analogous to R = E/I.
Let Ih = c1eλ1t + c2eλ2t. Then
R 1
λ2 + λ + = 0, λ1 = −α + β, λ2 = −α − β,
L LC
√ √
R R 2 1 1 4L
where α = , β= − = R 2 − .
2L 4L2 LC 2L C
Since R > 0, the transient current I = Ih + Ip tends to the steady-state
current Ip as t → ∞.

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 28

Example 1. RLC-Circuit
Find the current I(t) in an RLC-circuit with R = 11Ω, L = 0.1H,
C = 10−2F and E(t) = 100 sin(60 · 2πt) = 110 sin 377t.
Assume that current and charge are zero when t = 0.
Sol. 0.1I ′′ + 11I ′ + 100I = 110 · 377 cos 377t.
Ih = c1e−10t + c2e−100t
Ip = a cos 377t + b sin 377t
=⇒ Ip = −2.71 cos 377t + 0.796 sin 377t
I = Ih + Ip
= c1e−10t + c2e−100t − 2.71 cos 377t + 0.796 sin 377t
initial condition : I(0) = 0,∫Q(0) = 0
′ 1
LI + RI + Idt = E(t) = E0 sin ωt.
∫ C
Note that Q(t) = Idt. Putting t = 0,
1
LI ′(0) + RI(0) + ·0=0
C
gives I ′(0) = 0. The solution is
I = −0.323e−10t + 3.033e−100t
−2.71 cos 377t + 0.796 sin 377t.

[Analogy of Electrical and Mechanical Quantities]


1
LI ′′ + RI ′ + I = E0ω cos ωt my ′′ + cy ′ + ky = F0 cos ωt
C

Computational Science & Engineering (CSE) T. Jeong


Chapter 2. Second-Order Linear ODEs 29

§2.10 Solution by Variation of Parameters

y ′′ + p(x)y ′ + q(x)y = r(x) (1)


When yh(x) = c1y1 + c2y2 is the general solution of the ODE
y ′′ + p(x)y ′ + q(x)y = 0
find a solution yp of (1).
Setting yp = uy1 + vy2, determine u and v.
Then
yp′ = u′y1 + uy1′ + v ′y2 + vy2′ .
We may impose a second condition:
u′y1 + v ′y2 = 0.
Thus yp′ = uy1′ + vy2′ and yp′′ = u′y1′ + uy1′′ + v ′y2′ + vy2′′.
Substituting yp, yp′ and yp′′ into (1), we obtain
u(y1′′ + py1′ + qy1) + v(y2′′ + py2′ + qy2) + u′y1′ + v ′y2′ = r
| {z } | {z }
=0 =0

and
u′y1′ + v ′y2′ = r,
u′y1 + v ′y2 = 0.
We solve the linear system:
y2 r y1 r y 1 y2
u′ = − , v′ = , where W = .
W W y1′ y2′
By integration,
∫ ∫
y2 r y1 r
u=− dx, v = dx.
W W
Thus ∫ ∫
y2 r y1 r
yp(x) = −y1 dx + y2 dx
W W
(method of variation of parameters).
Computational Science & Engineering (CSE) T. Jeong
Chapter 2. Second-Order Linear ODEs 30

Example 1. Method of Variation of Parameters


Solve the nonhomogeneous ODE
y ′′ + y = sec x.

Sol. The general solution of the homogeneous ODE y ′′ + y = 0 is


yh = c1 cos x + c2 sin x.
Let y1 = cos x and y2 = sin x.
Then
cos x sin x
W = =1
− sin x cos x
and
∫ ∫
y2 r y1 r
yp = −y1 dx + y2 dx
W
∫ W ∫
1 1
= − cos x sin x dx + sin x cos x dx
cos x cos x
= cos x ln | cos x| + x sin x.
The general solution of the ODE is
∴ y = c1 cos x + c2 sin x + cos x ln | cos x| + x sin x.

Computational Science & Engineering (CSE) T. Jeong

You might also like