Higher Order Ordinary de 6
Higher Order Ordinary de 6
Higher Order Ordinary de 6
differential equations
1
A linear ODE of general order n has the form
dn y dn−1 y dy
an (x) n +an−1 (x) n−1 +· · ·+a1 (x) +a0 (x)y = f (x).
dx dx dx
(1)
If f (x) = 0 then the equation is called
homogeneous; otherwise it is inhomogeneous. The
general solution to Eq. (1) will contain n arbitrary
constants.
In order to solve any equation of the form (1), we
must first find the general solution of the
complementary equation:
dn y dn−1 y dy
an (x) n +an−1 (x) n−1 +· · ·+a1 (x) +a0 (x)y = 0.
dx dx dx
(2)
The general solution of Eq. (2) will contain n
linearly independent functions, say
y1 (x), y2 (x), · · · , yn (x). Then the general solution is
given by
yc (x) = c1 y1 (x) + c2 y2 (x) + · · · + cn yn (x), (3)
where the cm are arbitrary constants that may be
determined if n boundary conditions are provided.
2
For n functions to be linearly independent over an
interval, there must not exist any set of constants
c1 , c2 , . . . , cn such that
3
The n functions y1 (x), y2 (x), . . . , yn (x) are linearly
independent over an interval if
¯ ¯
¯ y1 y2 · · · yn ¯¯
¯
¯ ¯
¯ y10 ¯
¯ ¯
W (y1 , . . . , yn ) = ¯ .. .. ¯ 6= 0
¯ . . ¯
¯ ¯
¯ (n−1) ¯
¯ y yn
(n−1) ¯
1
(6)
over that interval; W (y1 , . . . , yn ) is called the
Wronskian of the set of functions.
If f (x) 6= 0, the general solution of Eq. (1) is given
by
y(x) = yc (x) + yp (x), (7)
where yp (x) is the particular integral, which can be
any function that satisfies Eq. (1) directly, provided
it is linearly independent of yc (x).
4
Linear equations with constant coefficients
If the am in Eq. (1) are constants, then we have
dn y dn−1 y dy
an n +an−1 n−1 +· · ·+a1 +a0 y = f (x). (8)
dx dx dx
5
In general, the auxiliary equation has n roots, say
λ1 , · · · , λn . Some roots may be repeated, and some
complex. Three main cases are as follows:
1. All roots real and distinct. The n solutions to
Eq. (9) are exp(λm x) for m = 1 to n. The
complementary function is therefore
c1 e(α+iβ)x + c2 e(α−iβ)x
= eαx (d1 cos βx + d2 sin βx)
sin
= Aeαx (βx + φ) (12)
cos
6
3. Some roots repeated. Suppose λ1 occurs k
times (k > 1) as a root of the auxiliary
equation. Then, the complementary function is
given by
7
Example
Find the complementary function of the equation
d2 y dy x
2
− 2 + y = e . (15)
dx dx
Answer
Setting the RHS to zero, substituting y = Aeλx and
dividing through by Aeλx we obtain the auxiliary
equation
λ2 − 2λ + 1 = 0.
This equation has the repeated root λ = 1 (twice).
Therefore the complementary function is
8
Finding the particular integral yp (x)
If f (x) contains only polynomial, exponential, or
sine and cosine terms, then by assuming a trial
function for yp (x) of similar form and substituting it
into Eq. (9), yp (x) can be deduced. Standard trial
functions are:
1. If f (x) = aerx then try yp (x) = berx .
2. If f (x) = a1 sin rx + a2 cos rx (a1 or a2 may be
zero) then try yp (x) = b1 sin rx + b2 cos rx.
3. If f (x) = a0 + a1 x + · · · + aN xN (some am
may be zero) then try
yp (x) = b0 + b1 x + · · · + bN xN .
4. If f (x) is the sum or product of any of the
above then try yp (x) as the sum or product of
the corresponding individual trial functions.
9
Example
Find a particular integral of the equation
d2 y dy x
2
− 2 + y = e .
dx dx
Answer
Assume yp (x) = bex . However, since the
complementary function of this equation is
yc (x) = (c1 + c2 x)ex , we see that ex is already
contained in it, as indeed is xex . Multiplying the
first guess by the lowest necessary integer power of
x such that it does not appear in yc (x), we
therefore try yp (x) = bx2 ex . Substituting this into
the ODE, we find that b = 1/2, so the particular
integral is given by yp (x) = x2 ex /2.
10
Example
Solve
d2 y 2
+ 4y = x sin 2x (16)
dx2
Answer
The auxiliary equation is
λ2 + 4 = 0 ⇒ λ = ±2i. (17)
11
Substituting this into Eq. (14) to fix the constants
in Eq. (20), we find the particular integral to be
x3 x2 x
yp (x) = − cos 2x + sin 2x + cos 2x. (21)
12 16 32
The general solution to Eq. (16) then reads
12
Linear equations with variable coefficients
13
Therefore we can write the terms of Eq. (22) as
dy dy
(αx + β) = α ,
dx dt
2
µ ¶
2 d y 2 d d
(αx + β) = α − 1 y,
dx2 dt dt
..
. (23)
n
µ ¶
n d y d d
(αx + β) = αn − 1 ···
dxn dt dt
µ ¶
d
− n + 1 y.
dt
Substituting Eq. (23) into the Eq. (22), the latter
becomes a linear ODE with constant coefficients,
µ ¶ µ ¶
d d d
an αn − 1 ··· − n + 1 y + ···
dt dt dt
µ t ¶
dy e −β
+a1 α + a0 y = f .
dt α
14
A special case of Legendre’s equation, with α = 1
and β = 0, is Euler’s equation,
n
n d y dy
an x + · · · + a1 x + a0 y = f (x), (24)
dxn dx
and may be solved by substituting x = et .
Alternatively, in the special case where f (x) − 0 in
Eq. (24), substituting y = xλ leads to a simple
algebraic equation in λ, which can be solved to yield
the solution to Eq. (24).
15
Example
Solve
2
2 d y dy
x +x − 4y = 0 (25)
dx2 dx
by both methods discussed above.
Answer
First, we make the substitution x = et , which gives
µ ¶
d d dy d2 y
−1 y+ − 4y = 0 ⇒ 2 − 4y = 0.
dt dt dt dt
(26)
The general solution of Eq. (25) is therefore
16
Since the RHS of Eq. (25) is zero, we can reach the
same solution by instead substituting y = xλ into
Eq. (25). This gives
which reduces to
(λ2 − 4)xλ = 0.
17
Exact equations
Sometimes an ODE may be merely the derivative of
another ODE of one order lower. If this is the case
then the ODE is called exact. The nth-order linear
ODE
dn y dy
an (x) n + · · · + a1 (x) + a0 (x)y = f (x), (27)
dx dx
is exact if the LHS can be written as a simple
derivative,
dn y
an (x) n + · · · + a0 (x)y
dx
· n−1
¸
d d y
= bn−1 (x) n−1 + · · · + b0 (x)y . (28)
dx dx
For Eq. (28) to hold, we require
18
Example
Solve
2d2 y dy
(1 − x ) 2 − 3x − y = 1. (30)
dx dx
Answer
Comparing with Eq. (27), we have a2 = 1 − x2 ,
a1 = −3x and a0 = −1. Therefore,
a0 − a01 + a002 = 0, so Eq. (30) is exact and can
therefore be written in the form
· ¸
d dy
b1 (x) + b0 (x)y = 1. (31)
dx dx
Expanding the LHS of Eq. (31), we find
µ ¶
d dy d2 y 0 dy
b1 + b0 y = b1 2 + (b1 + b0 ) + b00 y.
dx dx dx dx
(32)
19
These relations integrate consistently to give
b1 = 1 − x2 and b0 = −x, so Eq. (30) can be
written as
· ¸
d dy
(1 − x2 ) − xy = 1. (33)
dx dx
Integrating Eq. (33) gives us directly the first-order
linear ODE
µ ¶
dy x x + c1
− 2
y = 2
,
dx 1−x 1−x
which can be solved to give
c1 sin−1 x + c2
y= √ − 1.
1−x 2
20
Partially known complementary function
Suppose we wish to solve the nth-order linear ODE
dn y dy
an (x) n + · · · + a1 (x) + a0 (x)y = f (x), (34)
dx dx
and we happen to know that u(x) is a solution of
Eq. (34) when the RHS is set to zero. By making
the substitution y(x) = u(x)v(x), we can transform
Eq. (34) into an equation of order n − 1 in dv/dx.
In particular, if the original equation is of second
order, then we obtain a first-order equation in
dv/dx. In this way, both the remaining term in the
complementary function and the particular integral
are found.
21
Example
Solve
d2 y
2
+ y = cosec x. (35)
dx
Answer
The complementary function of Eq. (35) is
22
Multiplying through Eq. (37) by cos2 x, we obtain
µ ¶
d dv
cos2 x = cot x,
dx dx
which integrates to give
2 dv
cos x = ln(sin x) + c1 .
dx
After rearranging and integrating again this becomes
Z Z
v = sec2 x ln(sin x) dx + c1 sec2 x dx
23
variation of parameters
Suppose we wish to find the particular integral of
the equation
dn y dy
an (x) n + · · · + a1 (x) + a0 (x)y = f (x), (38)
dx dx
and the complementary function yc (x) is
24
k10 (x)y1 (x) + · · · + kn0 (x)yn (x) = 0
k10 (x)y10 (x) + · · · + kn0 (x)yn0 (x) = 0
..
. (40)
(n−2)
k10 (x)y1 (x) + · · · + kn0 (x)yn(n−2) (x) = 0
(n−1) f (x)
k10 (x)y1 (x) + · · · + kn0 (x)yn(n−1) (x) = .
an (x)
The last of these equations is not a freely chosen
constraint, but must be satisfied given the previous
n − 1 constraints and the original ODE.
This choice of constraints is easily justified.
Differentiating Eq. (39) with respect to x, we obtain
25
Differentiating again we find
26
Rearranging the sum over m on the LHS, we find
n
X
(n) 0
km (an ym + · · · + a1 ym + a0 ym )
m=1
(n−1)
+an (k10 y1 + · · · + kn0 yn(n−1) ) = f (x). (41)
27
Example
Use the variation of parameters to solve
d2 y
+ y = cosec x, (42)
dx2
subject to the boundary conditions
y(0) = y(π/2) = 0.
Answer
The complementary function of Eq. (42) is
28
Solving these equations for k10 (x) and k20 (x) gives
29
Green’s functions
Consider the equation,
dn y dy
an (x) n + · · · + a1 (x) + a0 (x)y = f (x), (43)
dx dx
and introduce a linear differential operator L acting
on y(x). That is, Eq. (43) is written as
30
Comparing of Eq. (46) with a standard property of
the Dirac delta function,
Z b
f (x) = δ(x − z)f (z) dz,
a
31
The second concerns the continuity or discontinuity
of G(x, z) and its derivative at x = z, and can be
found by integrating Eq. (47) with respect to x over
the small interval [z − ², z + ²] and taking the limits
as ² → 0. We then obtain
Xn Z z+²
dm G(x, z)
lim am (x) m
dx
²→0
m=0 z−²
dx
Z z+²
= lim δ(x − z)dx
²→0 z−²
= 1. (48)
32
Noting that, apart from an arbitrary constant,
R m
(d G/dxm )dx = dm−1 G/dxm−1 , we therefore
obtain, for m = 0 to n − 1,
Z z+²
dm G(x, z)
lim am (x) m
dx
²→0 z−² dx
· m−1
¸z+²
d G(x, z)
= lim am (x) m−1
= 0. (49)
²→0 dx z−²
33
Example
Use Green’s functions to solve
d2 y
2
+ y = cosec x, (51)
dx
subject to the boundary conditions
y(0) = y(π/2) = 0.
Answer
From Eq. (47), we see that the Green’s functions
G(x, z) must satisfy
d2 G(x, z)
2
+ G(x, z) = δ(x − z). (52)
dx
The complementary function of Eq. (52) consists of
a linear superposition of sin x and cos x, and must
consist of different superpositions on either side of
x = z since its (n − 1)th derivative is required to
have a discontinuity there. Therefore we assume the
form of the Green’s function to be
A(z) sin +B(z) cos x for x < z,
G(x, z) =
C(z) sin x + D(z) cos x for x > z.
34
We now impose the relevant restrictions on G(x, z)
in order to determine the functions A(z), . . . , D(z).
The first of these is that G(x, z) should itself obey
the homogeneous boundary conditions
G(0, z) = G(π/2, z) = 0. This leads to the
conclusion that B(z) = C(z) = 0, so we now have
A(z) sin x for x < z,
G(x, z) =
D(z) cos x for x > z.
35
Solving these equations for A(z) and D(z), we find
Thus we have
− cos z sin x for x < z,
G(x, z) =
− sin z cos x for x > z.
36
General ordinary differential equations
37
Example
Solve
d2 y dy
+2 = 4x (53)
dx2 dx
Answer
Using the substitution p = dy/dx, we have
dp
+ 2p = 4x. (54)
dx
The solution to Eq. (54) is therefore
dy
p= = ae−2x + 2x − 1,
dx
where a is a constant. Thus, the general solution to
Eq. (53) is
y(x) = c1 e−2x + x2 − x + c2 .
38
Independent variable absent
If an ODE does not contain the independent
variable x explicitly, and if we make the substitution
p = dy/dx, we have
d2 y dp dy dp dp
= = =p
dx2 dx dx dy dy
µ ¶ µ ¶
d3 y d dp dy d dp
= p = p
dx3 dx dy dx dy dy
2
µ ¶2
2d p dp
= p +p , (55)
dy 2 dy
and so on for higher-order derivatives. This leads to
an equation of one order lower.
39
Example
Solve µ ¶2
2
d y dy
1+y 2 + = 0. (56)
dx dx
Answer
Making the substitution dy/dx = p and
d2 y/dx2 = p(dp/dy), we obtain the first-order ODE
dp
1 + yp + p2 = 0,
dy
which is separable and the solution is
(1 + p2 )y 2 = c1 .
(x + c2 )2 + y 2 = c21 .
40
Non-linear exact equations
Example
Solve
d3 y dy d2 y
2y 3 + 6 = x. (57)
dx dx dx2
We first note that the term 2y d3 y/dx3 can be
obtained by differentiating 2y d2 y/dx2 since
µ 2
¶
d d y d3 y dy d2 y
2y 2 = 2y 3 + 2 . (58)
dx dx dx dx dx2
Rewriting the LHS of Eq. (57) using (58), we are
left with 4(dy/dx)(d2 y/dx2 ), which itself can be
written as a derivative
" µ ¶ #
2 2
dy d y d dy
4 = 2 . (59)
dx dx2 dx dx
41
Since we can write the LHS of Eq. (57) as a sum of
simple derivatives of other functions, Eq. (57) is
exact. Integrating Eq. (57) with respect to x, and
using Eq. (58) and (59), gives
2
µ ¶2 Z
d y dy x2
2y 2 + 2 = x dx = + c1 . (60)
dx dx 2
Now we can repeat the process to find whether
Eq. (60) is itself exact. Considering the term on the
LHS of Eq. (60) that contains the highest-order
derivative, we find
µ ¶ 2
µ ¶2
d dy d y dy
2y = 2y 2 + 2 .
dx dx dx dx
The expression already contain all the terms on the
LHS of Eq. (60), so we can integrate Eq. (60) to
give
dy x3
2y = + c1 x + c2 .
dx 6
Hence the solution is
2 x4 c1 x2
y = + + c2 x + c3 .
24 2
42
Isobaric or homogeneous equations
An nth-order isobaric equation is one in which every
term can be made dimensionally consistent upon
giving y and dy each a weight m, and x and dx
each a weight 1. In the special case where the
equation is dimensionally consistent with m = 1, the
equation is called homogeneous. If an equation is
isobaric or homogeneous, then the change in
dependent variable y = vxm (or y = vx for the
homogeneous case) followed by the change in
independent variable x = et leads to an equation in
which the new independent variable t is absent
except in the form d/dt.
43
Example
Solve
2
3d y 2 dy
x − (x + xy) + (y 2 + xy) = 0. (61)
dx2 dx
Answer
Assigning y and dy the weight m, and x and dx the
weight 1, the weights of the five terms on the LHS
of Eq. (61) are, from left to right: m + 1, m + 1,
2m, 2m, m + 1. For these weights all to be equal,
we require m = 1. Since it is homogeneous, we now
make the substitution y = vx,
d2 v dv
x 2 + (1 − v) = 0. (62)
dx dx
Substituting x = et into Eq. (62), we obtain
d2 v dv
2
− v = 0, (63)
dt dt
which can be integrated to give
dv 1 2
= v + c1 . (64)
dt 2
44
Eq. (64) is separable, and integrates to give
Z
1 dv
t + d2 =
2 v 2 + d21
µ ¶
1 −1 v
= tan .
d1 d1
Rearranging and using x = et and y = vx, we finally
obtain the solution to Eq. (61) as
1
y = d1 x tan( d1 ln x + d1 d2 ).
2
45
Equations homogeneous in x or y alone
If the weight of x taken alone is the same in every
term in the ODE, then the substitution x = et leads
to an equation in which the new independent
variable t is absent. If the weight of y taken alone is
the same in every term then the substitution y = ev
leads to an equation in which the new dependent
variable v is absent except in the form d/dv.
46
Example
Solve
2
2d y dy 2
x +x + 3 = 0.
dx2 dx y
Answer
This equation is homogeneous in x alone, and on
substituting x = et we obtain
d2 y 2
2
+ 3
= 0,
dt y
which does not contain the new independent
variable t except as d/dt. We integrate this directly
to give
dy p
= 2(c1 + 1/y 2 ).
dt
47
This equation is separable, and we find
Z
dy
p = t + c2 .
2
2(c1 + 1/y )
By multiplying the numerator and denominator of
the integrand on the LHS by y, we find the solution
p
c1 y 2 + 1
√ = t + c2 .
2c1
Remembering that t = ln x, we finally obtain
p
c1 y 2 + 1
√ = ln x + c2 .
2c1
48