First Order Differential
First Order Differential
Differential equations
First Order ODE
TUT Lecturer
01/07/2021
Definition
A differential equation is an equation involving a function and
one or more of its derivatives. If the function has only one
independent variable the equation it is called an Ordinary
differential equation.
Definition
A differential equation involving a function of several variables
and its partial derivative is called a Partial differential
equation.
The order of the differential equation is determined by the
highest-order derivative in the equation.
Definition
A function y = f (x) is called a solution of a differential
equation if the equation is satisfied when y and its derivatives
are replaced by f (x) and its derivatives. For example
y 0 + 2y = 0 has y = Ce−2x as its general solution.
y 00 − y = 0
(a) y = sin x
(b) y = e2x
(c) y = 4e−x
(d) y = Cex .
y 00 − y = − sin x − sin x
= −2 sin x 6= 0
xy 0 − 3y = 0,
verify that
y = Cx 3
is its general solution and find the particular solution
determined by the initial condition y = 2 when x = −3.
xy 0 − 3y = 0,
y = Cx 3 , y 0 = 3x 2
LHS = xy 0 − 3y
= x3Cx 2 − 3Cx 3
= 3Cx 3 − 3Cx 3
= 0 = RHS.
dy
M(x, y ) + N(x, y ) = 0, (1)
dx
where M is a continuous function of x alone and N is a
continuous function of y alone. For this type of equation, all x
terms can be collected with dx and all y terms with dy , and the
solution can be obtained by integration. The equations are
said to be separable and the solution procedure is called
separation of variables.
or
M(x, y )dx = −N(y )dy
2 Integrate to obtain the general solution:
Z Z
M(x)dx + N(y )dy = C
Example
Find the general solution of (x 2 + 4) dy
dx = xy .
Example
Given the initial condition y (0) = 1, find the particular solution
2
to the equation xydx + e−x (y 2 − 1)dy = 0.
Example
Find the equation of the curve that passes through point (1, 3)
and has a slope xy2 at the point (x, y )
dy
(x 2 + 4) = xy
dx
dy x
= dx
y +4 x2
Z Z
dy x
= 2
dx
y x +4
1
ln y − ln(x 2 + 4) = C
2 p
∴ y = C x2 + 4
√
The general solution is y = C x 2 + 4.
2
The general solution is 21 ex + 12 y 2 − ln y = C. The substitution
of the initial condition in the general solution yields that C = 1.
2
Thus the particular solution is 12 ex + 21 y 2 − ln y = 1.
First Order Differential Equations
Solution to example 3
In the third example we have the equation dy y
dx = x 2 subject to
the initial condition y (1) = 3. The initial conditions imply that we
obtain a particular solution.
dy y
= 2
Z dx Zx
dy dx
=
y x2
1
ln y = − +C
x
1
y = Ce− x
1
The general solution is y = Ce− x . The substitution of the initial
condition in the general solution yields that C = 3e. Thus the
1
particular solution is y = 3e1− x .
First Order Differential Equations
Homogeneous Function
Definition
A function given by
z = f (x, y )
is said to be homogeneous of degree n if
Example
Determine whether the functions
1 f (x; y ) = x 2 y − 4x 3 + 3xy 2
x
2 f (x; y ) = xe y + ysin( yx )
3 f (x; y ) = x + y 2
are homogeneous or not. If they are, what are their degrees?
f (tx; ty ) = tx + (ty )2
= tx + t 2 y 2
1
= t( x + y 2 )
t
∴ f (tx; ty ) 6= t(f (x; y ))
Definition
A homogeneous differential equation is an equation of the form
If
M(x, y )dx + N(x, y )dy = 0
is homogeneous, then it can be transformed into a differential
equation whose variables are separable by the substitution
y = vx, (4)
Example
Find the general solution to the differential equation
1 (x 2 − y 2 )dx + 3xydy = 0.
2 In the preservation of food, cane sugar is broken down
(inverted) into two simpler sugars: glucose and fructose. In
dilute solutions, the inversion rate is proportional to the
concentration y (t) of unaltered sugar. If the concentration
1 1
is 50 when t = 0 and 200 after 3 hours, find the
concentration of unaltered sugar after 6 hours and after 12
hours.
3
ln x + ln(1 + 2v 2 ) = C
4
ln x 4 + ln(1 + 2v 2 )3 = C
y2
x 4 (1 + 2 2 )3 = C
x
∴ (x 2 + 2y 2 )3 = Cx 2
1 −0,46209812t
y (t) = e
50
The concentration unaltered sugar after 6 hours and after 12
hours respectively is given by
1 −0,46209812×6 1 −2,77258872
y (6) = e = e = 0.00125
50 50
1 −0,46209812×12 1 −5,54517744
y (12) = e = e = 0.000078125
50 50
Definition
If z = f (x, y ) and ∆x and ∆y are increments of x and y , then
the differentials of x and y are dx = ∆x and dy = ∆y and the
total differential of z is
∂z ∂z
dz = dx + dz = fx (x, y )dx + fy (x, y )dy
∂x ∂y
Example
Find the total differentials of
1 z = 2x sin y + 3x 2 y 2 .
2 w = x 2 + y 2 + z2
∂z ∂z
dz = dx + dy
∂x ∂y
dz = (2 sin x + 6xy 2 )dx + (2x cos y + 6x 2 y )dy
∂w ∂w ∂w
dw = dx + dy + dz
∂x ∂y ∂z
dw = 2xdx + 2ydy + 2zdz
The equation
M(x, y )dx + N(x, y )dy = 0
is an exact differential equation if there exists a function f of
two variable x and y having continuous partial derivatives such
that
∂f
= fx (x, y ) = M(x, y ) (6)
∂x
and
∂f
= fy (x, y ) = N(x, y ) (7)
∂y
The general solution to the equation is
f (x, y ) = C (8)
∂2f ∂2f
= (10)
∂y ∂x ∂x∂y
Example
Test the exactness of the following differential equations:
(a) (xy 2 + x)dx + yx 2 dy = 0
(b) (2xy + 3x 2 )dx + (x 2 − 2y )dy = 0
(c) (y 2 + cos x − x sin x)dx + 2yxdy = 0
(d) ydx + 2xdy = 0
Example
We consider the differential equation given as
(xy 2 + x)dx + yx 2 dy = 0.
If a differential equation
u(x, y )
1
1 IfN(x,y ) [My (x, y ) − Nx (x, y )] = h(x) is a function of x
R
alone, then e h(x)dx is an integrating factor.
1
2 IfM(x,y ) [Nx (x, y ) − My (x, y )] = k (y ) is a function of y
R
alone, then e k (y )dy is an integrating factor.
Example
Find the integrating factor in the following differential equations:
(a) 2ydx + xdy = 0
(b) ydx − xdy = 0
(c) (y 2 − x)dx + 2ydy = 0
Example
We consider the differential equation given as
2ydx + xdy = 0
∂M ∂N
= 2 and =1
∂y ∂x
∂M ∂N
6=
∂y ∂x
1
[My (x, y ) − Nx (x, y )] = h(x)
N(x, y )
If a differential equation
Example
Determine the exactness of the following differential equations.
If exact, solve it. If not, make it exact and solve it.
(a) (xy 2 + x)dx + yx 2 dy = 0
(b) (2xy + 3x 2 )dx + (x 2 − 2y )dy = 0
(c) (y 2 + cos x − x sin x)dx + 2yxdy = 0
(d) ydx + 2xdy = 0
(xy 2 + x)dx + yx 2 dy = 0
1 2 2 1 2
f (x, y ) = x y + x +C
2 2
Example
Alternatively we integrate one function, say M(x, y ) with
respect to x, or N(x, y ) with respect to y and reconcile. Thus
integrating M(x, y ) we get
Z
(xy 2 + x)dx = 12 x 2 y 2 + 21 x 2 + g(y )
R
f (x, y ) = M(x, y )dx =
1 2 2 1 2
f (x, y ) = x y + x +C
2 2
dy du(x)y
u(x) + u(x)P(x)y = (12)
dx dx
R
Integration with respect to x yields that u(x) = Ce P(x)dx . We
let C = 1 to avoid the most general integrating factor.An
integrating factor for the first-order linear differential equation
dy
+ P(x)y = Q(x)
dx
is R
P(x)dx
u(x) = e . (13)
which simplifies to
Z R R R
y = ( Q(x)e P(x)dx dx)e− P(x)dx + Ce− P(x)dx (15)
Example
Find the general solutions to the following first-order linear
differential equations:
(a) xy 0 − 2y = x 2
(b) y 0 − y tan t = 1
(c) xy 0 − y = x
y0 y 1
2
−2 3 =
x x x
d y 1
2
=
Zdx x Zx
y 1
d 2 = dx
x x
y
= ln x + C
x2
The general solution is y = x 2 ln x + Cx 2 .
dy
+ P(x)y = Q(x)y n (16)
dx
The equation is linear if n = 0, and has separable variables if
n = 1. To solve the Bernoulli equation, let z = y 1−n , and
multiply the whole equation by (1 − n) to
dz
+ (1 − n)P(x)z = (1 − n)Q(x) (17)
dx
which is linear.
Example
Find the general solutions to the following Bernoulli equations:
2
(a) y 0 + xy = xe−x y −3
(b) y 0 + 3x 2 y = x 2 y 3
dP P
= kP(1 − )
dt M
Example
dP P
Solve dt = 1.2P(1 − M)
The example dP P
dt = 1.2P(1 − M ) is a separable variable
problem. We thus have
Z Z
dP
P
= 1, 2dt
P(1 − M )
P
ln P − ln(1 − ) = 1, 2t + C
M
P
P
= Ce1,2t
1− M
PC 1,2t
P = Ce1,2t − e
M
Ce1,2t
P = C 1,2t
1+ M e
dI
4 + 12I = 60
dt
Determine I(t)
dθ
= −k (θ − A)
dt
with θ(t0 ) = θ0 , where θ(t) is the object’s temperature, A is the
ambient temperature (constant) and k is a positive constant.
This is a first-order linear ODE
dθ
+ k (θ) = kA
dt
Find θ(t) for the given initial condition
Definition
The half-life of a radioactive element is the time required for half
of the radioactive nuclei present in a sample to decay (i.e. for
the quantity to be reduced to half.) This is represented by the
equation
dy
= ky
dt
where y0 is the number of nuclei present initially, and y is the
number of nuclei present at time t.
Example
Find the half-life of plutonium-210 if the disintegration constant
is k = −4.95 × 10−3
dv
m = mg − cv .
dt
If v = 0, when t = 0,
mg tc
1 (a) Show that v = c (1 − e− m )
2 (b) Find the distance the object has fallen in t seconds.