Free–style problem solver:
second order linear inhomogenous ODE’s
Octavian G. Mustafa∗
e-mail address: octawian@[Link]
To Lidia Aştefanei †
Introduction
Many undergraduate problems in mathematics and mechanics reduce
to finding solutions to (in)homogenous second order ordinary differential
equations (aka ODE’s). A set of computations, based on the simple Bell-
man’s estimate, is always useful in this respect. In the author’s experience,
it is a pretty good time saver.
Contents
Bellman’s estimate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Changing the variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
The solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Particular cases: constant coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Particular cases: perturbations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Further reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
∗
This essay has not been submitted to a referee. Therefore its content must be taken
”as is.” The author welcomes your comments to the above e-mail address and thanks you
in advance for your effort.
1
1 Bellman’s estimate
1.1 An integral inequality
Given the interval I ⊂ R, with [t0 , T ] ⊆ I, consider the next inequality
t
x(t) ≤ x0 + a(s)x(s)ds, t ∈ [t0 , T ], (1)
t0
where x0 ≥ 0 is a constant and a, x are continuous, non–negative valued
functions defined in I.
Set ε > 0. The integral inequality still holds if we replace x0 with x0 + ε.
The difference is that now the right–hand member of the inequality is a
positive quantity and we can write
a(t)x(t)
t ≤ a(t), t ∈ [t0 , T ]. (2)
x0 + ε + t0 a(s)x(s)ds
Since
t
d a(t)x(t)
ln x0 + ε + a(s)x(s)ds = t ,
dt t0 x0 + ε + t0 a(s)x(s)ds
an integration of (2) with respect to t over [t0 , T ] leads to
t
x0 + ε + t0 a(s)x(s)ds t
ln ≤ a(s)ds.
x0 + ε t0
Now,
t t
a(s)ds
x0 + ε + a(s)x(s)ds ≤ (x0 + ε)e t0
, t ∈ [t0 , T ].
t0
Taking into account (1), we get
t
a(s)ds
x(t) ≤ (x0 + ε)e t0
, t ∈ [t0 , T ].
Finally, by making ε 0, we obtain
t
a(s)ds
x(t) ≤ x0 e t0
, t ∈ [t0 , T ]. (3)
2
1.2 Bellman’s estimate
Consider the second order linear homogenous ODE below
y + a(t)y + b(t)y = 0, t ∈ [t0 , T ], (4)
where the functions a, b are defined in I and continuous. The solution y is
always assumed C 2 , that is twice continuously differentiable.
The equation (4) can be rewritten as a system of two first order ODE’s
by introducing the new variable v = y . We have
y = v,
t ∈ [t0 , T ].
v = −b(t)y − a(t)v,
The initial data for the equation (4) read as
y(t0 ) = y0 , y (t0 ) = v(t0 ) = y1
for y0 , y1 ∈ R.
An integration with respect to t over [t0 , T ] leads to
t
y(t) − y0 = v(s)ds
t0
and
t
v(t) − y1 = − [b(s)y(s) + a(s)v(s)]ds.
t0
The triangle inequality helps us estimate that
t
|y(t)| ≤ |y0 | + |v(s)|ds (5)
t0
and
t
|v(t)| ≤ |y1| + [|b(s)| · |y(s)| + |a(s)| · |v(s)|]ds. (6)
t0
The sum of (5) and (6) yields
t
|y(t)| + |v(t)| ≤ |y0| + |y1 | + (1 + |a(s)| + |b(s)|) · (|y(s)| + |v(s)|)ds
t0
for every t ∈ [t0 , T ].
An application of formula (3), with
x(t) = |y(t)| + |v(t)|, x0 = x(t0 ),
leads to the simple estimate
t
t0 (1+|a(s)|+|b(s)|)ds
|y(t)| + |y (t)| ≤ (|y0 | + |y1 |) · e , (7)
known as Bellman’s estimate. See also [1].
3
2 Changing the variables
2.1 The case when a ∈ C 1
Consider now the second order inhomogenous ODE
y + a(t)y + b(t)y = f (t), t ∈ [t0 , T ], (8)
where the functions a, b, f : I → R are continuous and, as before, y ∈ C 2 .
Our aim in this section is to simplify this equation by reducing it to the
formula
d2 z
+ c(s)z = g(s), s ∈ [s0 , S], (9)
ds2
where J ⊂ R is an interval, [s0 , S] ⊆ J and c, g are continuous in J.
To this end, let us assume first that a ∈ C 1 . We look for a change of
variables
y = v(t)z
that will make the term ”a(t)y ” from (8) vanish.
The formulas
y = v z + vz , y = v z + 2v z + vz ,
once introduced into (8), yield
vz + [2v + a(t)v]z + [b(t)v + a(t)v + v ]z = f (t), t ∈ [t0 , T ].
We notice that, if 2v + a(t)v = 0, we can get rid of z in the preceding
equation. In this way, by taking
t
1 − 12
v(t) = e− 2 a(t)dt t0
a(s)ds
=e ,
we reduce the equation (8) to the simpler form (9), that is
z + c(t)z = g(t), t ∈ [t0 , T ],
where
b(t)v + a(t)v + v [a(t)]2 a (t)
c(t) = = b(t) − −
v(t) 4 2
and
f (t) 1 t
a(s)ds
g(t) = = f (t) · e 2 t0 .
v(t)
4
2.2 The general case
Let us notice that, by multiplying the equation (8) with
t
a(t)dt t0
a(s)ds
p(t) = e =e ,
we can recast it as
[p(t)y ] + p(t)b(t)y = p(t)f (t), t ∈ [t0 , T ].
We would like to have
dy dz
p(t)y = dt
= ,
p(t)
ds
which means that we are interested in finding s = s(t) such that
dz
z(s(t)) = y(t) and (s(t)) = p(t)y (t), t ∈ [t0 , T ]. (10)
ds
A differentiation of the first identity in (10) with respect to t yields
d dz
[z(s(t))] = (s(t)) · s (t) = y (t)
dt ds
and, taking into account the second identity in (10), we obtain the initial
value problem
ds 1
= , s(t0 ) = s0 . (11)
dt p(t)
An integration with respect to t in [t0 , T ] leads to
t t
dτ − τ a(ξ)dξ
s(t) = s0 + = s0 + e t0 dτ.
t0 p(τ ) t0
Further,
d dz d2 z ds 1 d2 z
[p(t)y ] = (s(t)) = 2 · = · .
dt ds ds dt p(t) ds2
The equation (8) reads now as
d2 z
+ [p(t)]2 b(t)z = [p(t)]2 f (t), t ∈ [t0 , T ]. (12)
ds2
May be omitted at first reading.
5
The inverse of the function s = s(t), that is t = t(s), verifies the initial
value problem — recall (11) —
dt
= p(t), t(s0 ) = t0 .
ds
In conclusion, we get from (12) that
dz 2
+ c(s)z = g(s), s ∈ [s0 , S],
ds2
where
c(s) = [p(t(s))]2 b(t(s)), g(s) = [p(t(s))]2 f (t(s)).
The general case is, obviously, more difficult than the first case discussed
here. Fortunately, in most problems we encounter a continuously differen-
tiable coefficient a. See also [3].
3 The solution
3.1 The uniqueness
We are interested in this essay in solving the initial value problem
y + a(t)y + b(t)y = f (t), t ∈ [t0 , T ],
y(t0 ) = y0 , (13)
y (t0 ) = y1 .
According to the previous section, we first simplify the formula of the
equation. Since in most undergraduate applications the continuous coeffi-
cients a, b are constant — meaning that a is always C 1 —, we shall keep the
notation t for the argument of the unknown function z.
Before writing down the initial value problem for the simplified equation,
let us notice that, given the change of variables
t
− 12 a(s)ds
y(t) = e t0
z(t), t ∈ [t0 , T ], (14)
we have
1 − 12 tt a(s)ds
y (t) = − a(t) · y(t) + e 0 · z (t). (15)
2
6
The new initial value problem reads as
z + c(t)z = g(t), t ∈ [t0 , T ],
z(t0 ) = z0 , (16)
z (t0 ) = z1 ,
where, taking into account (14), (15) for t = t0 , we have
z0 = y0 ,
z1 = a(t20 ) · y0 + y1 .
Let us establish now that the initial value problem (16) has a unique
solution. To this end, assume that z1 , z2 verify both the problem (16).
Their difference, namely Y = z1 −z2 , verifies the next initial value problem
Y + c(t)Y = 0, t ∈ [t0 , T ],
Y (t0 ) = 0,
Y (t0 ) = 0.
Now, according to Bellman’s estimate (7), we deduce that
t
(1+|c(s)|)ds
|Y (t)| + |Y (t)| ≤ (|Y (t0 )| + |Y (t0 )|) · e t0
= 0, t ∈ [t0 , T ].
In conclusion, z1 = z2 throughout [t0 , T ].
3.2 The wronskian
Given the linear homogenous ODE
y + a(t)y + b(t)y = 0, t ∈ [t0 , T ], (17)
assume that we know a particular solution y1 which is positive everywhere
in [t0 , T ].
The wronskian of the pair (y1 , y) of solutions — here, y stands for the
general solution of (17) — is defined by the formula
y1 (t) y(t)
W [y1 , y](t) =
, t ∈ [t0 , T ].
y1 (t) y (t)
We make the following computations
dW [y1 , y]
y1 (t) y (t)
y1 (t) y(t)
y1 (t) y(t)
=
+
=
dt y1 (t) y (t)
y1 (t) y (t)
y1 (t) y (t)
y (t) y(t)
=
1
.
−a(t)y1 (t) − b(t)y1 (t) −a(t)y (t) − b(t)y(t)
7
Recalling that, if we add the first row multiplied by ”b(t) ” to the second
row, the determinant does not change, we get
dW [y1, y]
y1 (t) y(t)
=
= −a(t) · W [y1 , y], t ∈ [t0 , T ].
dt −a(t)y1 (t) −a(t)y(t)
In conclusion, the wronskian verifies the formula
t
−
W [y1 , y](t) = C · e−
a(s)ds
a(t)dt
= W [y1, y](t0 ) · e t0
(18)
throughout [t0 , T ].
3.3 The general solution of the simplified equation
Given the simplified ODE below
z + c(t)z = 0, t ∈ [t0 , T ],
assume that it has a positive valued solution z1 .
The wronskian reads in this case as
z1 (t) z(t)
W [z1 , z](t) =
= C, C ∈ R.
z1 (t) z (t)
Recasting this identity as a first order inhomogenous ODE with respect
to z, we obtain
z1 (t) C
z = ·z+ . (19)
z1 (t) z1 (t)
The general solution of the equation (19) reads as
(t)
z1 t (τ )
z1
dt t0 z1 (τ ) dτ
z(t) = C(t) · e z1 (t)
= C(t) · e
= C(t)z1 (t), t ∈ [t0 , T ],
where C is an yet unknown smooth function.
To find C, we introduce the preceding formula into the equation and get
C
C (t) =
[z1 (t)]2
everywhere in [t0 , T ].
By an integration with respect to t, we conclude that the general solution
of the simplified ODE reads as
t
C dτ
z(t) = C(t)z1 (t) = dt · z1 (t) = C 1 · z1 (t) + C 2 · z1 (t) ,
[z1 (t)]2 t0 [z1 (τ )]
2
where the numbers C1 , C2 ∈ R are the integration constants.
8
3.4 A particular solution of the inhomogenous ODE
Assuming that the homogenous ODE
z + c(t)z = 0, t ∈ [t0 , T ], (20)
has a positive valued particular solution z1 , we would like to find a particular
solution zp of the inhomogenous ODE
z + c(t)z = g(t), t ∈ [t0 , T ]. (21)
Let us try the following formula
zp = D(t)z1 , (22)
where D is an yet unknown smooth function with real values.
Inserting (22) into the equation (21), we get
z1 (t)D + 2z1 (t)D + [z1 (t) + c(t)z1 (t)]D = g(t), t ∈ [t0 , T ].
Notice that the sum between the brackets is zero, z1 being a solution of the
equation (20).
Introduce the function E = E(t) with the formula E = D . We can now
recast the latter formula as an inhomogenous first order ODE, that is
z1 (t) g(t)
E = −2 ·E + , t ∈ [t0 , T ]. (23)
z1 (t) z1 (t)
As before, the general solution of this equation reads as
(t)
z1
−2 dt C(t)
E(t) = C(t) · e z1 (t)
= (24)
[z1 (t)]2
for every t ∈ [t0 , T ], where C is an yet unknown smooth function.
The formula (24), once inserted into (23), yields
C (t) = z1 (t)g(t).
Since we are looking for a particular solution of (23), we take
t
C(t) = z1 (s)g(s)ds.
t0
Now, because of
t
C(t) 1
D (t) = 2
= z1 (s)g(s)ds, t ∈ [t0 , T ], (25)
[z1 (t)] [z1 (t)]2 t0
9
a variant of D is given by
t s
1
D(t) = z1 (τ )g(τ )dτ ds. (26)
t0 [z1 (s)]2 t0
Via an integration by parts, we have that
D(t)
t s s
d dτ
= 2
· z1 (τ )g(τ )dτ ds
t0 ds t0 [z1 (τ )] t0
t t t s
dτ dτ
= 2
· z1 (τ )g(τ )dτ − z1 (s) 2
g(s)ds.
t0 [z1 (τ )] t0 t0 t0 [z1 (τ )]
Notice that, for our choice of D, — recall (25), (26) for t = t0 —
D(t0 ) = D (t0 ) = 0. (27)
Finally, collecting all the details into (22), we obtain
t t
dτ
zp (t) = z1 (t) 2
· z1 (s)g(s)dτ
t0 [z1 (τ )] t0
t s
dτ
−z1 (t) z1 (s) 2
· g(s)ds
t0 t0 [z1 (τ )]
t t s
dτ dτ
= z1 (t) z1 (s) 2
− 2
g(s)ds
t0 t0 [z1 (τ )] t0 [z1 (τ )]
t t
dτ
= z1 (t) z1 (s) 2
g(s)ds, t ∈ [t0 , T ]. (28)
t0 s [z1 (τ )]
Taking into account (27), we have also that
zp (t0 ) = D(t0 )z1 (t0 ) = 0 (29)
and
zp (t0 ) = D (t0 )z1 (t0 ) + D(t0 )z1 (t0 ) = 0. (30)
3.5 The solution of (16)
Since the problem (16) has a unique solution, we look for constants C1 , C2 ∈
R so that the solution can be written as
z(t) = a particular solution of the equation (20) + zp (t)
t
ds
= C1 z1 (t) + C2 z1 (t) 2
+ zp (t), t ∈ [t0 , T ].
t0 [z1 (s)]
10
The constants C1 , C2 are found by means of the data from problem (16).
To this end, we have — recall (29), (30) —
z(t0 ) = C1 z1 (t0 ) + zp (t0 ) = z0
and
1
z1 (t0 ) = C1 z1 (t0 ) + C2 · + zp (t0 ) = z1 .
z1 (t0 )
We have obtained
z0
C1 = , C2 = z1 · z1 (t0 ) − z0 · z1 (t0 ).
z1 (t0 )
4 Particular cases: constant coefficients
If the coefficients a, b of the general linear inhomogenous ODE (4) are
constant then the coefficient c of the simplified ODE (20) is also a constant,
a2
c(t) = b − = c.
4
We recall the fundamental formula (28),
t t
dτ
zp (t) = G(t, s)g(s)ds, G(t, s) = z1 (t)z2 (s) ,
t0 s [z1 (τ )]2
where t0 ≤ s ≤ t ≤ T .
We have three cases. In the first one, c = −ω 2 < 0 for some constant
ω > 0. We take z1 (t) = eωt . Here, the quantity G(t, s) reads as
t
dτ 1
G(t, s) = eω(t+s)
2ωτ
= · sinh ω(t − s).
s e ω
The solution of (16) is given by
t
z1 1
z(t) = z0 cosh ω(t − t0 ) + sinh ω(t − t0 ) + sinh ω(t − s) · g(s)ds.
ω ω t0
In the second case, c = 0. We take z1 (t) = 1. Here, the quantity G(t, s)
reads as
G(t, s) = t − s.
11
The solution of (16) is given by
t
z(t) = z0 + z1 (t − t0 ) + (t − s)g(s)ds.
t0
In the third case, c = ω 2 for some constant ω > 0. We take z1 (t) = cos ωt
— the interval [t0 , T ] must be chosen appropriately! —. Here, the quantity
G(t, s) reads as
t
dτ 1
G(t, s) = sin ωt sin ωs 2
= · sin ω(t − s).
s cos ωτ ω
The solution of (16) is given by
t
z1 1
z(t) = z0 cos ω(t − t0 ) + sin ω(t − t0 ) + sin ω(t − s) · g(s)ds.
ω ω t0
5 Particular cases: perturbations
In many undergraduate textbooks, e.g. [2, pages 168, 176], one can find pre-
sentations of the so-called method of undetermined coefficients as some sort of
independent enterprise and not as of a less-obvious application of the fundamental
variation of parameters procedure. The computations in this section show that
the method of undetermined coefficients is nothing but a disguised particular case
of the method of variation of parameters.
Given the simplified inhomogenous equation (21), assume that
c(t) = ±ω 2 , g(t) = tn eαt cos βt, (31)
where ω > 0, n ≥ 1 is an integer and α, β ∈ R.
The particular solution zp can be computed in this case by taking into
account formula (26), that is
t s
1
zp (t) = z1 (t) 2
z1 (τ )g(τ )dτ ds, t ∈ [t0 , T ].
t0 [z1 (s)] t0
In fact, we shall work loosely and compute the solution without caring
about the integration constants, namely
1
zp (t) = z1 (t) z1 (t)g(t)dt dt,
[z1 (t)]2
since the integration constants will join the homogenous part of the general
solution (the expense will be on the initial data).
12
Now, given γ ∈ C − {0} and m ≥ 0 an integer, the following formula
γt 1
m γt
t e dt = e · tm
γ
m
m(m − 1) · · · (m − k + 1) m−k
+ (sign m) (−1)k ·t (32)
k=1
γ k+1
can be established by mathematical induction.
Notice that the perturbation from (31) is the real part ”Re ” of the quan-
tity
g(t) = tn eηt , η = α + iβ.
Take z1 (t) = e−λt , where λ ∈ {ω, iω}. Then, taking into account (32) for
γ = η − λ = 0, we obtain
1
z1 (t)g(t)dt
[z1 (t)]2
n
(2λ+γ)t 1 k n(n − 1) · · · (n − k + 1)
=e ·t +
n
(−1) ·tn−k
.
γ k=1
γ k+1
Further, by assuming that 2λ + γ = η + λ = 0, we obtain
1
z1 (t) z1 (t)g(t)dt dt
[z1 (t)]2
−λt 1 n (2λ+γ)t
=e ·t e dt
γ
n
n(n − 1) · · · (n − k + 1)
+ (−1)k k+1
tn−k e(2λ+γ)t dt
γ
k=1
e (2λ+γ)t
tn n
n(n − 1) · · · (n − p + 1)tn−p
= e−λt + (−1)p
γ 2λ + γ p=1 (2λ + γ)p+1
n−1
n(n − 1) · · · (n − k + 1)
+ (−1)k
k=1
γ k+1
tn−k n−k
(n − k) · · · (n − k − p + 1)tn−k−p
×e(2λ+γ)t + (−1)p
2λ + γ p=1 (2λ + γ)p+1
n n! e(2λ+γ)t
+(−1) n+1 ·
γ 2λ + γ
13
(λ+γ)t 1
=e · tn
γ(2λ + γ)
n
1 1
+ (−1) n · · · (n − p + 1)
p
p+1
+ p+1 · tn−p
p=1
γ(2λ + γ) γ (2λ + γ)
n−1
n−k
n · · · (n − k − p + 1)
+ (−1)k+p k+1 (2λ + γ)p+1
· tn−k−p
k=1 p=1
γ
= eηt · (n–th order polynomial in t).
If γ = η − λ = 0 and η + λ = 0 then
1
z1 (t) z1 (t)g(t)dt dt
[z1 (t)]2
1 2
2γ · t − γ12 · t, when n = 1,
= e−λt · 1
n
(n+1)γ · tn+1 + (−1)k n···(n−k+2)
γ k+1
· tn−k+1, when n ≥ 2,
1 1
k=1
2γ · t − γ2
, when n = 1,
=e t·−λt
1
n
(n+1)γ · tn + (−1)k n···(n−k+2)
γ k+1
· tn−k , when n ≥ 2,
k=1
= te · (n–th order polynomial in t).
ηt
If γ = η − λ = 0 then
1
z1 (t) z1 (t)g(t)dt dt
[z1 (t)]2
1 2
4λ · t − 4λ12 · t + 8λ13 , when n = 1,
= eλt · 1
n+1
(n+1)(2λ) · tn+1 + (−1)k n···(n−k+2)
(2λ)k+1
· tn−k+1 , when n ≥ 2,
k=1
= eλt · [(n + 1)–th order polynomial in t]
= teηt · (n–th order polynomial in t) + constant · eλt .
Since the latter term of this sum is a solution of the homogenous (part of
the) equation, we can neglect it.
In all of these three situations, the particular solution reads as
1
zp (t) = Re z1 (t) z1 (t)g(t)dt dt , t ∈ [t0 , T ].
[z1 (t)]2
14
Further reading
[1] R. Bellman, Stability theory of differential equations, McGraw-Hill,
London, 1953
[2] W.E. Boyce, R.C. DiPrima, Elementary differential equations and
boundary value problems, Sixth edition, J. Wiley & Sons, New
York, 1997
[3] P. Hartman, A. Wintner, On the assignment of asymptotic values for
the solutions of linear differential equations of second order, Amer.
J. Math. 77 (1955), 475–483
15