Tuan 11.12 InhomogeneouslinearODE

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

Chapter 5: Second order linear ODEs (continued)

Nguyen Thu Huong

School of Applied Mathematics and Informatics


Hanoi University of Science and Technology

January 9, 2023
Inhomogeneous second order linear equations

Content

2. Inhomogeneous second order linear equations


2.1 Variation of parameters
2.2 Inhomogeneous equations with constant coefficients
2.3 Euler equations
2.4 Mass – spring system: forced oscillation

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Recall
Theorem (Superposition of solutions)
Assume that
y1 is a solution of the equation y 00 + p(x)y 0 + q(x)y = f1 (x),
y2 is a solution of the equation y 00 + p(x)y 0 + q(x)y = f2 (x).
Then y1 + y2 solves the equation

y 00 + p(x)y 0 + q(x)y = f1 (x) + f2 (x).

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Recall
Theorem
The general solution to the inhomogeneous equation

y 00 + p(x)y 0 + q(x)y = f (x) (1)

has the form y = ȳ + y ∗ , where


ȳ is the general solution to the corresponding homogeneous
equation y 00 + p(x)y 0 + q(x)y = 0,
y ∗ is a particular solution to (1).

Last week: Solve for ȳ = C1 y1 (x) + C2 y2 (x). In the special case of


an ODE with constant coefficients: characteristic equation.
Today: We aim at y ∗ .

2nd order linear DEs Nguyen Thu Huong


Content

2. Inhomogeneous second order linear equations


2.1 Variation of parameters
2.2 Inhomogeneous equations with constant coefficients
2.3 Euler equations
2.4 Mass – spring system: forced oscillation
Inhomogeneous second order linear equations

Variation of parameters
The general solution of the corresponding homogeneous equation
y 00 + p(x)y 0 + q(x)y = 0 is:

ȳ (x) = C1 y1 (x) + C2 y2 (x).

We look for a particular solution of the inhomogeneous equation in


the form:
y ∗ (x) = C1 (x)y1 (x) + C2 (x)y2 (x)
Substituting in the equation

y ∗ = C1 y1 + C2 y2
(y ∗ )0 = C1 y10 + C2 y20 + C10 y1 + C20 y2
| {z }
0
∗ 00
(y ) = C1 y100 + C2 y200 + C10 y10 + C20 y20 .

Hence Ly ∗ = C1 Ly1 + C2 Ly2 + C10 y10 + C20 y20 ⇒ C10 y10 + C20 y20 = f (x).
2nd order linear DEs Nguyen Thu Huong
Inhomogeneous second order linear equations

A particular solution of the inhomogeneous equation is found in


the form:
y ∗ (x) = C1 (x)y1 (x) + C2 (x)y2 (x),
where
( C10 (x), C20 (x) satisfy the system
C1 (x)y1 (x) + C20 (x)y2 (x) = 0,
0

C10 (x)y10 (x) + C20 (x)y20 (x) = f (x).


(
C1 (x) = ϕ1 (x) + K1 ,
We obtain
C2 (x) = ϕ2 (x) + K2 , K1 , K2 ∈ R,
The general solution is given by
y = (ϕ1 (x) + K1 ) y1 (x) + (ϕ2 (x) + K2 ) y2 (x).

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

How to solve y 00 + p(x)y 0 + q(x)y = f (x)

1 Solve the homogeneous equation y 00 + p(x)y 0 + q(x)y = 0. If


a solution y1 is given, we find another one y2 by Liouville
formula. Then we obtain ȳ = C1 y1 + C2 y2 .
2 Find a particular solution of the inhomogeneous by the method
of variation of parameters: y ∗ = C1 (x)y1 (x) + C2 (x)y2 (x).

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Example
Solve the following equations
x 1
a) y 00 + y0 − y = x − 1 that the corresponding
1−x 1−x
homogeneous equation has a solution y1 = e x .
e −x
b) y 00 + 2y 0 + y = 2 .
x +1
1
c) y 00 + 4y = .
cos 2t

2nd order linear DEs Nguyen Thu Huong


Content

2. Inhomogeneous second order linear equations


2.1 Variation of parameters
2.2 Inhomogeneous equations with constant coefficients
2.3 Euler equations
2.4 Mass – spring system: forced oscillation
Inhomogeneous second order linear equations

Inhomogeneous equations with constant coefficients

Form:
y 00 + py 0 + qy = f (x), p, q ∈ R.

Solve the corresponding homogeneous equation

y 00 + py 0 + qy = 0.

(We use the characteristic equation).


Find a particular solution to inhomogeneous equation.
General approach: variation of parameters.
Special RHS ⇒ special approach: undetermined coefficients
f (x) = e αx Pn (x) and
f (x) = e αx (Pn (x) cos βx + Qm (x) sin βx), where
Pn (x), Qm (x) are polynomials of x.

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

The case f (x) = e αx Pn (x)

Consider the RHS of the form

f (x) = e α x Pn (x),

where Pn (x) = an x n + an−1 x n−1 + . . . + a0 is a polynomial of


degree n.
Compare α to the root of the characteristic equation. We look for
a particular solution y ∗ to the inhomogeneous equation of the
form
if α is not a root: y ∗ = e αx Qn (x),
if α is a single root, y ∗ = xe αx Qn (x),
if α is a double root, y ∗ = x 2 e αx Qn (x),
where Qn (x) is a polynomial of degree n.
Plug y ∗ in the equation to find the coefficients of Qn (x).

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

When substituting y ∗ = e αx Q(x) into the equation, we obtain


q× y ∗ = e αx Q(x)
p× (y ) = αe αx Q(x) + e αx Q 0 (x)
∗ 0

(y ∗ )00 = α2 e αx Q(x) + 2αe αx Q 0 (x) + e αx Q 00 (x)


Hence, dividing both sides by e αx , we gain

(α2 + pα + q)Q(x) + (2α + p)Q 0 (x) + Q 00 (x) = Pn (x).

Example
Solve the following equations:
1 y 00 + 4y 0 + 5y = 8e −2x .
2 y 00 − 2y 0 = xe 2x + 3.
3 y 00 − 2y 0 + y = 2e x , y (0) = −1, y 0 (0) = 0.

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Example
Solve the ODE: y 00 + 4y 0 + 5y = 8e −2x .

The characteristic equation is k 2 + 4k + 5 = 0


⇒ k1,2 = −2 ± i. The general solution to the corresponding
homogeneous equation is ȳ = e −2x (C1 cos x + C2 sin x).
α = −2 is not a solution of (CE). We look for y ∗ = Ae −2x .
Plugging in the equation, we have:
5× y∗ = Ae−2x
4× (y ∗ )0 = −2Ae −2x
(y ∗ )00 = 4Ae −2x
8e −2x = Ae −2x ⇒ A = 8; y ∗ = 8e −2x .
The general solution to the given ODE is
y = e −2x (C1 cos x + C2 sin x) + 8e −2x .

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Example
Solve the ODE: y 00 − 2y 0 = xe 2x .

The characteristic equation is k 2 − 2k = 0 ⇒ k1 = 0, k2 = 2.


The general solution to the corresponding homogeneous
equation is ȳ = C1 + C2 e 2x .
α = 2 is a single root of (CE). We look for a particular
solution y ∗ = x(Ax + B)e 2x .
Plugging in the equation, we have:
0× y∗ = (Ax 2 + Bx)e 2x
−2× (y ∗ )0 = 2(Ax 2 + Bx)e 2x + (2Ax + B)e 2x
(y ∗ )00 = 4(Ax 2 + Bx)e 2x + 2.(2Ax + B).2e 2x + 2Ae 2x
xe 2x = 2(2Ax + B)e 2x + 2Ae 2x
2
⇒ A = 41 , B = − 41 ; y ∗ = x 4−x e 2x .
The general solution to the given ODE is
2
y = C1 + C2 e 2x + x 4−x e 2x .
2nd order linear DEs Nguyen Thu Huong
Inhomogeneous second order linear equations

Example
Solve the IVP: y 00 − 2y 0 + y = 2e x , y (0) = −1, y 0 (0) = 0.

The characteristic equation is k 2 − 2k + 1 = 0 ⇒ k1,2 = 1.


The general solution to the corresponding homogeneous
equation is ȳ = (C1 + C2 x)e x .
α = 1 is a double root of (CE). We look for a particular
solution y ∗ = x 2 Ae x .
Plugging in the equation, we have:
1× y∗ = Ax 2 e x
−2× (y ∗ )0 = Ax 2 e x + 2Axe x
(y ∗ )00 = Ax 2 e x + 2.2Ax.e x + 2Ae x
2e x = 2Ae x ⇒ A = 1; y ∗ = x 2 e x .
The general solution is y = (C1 + C2 x)e x + x 2 e x .
y 0 (x) = (C1 + C2 x)e x + C2 e x + x 2 e x + 2xe x .
Using the initial data −1 = y (0) = C1 ;
0 = y 0 (0) = C1 + C2 ⇒ C2 = 1.
Hence, the solution in search is y = (x 2 + x − 1)e x .
2nd order linear DEs Nguyen Thu Huong
Inhomogeneous second order linear equations
 
αx
The case f (x) = e Pm (x) cos βx + Qn (x) sin βx

Consider the RHS of the form


 
f (x) = e α x Pm (x) cos β x + Qn (x) sin β x ,

where Pm (x), Qn (x) are polynomials of degrees m, n.


Compare α ± iβ to the root of the characteristic equation. We
look for y ∗ of the form
 
if α ± iβ is not a root, y ∗ = e αx P̄l (x) cos βx + Q̄l (x) sin βx ,
if α ± iβ isa single root, 
y ∗ = xe αx P̄l (x) cos βx + Q̄l (x) sin βx ,
where P̄l (x), Q̄l (x) are polynomials of degree l, l = max{m, n}.
Plug y ∗ in the equation to find the coefficients of P̄l (x), Q̄l (x).

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Example
Solve the following equations:
1 y 00 + 2y 0 + 5y = 17 cos 2x.
2 y 00 + y = 2 cos x, y (0) = 2, y 0 (0) = −1.
3 y 00 + 4y = xe −2x − 3 sin 2x.

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Example
Solve the ODE: y 00 + 2y 0 + 5y = 17 cos 2x.

The characteristic equation is k 2 + 2k + 5 = 0


⇒ k1,2 = −1 ± 2i. The general solution to the corresponding
homogeneous equation is ȳ = e −x (C1 cos 2x + C2 sin 2x).
α = 0, β = 2, ±2i is not a solution of (CE). We look for
y ∗ = A cos 2x + B sin 2x.
Plugging in the equation, we have:
5× y∗ = A cos 2x + B sin 2x

2× (y ) = 0 2B cos 2x − 2A sin 2x
(y ∗ )00 = −4A cos 2x − 4B sin 2x
( 2x = (A + 4B) cos 2x + (B − 4A) sin 2x
17 cos
A + 4B = 17
⇒ ⇒ A = 1, B = 4; y ∗ = cos 2x + 4 sin 2x.
B − 4A = 0
The general solution to the given ODE is
y = e −x (C1 cos 2x + C2 sin 2x) + cos 2x + 4 sin 2x.
2nd order linear DEs Nguyen Thu Huong
Inhomogeneous second order linear equations

Example
Solve the following IVP y 00 + y = 2 cos x, y (0) = 2, y 0 (0) = −1.

The characteristic equation is k 2 + 1 = 0 ⇒ k1,2 = ±i. The general


solution to the corresponding homogeneous equation is
ȳ = C1 cos x + C2 sin x.
α = 0, β = 1, ±i is a solution of (CE). We look for
y ∗ = x(A cos x + B sin x).
Plugging in the given equation
y∗ = x(A cos x + B sin x)
(y ∗ )00 = −x(A cos x + B sin x) + 2(−A sin x + B cos x)
⇒ 2 cos x = 2(−A sin x + B cos x) ⇒ A = 0, B = 1; y ∗ = x sin x.
The general solution to the inhomogeneous equation is
y = C1 cos x + C2 sin x + x sin x.
Using the initial data y (0) = 2 ⇒ C1 = 2.
y 0 = −C1 sin x + C2 cos x + sin x − x cos x, y 0 (0) = −1 ⇒ C2 = −1.
Hence, the solution in search is y = 2 cos x − sin x + x sin x.
2nd order linear DEs Nguyen Thu Huong
Inhomogeneous second order linear equations

Example
Solve the ODE y 00 + 4y = xe −2x − 3 sin 2x.

C.E. is k 2 + 4 = 0 ⇒ k1,2 = ±2i. Hence,


ȳ = C1 cos 2x + C2 sin 2x.
We look for y ∗ = y1∗ + y2∗ , where y1∗ and y2∗ are solutions of
the equations y 00 + 4y = xe −2x và y 00 + 4y = −3 sin 2x,
respectively.
α = −2 is not a solution of C.E., y1∗ = (Ax + B)e −2x .
α = 0, β = 2, 2i is a root of the C.E.,
y2∗ = x(A cos 2x + B sin 2x).
The general solution of the given equation is y = ȳ + y1∗ + y2∗ .

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Plugging in the equations


y1∗ = (Ax + B)e −2x
(y1∗ )00 = 4(Ax + B)e −2x + 2.A.(−2)e −2x
⇒ xe −2x = 8(Ax + B)e −2x − 4Ae −2x
⇒ A = 18 , B = 16
1
; y1∗ = 2x+1
16 e
−2x .

y2 = x(A cos 2x + B sin 2x)
∗ 00
(y2 ) = −4(A cos 2x + B sin 2x) + 2(−2A sin 2x + B cos 2x)
⇒ −3 sin 2x = −4A sin 2x + 4B cos 2x
⇒ A = 34 , B = 0; y2∗ = 43 x cos 2x.
The general solution is
y = C1 cos 2x + C2 sin 2x + 2x+1 −2x + 3 x cos 2x.
16 e 4

2nd order linear DEs Nguyen Thu Huong


Content

2. Inhomogeneous second order linear equations


2.1 Variation of parameters
2.2 Inhomogeneous equations with constant coefficients
2.3 Euler equations
2.4 Mass – spring system: forced oscillation
Inhomogeneous second order linear equations

Euler equations
Form
x 2 y 00 + axy 0 + by = f (x), a, b ∈ R.
Set x = e t , x > 0 ⇒ t = ln x.
1
y 0 (x) =y 0 (t).t 0 (x) = y 0 (t)
x
 1 0 1 1  dy 0
y 00 (x) = y 0 (t) = − 2 y 0 (t) +
x x x x dt x
1 00 0
= 2 (y (t) − y (t)).
x
The given equation is transformed to

y 00 (t) + (a − 1)y 0 (t) + by (t) = g (t).

(Second order linear equation with constant coefficients).


2nd order linear DEs Nguyen Thu Huong
Inhomogeneous second order linear equations

Example
Solve the equations
1 x 2 y 00 − 9xy 0 + 21y = 36x ln x.
2 x 2 y 00 − 2xy 0 + 2y = 3x 2 .

Set ln x = t, then xy 0 (x) = y 0 (t); x 2 y 00 (x) = y 00 (t) − y 0 (t).


The equation becomes y 00 − 10y 0 + 21y = 36te t .
C.E. is k 2 − 10k + 21 = 0 ⇒ k1 = 3, k2 = 7; ȳ = C1 e 3t + C2 e 7t .
y ∗ = (At + B)e t , plugging in the equation, we obtain
A = 3, B = 2, y ∗ = (3t + 2)e t .
The general solution of the given equation is
y = C1 e 3t + C2 e 7t + (3t + 2)e t = C1 x 3 + C2 x 7 + x(3 ln x + 2).

2nd order linear DEs Nguyen Thu Huong


Content

2. Inhomogeneous second order linear equations


2.1 Variation of parameters
2.2 Inhomogeneous equations with constant coefficients
2.3 Euler equations
2.4 Mass – spring system: forced oscillation
Inhomogeneous second order linear equations

Mass – spring system: forced oscillation

Consider a vertical mass – spring system, the mass is acted by an


external force g (t). The equation governing the system is

mẍ(t) + γ ẋ(t) + kx(t) = g (t)

where mẍ - the force of inertia, γ ẋ - the damping force, kx -spring


force, g (t) - external force acting on the mass.
g (t): the input or driving force; x(t): the output or the response
of the system.
Undamped case: γ = 0.
Damped case: γ 6= 0.
Special interest: g (t) = F0 cos ωt, ω > 0.

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Forced vibrations without damping

mẍ(t) + kx(t) = F0 cos ωt


We consider two interesting cases:
q
k
If ω0 = m 6= ω, then the general solution is

F0
x = C1 cos ω0 t + C2 sin ω0 t + cos ωt.
m(ω02 − ω2)

In particular, the mass is initially at rest, i.e. x(0) = 0,


x 0 (0) = 0. We obtain
 
F0 (cos ωt − cos ω0 t) 2F0 (ω0 − ω)t (ω0 + ω)t
x= = sin sin .
m(ω02 − ω 2 ) m(ω02 − ω 2 ) 2 2

If |ω0 − ω| is small, then the motion is a rapid oscillation with


high frequency, but a slowly varying sinusoidal amplitude.
2nd order linear DEs Nguyen Thu Huong
Inhomogeneous second order linear equations

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

If ω0 = ω, then the general solution is


F0
x = C1 cos ω0 t + C2 sin ω0 t + t sin ω0 t.
2mω0
Because of the term t sin ω0 t, it is predicted that the motion
will become unbounded regardless of the initial data.

Actually, as x is large, the model is invalid.

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

If damping is included in the model, the predicted motion remains


bounded; however, the response to the input function F0 cos ωt
may be quite large if γ is small and ω ≈ ω0 (resonance).
Resonance can be either good or bad depending on the
circumstances. It must be taken very seriously in the design of
structures, such as buildings or bridges, where it can produce
instabilities possibly leading to the catastrophic failure of the
structure. For example, soldiers traditionally break step when
crossing a bridge to eliminate the periodic force of their marching
that could resonate with a natural frequency of the bridge. On the
other hand, resonance can be put to good use in the design of
instruments, such as seismographs, intended to detect weak
periodic incoming signals.

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Forced vibrations with damping

mẍ(t) + γ ẋ(t) + kx(t) = F0 cos ωt


Exer. 65 states that all solutions of the corresonding homogeneous
F0
equation approach 0. x(t) = C1 e r1 t + C2 e r2 t + cos(ωt − δ),
| {z } ∆
transient solution
| {z }
steady state
q 2 −ω)2
m(ω
where ∆ = m2 (ω02 − ω)2 + γ 2 ω 2 ; cos δ = 0
∆ ; sin δ = γω
∆.
With damping, the energy put into the system by the initial
displacement and velocity is dissipated, and the motion becomes
the response of the system to the external force.
Without damping, the effect of the initial data would persist for all
time.

2nd order linear DEs Nguyen Thu Huong


Inhomogeneous second order linear equations

Further investigation on the steady state solution

F0
X (t) = cos(ωt − δ)

F0
The amplitude R = √ .
m2 (ω02 −ω)2 +γ 2 ω 2
For low frequency ω → 0, R → Fk0 .
For high frequency ω → ∞, R → 0.
m(ω 2 −ω)2
The phase angle δ: cos δ = 0
∆ ; sin δ = γω
∆.
For low frequency ω → 0, δ → 0, the response is nearly in
phase with the excitation.
For ω = ω0 , δ = π2 , the response lags behind the excitation by
π
2.
For high frequency ω → ∞, δ ≈ π, the response is nearly out
of phase with the excitation, i.e. the response attains its
minima when the excitation attains its maxima.
2nd order linear DEs Nguyen Thu Huong

You might also like