Chapter 2
Chapter 2
Ordinary Differential
Equations
2.1 Introduction
A differential equation is an equation involving an unknown function and
its derivatives. A differential equation is an ordinary differential equation
(ODE) if the unknown function depends on only one independent variable.
If the unknown function depends on two or more independent variables, the
differential equation is a partial differential equation (PDE).
The function y = φ(x), which converts (2.1) into an identity, is called the so-
lution of the equation. If the solution is represented implicitly, Φ(x, y) = 0,
then it is called an integral.
The integral
Φ(x, y, c1 , c2 , . . . , cn ) = 0 (2.2)
of the differential equation (2.1), which contains n independent arbitrary
constants c1 , c2 , . . . , cn and is equivalent (in the given region) to equation
1
Class Notes on ECEG-6201
2.1. INTRODUCTION Analytical & Comp. Methods
(2.1), is called the general solution. By assigning definite values to the con-
stants c1 , c2 , . . . , cn in (2.2), we get particular solutions.
Example 2.3 Find the curve of the family y = c1 ex + c2 e−2x for which
y(0) = 1, y 0 (0) = −2.
Exercise 2.1 Show that for the given differential equations the indicated relations
are integrals (solutions)
1. (x − 2y)y 0 = 2x − y, x2 − xy + y 2 = c2
2. (x − y + 1)y 0 = 1, y = x + cey
3. (xy − x)y 00 + xy 02 + yy 0 − 2y 0 = 0, y = ln(xy)
Exercise 2.2 Form the differential equations of the given families of curves
1. y = cx
2. ln xy = 1 + cy
3. x3 = c(x2 − y 2 )
Murad Ridwan, 2 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.2. FIRST ORDER DIFFERENTIAL EQUATION Analytical & Comp. Methods
4. y = c1 cos 2x + c2 sin 2x
5. (c1 + c2 x)ex + c3 = y
[ans. y −xy 0 = 0; y = xy 0 ln xy ; 3y 2 −x2 = 2xyy 0 ; y 00 +4y = 0; y 00 −2y 0 +y =
0.]
Exercise 2.3 Form the differential equation of all circles in the xy-plane. [ans.
(1 + y 02 )y 000 − 3y 0 y 002 = 0]
Exercise 2.4 For the given families of curves find the lines that satisfy the given
initial conditions
1. y = c1 sin(x − c2 ), y(π) = 1, y 0 (π) = 0
2. y = c1 e−x + c2 ex + c3 e2x , y(0) = 0, y 0 (0) = 1, y 00 (0) = −2
[ans. y = − cos x; y = 61 (−5e−x + 9ex − 4e2x ).] J
Murad Ridwan, 3 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.2. FIRST ORDER DIFFERENTIAL EQUATION Analytical & Comp. Methods
y
Example 2.5 Solve y 0 = e x + xy .
Murad Ridwan, 4 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.2. FIRST ORDER DIFFERENTIAL EQUATION Analytical & Comp. Methods
p
4. x dy − y dx = x2 + y 2 dx
x + 2y + 1
5. y 0 =
2x + 4y + 3
[ans. y = ln xc ; x = cex/y ; y= c x
x−2; y = 2c x2 − 2c
1
; ln |4x+8y+5|+8y−4x =
c.] J
for which
∂P ∂Q
= (2.9)
∂y ∂x
In this case P dx + Qdy is an exact differential
∂U ∂U
P dx + Qdy = dU = dx + dy
∂x ∂y
from which
∂U ∂U
P = , Q=
∂x ∂y
∂2U ∂2U
Since ∂x∂y = ∂y∂x , we have
∂P ∂Q
= .
∂y ∂x
If (2.9) holds, the general solution is
Example 2.6 Find the solution of (3x2 + 6xy 2 )dx + (6x2 y + 4y 3 )dy = 0. J
∂Q
If for (2.8), ∂P
∂y 6= ∂x , the equation (2.8) is inexact. In such cases, (2.8) can
be made exact by an integrating factor µ(x, y) such that
µ(P dx + Qdy) = dU
so that
∂ ∂
(µP ) = (µQ).
∂y ∂x
Murad Ridwan, 5 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.2. FIRST ORDER DIFFERENTIAL EQUATION Analytical & Comp. Methods
Murad Ridwan, 6 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.3. SECOND ORDER D.E. Analytical & Comp. Methods
√
Example 2.8 Solve y 0 = x4 y + x y.
λ2 + pλ + q = 0,
then the general solution to (2.15) is written in one of the following three
ways
Murad Ridwan, 7 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.4. SERIES SOLUTION Analytical & Comp. Methods
homogeneous equation, i.e., yc (x). Then, assuming the constants are func-
tions of x, we seek the solution of the inhomogeneous equation (2.19).
Usually we will take x0 = 0. If this is not already the case, then a substitu-
tion x = x − x0 will make it so.
Murad Ridwan, 8 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.4. SERIES SOLUTION Analytical & Comp. Methods
Example 2.11 Solve the following equations near the ordinary point x = 0
1. y 0 − y = 0
2. y 0 = 2xy
3. y 00 + 4y = 0
4. (1 − x2 )y 00 − 6xy 0 − 4y = 0
Exercise 2.12 Find the general solutions near the origin
1. xy 0 − 3y = 6
2. (1 − x2 )y 0 = 2xy
3. y 00 + 3xy 0 + 3y = 0
2y
4. y 00 − =0
(1 − x)2
5. (1 − x2 )y 00 − 2xy 0 + 2y = 0
6. (1 + x2 )y 00 − 4xy 0 + 6y = 0
Answers
1. y = −2 + a3 x3
2. y = a0 (1 + x2 + x4 + . . .) = a0 /(1 − x2 )
h n 2n
i h i
P∞ P∞ (−3)n x2n+1
3. y = a0 1 + n=1 (−3) n
2 n!
x
+ a1 x + n=1 3·5·7···(2n+1)
1
4. y = a0 1−x + a1 (1 − x)2
5. y = a0 x + a1 (1 − x2 − 13 x4 − 51 x6 − 17 x8 − . . .)
6. y = a0 (1 − 3x2 ) + a1 (1 − 13 x3 )
Exercise 2.13 Find the general solutions about the indicated points
1. y 00 − 2(x + 3)y 0 − 3y = 0 about x = −3
00 2 0
2. y + (x − 1) y − 4(x − 1)y = 0 about x = 1
Answer
h i
P∞ 3·7·11···(4n−1)(x+3)2n
1. y = a0 1 + n=1 (2n)! +
h P∞ 2n+1
i
5·9·13···(4n+1)(x+3)
a1 (x + 3) + n=1 (2n+1)!
P∞ 4(−1)n (x−1)3n
+ a1 (x − 1) + 14 (x − 1)4
2. y = a0 n=0 3n (3n−1)(3n−4)n! J
Murad Ridwan, 9 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.4. SERIES SOLUTION Analytical & Comp. Methods
Substitute (2.25) in (2.24) and equate the coefficient of the lowest power of x.
This gives a quadratic equation in r, which is known as the indicial equation.
Murad Ridwan, 10 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.4. SERIES SOLUTION Analytical & Comp. Methods
Case III When the roots r1 and r2 (r1 > r2 ) are distinct and differ by an
integer (i.e., r1 − r2 is an integer). The complete solution is
∂[(r − r2 )y(x, r)]
y(x) = c1 y|r=r1 + c2 (2.28)
∂r r=r2
y0 x2 + 1
Example 2.14 Solve y 00 − + y=0 (Case I)
2x 2x2
Example 2.15 Differentiation of a product function: Suppose that
u = u1 u2 · · · un
each of the u’s being a function of the parameter r. Show that
0
u02 u0n
0 u1
u =u + + ··· +
u1 u2 un
du 0 du0
where u0 = , uk = k (k = 1, 2, . . . , n).
dr dr
Example 2.16 Differentiate with respect to r.
1. y = (ar + b)k
r2 (r + 1)
2. y =
(4r − 1)3 (7r + 2)6
r+n
3. y =
r(r + 1)(r + 2) · · · (r + n − 1)
r3
4. y =
[(r + 2)(r + 3) · · · (r + n + 1)]2
Example 2.17 Solve x2 y 00 + xy 0 + x2 y = 0 (Case II)
Murad Ridwan, 11 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.5. NUMERICAL SOLUTION Analytical & Comp. Methods
We start from y0 = y(x0 ) and proceed stepwise. In the first step we compute
an approximate value y1 of the solution y of (2.29) at x = x1 = x0 + h. In
the second step we compute an approximate value of y2 of the solution at
x = x2 = x0 + 2h, etc. Here h is a fixed number.
In each step the computations are done by the same formula, usually such
formulas are suggested by the Taylor series
h2 00
y(x + h) = y(x) + hy 0 (x) + y (x) + · · ·
2!
h2 h3
= y(x) + hf + f 00 + f 000 + · · · (2.30)
2! 3!
where f 0 , f 00 , f 000 , . . . are computed at (x, y(x)).
Example 2.19 Find y(1.5) for y 0 = 2xy, y(1) = 1 using h = 0.10 and h = 0.05.
Compare with actual values. Verify Figures 2.2 and 2.3 J
Murad Ridwan, 12 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.5. NUMERICAL SOLUTION Analytical & Comp. Methods
In the improved Euler method (also called Heun method), in each step we
compute first the auxiliary value
∗
yn+1 = yn + hf (xn , yn ) (2.31)
Murad Ridwan, 13 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.5. NUMERICAL SOLUTION Analytical & Comp. Methods
Example 2.20 Use the improved Euler’s method to obtain an approximate value
of y(1.5) for the solution
y 0 = 2xy, y(1) = 1
Compare the results for h = 0.1 and h = 0.05. Verify Figures 2.4 and 2.5 J
Murad Ridwan, 14 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.5. NUMERICAL SOLUTION Analytical & Comp. Methods
agrees with a Taylor expansion out to h4 or the fifth term. The constants
a, b, c, d and the auxiliary quantities k1 , k2 , k3 , k4 are given as
The method is well suited to the computer because it needs no special start-
ing procedure, makes light demand on storage, and repeatedly uses the same
straight forward computational procedure. It is numerically stable.
Example 2.21 Derive the second order Runge-Kutta method by finding the con-
stants a, b, α, and β such that the formula
where
k1 = hf (xn , yn ), k2 = hf (xn + αh, yn + βk1 )
agrees with a Taylor series expansion out to h3 .
Murad Ridwan, 15 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.5. NUMERICAL SOLUTION Analytical & Comp. Methods
In contrast, a multi-step method uses in each step values from two or more
previous steps. These methods are motivated by the expectation that the ad-
ditional information will increase accuracy and stability. But to get started,
one needs values, say, y0 , y1 , y2 , y3 in a 4-step method, obtained by Runge-
Kutta or other accurate methods. Thus, multi-step methods are not self-
starting.
where
yn0 = f (xn , yn ), 0
yn−1 = f (xn−1 , yn−1 ), 0
yn−2 = f (xn−2 , yn−2 )
Exercise 2.16 For the following differential equations, construct a table computing
the indicated values of y(x) using Euler, improved Euler and Runge-Kutta methods.
Use h = 0.1 and compute to four rounded decimal places.
1. y 0 = 2 ln(xy), y(1) = 2.
y(1.1), y(1.2), y(1.3), y(1.4), y(1.5)
Murad Ridwan, 16 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
y 00 + xy 0 + y = 0
y(0) = 1, y 0 (0) = 2.
Exercise 2.18 Use Milne’s method to approximate the value of y(0.4) where
y 0 = 4x − 2y, y(0) = 2
Use the Runge-Kutta formula and h = 0.1 to obtain the values of y1 , y2 and y3 . J
Murad Ridwan, 17 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
From (2.37), Γ(n) can be determined for all n > 0 when the values for
1 ≤ n < 2 (or any other interval of unit length) are known. For instance,
Γ 11 7
7 7 3 3
4 = Γ 4 + 1 = 4Γ 4 = 4Γ 4
1
√
Example 2.24 Show that Γ 2 = π.
Murad Ridwan, 18 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
Many integrals can be expressed through beta and gamma functions. Two
of special interest are
Z π/2
1
sin2m−1 θ cos2n−1 θ dθ = B(m, n)
0 2
∞
xp−1
Z
π
dx = Γ(p)Γ(p − 1) = , 0<p<1
0 1+x sin πp
8 √
2. Γ − 52 = − 15
π
Z 1
(−1)n n!
3. xm (ln x)n dx = , n is positive integer and m > −1
0 (m + 1)n+1
Z ∞ √
−k2 x2 π
4. e dx =
−∞ k
Z ∞ c
x Γ(c + 1)
5. x
dx = ,c > 1
0 c (ln c)c+1
Z π/2 √
π
6. tan θ dθ = √
0 2
7. yB(x + 1, y) = xB(x, y + 1)
Z a
8. xn−1 (a − x)m−1 dx = am+n−1 B(m, n)
0
Z b
9. (x−a)m (b−x)n dx = (b−a)m+n+1 B(m+1, n+1) [Hint: put x = a+(b−a)z]
a
Z π/2
p 1
q p+1 q+1
10. sin x cos x dx = B ,
0 2 2 2
11. B(m, n) = B(m + 1, n) + B(m, n + 1)
Z ∞ Z 1 p−1
y q−1 x + xq−1
12. dy = dx = B(p, q) J
0 (1 + y)p+q 0 (1 + x)p+q
Murad Ridwan, 19 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
Dividing (2.42) by 1−x2 we see that the coefficients of the resulting equation
are
P∞analyticm at x = 0, so that we may apply the power series method y =
m=0 am x . The resulting solution becomes
where
n(n + 1) 2 (n − 2)n(n + 1)(n + 3) 4
y1 (x) = 1 − x + x − +···
2! 4!
(n − 1)(n + 2) 3 (n − 3)(n − 1)n(n + 2)(n + 4) 5
y2 (x) = x − x + x − +···
3! 5!
These series converge for |x| < 1.
Murad Ridwan, 20 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
In particular
P0 (x) = 1
P1 (x) = x
1 2
P2 (x) = 2 (3x − 1)
1 3
P3 (x) = 2 (5x − 3x)
1 4 2
P4 (x) = 8 (35x − 30x + 3)
1 5 3
P5 (x) = 8 (63x − 70x + 15x)
1 6 4 2
P6 (x) = 16 (231x − 315x + 105x − 5)
1 7 5 3
P7 (x) = 16 (429x − 693x + 315x − 35x)
Exercise 2.22 Verify (2.45) by applying the binomial theorem to (x2 − 1)n ,
differentiating n times term by term, and comparing the result with (2.44).
Murad Ridwan, 21 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
Orthogonality: The Legendre polynomials are orthogonal over [−1, 1], i.e.,
Z 1
0, if m 6= n;
Pm (x)Pn (x)dx = 2 (2.47)
−1 2n+1 , if m = n.
Let
∞
X
f (x) = an Pn (x) (2.48)
n=0
Murad Ridwan, 22 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
Murad Ridwan, 23 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
The solution is
y(x) = c1 Jn (x) + c2 J−n (x) (2.50)
where Jn (x), called the Bessel function of the first kind of order n, is
∞
X (−1)m x n+2m
Jn (x) = (2.51)
m!Γ(n + m + 1) 2
m=0
and J−n (x), called the Bessel function of the first kind of order −n, is
∞
X (−1)m x −n+2m
J−n (x) = (2.52)
m!Γ(−n + m + 1) 2
m=0
Case II When n = 0.
Murad Ridwan, 24 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
The two functions Jn (x) and J−n (x) are not independent but are con-
nected by the relation
Figure 2.9: The first three integer order Bessel functions of the first kind.
Murad Ridwan, 25 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
Figure 2.10: The first three integer order Bessel functions of the second kind.
Murad Ridwan, 26 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
Exercise 2.33 Show that the Fourier-Bessel series in J2 (λi x) for f (x) = x2 (0 <
∞
X J2 (λi x)
x < a) where λi a are positive roots of J2 (x) = 0, is x2 = 2a2 . J
i=1
aλ i J3 (λi a)
2. d
dx [x−n Jn (x)] = −x−n Jn+1 (x)
3. Jn0 (x) + nx Jn (x) = Jn−1 (x)
x
4. Jn (x) = 2n [Jn−1 (x) + Jn+1 (x)]
q h i
2 3−x2 3
5. J5/2 (x) = πx x2 sin x −
cos x 2
Murad Ridwan, 27 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
ab x a(a + 1)b(b + 1) x2
y1 (x) = F (a, b, c; x) ≡ 1 + + + · · · (2.67)
c 1! c(c + 1) 2!
∞
Γ(c) X Γ(a + n)Γ(b + n) xn
=
Γ(a)Γ(b) Γ(c + n) n!
n=0
Murad Ridwan, 28 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.
Class Notes on ECEG-6201
2.6. SPECIAL FUNCTIONS Analytical & Comp. Methods
Murad Ridwan, 29 of 29
School of Electrical & Computer Engineering
AAiT, Addis Ababa University.
Nov 2012.