Notes-1 (SMA-2271)
Notes-1 (SMA-2271)
⃝Francis
c O. Ochieng
[email protected]
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.
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.
Lecture 1
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
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
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
(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.
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
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.
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
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
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]
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)
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
Solution
7
Exercise:
y
(a) Solve xy ′ = y + y 2 . [ans: = C]
x(1 + y)
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
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
√
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
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
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
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
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ϕ ∂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 ∂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
ϕ(x, y) = x2 y + x cos y + C
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]
µ = 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) ,
Example(s):
Solve the following differential equations
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
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.
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
dx d ( 2)
y2 + 2yx = 4y 3 ⇒ xy = 4y 3
dy dy
Integrating yields ∫
2
xy = 4y 3 dx ⇒ xy 2 = y 4 + C,
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
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
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
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
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
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):
(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]
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
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.
21