Chapter 02
Chapter 02
S
Second-Order
d O d Linear
Li ODE
ODEs
Contents
2.1 Homogeneous Linear ODEs of Second Order
2.2 Homogeneous Linear ODEs with Constant Coefficients
2.3 Differential Operators. Optional
(Mass-Spring
2.4 Modeling: Free Oscillations. (Mass Spring System)
2.5 Euler-Cauchy Equations
2 6 Existence and Uniqueness of Solutions
2.6 Solutions. Wronskian
2.7 Nonhomogeneous ODEs
2 8 Modeling: Forced Oscillations.
2.8 Oscillations Resonance
2.9 Modeling: Electric Circuits
2 10 Solution by Variation of Parameters
2.10
2
2.1 Homogeneous Linear ODEs of Second
Order
A linear second-order
second order ODE is defined as
y" + p(x)y' + q(x)y = r(x)
If r(x)
( ) = 0 for
f all ll x considered,
id d th then th
the ODE is
i called
ll d
homogeneous. If r(x) ≠ 0, the ODE is called
nonhomogeneous.
nonhomogeneous
For instance, y" + 25y = e– x cos x is nonhomogeneous
and xy
xy" + yy' + xy = 0 is homogeneous.
homogeneous
An example of nonlinear ODE is: y"y + y' 2 = 0.
continued
3
continued
4
Homogeneous Linear ODEs: Superposition Principle
EXAMPLE 1: Homogeneous Linear ODEs: Superposition
(Linearity) of Solutions
The functions y1 = cos x and y2 = sin x are solutions of the
homogeneous linear ODE: y" + y = 0, for all x. We verify this
by differentiation and substitution.
substitution
Similarly we can verify for y2 = sin x.
A linear combination (superposition) of two functions: y1
and y2 is defined as
y = c1 y1 + c2 y2
If we take the linear combination (superposition) of cos x and
sin x, say, (4.7 cos x – 2 sin x), then we can verify that this
li
linear combination
bi ti is i also
l a solution
l ti off the
th given
i ODE:
ODE
(4.7 cos x – 2 sin x)" + (4.7 cos x – 2 sin x)
= – 4.7
4 7 cos x + 2 sin x + 4.7
4 7 cos x – 2 sin x = 0.
0
THEOREM 1
Fundamental Theorem for the
Homogeneous Linear ODE
For a homogeneous linear ODE: y" + p(x)y' + q(x)y = 0, any
li
linear combination
bi ti off twot solutions
l ti on an open interval
i t l I is
i
again a solution of the given ODE on I. In particular, for such
an equation,
equation sums and constant multiples of solutions are again
solutions.
6
PROOF
8
Initial Value Problem. Basis. General Solution
For a second-order homogeneous linear ODE, an initial value
problem should consist of two initial conditions: y(x0) = K0
and y '(x0) = K1.
These conditions prescribe given values K0 and K1 of the solution and
its first derivative (the slope of its curve) at the same given x = x0 in the
open interval considered.
The initial value conditions are used to determine the two
arbitrary constants c1 and c2 in a general solution:
y = c1 y 1 + c 2 y 2
of the ODE; here, y1 and y2 are suitable solutions of the ODE.
The resulting
Th lti y, withith specific
ifi c1 andd c2 determined
d t i d by
b the
th
initial values, is the particular solution of the ODE.
10
DEFINITION
General Solution,, Basis,, Particular Solution
A general solution of a homogeneous linear ODE on an
p interval I is y = c1y1 + c2y2, in which y1 and y2 ((not
open
constantly proportional to each other) are solutions of the
given ODE on I, and c1 and c2 are arbitrary constants. These
y1, y2 are called a basis (or a fundamental system) of the
solutions on I.
A particular solution of the given ODE on I is obtained if
we assign specific values to c1 and c2 in y = c1y1 + c2y2.
Definition: Two functions y1 and y2, where they are defined on an interval
I, are called linearly independent if and only if both k1 and k2 for k1y1(x) +
k2y2(x) = 0 are trivial everywhere on I.
11
DEFINITION
Basis ((Reformulated))
A basis of solutions of a homogeneous ODE on an open
interval I is a pair of linearly independent solutions of the
ODE on I.
EXAMPLE 5 Basis,
Basis General Solution
Solution, Particular Solution
in Example 4: y" + y = 0
cos x and sin x form a basis of solutions for all x because
their quotient is cot x ≠ const (or tan x ≠ const).
y = c1 cos x + c2 sin x is a ggeneral solution.
The solution y = 3.0 cos x – 0.5 sin x of the initial value
problem is a particular solution.
12
Find a Basis if One Solution Is Known. Reduction of
Order
EXAMPLE 7 Reduction of Order if a Solution Is
Known Basis
Known.
Find a basis of solutions of the ODE
(x2 – x)y
x)y" – xy 0
xy' + y = 0.
Solution.
Inspection shows that y1 = x is a solution because yy'1 = 1 and
y"1 = 0,
The idea of the method is to substitute
y = uy1 = ux, y' = u'x + u, y" = u"x + 2u'
into the ODE. This gives
( 2 – x)(u"x
(x )( " + 2u')
2 ') – x(u'x
( ' + u)) + ux = 0.
0
Then the ODE becomes:
(x2 – x)(u 2u')) – x2uu' = 0, (x2 – x)u
x)(u"xx + 2u x)u" + (x – 2)u
2)u' = 0.
continued
13
14
Reduction of Order. (General Case)
Let y1 be a solution of a homogeneous linear ODE y" + p(x)y'
+ q(x)y = 0, to find y2, let y = y2 = uy1. Then applying
y ' y2 ' u ' y1 uy1 ' y '' y2 '' u '' y1 2u ' y1 ' uy1 ''
into the equation:
q
u '' y1 2u ' y1 ' uy1 '' p (u ' y1 uy1 ') quy1 =0
Collecting terms in u u",, u
u' and u:
u '' y1 u '(2 y1 ' py1 ) u ( y1 '' py1 ' qy1 )=0
∵y1 is the solution of the given ODE: y1 '' py1 ' qy1 =0 0
2 y ' py1
Thus u '' u ' 1 0. Let u' = U and u" = U ', then
y1
2y '
U ' 1 p U 0 a first-order ODE
y1
continued
15
dU 2y '
Then 1 p dx and ln U 2 ln y1 pdx
U y1
By taking exponents, we obtain:
1 ppdx
U 2e
y1
Hence, ∵U = uu' u Udx and y2 = uy1, the second
Hence
solution y2:
y2 uy1 y1 Udx
16
2.2 Homogeneous Linear ODEs with Constant
Coefficients
Consider a 2nd-order homogeneous linear ODE whose
coefficients a and b are constant:
y" + ay' + by = 0
How to solve this ODE?
Remember: the solution of the first-order linear ODE with a
constant coefficient k: y' + ky = 0, is an exponential function
k .
y = ce–kx
Assume: y = e
x and substituting it and its derivatives: y' =
ex and yy'' = 2ex into the ODE, we obtain
(2 + a + b)ex = 0
Hence if is a solution of the important characteristic
ti (or
equation ( auxiliary
ili i )
equation
2 + a + b = 0
continued
17
18
EXAMPLE 2 Initial Value Problem
Solve the initial value problem
yy" + yy' – 2y = 0, y(0) = 4, (0) = –5.
yy'(0) 5.
Solution.
Step 1. General solution. The characteristic equation is
2 + – 2 = 0.
Its roots are = 1 and –2,, so the ggeneral solution:
y = c1ex + c2e-2x.
Stepp 2. Particular solution. Since yy'(x) = c1ex – 2c2e-2x, we
obtain from the general solution and the initial conditions
y(0) = c1 + c2 = 4, c1 = 1
y'(0) = c1 – 2c2 = –5 c2 = 3.
The particular solution: y = ex + 3e-2x
19
20
EXAMPLE 4 Initial Value Problem in the Case of a
Double Root
Solve the initial value problem
y" + y' + 0.25y = 0, y(0) = 3.0, y'(0) = –3.5.
Solution.
The characteristic equation is 2 + + 0.25 = (+ 0.5)2 = 0.
It has the double root: = –0.5. This gives the general
solution y = (c1 + c2x)e–0.5x.
We need its derivative
y' = c2e-0.5x – 0.5(c1 + c2x)e–0.5x
From this and the initial conditions we obtain
y(0) = c1 = 3.0, y'(0) = c2 – 0.5c1 = 3.5, hence c2 = –2.
The particular solution of the initial value problem is
y = (3 – 2x)e–0.5x. continued
21
12 a a 2 4b a 2 i where b 14 a
2
We can obtain
b i a basis
b i off reall solutions
l i
y1 = e-ax/2 cos x, y2 = e-ax/2 sin x ( > 0)
It can be verified that these are solutions by
substitution. They form a basis on any interval since
their
h i quotient
i cot x is i not a constant. Hence
H a reall
general solution in Case III is
ax/2 (A cos x + B sin
y = e-ax/2 i x)) (A,
(A B arbitrary).
bit )
22
Derivation in Case III.
Complex Exponential Function
For a complex variable z = r + it, the complex
exponential function ez can be expressed in terms of
the real functions er, cos t, and sin t:
ez = er + it = ereit = er(cos t + i sin t).
where eit = cos t + i sin t is the Euler formula.
For case III, 12 a a 4b a 2 i where
2
b 14 a 2 then
e1x e ( a / 2) x i x e ( a / 2) x (cos x i sin x)
e2 x e ( a / 2)) x i x e ( a / 2)) x (cos x i sin x)
1 x 2 x
By adding (subtracting) e and e and multiplied by
1/2 (1/2i),
(1/2i) we can obtain
b i y1 (y ( 2).
)
23
24
The solution curve shows y and the curves of e–0.2x
and –ee–0.2x (dashed), between which the curve of y
oscillates. Such “damped vibrations” have important
mechanical and electrical applications.
pp
25
26
2.5 Euler–Cauchy
y Equations
q
Euler–Cauchy equations are ODEs of the form
x2y" + axy' + by = 0
with given constants a and b and unknown y(x). We substitute
y = xm andd its
i derivatives
d i i y'' = mxm-11 and
d y'''' = m(m 1) m-22 into
( – 1)x i
the given ODE. This gives
x2m(m
( – 1)x m 2 + axmxm-1
1) m-2 m 1 + bx
b m
= m(m – 1)xm + amxm + bxm
[ 2 + (a
= [m ( – 1)m1) + b] xm = 0. 0
We obtained a common factor xm. Dropping it, we have the
auxiliary equation m2 + (a – 1)m + b = 0. 0
Hence y = xm is a solution if and only if m is a root of the
equation
quadratic equation.
continued
31
Let the second solution y2 = uy1, then we can obtain u by (Sec. 2.1)
1
u Udx 2 exp pdx dx where y1 x ((1 a ) / 2 and p
y1
a
x
1 a 1
1 a exp p a ln x dx
p dx dx 1 a exp
x x x
xa 1
1 a dx dx ln x c *
x x
The general solution is:
y c1 y1 c2 y2 c1 y1 c2 uy1 (c1 c2 u ) y1
(c1 c2 ln x) x m (c1 c2 ln x) x (1 a ) / 2
33
35
Fig.47.
g Euler–Cauchy
y equations
q
36
Linear Independence of Solutions
38
39
Proof of Wronskian
() If y1 and y2 are linearly dependent on I, then y1 = ky2. The
Wronskian: W(y1, y2) = y1y'2 – y2y'1 = ky2y'2 – y2ky'2 = 0.
() We wish to show that if W(y1, y2) = 0 for some x = x0, then y1
and y2 are linear dependent.
p
Let k1y1 + k2y2 = 0, then k1y'1 + k2y'2 = 0.
To eliminate k2, we can multiply k1y1 + k2y2 = 0 by y'2, k1y'1 + k2y'2 = 0 by –
y2 andd add
dd them
h together: h
k1y1 y'2 + k2y2 y'2 – k1y'1y2 – k2y'2y2 = k1(y1 y'2 – y'1y2) = k1W = 0
To eliminate k1, we can multiply k1y1 + k2y2 = 0 by – y'1, k1y'1 + k2y'2 = 0 by
y1 and add them together:
– k1y1 y'1 – k2y2 y'1 + k1y'1y1 + k2y'2y1 = k2(y'2 y1 – y'1y2) = k2W = 0
If W(y1, y2) 0, then k1 and k2 are both 0, which means y1 and y2 are
linearly independent.
40
Since W(y1, y2) = 0, then k1 and k2 can be any arbitrary number. So k1 and k2
are not necessary to be trivial to make k1y1 + k2y2 = 0 which implies y1 and y2
are linearly dependent.
To p
prove the last statement, if W(x ( 0) = 0 at an x0 on I, then we have
W = y1y'2 – y2y'1 and W' = y1y2" + y'1y'2 – y'2y'1 – y2y1" = y1y2" – y2y1"
Since y1" + p( )y1' + q(
p(x)y q(x)y )y1 = 0 and y2" + p( )y2' + q(
p(x)y )y2 = 0,,
q(x)y
multiply the former equation by –y2 and the latter one by y1 to get
–y2 y1" – p(x)y2 y1' – q(x)y2 y1 = 0
y1 y2" + p(x)y1 y2' + q(x)y2 y1 = 0
Add these equations: y1y2" – y2y1" + p(x)(y1 y2' – y2 y1') = 0
This is W' + p(x)W = 0. The solution of this 1st-order ODE is:
W ( y1 , y2 ) Ce
p ( x ) dx
for all x on I. where C: any y constant
41
Since e
p ( x ) dx
can not be 0, if C = 0, then W(y1, y2) = 0 for all x on
I. However,, if C ≠ 0,, then W(y
(y1, y2) ≠ 0 for all x on I. That is,, if W
= 0 at an x = x0 in I, then W ≡ 0 on I; hence if there is an x1 in I at
which W is not 0, then y1, y2 are linearly independent on I.
42
43
EXAMPLE 2 Illustration of Theorem 2 for a Double
Root
Ag general solution of yy" – 2y'
y + y = 0 on any
y interval
is y = (c1 + c2x)ex. The corresponding Wronskian is
not 0, which shows linear independence of ex and xex
on any interval. Namely,
ex xe x
W (e , xe ) x
x x
( x 1) e 2x
xe 2x
e 2x
0
e ( x 1)e x
44
THEOREM 4
47
Proof of Theorem 4
Let y = Y(x) be any solution of the given ODE. From theorem
3, we know there’s a general solution y(x) = c1y1(x) + c2y2(x)
exists
i on I.
Assume x0 in I, then the initial conditions: y(x0) = Y(x0) and
'( 0) = Y'(x
y'(x Y'( 0),
) then
th
Y ( x0 ) c1 y1 ( x0 ) c2 y2 ( x0 ) (a)
Y '(( x0 ) c1 y '1 ( x0 ) c2 y '2 ( x0 ) (b)
Multiplying (a) by y2'(x0) and (b) by –y2(x0) and adding the
resulting equations:
c1 ( y1 y2 ' y2 y1 ') c1W ( y1 , y2 ) Yy2 ' y2Y '
a : c2 ( y1 y2 ' y2 y1 ')) c2W ( y1 , y2 ) y1Y ' Yy1 '
Same way:
Since y1, y2 are linearly independent, W 0, then c1 and c2 can
be solved .
48
49
2.7 Nonhomogeneous
g ODEs
DEFINITION
General Solution
Solution, Particular Solution
A general solution of the nonhomogeneous ODE y" + p(x)y'
+ q(x)y = r(x) on an open interval I is a solution of the form
y(x) = yh(x) + yp(x);
here yh = c1y1 + c2y2 is a general solution of the
here,
homogeneous ODE y" + p(x)y' + q(x)y = 0 on I and yp is any
solution of the given nonhomogeneous ODE solution on I
containing no arbitrary constants.
A particular solution of the given nonhomogeneous ODE
on I is a solution obtained from y(x) = yh(x) + yp(x) by
assigning specific values to the arbitrary constants c1 and c2
in yh.
50
THEOREM 1
51
Proof of Theorem 1
(a) Let L[y] denotes the left hand side of the given nonhomo-
geneous ODE y" + p(x)y' + q(x)y = r(x) and y and y are the
solutions of the given ODE and its corresponding homogeneous
ODE on I, respectively. Then
L[ y y ] L[ y ] L[ y ] r ( x) 0 r ( x)
So y + y is also a solution of the given ODE on I.
(b) Let y and y* be any solution of y" + p(x)y' + q(x)y = r(x). We
can write them as L[y]= r(x) and L[y*] = r(x). Since L is a linear
operator,
L[y – y*] = L[y] – L[y*] = r(x) – r(x) = 0.
So y – y* is a solution of the corresponding homogeneous ODE.
52
THEOREM 2
53
Proof of Theorem 2
Let y* be any solution of the given ODE on I and x0 any x in I.
Also let y(x) = yh(x) + yp(x) be any general solution of the
Also,
given ODE.
By Thm. 3 in Sec. 2.6, yh = c1y1 + c2y2 exists because p(x) and
q(x) are continuous.
Since yp can satisfies the g given ODE,, by y Thm 1(b), ( ), let Y = yy* –
yp is a solution of the corresponding homogeneous ODE. At
x0, we have
Y ( x0 ) y *( x0 ) y p ( x0 ) Y '( x0 ) y *'( x0 ) y ' p ( x0 )
By Thm. 1 in Sec. 2.6, for any initial conditions in I, there
exists a unique particular solution for the corresponding
homogeneous ODE obtained by assigning suitable values to
c1, c2 in yh.
54
55
Table2.1 Method of Undetermined Coefficients
56
57
EXAMPLE 1 Application of the Basic Rule
y p = K2 x 2 + K1 x + K0 .
Then y"p + yp = 2K2 + K2x2 + K1x + K0 = 0.001xcontinued 2.
58
60
continued
62
Fig.50.
g Solution in Example 2
The curve begins with a horizontal tangent, crosses the x-axis at x
= 0.6217 1 5x – 5x2 = 0) and approaches the axis from
0 6217 (where 1 + 1.5x
below as x increases.
63
EXAMPLE 3 Application of the Sum Rule (c)
Substitute the above solution into the given ODE and omit
the exponential factor gives (0.25 + 220.5
0.5 + 5)C = 1, hence
0.5x
C = 1/6.25 = 0.16, and yp1 = 0.16e .
We now set yp2 = K cos 10x + M sin 10x, as in Table 2.1,
and obtain
y'p2 = –10K sin 10x + 10M cos 10x,
yy"p2 = –100K
100K cos 10x – 100M sin 10x.
Substitution into the given ODE gives for the cosine terms
and for the sine terms
–100K
100K + 210M
2 10M + 5K = 40,
40
–100M – 210K + 5M = 190
or by simplification
or, simplification,
–95K + 20M = 40, –20K – 95M = 190.
The solution is K = 0, M = 2. Hence yp2 = 2 sin 10x.
continued
65
Together
y = yh + yp1 + yp2
= e-x(A cos 2x + B sin 2x) + 0.16e0.5x + 2 sin 10x
Step 3. Solution of the initial value problem.
From
F y andd the
h fi
first initial
i i i l condition,
di i y(0)
(0) = A + 0.16
0 16 =
0.16, hence A = 0. Differentiation gives
yy' = e-x(–A cos 2x – B sin 2x – 2A sin 2x + 2B cos 2x)
+ 0.08e0.5x + 20 cos 10x.
From this and the second initial condition we have y (0)
y'(0)
= –A + 2B + 0.08 + 20 = 40.08, hence B = 10. This gives
the solution:
y = 10e-x sin 2x + 0.16e0.5x + 2 sin 10x.
continued
66
67
2.9 Modeling: Electric Circuits
An ODE for the current I(t) in the RLC-
circuit in the figure
g is obtained from the
following law:
Kirchhoff’s Voltage Law (KVL). The
voltage
lt (the
(th electromotive
l t ti force)
f )
impressed on a closed loop is equal to
the sum off the voltageg drops
p across the
other elements of the loop.
The circuit in the figure is a closed loop, and the impressed
lt
voltage l the
E(t) equals th sum off the
th voltage
lt d
drops th three
across the th
elements R, L, C of the loop.
Voltage Drops.
RI (Ohm’s law): Voltage drop for a resistor of resistance R ohms
LI' = L(dI/dt): Voltage drop for an inductor of inductance L henrys (H),
Q/C: Voltage drop for a capacitor of capacitance C farads (F).
continued
69
According to KVL
KVL, for an RLC-circuit
RLC circuit with electromotive
force E(t) = E0 sin t (E0 constant) as a model the “integro-
differential equation”
1
LI ' RI Idt E (t ) E0 sin t
C
To g g , we differentiate the equation
get rid of the integral, q with
respect to t, obtaining
1
LI " RI ' I E '((t ) E0 cos t
C
70
2.10 Solution by
y Variation of Parameters
For a nonhomogeneous linear ODEs
y" + p(x)y' + q(x)y = r(x).
the solution is y(x) = yh(x) + yp(x).
A more general way (other than the previous undetermined
coefficients method case) to find yp on I is called method of
variation
i ti off parameters t (or( Lagrange’s
L ’ method
th d or reduction
d ti off
orders):
yr yr
y p ( x) y1 2 dx y2 1 dx
W W
where y1, y2 form a basis of solutions of the corresponding
homogeneous ODE: y" + p(x)y' + q(x)y = 0, on I and W is the
Wronskian of y1, y2: W = y1y'2 – y2y'1.
continued
71
74
EXAMPLE 1
Solve the nonhomogeneous ODE
1
y " y sec x
cos x
Solution. A basis of solutions of the homogeneous ODE on
any interval is y1 = cos x,x y2 = sin x.
x This gives the Wronskian
W(y1, y2) = cos x cos x – sin x (–sin x) = 1.
By taking the previous results,
results choosing zero constants of
integration, we get the particular solution of the given ODE
yr yr
y p y1 2 dxd y2 1 dx d
W W
cos x sin x sec xdx sin x cos x sec xdx
cos x ln cos x x sin x
continued
75
Fig.69.
g Particular solution yp and its first term in
Example 1
The general solution:
y yh y p (c1 y1 c2 y2 ) y p
(c1 ln cos x ) cos x (c2 x) sin x
76