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) = −2.
Exercise 2.1 Show that for the given differential equations the indicated relations
are integrals (solutions)
1. (x − 2y)y ′ = 2x − y, x2 − xy + y 2 = c2
2. (x − y + 1)y ′ = 1, y = x + cey
3. (xy − x)y ′′ + xy ′2 + yy ′ − 2y ′ = 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 )
4. y = c1 cos 2x + c2 sin 2x
5. (c1 + c2 x)ex + c3 = y
[ans. y −xy ′ = 0; y = xy ′ ln xy ; 3y 2 −x2 = 2xyy ′ ; y ′′ +4y = 0; y ′′ −2y ′ +y =
0.]
Exercise 2.3 Form the differential equation of all circles in the xy-plane. [ans.
(1 + y ′2 )y ′′′ − 3y ′ y ′′2 = 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
2. y = c1 e−x + c2 ex + c3 e2x , y(0) = 0, y ′ (0) = 1, y ′′ (0) = −2
[ans. y = − cos x; y = 61 (−5e−x + 9ex − 4e2x ).] ◀
y
Example 2.5 Solve y ′ = e x + xy .
p
4. x dy − y dx = x2 + y 2 dx
x + 2y + 1
5. y ′ =
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.] ◀
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. ◀
∂Q
If for (2.8), ∂P
∂y ̸= ∂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
√
Example 2.8 Solve y ′ = x4 y + x y.
λ2 + pλ + q = 0,
then the general solution to (2.15) is written in one of the following three
ways
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.
Example 2.11 Solve the following equations near the ordinary point x = 0
1. y ′ − y = 0
2. y ′ = 2xy
3. y ′′ + 4y = 0
4. (1 − x2 )y ′′ − 6xy ′ − 4y = 0
Exercise 2.12 Find the general solutions near the origin
1. xy ′ − 3y = 6
2. (1 − x2 )y ′ = 2xy
3. y ′′ + 3xy ′ + 3y = 0
2y
4. y ′′ − =0
(1 − x)2
5. (1 − x2 )y ′′ − 2xy ′ + 2y = 0
6. (1 + x2 )y ′′ − 4xy ′ + 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 ′′ − 2(x + 3)y ′ − 3y = 0 about x = −3
′′ 2 ′
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! ◀
where the exponent r may be any real or complex number, and a0 ̸= 0. Such
a series is called a generalized power series or Frobenius series.
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.
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
y′ x2 + 1
Example 2.14 Solve y ′′ − + 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
′
u′2 u′n
′ u1
u =u + + ··· +
u1 u2 un
du ′ du′
where u′ = , 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 ′′ + xy ′ + x2 y = 0 (Case II)
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 ′′
y(x + h) = y(x) + hy ′ (x) + y (x) + · · ·
2!
h2 h3
= y(x) + hf + f ′′ + f ′′′ + · · · (2.30)
2! 3!
where f ′ , f ′′ , f ′′′ , . . . are computed at (x, y(x)).
Example 2.19 Find y(1.5) for y ′ = 2xy, y(1) = 1 using h = 0.10 and h = 0.05.
Compare with actual values. Verify Figures 2.2 and 2.3 ◀
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)
Example 2.20 Use the improved Euler’s method to obtain an approximate value
of y(1.5) for the solution
y ′ = 2xy, y(1) = 1
Compare the results for h = 0.1 and h = 0.05. Verify Figures 2.4 and 2.5 ◀
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 .
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
yn′ = f (xn , yn ), ′
yn−1 = f (xn−1 , yn−1 ), ′
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 ′ = 2 ln(xy), y(1) = 2.
y(1.1), y(1.2), y(1.3), y(1.4), y(1.5)
y ′′ + xy ′ + y = 0
y(0) = 1, y ′ (0) = 2.
Exercise 2.18 Use Milne’s method to approximate the value of y(0.4) where
y ′ = 4x − 2y, y(0) = 2
Use the Runge-Kutta formula and h = 0.1 to obtain the values of y1 , y2 and y3 . ◀
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 = π.
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)Γ(1 − p) = , 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) ◀
0 (1 + y)p+q 0 (1 + x)p+q
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.
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).
Orthogonality: The Legendre polynomials are orthogonal over [−1, 1], i.e.,
Z 1
0, if m ̸= 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
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.
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.
Figure 2.10: The first three integer order Bessel functions of the second kind.
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 . ◀
i=1
aλ i J3 (λi a)
2. d
dx [x−n Jn (x)] = −x−n Jn+1 (x)
3. Jn′ (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
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