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

Second order ordinary differential equations

Luis L. Bonilla

Universidad Carlos III de Madrid, 2.1.D17, bonilla@ing.uc3m.es

October 8, 2019

Bonilla (UC3M) Lecture 3 October 8, 2019 1 / 26


Outline

Outline

Linear second order ODEs.


Variation of parameters.
Method of undetermined coefficients.
Reduction of order.
Driven systems, linear oscillators and resonance.

Bonilla (UC3M) Lecture 3 October 8, 2019 2 / 26


Linear second order ODEs

General properties

Existence and uniqueness: a(t), b(t), f (t) continuous on interval I .


Then for each t0 in I and each set of values of y0 , v0 , the IVP:

y 00 + a(t)y 0 + b(t)y = f (t), y (t0 ) = y0 , y 0 (t0 ) = v0 ,

has a unique solution y (t) for t ∈ I .


Superposition principle for undriven ODE: y1 (t), y2 (t) are solutions of
the homogeneous ODE with f (t) = 0. Then y (t) = c1 y1 (t) + c2 y2 (t)
is also a solution (ci are arbitrary constants).
For independent solutions yi (t), with Wronskian determinant
W (y1 , y2 ) = y1 y20 − y2 y10 6= 0, y (t) = c1 y1 (t) + c2 y2 (t) is the general
d
solution. Abel formula: dt W (y1 , y2 ) = −a(t) W (y1 , y2 ), f (t) = 0.
Particular solution yp (t) of the driven ODE gives general solution:
y (t) = yp (t) + c1 y1 (t) + c2 y2 (t) if y1 (t), y2 (t) are independent
solutions of the homogeneous ODE.
Bonilla (UC3M) Lecture 3 October 8, 2019 3 / 26
Linear second order ODEs

Superposition principle

Let y 00 + a(t)y 0 + b(t)y = 0 be a linear homogeneous ODE and y1 (t), y2 (t)


two of its solutions. Then y (t) = c1 y1 (t) + c2 y2 (t) is also a solution.

We insert this y (t) directly in the ODE and use linearity of the derivatives:

(c1 y1 + c2 y2 )00 + a(t)(c1 y1 + c2 y2 )0 + b(t)(c1 y1 + c2 y2 )


= (c1 y100 + c2 y200 ) + a(t)(c1 y10 + c2 y20 ) + b(t)(c1 y1 + c2 y2 )
= c1 [y100 + a(t)y10 + b(t)y1 ] + c2 [y200 + a(t)y20 + b(t)y2 ] = 0.

Here y100 + a(t)y10 + b(t)y1 = 0 and y200 + a(t)y20 + b(t)y2 = 0 because y1


and y2 are both solutions of the ODE.

Example: y1 = 1 + t and y2 = e t are solutions of ty 00 − (1 + t)y 0 + y = 0,


therefore y = c1 (1 + t) + c2 e t is also a solution.

Bonilla (UC3M) Lecture 3 October 8, 2019 4 / 26


Linear second order ODEs

Independence of solutions
Let y 00 + a(t)y 0 + b(t)y = 0 be a linear homogeneous ODE and y1 (t),
y2 (t) two of its solutions. y1 (t), y2 (t) are linearly independent iff their
Wronskian is not zero.
0 0

= 0 ⇐⇒ y1 y20 − y10 y2 = 0 ⇐⇒ y2 − y1 = 0
y1 y2
W [y1 , y2 ] ≡ 0

0
y y
1 2 y2 y1
d d d d y2
⇐⇒ ln y2 − ln y1 = 0 ⇐⇒ (ln y2 − ln y1 ) = ln =0
dt dt dt dt y1
y2
⇐⇒ = c ⇐⇒ y2 = c y1 .
y1
We have proven that the Wronskian is zero if and only if two functions are
linearly dependent: y2 (t) = c y1 (t). This is equivalent to the statement.
1 + t et

t = (1 + t)e t − e t = te t 6= 0,
Example: W [1 + t, e ] =
1 et
so y1 = 1 + t and y2 = e t are linearly independent solutions of
ty 00 − (1 + t)y 0 + y = 0. The general solution is y (t) = c1 (1 + t) + c2 e t .
Bonilla (UC3M) Lecture 3 October 8, 2019 5 / 26
Linear second order ODEs

Abel’s formula
Let y 00 + a(t)y 0 + b(t)y = 0 be a linear homogeneous ODE and y1 (t),
d
y2 (t) two of its solutions. Then dt W [y1 , y2 ] = −a(t) W [y1 , y2 ].
d d d d
W [y1 , y2 ] = (y1 y20 − y1 y20 ) = (y1 y20 ) − (y10 y2 )
dt dt dt dt
= (y1 y200 + y10 y20 ) − (y10 y20 + y100 y2 ) = y1 y200 − y2 y100
= y1 [−a(t)y 0 2 − b(t)y2 ] − y2 [−a(t)y10 − b(t)y1 ] = a(t)y2 y10 − a(t)y1 y20
= −a(t)(y1 y20 − y1 y20 ) = −a(t) W [y1 , y2 ].

Example:

W [1 + t, e t ] = te t =⇒ ln W [1 + t, e t ] = t + ln t
d 1 1+t
=⇒ ln W [1 + t, e t ] = 1 + = ,
dt t t
which is Abel’s formula as ty 00 − (1 + t)y 0 + y = 0 divided by t yields
y 00 − (1 + t)y 0 /t + y /t = 0 and therefore a(t) = − 1+t
t .
Bonilla (UC3M) Lecture 3 October 8, 2019 6 / 26
Linear second order ODEs

Solving linear ODEs with constant coefficients


Let y 00 + ay 0 + by = 0 be a linear homogeneous ODE with constant
coefficients. We try exponential solutions: y = e rt .

0 = (e rt )00 + a(e rt )0 + b(e rt ) = r 2 e rt + are rt + be rt = (r 2 + ar + b)e rt



2 −a ± a2 − 4b
=⇒ r + ar + b = 0 =⇒ r = characteristic roots.
2
Cases:
(a) a2 > 4b: √ Two different real√roots r+ and r− give solution
2 2
y = (c1 e t a −4b/2 + c2 e −t a −4b/2 )e −at/2 .
(b) a2 = 4b: one double real root r0 = − 2a give solution
y = (c1 + c2 t)e −at/2 .
q
a2
(c) a2 < 4b: two complex conjugate roots − 2a ± iω, ω = b− 4, give
solution y = [c1 cos(ωt) + c2 sin(ωt)] e −at/2 .
Bonilla (UC3M) Lecture 3 October 8, 2019 7 / 26
Linear second order ODEs

Visualizing solutions: damped spring (spiral point/focus)

Bonilla (UC3M) Lecture 3 October 8, 2019 8 / 26


Linear second order ODEs

Visualizing solutions: vector fields


For an autonomous second order ODE:

y 00 + f (y , y 0 ) = 0,

1 Write it as two first order ODEs:


y0 = v,

0
v = −f (y , v ).

2 On a grid of the phase plane (y , v ) draw at each point a velocity


vector (v , −f (y , v )) with the same length.
• For a linear ODE with constant coefficients, f (y , y 0 ) = ay 0 + by .
• A first order ODE y 0 = f (t, y ) can be written as the system t 0 = 1,
y 0 = f (t, y ), whose vector field (1, f (t, y )) is the direction field studied in
the previous lectures.
Bonilla (UC3M) Lecture 3 October 8, 2019 9 / 26
Linear second order ODEs

Visualizing solutions: vector field damped spring

y 00 + 0.4y 0 + 65y = 0, equivalent to y 0 = v , v 0 = −65y − 0.4v .

Bonilla (UC3M) Lecture 3 October 8, 2019 10 / 26


Linear second order ODEs

Visualizing solutions: vector field undamped spring (center)

y 00 + 4y = 0, equivalent to y 0 = v , v 0 = −4y .

Bonilla (UC3M) Lecture 3 October 8, 2019 11 / 26


Linear second order ODEs

Visualizing solutions: saddle point

y 00 + y 0 − 2y = 0, equivalent to y 0 = v , v 0 = 2y − v .

Bonilla (UC3M) Lecture 3 October 8, 2019 12 / 26


Variation of parameters

Variation of parameters
Inhomogeneous ODE: ay 00 + by 0 + cy = F (t).
y1 (t), y2 (t) are independent solutions of the homogeneous ODE.
Particular solution of the inhomogeneous ODE:
Z t Z t
y2 (s)F (s)ds y1 (s)F (s)ds
yp (t) = −y1 (t) + y2 (t) ,
t0 a(s)W (y1 , y2 )(s) t0 a(s)W (y1 , y2 )(s)

where W (y1 , y2 ) = y1 y20 − y2 y10 is the Wronskian determinant.


General solution is the sum of a particular solution of the
inhomogeneous ODE plus a general solution of the homogeneous
(F = 0) ODE:
y (t) = yp (t) + c1 y1 (t) + c2 y2 (t).
Proof of formula: Write ODE as y 00 + ba y 0 + ca y = Fa , and for
y = u1 (t)y1 (t) + u2 (t)y2 (t) find y1 u10 + y2 u20 = 0, y10 u10 + y20 u20 = F
a, and
solve.
Bonilla (UC3M) Lecture 3 October 8, 2019 13 / 26
Variation of parameters

Example: ty 00 − (1 + t)y 0 + y = t 2 e 2t

Solutions of homogeneous ODE: y1 = e t , y2 = 1 + t.


System of equations for f (t) = t e 2t :
 t  0   
e 1+t u1 0
= .
et 1 u20 t e 2t

Then, subtracting equations, −t u20 = t e 2t =⇒ u20 = −e 2t , and


u2 = − 21 e 2t + c2 . Also, u10 e t = −(1 + t)u20 = (1 + t)e 2t , which yields
u10 = (1 + t)e t . Then u1 = t e t + c1 .
General solution: y (t) = u1 (t)y1 (t) + u2 (t)y2 (t):

t − 1 2t
y (t) = e + c1 e t + c2 (1 + t).
2
Try particular solution yp = (At + B)e 2t .

Bonilla (UC3M) Lecture 3 October 8, 2019 14 / 26


Undetermined coefficients

Method of undetermined coefficients


F (t) yp (t)

Pn (t) = a0 t n + a1 t n−1 + . . . + an t s (A0 t n + A1 t n−1 + . . . + An )


Pn(t)e αt t s (A0 t n + A1 t n−1 + . . . + An )e αt
cos βt
Pn (t) t s [(A0 t n + A1 t n−1 + . . . + An ) cos βt
sin βt
+(B0 t n + B1 t n−1 + . . . + Bn ) sin βt]

Particular solutions of the ODE ay 00 + by 0 + cy = F (t) depending on the


form of the source term F (t). Here s is the smallest nonnegative integer
(s = 0, 1, or 2) that will ensure that no term in yp (t) is a solution of the
corresponding homogeneous equation. Equivalently, for the three cases, s
is the number of times 0 is a root of the characteristic equation, α is a
root of the characteristic equation, and iβ is a root of the characteristic
equation, respectively.
Bonilla (UC3M) Lecture 3 October 8, 2019 15 / 26
Undetermined coefficients

Example: y 00 − 2y 0 − 3y = t
Variation of parameters. Solution of homogeneous ODE:
y = u1 e −t + u2 e 3t , because r 2 − 2r − 3 = 0 has the solutions r = −1 and
r = 3. Now u1 (t) and u2 (t) selected so that
u10 e −t + u20 e 3t = 0.
Then
−u10 e −t + 3u20 e 3t = t.
This yields (adding the two equations): 4u20 e 3t = t, hence u20 = 4t e −3t .
Integrating by parts, u2 = −( 12 t
+ 361
)e −3t + c2 . From the first equation,
u10 e −t = −u20 e 3t =⇒ u10 = − 4t e t . Integrating by parts, u1 = 1−t t
4 e + c1 .
2−3t −t
We obtain y (t) = 9 + c1 e + c2 e . 3t

Undetermined coefficients. Particular solution: yp = at + b. Inserting in


ODE: −2a − 3at − 3b = t =⇒ 2a + 3b + (1 + 3a)t = 0. Then 1 + 3a = 0
and 2a + 3b = 0, which produce a = − 13 , b = 29 . Thus yp = − 3t + 29 .
Adding general solution of the homogeneous ODE, same result as before.
Bonilla (UC3M) Lecture 3 October 8, 2019 16 / 26
Undetermined coefficients

b2
Example: y 00 + by 0 + cy = cos t, with c − 4 = ω2 > 0
Undetermined coefficients. Particular solution: yp = A cos t + B sin t.
Inserting in ODE:
(c − 1)A + Bb = 1, (c − 1)B − Ab = 0 =⇒ A = (c − 1)γ, B = bγ with
γ −1 = (c − 1)2 + b 2 . Then

(c − 1) cos t + b sin t
y (t) = + e −bt/2 (d1 cos ωt + d2 sin ωt),
(c − 1)2 + b 2

where we have used r 2 + br + c = 0 to solve the homogeneous ODE.

Resonance: b = 0, ω = 1, y (0) = 0, y 0 (0) = 0.


resonance
t sin t
2

40
20
t
20 40 60 80 100
-20

cos t−cos ωt t
y (t) = ω 2 −1
→ 2 sin t, as ω → 1. -40

Bonilla (UC3M) Lecture 3 October 8, 2019 17 / 26


Reduction of order

Reduction of order

Let y1 (t) be a solution of a(t)y 00 + b(t)y 0 + c(t)y = 0. The substitution


y (t) = y1 (t)v (t) transform the ODE a(t)y 00 + b(t)y 0 + c(t)y = F (t) in a
first-order ODE for v 0 :
u10 0
 
00 F (t)
a(t)v + b(t) + 2 v = .
u1 y1 (t)
y
Example. y 00 − 1+t 0
t y + t = 0 is solved by y1 = 1 + t. y = (1 + t)v gives:

(1 + t)2 0 v 00 1 2
(1 + t)v 00 + 2v 0 − v = 0 =⇒ 0 = 1 + −
t v t 1+t
te t
R te t dt
or ln v 0 = t + ln (1+t)
t
2 =⇒ v 0 = (1+t) 2 =⇒ v = (1+t)2
=
te t et
− 1+t + e dt = 1+t . Thus y = e t is the other independent solution.
t
R

Bonilla (UC3M) Lecture 3 October 8, 2019 18 / 26


Driven systems, linear oscillators and resonance

Nonlinear autonomous ODE

d y 02
y 00 + V 0 (y ) = 0 =⇒ 0 = y 0 [y 00 + V 0 (y )] = [ + V (y )].
dt 2
y 02
Then 2 + V (y ) = C and
Z
dy
± p = t − t0 .
2[C − V (y )]
Example: Pendulum: ml θ̈ = −mg sin θ =⇒ 12 θ̇2 + gl (1 − cos θ) = C .

Bonilla (UC3M) Lecture 3 October 8, 2019 19 / 26


Driven systems, linear oscillators and resonance

Linear oscillations and resonance

Damped pendulum with force −γ θ̇ − mgl sin θ:


γ g
θ̈ +
θ̇ + sin θ = 0.
ml l
q
Use sin θ ≈ θ and t = ω0 t̃, with ω0 = gl ,

γ
θ̈ + 2β θ̇ + θ = 0, √ , (damped spring).
β=
2m gl
p
λ2 + 2βλ + 1 = 0 gives λ = −β ± β 2 − 1.
√ √
2 2
β > 1, overdamped pendulum: θ = e −βt (ae β −1t + be β −1t ).
0 ≤ βp< 1, underdamped pendulum: θ(t) = ce −βt cos(Ωt + ϕ),
Ω = 1 − β 2 . Also θ = e −βt (a cos Ωt + b sin Ωt), a + ib = ce iϕ .

Bonilla (UC3M) Lecture 3 October 8, 2019 20 / 26


Driven systems, linear oscillators and resonance

Visualizing solutions: driven damped spring

Bonilla (UC3M) Lecture 3 October 8, 2019 21 / 26


Driven systems, linear oscillators and resonance

Visualizing solutions: driven undamped spring

Bonilla (UC3M) Lecture 3 October 8, 2019 22 / 26


Driven systems, linear oscillators and resonance

Particular solution: transfer function


Add periodic forcing term (coefficient can be set equal to 1):

θ̈ + 2β θ̇ + θ = cos ωt.

For a force e iωt


1
θ(t) = Re H(iω)e iωt = Re e iωt ,
1− ω2 + 2iβω

where H(r ) = 1/(r 2 + 2βr + 1) is the transfer function.

Amplitude and phase shift of transfer function:


1 2βω
M(ω) = p , ϕ(ω) = − arctan .
(1 − ω )2 + 4β 2 ω 2
2 1 − ω2

If ω < 1, −π < ϕ(ω) < 0. Steady solution is θ(t) = M(ω) cos[ωt + ϕ(ω)].

Bonilla (UC3M) Lecture 3 October 8, 2019 23 / 26


Driven systems, linear oscillators and resonance

Gain and phase shift (Bodé plots)


Gain M(ω) (ratio of amplitude of response to force amplitude):

Resonance:
1 p
max M(ω) = p , ωmax = 1 − 2β 2 .
2β 1 − β 2

As β → 0+, M(ω) → +∞.


Bonilla (UC3M) Lecture 3 October 8, 2019 24 / 26
Driven systems, linear oscillators and resonance

Resonance
Spring driven by a periodic forcing term:

θ̈ + 2β θ̇ + θ = cos ωt.

General solution:
p
θ(t) = M(ω) cos[ωt + ϕ(ω)] + ce −βt cos[Ωt + ϕ0 ], Ω= 1 − β2

1 2βω
M(ω) = p , ϕ(ω) = − arctan .
(1 − ω 2 )2 + 4β 2 ω 2 1 − ω2

Undamped oscillator with θ(0) = θ̇(0) = 0:

cos ωt − cos t 2 sin (1−ω)t


2 (1 + ω)t t
θ(t) = 2
= 2
sin =⇒ θ ≈ sin t (ω → 1).
1−ω 1−ω 2 2

Bonilla (UC3M) Lecture 3 October 8, 2019 25 / 26


Soft and hard springs

Soft and hard springs

my 00 = −ky ∓ αy 3 − cy 0 ; +: soft spring; -: hard spring.


k 2 α 4
V (y ) = y ± y .
2m 4m
02
For c = 0, y2 + V (y ) = E and V (ytp ) = E , ytp > 0, give the period
Z y Z ytp
du du
± p = t − t0 =⇒ P = 4 p .
2[E − V (u)] 0 2[E − V (u)]

Bonilla (UC3M) Lecture 3 October 8, 2019 26 / 26

You might also like