0% found this document useful (0 votes)
16 views

Notes-1 (SMA-2271)

Uploaded by

pluto1565
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Notes-1 (SMA-2271)

Uploaded by

pluto1565
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

SMA 2271: ORDINARY DIFFERENTIAL EQUATIONS

⃝Francis
c O. Ochieng
[email protected]

Department of Pure and Applied Mathematics


Jomo Kenyatta University of Agriculture and Technology

Course content
• First order differential equations: solution by separation of variables, homogeneous, exact and
integrating factor.

• Second order linear equations: homogeneous with constant and variable coefficients, using inverse
differential operators, variation of parameters.

• Systems of linear differential equations.

• Laplace transform: methods of solution.

• Power series solutions including Bessel and Legendre functions.

• Applications: dynamics, catenaries, circuits and wave motion.

References
[1] Advanced Engineering Mathematics (10th ed.) by Erwin Kreyszig

[2] Swift R. J., & Wirkus S. (2014). A Course in Ordinary Differential Equations, 2nd Edition, 807 p,
Published by Chapman and Hall/C, ISBN-13: 978-1466509085.

[3] Noonburg, V. W. (2014). Ordinary Differential Equations: From Calculus to Dynamical Systems,
334 p, Published by Mathematical Association of America, ISBN-13: 978-1939512048.

[4] Journal of Differential Equations, ISSN: 0022-0396.

[5] Journal of Dynamics and Differential Equations, ISSN: 1040-7294

Lecture 1

1 Definitions and basic concepts


1.1 Differential equations
Definition 1.1.1 (Dependent and independent variable). Suppose y = y(x), then y is the dependent
variable while x is the independent variable. Also, suppose z = z(x, y), then z is the dependent variable
while x and y are the independent variables.

Definition 1.1.2 (Differential equation (DE)). A differential equation is an equation that involves
derivatives of a function which depends on either one or more than one independent variable(s). For
example,
dy 2
= 2xex (1)
dx

1
∂z ∂z
+ = 2(x + y) (2)
∂x ∂y
There are two types of differential equations: ODE and PDE.

Definition 1.1.3 (Ordinary differential equation (ODE)). An ODE is a differential equation which
contains derivative(s) of a function which depends on only one independent variable. For example,
equation (1) is an ODE since it contains ordinary derivatives.

Definition 1.1.4 (Partial differential equation (PDE)). A PDE is a differential equation which con-
tains derivative(s) of a function which depends on more than one independent variable. For example,
equation (2) is a PDE since it contains partial derivatives. Other examples of PDEs are:

∂u ∂2u
= α2 2 (1D heat equation)
∂t ∂x

∂2 u 2
2∂ u
= c (1D wave equation)
∂t2 ∂x2

∂2 u ∂2u ∂2 u
+ 2 + = 0 (Laplace equation)
∂x2 ∂y ∂z 2

1.2 Order and degree of a differential equation


Definition 1.2.1 (Order of a differential equation). The order of a differential equation is the order
of the highest ordered derivative which occurs in the differential equation. For example, the equation

d2 y dy
2
−3 + 2y = ex (3)
dx dx
d2 y
is of order 2 since is the highest ordered derivative which occurs in the equation (3).
dx2
Definition 1.2.2 (Degree of a differential equation). The degree of a differential equation is the
greatest power of the highest ordered derivative which occurs in the differential equation. For example,
d2 y
equation (3) is of degree 1 since is the highest ordered derivative and its power is 1.
dx2
More examples,
dy
+ y 2 = cos x, (order 1, degree 1)
dx
( )2
dy
+ y = sin x, (order 1, degree 2)
dx
( )3
d2 y dy
2
+ + y = ex , (order 2, degree 1)
dx dx

Exercise:
Determine the order and degree of the following differential equations.
d4 y d2 y
(a) − − 6y = 0.
dx4 dx2
( )4 ( )5
d2 y dy
(b) − + 3y = ex .
dx2 dx

1.3 Classification of ODEs


Ordinary differential equations are classified into two groups: linear and nonlinear.

2
Definition 1.3.1 (Linear differential equation). A linear differential equation of order n in the de-
pendent variable y and independent variable x is one which can be expressed in the form

dn y dn−1 y dn−2 y d2 y dy
an (x) n
+ a n−1 (x) n−1
+ a n−2 (x) n−2
+ · · · + a2 (x) 2
+ a1 (x) + a0 (x)y = F̃ (x), (4)
dx dx dx dx dx
where an (x) ̸= 0 and which is such that

(i) Dependent variable y and its derivatives are of power 1 only.

(ii) No product of the dependent variable, y, and/or its derivatives are present.

(iii) No transcendental functions of the dependent variable, y, and its derivatives occur. For example,
cos(y), ln y or ey is absent.

Examples of linear differential equations are:

d2 y dy
2
−7 − 3y = 0 (linear equation with constant coefficient)
dx dx
d4 y 3
2d y
2
3d y
x − x + x − e−x y = cos(x) (linear equation with variable coefficient)
dx4 dx3 dx2

→ Note: trigonometric, exponential, and logarithmic functions are called transcendental functions.

A differential equation that does not satisfy all the three conditions above is called nonlinear differ-
d2 y dy dy
ential equation. For example, + xy + y 2 = ex is nonlinear because of the terms xy and y 2 .
dx2 dx dx
d2 y
Similarly, + cos(y) = 0 is nonlinear because cos(y) is a transcendental function of y.
dx2
Exercise:
Classify the following ODEs into linear or nonlinear, giving reasons.
( )2
d2 y dy
(a) 2
−7 − 4y = 0.
dx dx
d3 y dy
(b) 3
−5 + 6y 2 = 9.
dx dx
( )2
d2 y dy
(c) x 2 + x −y − 3y 2 = 0.
dx dx

1.4 Origin/formation of ODEs


Differential equations occur in connection to numerous problems that one encounters in various
branches of science and engineering: geometric problems, physical problems, and primitive.

1.4.1 Geometric problem

Example(s):
A curve is defined by the condition that at each point the slope is 2 times the sum of the coordinates.
Form an ODE from the information given.

Solution
∆y dy dy
Slope/gradient of the line is defined by: m = lim = ⇒ = 2 (x + y)
∆x→0 ∆x dx dx

3
1.4.2 Physical problem

Example(s):
Powdered milk is being transformed to liquid milk at a rate that is directly proportional to the
unconverted milk. If originally there was 30kg of powdered milk. Find the ODE describing this
information.

Solution
Let y kg be the mass of converted milk at time t. Thus, the mass of unconverted milk at time t is
dy dy
(30 − y). From the statement, we have ∝ (30 − y) ⇒ = k(30 − y), where k is a constant
dt dt
of proportionality.

1.4.3 Elimination of essential arbitrary constants from primitives


Definition 1.4.1 (Arbitrary constant). An arbitrary constant refers to an undefined constant in a
function. For example, consider the primitive

y = ax3 + bx2 + cx2 + 3x + 4 (5)

Here, 3 and 4 in equation (5) are defined constants while a, b and c are undefined constants. Thus,
a, b and c are arbitrary constants.

Definition 1.4.2 (Essential arbitrary constant). Arbitrary constants are said to be essential if they
cannot be reduced to a lower number of constants. For example, equation (5) can be written as

y = ax3 + (b + c)x2 + 3x + 4 ⇒ y = ax3 + dx2 + 3x + 4 (6)

The arbitrary constants, a, b and c , in equation (5) are not all essential constants because they can be
reduced to 2 constants by replacing (b + c) with another constant d, as shown in equation (6). Hence,
there are only 2 essential constants, i.e., a and d.

Definition 1.4.3 (Primitive). A primitive is a function which involves essential arbitrary constants.
For example, the function y = cx2 + 3x + 4 is a primitive.

To obtain a differential equation from a primitive, we differentiate the primitive a number of times
equal to the number of essential arbitrary constants then manipulate algebraically the derivatives to
eliminate the constants.

→ Note: A primitive involving n essential arbitrary constants gives rise to a differential equation of
order n, free of arbitrary constants.

Example(s):
Obtain a differential equation associated with the following primitives

(a) y = Ax2 + Bx.

Solution
Since we have two essential arbitrary constants, we differentiate the given primitive 2 times.
Thus,
y = Ax2 + c2 x ⇒ y ′ = 2Ax + B and y ′′ = 2A
1
⇒ A = y ′′ and B = y ′ − 2Ax = y ′ − xy ′′
2
Substituting in the given primitive yields

x2 ′′ ( ) d2 y dy
y= y + x y ′ − xy ′′ ⇒ x2 y ′′ − 2xy ′ + 2y = 0 or x2 − 2x + 2y = 0
2 dx2 dx

4
(b) y = A cos 2x + B sin 2x.

Solution
Since we have two essential arbitrary constants, we differentiate the given primitive 2 times.
y = A cos 2x + B sin 2x ⇒ y ′ = −2A sin 2x + 2B cos 2x and y ′′ = −4 (A cos 2x + B sin 2x)
d2 y
⇒ y ′′ = −4y or + 4y = 0
dx2
(c) y = Ae2x + Be−3x .

Solution
Since we have two essential arbitrary constants, we differentiate the given primitive 2 times.
Thus,
y = Ae2x + Be−3x · · · (i)
y ′ = 2Ae2x − 3Be−3x · · · (ii)
y ′′ = 4Ae2x + 9Be−3x · · · (iii)
Eliminating A between equations (i)and (ii), we obtain y ′ − 2y = −5Be−3x · · · (∗).
Eliminating A between equations (ii)and (iii), we obtain y ′′ − 2y ′ = 15Be−3x · · · (∗∗).
Eliminating B between equations (∗)and (∗∗), we obtain
y ′′ + y ′ − 6y = 0
Alternatively, equations (i), (ii) and (iii) can be written in matrix form as
    
e2x e−3x −y A 0
 2x −3x −y ′  B  = 0
 2e −3e    
4e2x 9e−3x −y ′′ 1 0
The above matrix is a homogeneous system of equations in the unknowns A and B. To obtain a
non-trivial solution (i.e., for A ̸= 0 and B ̸= 0), the determinant of the coefficient matrix should
be equal to zero. That is,
e2x e−3x −y
2e 2x −3e −3x −y ′ = 0
4e 2x 9e −3x −y ′′
⇒ e2x [3e−3x y ′′ + 9e−3x y ′ ] − e−3x [−2e2x y ′′ + 4e2x y ′ ] − y[18e−x + 12e−x ] = 0
y ′′ + y ′ − 6y = 0

Exercise:
(a) y = e2x (A cos x + B sin x).

Solution
Since we have two essential arbitrary constants, we need to differentiate the given primitive 2
times. Now,
y = e2x (A cos x + B sin x) ⇒ ye−2x = A cos x + B sin x
Differentiating implicitly, using product rule on the left hand side, yields
e−2x [y ′ − 2y] = −A sin x + B cos x
Differentiating again yields
e−2x [y ′′ − 4y ′ + 4y] = −(A cos x + B sin x)
⇒ e−2x [y ′′ − 4y ′ + 4y] = −ye−2x ⇒ y ′′ − 4y ′ + 5y = 0

5
(b) y = Ae2x + Bex + C. [ans: y ′′′ − 3y ′′ + 2y ′ = 0]
(c) y = A sin(4x + B) + Ce3x . [ans: y ′′′ − 3y ′′ + 16y ′ − 48y = 0]
(d) y = Ae2x + Bex + Ce−x . [ans: y ′′′ − 2y ′′ − y ′ + 2y = 0]
(e) y = Ax3 + Bx2 + C. [ans: x2 y ′′′ − 2xy ′′ + 2y ′ = 0]
(f) y = e4x (A cos 3x + B sin 3x). [ans: y ′′ − 8y ′ + 25y = 0]

1.5 Solution of differential equations


A solution of a differential equation is any function satisfying the differential equation. In other words,
the solution of a differential equation is the primitive associated with the DE. There are two types of
solutions: general solution and particular solution.
Definition 1.5.1 (General solution). A general solution of an ODE is the primitive associated with
the differential equation. The number of arbitrary constants in the solution is equal to the order of
the differential equation. For example, y = mx + c is a general solution of y ′′ = 0, where m and c are
essential arbitrary constants (parameters). The function y = mx + c is a family of straight lines on
the xy-plane.
Definition 1.5.2 (Particular solution). A particular solution of an ODE is obtained from the general
solution by giving numerical values of the arbitrary constants. For example, if we are given the initial
conditions, say y(0) = 3 and y ′ (0) = 4, then we would get the particular solution as y = 4x + 3. The
function y = 4x + 3 is a single straight line on the xy-plane.

Example(s):
1. Show that y = e2x and y = e−3x are both solutions to the differential equation defined by
d2 y dy
+ − 6y = 0 − − − (∗)
dx2 dx

Solution
dy d2 y
From y = e2x − − − (i) ⇒ = 2e2x and = 4e2x . Substituting these derivatives in the
dx dx2
given differential equation yields
( )
4e2x + 2e2x − 6 e2x = 0
Therefore, (i) is a solution to the given differential equation (∗).
dy d2 y
Similarly, y = e−3x −−−(ii) ⇒ = −3e2x and 2 = 9e2x . Substituting these derivatives
dx dx
in the given differential equation yields
( )
9e2x − 3e2x − 6 e−3x = 0
Therefore, (ii) is a solution to the given differential equation (∗).

→ Note: if y1 , y2 , · · · , yn are each solution to a DE, then their linear combination is also a solution
to the differential equation. That is, y = c1 y1 + c2 y2 + · · · + cn yn , where ci , i = 1, 2, 3, · · · , n are
arbitrary constants. For instance, y = c1 e2x + c2 e−3x is also a solution to the given differential
equation (∗).
2. Verify that the given function is a solution of the corresponding differential equation.
d2 y
(a) + y = 0; y = cos x
dx2
d2 y dy
(b) +4 + 13y = 0; y = e−2x (cos 3x + sin 3x)
dx2 dx

Lecture 2

6
2 First order ODEs
A first order ordinary differential equation takes the general form:
. (x, y)dy = 0
M (x, y)dx + N (7)

Equation (7) can be categorized into 5 groups:


1. Separable equation
2. Homogeneous equation
3. Exact differential equation
4. Linear differential equation of first order
5. Bernoulli’s equation

2.1 Separable equations


If equation (7) can be rearranged to take the form of A(x)dx + B(y)dy = 0, then equation (7) is said
to be an equation with variables separable. The solution is then obtained by integrating directly -i.e.,
∫ ∫
A(x)dx + B(y)dy = C,

where C is a constant of integration.

Example(s):
Solve the following differential equations
(a) sin x cos ydx + cos x sin ydy = 0.

Solution
Dividing the equation through by cos x cos y and then integrating we get
∫ ∫ ∫
sin x sin y
dx + dy = 0 ⇒ − ln | cos x| − ln | cos y| = − ln |C| ⇒ cos x cos y = C
cos x cos y

(b) (x2 y 2 + x2 + y 2 + 1)dx + (xy + y)dy = 0

Solution

(x2 y 2 + x2 + y 2 + 1)dx + (xy + y)dy = 0 ⇒ (x2 + 1)(y 2 + 1)dx + y(x + 1)dy = 0


∫ ∫ ∫
x2 + 1 y
Dividing through by (x + 1)(y 2 + 1) and integrating we get dx + 2
dy = 0.
x+1 y +1
By long division,
x−1
)
x+1 x2 +1
− x2 −x
−x+1
x+1
2
x2 + 1 2
So, = (x − 1) + . Thus, we have
x+1 x+1
∫ ∫ ∫ ∫
2 y
(x − 1)dx + dx + 2
dy = 0
x+1 y +1
x2 1
⇒ − x + 2 ln |x + 1| + ln |y 2 + 1| = C
2 2

7
Exercise:
y
(a) Solve xy ′ = y + y 2 . [ans: = C]
x(1 + y)

[ans: x2 + ln(xy) = C or xy = C1 e−x ]


2
(b) Solve (2x2 y + y)dx + xdy = 0.
dy y2 − 1 y−1
(c) Solve = . [ans: = Cx2 ]
dx x y+1
dy
(d) Solve the initial value problem: (x2 + 9) + xy = 0; y(0) = 2. [ans: y 2 (x2 + 9) = 36]
dx
dy
[ans: y 2 + 2y = 1 + Ce−x ]
2
(e) Solve (y + 1) + x(y 2 + 2y) = x.
dx
(f) Determine the family of curves such that at each point the slope is given by 2xy 2 . [ans:
1
x2 + = C]
y
(g) Show that the solution of the differential equation (1 + y 2 )dx + (1 + x2 )dy = 0; y(0) = −1 is
xy − x − y − 1 = 0.

2.2 Reduction to separable equation


2.2.1 Substitution method
Consider equation (7) such that the functions of x and y in both M and N are scalar multiples of
each other, then equation (7) can be reduced to an equation with variables separable.

Example(s):
Solve the following differential equations
(a) (x + 2y + 1)dx + (3x + 6y + 5)dy = 0.

Solution
1
Let u = x + 2y ⇒ du = dx + 2dy ⇒ dy = (du − dx). Substituting in the given
2
differential equation, we get
1 (3u + 5)
(u + 1)dx + (3u + 5)(du − dx) = 0 ⇒ dx − du = 0
2 u+3
∫ ∫ ∫
3u + 5 3u + 5 4
Integrating yields dx − du = 0. By long division, = 3− . So we have
u+3 u+3 u+3
∫ ∫ ( ) ∫ ∫ ∫ ∫
4 4
dx − 3− du = 0 ⇒ dx − 3du + du = C
u+3 u+3
⇒ x − 3u + 4 ln |u + 3| = C
⇒ x − 3(x + 2y) + 4 ln |x + 2y + 3| = C
⇒ x + 3y − 2 ln |x + 2y + 3| = C1

dy
(b) = (x + y)2 .
dx

Solution
dy
From = (x + y)2 ⇒ dy − (x + y)2 dx = 0. Let u = x + y ⇒ du = dx + dy ⇒ dy =
dx
du − dx. Substituting in the given DE yields (du − dx) − u2 dx = 0 ⇒ du − (1 + u2 )dx = 0.
Rearranging and integrating we get
∫ ∫
du
= dx − − − −(∗)
1 + u2

8
Let u = tan θ.
⇒ du = sec2 θdθ
Therefore, equation (∗) becomes
∫  ∫ ∫ ∫
sec2 θdθ
⇒ ⇒
2
= dx dθ = dx θ = x + C,
1+
 tan θ
where C is a constant of integration. Back substitution yields

tan−1 (u) = x + C ⇒ tan−1 (x + y) = x + C ⇒ x + y = tan (x + C)

dy
(c) = sin(x + y).
dx

Solution
dy
From = sin(x + y) ⇒ sin(x + y)dx − dy = 0. Let u = x + y ⇒ du = dx + dy ⇒
dx
dy = du − dx. Substituting in the given DE yields sin udx − (du − dx) = 0 ⇒ (1 + sin u)dx −
du = 0. Rearranging and integrating we get
∫ ∫ ∫
du
dx − = 0 − − − −(∗)
1 + sin u
Here, we use t substitution by letting t = tan( u2 ).
( )
1 u 2dt 2dt 2dt
⇒ dt = sec2 du ⇒ du = = ( ) =
2 2 sec2 ( u2 ) 1 + tan2 u2 1 + t2

Consider the following diagram


1 + t2
t
u
. 2
( ) ( ) ( )
1 u u u u 2t
sin u = sin + = 2 sin cos =
2 2 2 2 1 + t2
du 2dt/(1 + t )2 2dt 2dt
∴ = 2t = 2 =
1 + sin u 1 + 1+t 2 t + 2t + 1 (t + 1)2

Therefore, equation (∗) becomes


∫ ∫ ∫
2dt 2
dx − = 0 ⇒ x+ = C,
(t + 1)2 t+1

where C is a constant of integration. Back substitution yields


2 2
x+ (u) =C ⇒ x+ ( ) =C
tan 2 +1 tan x+y
+1
2

Exercise:
Solve the following differential equations
dy ( )
x+y
(a) = sin(x + y) + cos(x + y). [hint: put u = x + y, ans: 1 + tan 2 = Cex ]
dx
(b) (x + y)dx + (3x + 3y − 4)dy = 0. [hint: put u = x + y, ans: x + 3y + 2 ln(x + y − 2) = C]
dy x+y+1 2 1
(c) = . [hint: put u = x + y, ans: (x + y) + ln |3x + 3y + 4| = x + C]
dx 2y + 3 + 2x 3 9

9
2.2.2 Homogeneous equations
A function f (x, y) is said to be homogeneous of degree n if and only if there exists a real number
λ ∈ R such that
f (λx, λy) =. λn f (x, y)
For example,
Let f (x, y) = x3 + x2 y + 4y 2 x
⇒ f (λx, λy) = (λx)3 + (λx)2 (λy) + 4(λy)2 (λx)
= λ3 x3 + λ3 x2 y + 4λ3 y 2 x
= λ3 (x3 + x2 y + 4y 2 x)
= λ3 f (x, y)
Therefore, f (x, y) is homogeneous of degree 3.

Equation (7) is said to be homogeneous if and only if both M (x, y) and N (x, y) are homogeneous and
of the same degree. Note that if the sum of the powers of each term in equation (7) is the same, then
equation (7) is said to be homogeneous. If equation (7) is homogeneous, then the substitution
y = ux
reduces equation (7) to an equation with separable variables as follows. Let y = ux ⇒ dy =
udx + xdu. Equation (7) reduces to the simpler form
M (x, ux)dx + N (x, ux)[udx + xdu] = 0
⇒ xn M (u)dx + xn N (u)[udx + xdu] = 0, x ̸= 0
⇒ [M (u) + uN (u)]dx + xN (u)du = 0
dx N (u)du
⇒ + = 0
x M (u) + uN (u)
∫ ∫ ∫
dx N (u)du
⇒ + = 0
x M (u) + uN (u)

N (u)du
⇒ ln |x| + = C
M (u) + uN (u)

Example(s):
Solve the following differential equations
(a) (x − 2y)dx + xdy = 0.

Solution
First, we need to test for homogeneity as follows: M (x, y) = x − 2y ⇒ M (λx, λy) =
λx − 2(λy) = λ(x − 2y) = λM (x, y), which is homogeneous of degree 1.
Similarly, N (x, y) = x ⇒ N (λx, λy) = (λx) = λ(x) = λN (x, y) which is homogeneous of degree
1.
Therefore, the given DE is homogeneous of degree 1. Next, let
y = ux ⇒ dy = udx + xdu
Substituting in the given DE yields
(x − 2ux)dx + x (udx + xdu) = 0 ⇒(1 − 2u)dx + udx + xdu = 0
∫ ∫ ∫
dx du
⇒ (1 − u)dx + xdu = 0 ⇒ − = 0
x u−1 ( )
y
⇒ ln |x| − ln |u − 1| = ln |C| ⇒ x = C(u − 1) ⇒ x = C −1
x
⇒ x2 = C (y − x)

10
(√ )
(b) x2 − y 2 dx = ydx − xdy.

Solution
Clearly, the given equation is homogeneous of degree 1. Next, let

y = ux ⇒ dy = udx + xdu

Substituting in the given DE yields


(√ ) (√ )
x2 − u2 x2 − ux dx + x(udx + xdu) = 0 ⇒ 1 − u2 − u dx + (udx + xdu) = 0
(√ ) ∫ ∫ ∫
dx du
⇒ 1 − u2 dx + xdu = 0 ⇒ + √ = 0, [hint: put u = sin θ]
x 1 − u2
( )
y −1 y
⇒ ln |x| + sin−1 u = − ln |C| ⇒ − sin−1 = ln |Cx| ⇒ Cx = e− sin ( x )
x

dy
(c) xy = y 2 + 2x2 .
dx

Solution
The given DE can be written as (y 2 + 2x2 )dx − xydy = 0 − − − (∗). Clearly, equation (∗) is
homogeneous of degree 2. Next, let

y = ux ⇒ dy = udx + xdu

Substituting in equation (∗) yields


( ) ( )
u2 x2 + 2x2 dx − x2 u(udx + xdu) = 0 ⇒ u2 + 2 dx − u(udx + xdu) = 0
∫ ∫
2dx
⇒ 2dx − xudu = 0 ⇒ − udu = 0
x
1 ( )
⇒ 2 ln |x| − u2 = −C ⇒ u2 = 2 C + ln(x2 ) ⇒ y 2 = 2x2 (C + ln x2 )
2

Exercise:
Solve the following equations
dy x+y−2
(a) = .
dx x−y+2

Solution
Put v = y − 2 ⇒ dv = dy. Substituting in the given DE yields
dv x+v
= ⇒ (x − v)dv − (x + v)dx = 0 − − − (∗)
dx x−v
Clearly, this equation is homogeneous of degree 1. Next, let

v = ux ⇒ dv = udx + xdu

Substituting in equation (∗) yields

(x − ux)(udx + xdu) − (x + ux)dx = 0 ⇒


(1 − u)(udx + xdu) − (1 + u)dx = 0
∫ ∫ ∫
dx u−1
(u2 + 1)dx + x(u − 1)du = 0 ⇒ + du = 0
∫ ∫
x u2 +

1
u 1 1
⇒ ln |x| + 2
du − 2
du = ln |C|, [hint: put u = tan θ in 2
du]
u +1 u +1 u +1
1 1
⇒ ln |x| + ln |u2 + 1| − tan−1 u = − ln |C|
2 [ ( )] 2
⇒ ln Cx u + 1 = 2 tan−1 (u)
2 2

11
Back substitution yields
[ ( )] ( )
v2 v −1
⇒ ln Cx 2
+1 = 2 tan
x2 x
[ { }] ( )
y−2
⇒ ln C (y − 2)2 + x2 = 2 tan−1
x

dy y2 x
(b) x =y+ [ans: − = ln x + C]
dx x y
dy
(c) x = x cos(y/x) + y [ans: sec(y/x) + tan(y/x) = Cx]
dx

(d) xdy − ydx = x2 + y 2 dx [ans: sinh−1 (y/x) = ln x + C]
dy √ 1√ 2
(e) xy = y 2 + x x2 + y 2 [ans: x + y 2 = ln x + C]
dx x

Lecture 3

2.3 Exact differential equations


Equation (7) is said to be exact differential if there exits a function ϕ(x, y) (read as “phi”) such that

dϕ = M (x, y)dx + N (x, y)dy − − − (∗)


∂ϕ ∂ϕ
But from differential Calculus, dϕ = dx + ∂y dy. So equation (∗) can be written as
∂x
∂ϕ ∂ϕ
dx + dy = M (x, y)dx + N (x, y)dy
∂x ∂y
∂ϕ ∂ϕ
⇒ M (x, y) = , and N (x, y) =
∂x ∂y
∂M 2
∂ ϕ ∂N 2
∂ ϕ
⇒ = , and =
∂y ∂y∂x ∂x ∂x∂y

∂2ϕ ∂2ϕ
From differential Calculus, we have = .
∂y∂x ∂x∂y

∂M . ∂N
∴ = (8)
∂y ∂x

∂ϕ
Equation (8) is the condition for equation (7) to be exact. Now, from = M (x, y) ⇒ ∂ϕ =
∂x
M (x, y)∂x. Integrating yields
∫ ∫ ∫
∂ϕ = M (x, y)∂x ⇒ ϕ(x, y) = M (x, y)dx + g(y), − − −(∗∗)

where g is an arbitrary function. Equation (∗∗) is the solution of equation (7) so long as g(y) is
determined as follows: ∫
∂ϕ ∂
= M (x, y)dx + g ′ (y)
∂y ∂y

∂ϕ ∂
But = N (x, y) ∴ M (x, y)dx + g ′ (y) = N (x, y).
∂y ∂y

Example(s):
Solve the following differential equations

12
(a) (2xy + cos y)dx + (x2 − x sin y)dy = 0.

Solution
First, we need to test whether the given DE is exact. Here,

M (x, y) = 2xy + cos y and N (x, y) = x2 − x sin y

∂M ∂N
⇒ = 2x − sin y and = 2x − sin y
∂y ∂x
∂M ∂N
Since = = 2x − sin y, therefore the given DE is exact. Now, let the solution to the
∂y ∂x
given DE be ϕ(x, y), which we need to determine. Then, dϕ = M dx + N dy. That is,

∂ϕ ∂ϕ
dx + dy = (2xy + cos y)dx + (x2 − x sin y)dy − − − (i)
∂x ∂y

∂ϕ
⇒ = 2xy + cos y ⇒ ϕ(x, y) = (2xy + cos y)dx + g(y)
∂x
⇒ ϕ(x, y) = x2 y + x cos y + g(y), − − −(ii)
where g is an arbitrary function of integration. Equation (ii) is the solution provided g(y) is
determined as follows. Differentiating equation (ii) partially wrt y yields

∂ϕ
= x2 − x sin y + g ′ (y)
∂y

But from equation (i) we have


∂ϕ
= x2 − x sin y
∂y
Thus,
x2 − x sin y + g ′ (y) = x2 − x sin y ⇒ g ′ (y) = 0 ⇒ g (y) = C
Therefore, the solution to the given DE is

ϕ(x, y) = x2 y + x cos y + C

(b) (x3 + x tan y)dx + (y ln y + 12 x2 sec2 y)dy = 0.

Solution
First, we need to test whether the given DE is exact. Here,
1
M (x, y) = x3 + x tan y and N (x, y) = y ln y + x2 sec2 y
2
∂M ∂N
⇒ = x sec2 y and = x sec2 y
∂y ∂x
∂M ∂N
Since = = x sec2 y, therefore the given DE is exact. Now, let the solution to the given
∂y ∂x
DE be ϕ(x, y), which we need to determine. Then, dϕ = M dx + N dy. That is,

∂ϕ ∂ϕ 1
dx + dy = (x3 + x tan y)dx + (y ln y + x2 sec2 y)dy − − − (i)
∂x ∂y 2

∂ϕ
⇒ = x3 + x tan y ⇒ ϕ(x, y) = (x3 + x tan y)dx + g(y)
∂x
x4 1 2
⇒ ϕ(x, y) = + x tan y + g(y), − − −(ii)
4 2

13
where g is an arbitrary function of integration. Equation (ii) is the solution provided g(y) is
determined as follows. Differentiating equation (ii) partially wrt y yields
∂ϕ 1
= x2 sec2 y + g ′ (y)
∂y 2
But from equation (i) we have
∂ϕ 1
= y ln y + x2 sec2 y
∂y 2
Thus,

1 2 2 1
x sec y + g ′ (y) = y ln y + x2 sec2 y ⇒ ′
g (y) = y ln y ⇒ g (y) = y ln ydy + C
2 2
Integration by parts yields [hint: put u = ln y, dv = ydy]:
( )
1 1
g(y) = y 2 ln y − +C
2 2
Therefore, the solution to the given DE is
( )
1 1 1 1
ϕ(x, y) = x4 + x2 tan y + y 2 ln y − +C
4 2 2 2

Exercise:
1. Find the general solution of the following equations

(a) (2x + sin x tan y)dx − cos x sec2 ydy = 0. [ans ϕ(x, y) = x2 − cos x tan y + C]
(b) (3x2 + 4xy)dx + (2x2 + 2y)dy = 0. [ans ϕ(x, y) = x3 + 2x2 y + y 2 + C]
(c) Show that (3xy 4 +x)dx+(6x2 y 3 −2y 2 +7)dy = 0 is an exact differential and find its general
solution.

2. Find the value of n such that when the differential equation (x+y 3 )dx+6xy 2 dy = 0 is multiplied
by xn makes it exact and hence solve it. [ans: n = − 21 , ϕ(x, y) = 2x1/2 y 3 + 32 x3/2 + C]

2.4 Linear differential equations of first order


Suppose equation (7) can be re-written to take the form
dy
+ P ′ (x)y = Q(x), (9)
dx
then equation (9) is said to be linear in the independent variable y since there are no powers (different
from 1) or products of y and its derivatives. Also, y is not “inside” another function, for example, ey .
The integrating factor for equation (9) is defined by

µ = eP (x) ,

where P (x) = P ′ (x)dx. Let y be a differentiable function of x, then

d ( P (x) ) dy
e y = eP (x) + P ′ (x)eP (x) y (10)
dx dx
Multiplying equation (9) by the integrating factor, we obtain
dy
eP (x) + P ′ (x)eP (x) y = eP (x) Q(x) (11)
dx
From equations (10) and (11), we have
d ( P (x) ) ( )
e y = eP (x) Q(x) ⇒ d eP (x) y = eP (x) Q(x)dx
dx

14
Integrating yields
∫ ∫
−P (x)
e P (x)
y= e P (x)
Q(x)dx + C ⇒ y=e eP (x) .Q(x)dx + Ce−P (x) ,

which is the general solution of a linear DE of first order.

Example(s):
Solve the following differential equations

(a) xydy + y(2xy − x)dx = 0.

Solution
The given DE can be rewritten as
dy
+ 2y = 1 · · · (∗) (linear in y)
dx

Here, P ′ (x) =2 ⇒ P (x) = 2dx = 2x. Therefore, the integrating factor is

µ = eP (x) = e2x

Multiplying equation (∗) by e2x yields

dy d ( 2x )
e2x + 2e2x y = e2x ⇒ ye = e2x
dx dx
Integrating yields

1 1
ye 2x
= e2x dx ⇒ ye2x = e2x + C ⇒ y= + Ce−2x
2 2
which is the solution.

(b) y 2 dx + (2xy − 4y 3 )dy = 0.

Solution
The given DE can be rewritten as
dx 2
+ x = 4y · · · (∗) (linear in x)
dy y

2 2
Here, P ′ (y) = ⇒ P (y) = dy = 2 ln y = ln(y 2 ). Therefore, the integrating factor is
y y
2
µ = eP (y) = eln(y ) = y 2

Multiplying equation (∗) by y 2 yields

dx d ( 2)
y2 + 2yx = 4y 3 ⇒ xy = 4y 3
dy dy
Integrating yields ∫
2
xy = 4y 3 dx ⇒ xy 2 = y 4 + C,

which is the solution.

15
(c) (y + x3 )dx − xdy = 0.

Solution
The given DE can be rewritten as
dy 1
− y = x2 · · · (∗) (linear in y)
dx x

1 1
Here, P ′ (x) =− ⇒ P (x) = − dx = − ln x = ln(1/x). Therefore, the integrating factor
x x
is
1
µ = eP (x) = eln(1/x) =
x
1
Multiplying equation (∗) by yields
x
( )
1 dy 1 d y
− 2y = x ⇒ =x
x dx x dx x
Integrating yields ∫
y y 1
= xdx ⇒ = x2 + C,
x x 2
which is the solution.

Exercise:
1. Find the general solution of the differential equation
dy
[ans: y = 1 + Ce−x ]
2
(a) + 2xy = 2x.
dx
dy
(b) + y tan x = sin 2x. [ans: y = −2 cos2 x + C cos x]
dx
dy y
(c) x − 2y = x4 ex . [ans: = (x − 1)ex + C]
dx x2
df (y) dy
2. Show that the transformation u = f (y) reduces the equation · + P (x)f (y) = Q(x) to
dy dx
dy
[ans: y 2 + 2y = 1 + Ce−x ]
2
a linear DE. Hence, solve (y + 1) + x(y 2 + 2y) = x.
dx

Lecture 4

2.5 Bernoulli’s equation


This is an equation of the form
dy
+ P ′ (x)y = Q(x)y n (12)
dx
where n is a real number. Equation (12) is linear if n = 0. Otherwise, it is nonlinear and can be
reduced to a linear form by substituting z = z = y 1−n as follows. Dividing equation (12) through by
y n we get
dy
y −n + P ′ (x)y 1−n = Q(x) (13)
dx
dy 1 dz
Let z = y 1−n ⇒ dz = (1 − n)y −n dy ⇒ y −n = . Substituting this in equation (13)
dx 1 − n dx
we get
1 dz dz
+ P ′ (x)z = Q(x) ⇒ + (1 − n)P ′ (x)z = (1 − n)Q(x) (linear in z)
1 − n dx dx

16
Example(s):
Solve the following differential equations
dy
(a) + y = xy 4 .
dx

Solution
dy dy
+ y = xy 4 ⇒ y −4
+ y −3 = x
dx dx
dy 1 dz
Let z = y −3 ⇒ dz = −3y −4 dy ⇒ y −4 =− . So,
dx 3 dx
−1 dz dz
+z =x ⇒ − 3z = −3x (linear in z)
3 dx dx
The integrating factor is ∫
−3dx
µ=e = e−3x
Multiplying through by e−3x yields

dz d
e−3x − 3e−3x z = −3xe−3x ⇒ (ze−3x ) = −3xe−3x ⇒ ze−3x = −3 xe−3x dx.
dx dx
Integrating by parts and rearranging we get [hint: put u = x, dv = e−3x dx]

3z = 3x + 1 + Ce3x ⇒ 3y −3 = 3x + 1 + Ce3x

dy
(b) + y = y 2 (sin x + cos x).
dx

Solution
dy dy
+ y = y 2 (sin x + cos x) ⇒ y −2
+ y −1 = sin x + cos x
dx dx
dy dz
Let z = y −1 ⇒ dz = −y −2 dy ⇒ y −2 = − . So,
dx dx
dz
− z = −(sin x + cos x) (linear in z)
dx
The integrating factor is ∫
µ = e− dx
= e−x
Multiplying through by e−x we get
dz d
e−x − e−x z = −e−x (sin x + cos x) ⇒ (ze−x ) = −e−x (sin x + cos x)
dx dx
∫ [∫ ∫ ]
−x −x −x −x
⇒ ze =− e (sin x + cos x)dx = − e sin xdx + e cos xdx

Now, using the idea of Euler’s representation of a complex number, we have


∫ ∫ ∫ ∫ ∫
−x −x −x −x
e cos xdx + i e sin xdx = e (cos x + i sin x)dx = e · e dx =
ix
e(i−1)x dx
1 (i−1)x e−x
= e +C =− (1 + i)eix + C
i−1 2
e−x
= − (1 + i)(cos x + i sin x) + C
2
e−x e−x
= − (cos x − sin x) − i (cos x + sin x) + C
2 2
∫ ∫
−x e−x e−x
⇒ e cos xdx = − (cos x − sin x) + C1 and e−x sin xdx = − (cos x + sin x) + C2
2 2

17
Therefore,
[ ]
e−x e−x
ze−x =− − (cos x + sin x) + C1 − (cos x − sin x) + C2 = e−x cos x + C
2 2

⇒ z = cos x + Cex ⇒ y −1 = cos x + Cex ⇒ y (cos x + Cex ) = 1

Exercise:
dy y x2
(a) Solve − = y3. [ans: 3 + 2x3 = C]
dx x y2
( )
dy 1 1 3 x
(b) Solve − 1+ y = y3. [ans: = Ce−x − 6]
dx 2 x x y2
y
(c) Solve x(6x2 − y − 1)dy + 2ydx = 0. [ans: = 6 + Ce−y ]
x2
dy
(d) Prove that the transformation z = y 1−n reduces the equation + P (x)y = Q(x)y n to a linear
dx
dy y x
equation in z and x. Hence, solve the initial value problem + = 3 ; y(1) = 2. [ans:
dx 2x y
x
= Ce−x − 6]
y2

2.6 Applications of first order ODEs


2.6.1 Geometry

Example(s):

(a) A curve is defined by the condition that at each point the gradient is equal to twice the sum of
the coordinates. Find the equation of the curve.

Solution
dy dy 1
= 2(x + y) ⇒ − 2y = 2x which is linear in y. Solving it yields y = −x − + Ce2x .
dx dx 2

2.6.2 Orthogonal trajectories


Let F (x, y) = c be a family of curves. Then if there exists another family of curves G(x, y) = k such
that each curve in the family G intersects with every curve in the family F at 90o , then F and G are
said to be orthogonal trajectories of each other. The product of their gradients is −1. In case the two
families are identical, then we say that the family is self-orthogonal.

18
→ Note: orthogonal trajectories has important applications in the field of physics. For example, the
equipotential lines and the streamlines in an irrotational 2D flow are orthogonal.

Now, suppose the ODE of F (x, y) = c is given by M dx+N dy = 0 then the equation for the orthogonal
trajectories of F (x, y) will be given by M dy − N dx = 0 since the product of their gradients is −1.

Example(s):

1. Find the orthogonal trajectories of the curves whose equations are.

(a) x + y = c.

Solution
Here, F (x, y) ≡ x + y = c ⇒ dF ≡ dx + dy = 0, which is the DE for the family F (x, y).
dy dx
The DE for the orthogonal trajectories is obtained by replacing by − . Hence, the
dx dy
DE for the orthogonal trajectories is dy − dx = 0. Integrating yields y − x = k, which is
the required orthogonal trajectories.
x
(b) y = .
c+x
Solution
x ydx − xdy
Here, F (x, y) ≡ − x = c ⇒ dF ≡ − dx = 0 ⇒ (y 2 − y)dx + xdy = 0,
y y2
which is the DE for the family F (x, y). The DE for the orthogonal trajectories is obtained by
dy dx
replacing by − . Hence, the DE for the orthogonal trajectories is (y 2 −y)dy −xdx = 0.
dx dy
Integrating yields 2y 3 − 3y 2 − 3x2 = k, which is the required orthogonal trajectories.
(c) x2 + y 2 = c. [ans: orthogonal trajectories are y = kx]

2. (a) Find the orthogonal trajectories of all parabolas having their vertices at the origin and foci
on the x-axis.

Solution
The equation of parabolas having their vertices at the origin and foci on the x-axis is given by
y2 2xydy − y 2 dy
y 2 = cx. Here, F (x, y) ≡ = c ⇒ dF ≡ = 0 ⇒ 2xdy − ydx = 0,
x x2
which is the DE for the family F (x, y). The DE for the orthogonal trajectories is obtained
dy dx
by replacing by − . Hence, the DE for the orthogonal trajectories is 2xdx + ydy = 0.
dx dy
Integrating yields 2x + y 2 = k, which is the required orthogonal trajectories.
2

(b) Find the orthogonal trajectories of family of straight lines through the origin. [hint: the
equation of the family of straight lines through the origin is y = mx, answer: orthogonal
trajectories are x2 + y 2 = k]

2.6.3 Real life situations

Example(s):

(a) A substance cools from 100o C to 60o C in 10 seconds. Find the temperature of the substance
after 40 seconds, assuming room temperature to be 20o C.

Solution
We apply Newton’s law of cooling which states that “the rate at which a substance cools is
directly proportional to the excess temperature above the room temperature.”

19
Let the temperature of the substance at time t be T . Then Newton’s law of cooling becomes:
dT dT
∝ (T − 20) ⇒ = k(T − 20),
dt dt
where k is a constant of proportionality. Separating the variables, we obtain
dT
= kdt.
T − 20
Integrating and applying the given conditions, we get
∫60 ∫10 [ ]60 [ ]10
dT
= kdt ⇒ ln(T − 20) = kt ⇒ k = 0.1 ln(0.5)
T − 20 100 0
100 0
[ ]T [ ]40
Also, ln(T − 20) = kt ⇒ ln(T − 20) − ln(80) = 40k
100 0

T − 20
⇒ = e40k = e40×0.1 ln(0.5) = e4 ln(0.5) ⇒ T = 80e4 ln(0.5) + 20 = 25
80
Therefore, T = 25o C, when t = 40 seconds.

(b) The population of Juja constituency in 1964 and 1970 was 12 thousand and 18 thousand respec-
1
tively. Find the year when the population was 5 thousand, given that the rate of growth of
3
the population is directly proportional to the population.

Solution
dP dP
Let P be the population at time t. Then we have = kP ⇒ = kdt. Integrating and
dt P
applying the given conditions, we get
∫18 ∫
1970
dP 1
= kdt ⇒ k= ln(1.5)
P 6
12 1964

Also,
1
∫5 3 ∫t [ ]5 1 [ ]t [ ]
dP 3 1
= kdt ⇒ ln(P ) =k t ⇒ ln(16/3) − ln(12) = ln(1.5) t − 1964
P 12 1964 6
12 1964

⇒ t = 1952

Exercise:

(a) An electric circuit has a constant electromotive force E = 40v, a resistor of R = 10Ω and an
inductance L = 0.2 henry (H), with initial current I = 0 at t = 0 and basic differential equation
dI ( )
is: L + RI = E. Determine the current at any time t. [ans: I = 4 1 − e−50t ]
dt
(b) The JKUAT engineering students’ population N (t) at any time t is assumed to satisfy the logistic
dN 1 10000
growth law = N (10000 − N ). Prove that N (t) = , where C is an arbitrary
dt 500 1 + Ce−20t
constant.

(c) A company is using Newspaper advertising to introduce a new product to a community of 50,000
people. It was assumed that the rate at which people learn about the new product is proportional
to the product of the number of people who have heard about it and the number of people who
have not heard about it. If 100 individuals were aware of the product initially and 500 people
dN
were aware about it after 10 days of the campaign [hint: ∝ N (50000 − N )]
dt

20
i) How many people will be aware of the product after 20 days? [6 mks]
ii) When will half of the community be aware of the product? [3 mks]

Lecture 5

3 Higher order linear ODEs


Consider the linear ODE of order n:
dn y dn−1 y dn−2 y d2 y dy
an (x) + an−1 (x) + a n−2 (x) + · · · + a 2 (x) + a1 (x) + a0 (x)y = F̃ (x) (14)
dxn dxn−1 dxn−2 dx2 dx
If F̃ (x) = 0, then equation (14) is called homogeneous ODE, otherwise it is non-homogeneous
ODE. If the coefficients a0 (x), a1 (x), · · · , an (x) are constants, then equation (14) is called linear ODE
with constant coefficients. For n = 2, the equation (14) reduces to a second order linear equation.
d2 y dy
a2 (x) 2
+ a1 (x) + a0 (x)y = F̃ (x) (15)
dx dx
d d2
Define the D operator by D = ⇒ D2 = , etc. Then in terms of the D operator, a linear
dx dx2
ODE with constant coefficients takes the form
[ ]
an Dn + an−1 Dn−1 + an−2 Dn−2 + · · · + a2 D2 + a1 D + a0 y = F̃ (x),
where a0 , a1 , · · · , an are constants. This can be denoted by:
F (D)y = F̃ (x) (16)
Thus, the homogeneous equation becomes
F (D)y = 0 (17)
Definition 3.0.1 (Shift operator). Let y and eαx be differentiable functions of x. Then,
D(eαx y) = eαx (D + α)y
That is, to shift eαx to the LHS of D, shift it but in place of D substitute (D + α).
Proof.
( )
d αx dy d
D(eαx y) = (e y) = eαx + αeαx y = eαx + α y = eαx (D + α)y
dx dx dx

Similarly, eαx Dy = (D − α)eαx y . That is, eαx is shifted to the RHS of D. In this case we substitute
(D − α) in place of D.

3.1 Solution of homogeneous linear ODEs with constant coefficients


Consider equation (17) then either y = 0 (trivial solution) or
F (D) = 0 (18)
Equation (18) is called the characteristic equation (or auxiliary/subsidiary equation) of the
differential equation (17). The solution of y is dependent on the roots of equation (18) and we shall
consider a linear differential equation of order 2. The roots can be classified into three cases, depending
on the discriminant:
(i) Real and distinct roots
(ii) Real and equal roots
(iii) Complex conjugate roots
We shall consider the three cases above.

21

You might also like