Differential Equation
Differential Equation
Outline
1 Learning outcomes
2 Introduction
Order of an ODE
Degree of an ODE
Solution of ODEs
Formulation of ODEs
3 First order ODEs
4 Solution of first order ODEs
Direct Integration
Separable Equations
Homogeneous first order differential equations
Exact first order differential equations
Equation Reducible to Exact
Linear First Order Differential Equation
Ndinodiva Bernoulli’s First Order Differential Equations NUST others
The
First Order Differential xy Transformation
Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
Learning outcomes
By the end of this chapter, you should be able to:
will be able to explain the concept of differential equation,
classifies the differential equations with respect to their order and
linearity,
explains the meaning of solution of a differential equation,
will be able to solve first-order ordinary differential equations,
solves exact differential equations,
converts separable and homogeneous equations to exact differential
equations by integrating factors,
solves Bernoulli and Ricatti differential equations,
solves the homogeneous linear differential equations with constant
coefficients.
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
Order of an ODE
Degree of an ODE
Degree of an ODE
Solution of ODEs
Solution of ODEs
1 1 1
−24e −4x − e −x + 4(6e −4x + + e −x ) = 2 + e −x = RHS
3 2 3
therefore y = 6e −4x + 1
2 + 13 e −x is a solution.
Formulation of ODEs
Formulation of ODEs
There are two approaches to formulation an ODE,
1) Mathematical modelling of physical problems (or Application of
ODEs). Notes will be shared.
2) Theoretically by eliminating the arbitrary constants from a given
function.
For example Form a differential equation from the following family of
functions
a) y = C1 e 5x + c2 e −5x
b) y = x + xb
c) y = A1 sin x + A2 cos x
d) y = C1 x 2 + c2 x
e) y = Ae −4x + Be −6x
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
Formulation of ODEs
Solution a) the key here is to differentiate the function twice since it has
two arbitrary constants as follows
y0 = 5C1 e 5x − 5c2 e −5x
00
y = 25C1 e 5x + 25c2 e −5x
=⇒ y 00 = 25y hence the ODE.
b) the key here is to differentiate the function once since it has one
arbitrary constant and solve for b as follows
b
y0 = 1 − 2
x
=⇒ b = x 2 (1 − y 0 )
x 2 (1 − y 0 )
∴y = x+
x
=⇒ y = 2x − xy 0 hence the ODE.
I trust the concept is clear, now try the rest of the examples.
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
To solve an ODE, we have to find the function y (x) which satisfies the
equation. We will discuss the most useful algebraic method for solving
first order ordinary differential equations. When solving for first order
ODEs, please do try them in the order they are discussed, if you are not
as to which method to use.
Direct Integration
Direct Integration
If the equation can be explicitly re-arranged as
y 0 = f (x),
then by direct integration we can solve the equation as follows
Z Z
y 0 dx = f (x) dx + C
Z
=⇒ y = f (x) dx + C called the general solution of the equation.
If some informations are given called initial value conditions and obtain
C = k, then
Z
y = f (x) dx + k is called a particular solution of the equation.
Direct Integration
For example Find the general solution, and using the initial conditions if
any to obtain the particular solution to each of the following equations
a) y 0 = x − 2; y (0) = 1
b) y 0 = x
x 2 +1
x−xy
C) y 0 = 1−y ; y (1) = −2
Solution a) integrating both side we get:
x2
y = − 2x + c G.S,
2
but y (0) = 1 =⇒ c = 1
x2
∴y = − 2x + 1 P.S
2
I trust you will be able to do the rest of the problem.
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
Separable Equations
Separable Equations
The first ODEs that can be written in any of the following form:
y 0 = f (x)g (x)
f (x)
y0 = g (y )
F (x)G (y )y 0 ± f (x)g (x) = 0
are said to have separable variables or simply called Separable Equations,
i.e., x and y can be separated from each other. In general an first ODE
that can be reduced by algebraic manipulations to the form
g (y )dy = f (x)dx
Separable Equations
Separable Equations
dy x dx
=
y 4 − x2
Z Z
dy x dx
∴ =
y 4 − x2
1
∴ ln y = − ln(4 − x 2 ) + c, let c = ln k
2
k
then y = √
4 − x2
c) Is left for you to try.
Definition
A function P(x, y ) is said to be homogeneous of degree n if
If the first order DE p(x, y )dx + q(x, y )dy = 0 can be reduced to either
y 0 = f ( yx )
y 0 = f (ax + by )
y 0 = f ( ax+by +c
px+qy +r )
where both p(x, y ) and q(x, y ) are algebraically homogeneous functions
of the same degree n, then by substitution method we can reduce the
equation to a separable variable form.
Remark: The differential equations which are reducible to either of the
above forms are called Homogeneous Equations.
Differential forms:
Solution
Solution a) rearranging to get y 0 = x+3y 1 3y y
2x = 2 + 2x = f ( x ), also, both p
and q i.e., the coefficients of dx and dy , are homogeneous of degree 1,
we let
y = ux
and
1) differentiate both side for y 0
dv
y0 = v + x
dx
2) equate the equations to express each side in terms v and x.
dv x + 3vx
v +x =
dx 2x
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
dv x(1 + 3v )
v +x =
dx 2x
dv
2v + 2x = 1 + 3v
dx
dv
2x = 1+v
dx
dv dx
∴ = here the variables are separated
Z 1+v Z2x
dv dx
∴ =
1+v 2x
1
∴ ln(1 + v ) = lnx + c, let c = lnk
2
y √
=⇒ = k x −1
x
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
here the variables are separated, please continue and make sure you get
∴ v + ln(v − 1) = −lnx + c,
y y
=⇒ + ln( − 1) = −lnx + c
x x
ii)
Solution
let
z =x −y
and
1) differentiate both side for y 0
dz dy
=1−
dx dx
2) equate the equations to express each side in terms z and x.
dz
= 1 − sin z
dx
dz
∴ = dx
Z 1 − sin z Z
dz
∴ = dx
1 − sin z
the method of integration is left for you
∴ cotz + sec z = x + c
=⇒ cot(x − y ) + sec(x − y ) = x + c
iii)
iii) If the equation can be reduced to y 0 = f ( ax+by +c
px+qy +r ), then
a) If the two lines are not parallel, that is, aq 6= bp, then the lines will
meet at a point, say (h, k). Referring these two lines to a new set of
axis (X , Y ) with origin (h, k), by doing the translation
x = X + h; y =Y +k
the constants must varnish. Applying these translations we will get
(aX +bY )dX +(pX +qY )dY = 0, since dy = dY and dx = dX
which is a homogeneous equation and can be solved by the
substitution
Y = VX
and follow the method above.
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
iii)
b) If the two lines are parallel, that is, aq = bp, then the two lines have
no points of intersection. We rewrite the equations in the basis form:
m(ax + by ) + c
y0 =
n(ax + by ) + r
z = ax + by
Examples
Solution
1) Rewriting the equation in the standard form we get:
(2x − 3y + 4)dx + (2x − 2y + 1)dy = 0, we also note that
2(−2) 6= −3(3). Solve the two simultaneously to get (h; k) = (1; 2), now
using the transformation
x = X + 1; dx = dX
y = = Y + 2 dy = dY
dy 3y − 2x − 4
in the equation = to get
dx 3x − 2y + 1
dY 3(Y + 2) − 2(X + 1) − 4
=
dX 3(X + 1) − 2(Y + 2) + 1
3Y + 6 − 2X − 2 − 4
=
3X + 3 − 2Y − 4 + 1
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
3Y − 2X
= which in now homogeneous inX andY .
3X − 2Y
dy 1(x − y ) + 1
= .
dx −1(x − y ) + 1
Our duty is to find the f (x, y ) that will satisfy the above condition,
which is the solution to the equation M(x, y )dx + N(x, y )dy = 0. Let
M(x, y ), N(x, y ), My and Nx be continuous, then a necessary sufficient
condition for M(x, y )dx + N(x, y )dy = 0 to be exact is
∂M ∂N
= ∀x, y
∂y ∂x
and
differentiate f partial with respect to the variable of the unknown
function,
equate the answer to M or N,
simplify and integrate both side to solve for the unknown function.
2) Find f (x, y ) using the following steps
∂f
a) integrate M(x, y ) partial with respect to x since ∂x
= M(x, y ),
∂f
b) integrate N(x, y ) partial with respect to y since ∂y
= N(x, y ),
c) find the union of the two results.
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
Examples
∂M ∂N
M = 2xy and N = 1 + x 2 =⇒ = 2x =
∂y ∂x
therefore exact.
= y + x 2 y + g (x) + C or
Z
f (x, y ) = Mdx + g (y ) + C
Z
=⇒ f (x, y ) = 2xydx + g (y ) + C
= x 2 y + g (y ) + C and
∂f ∂(y + x 2 y ) d
= + (g (x) + C )
∂x ∂x dx
= 2xy + g 0 (x) or
∂f ∂(x 2 y ) d
= + (g (y ) + C )
∂y ∂y dy
= x 2 + g 0 (y ),
simplify and integrate both side to solve for the unknown function.
=⇒ g 0 (x) = 0
∴ g (x) = C or
0
=⇒ g (y ) = 1
∴ g (y ) = y.
Therefore,
f (x, y ) = y + x 2y + C or
f (x, y ) = x 2y + y + C
2) Testing: ∂M ∂N
∂y = 3 = ∂x , there fore the equation is exact. Using
method 2, we
∂f
a) integrate M(x, y ) partial with respect to x since ∂x = M(x, y ),
Z
=⇒ (2x + 3y − 2)∂x = x 2 + 3xy − 2x
∂f
b) integrate N(x, y ) partial with respect to y since ∂y = N(x, y ),
Z
=⇒ (3x − 4y + 1)∂y = 3xy − 2y 2 + y
∴ f (x, y ) = x 2 + 3xy − 2x − 2y 2 + y = C
that are not exact, can made exact by multiplying them with a suitable
function µ(x) or µ(y ) called integration factor
Definition
Let M(x, y )dx + N(x, y )dy = 0 be any first order differential equation
then,
if the expression N1 ∂M
∂y − ∂N
∂x ≡ g (x), i.e. the equation is a
function of x only, then the equation has the integrating factor
R
g (x) dx
µ(x) = e
Examples
Solve each of the following equations
1) (3x + 2y )dx + xdy = 0
2) (y 4 + 2y )dx + (xy 3 + 2y 4 − 4x)dy = 0
Solution 1) Testing: ∂M ∂N
∂y = 2 6= ∂x = 1, therefore not exact. Now
1 ∂M ∂N 1 1
− = (2 − 1) = ≡ g (x).
N ∂y ∂x x x
Therefore,
1
R
dx
µ(x) = e x =x
and
µ(x)(M(x, y )dx + N(x, y )dy = 0) yield (3x 2 + 2xy )dx + x 2 dy = 0.
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
∂M ∂N
2) Testing: ∂y = 4y 3 + 2 6= ∂x = y 3 − 4, therefore not exact. Now
1 ∂M ∂N 1 3
− = (3y 3 + 6) = ≡ h(y ).
M ∂y ∂x y4 + 2y y
Therefore,
R 1 1
µ(y ) = e − y dx
=
y3
and
2 4x
µ(y )(M(x, y )dx+N(x, y )dy = 0) yield (y + )dx+(x+2y − 3 )dy = 0.
y2 y
Z
1
y= IF (r (x))dx + C
IF
For example Solve each of the following equations
1) x dy
dx + 2y = x
3
2) sin x dy
dx + y cos x = 1
dy y
3) dx − x−2 = (x − 2)2
Solution
dy
1) Putting the equation in the standard form to get: dx + x2 y = x 2 , and,
Z Z
2
pdx
IF = e = e x dx = x 2 ,
therefore
Z
2
yx = x 2 (x 2 )dx
x5
= + C.
5
Note that,
dy 2 dy
x 2( + y) = x2 + 2xy = d(yx 2 ).
dx x dx
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
therefore
Z
y sin x = sin xcosecxdx
= x + C.
dy
+ p(x)y = r (x)y α
dx
to get
dz
+ (1 − α)p(x)z = (1 − α)r (x),
dx
which is now a linear differential equation in z and can be solved using
the above method. For example Solve each of the following equation.
dy y
1) dx + x = y3
dy
2) dx + 2xy = y 3
3) 3x y dy + 4(y 3 x − 3)dx = 0
2 2
The xy Transformation
The xy Transformation
So far we have dealt with first order differential equations of the form
Mdx + Ndy = 0,
The xy Transformation
So that
dz dy z
=x + y and xdy = dz − dx,
dx dx x
this then will lead to a separable variable equation. For example Solve
each of the following equation
1) (y − xy 2 )dx − (x + x 2 y )dy = 0
dy 3y −2xy 2
2) dx = 3x 2 y −x
3) (x + x y + x y )dy + (xy 2 + y )dy = 0
2 3 2
The xy Transformation
One way
leave the equation as is and let z = xy and y = xz so that
dz dy
dx = x dx + y and xdy = dz − xz dx, now the equation in the general
form become:
z z
(1 − z)dx − x(1 + z)(dz − dx) = 0
x x
∴ (z − z 2 )dx − x(1 + z)dz + (z + z 2 )dx = 0
∴ (z − z 2 + z + z 2 )dx = x(1 + z)dz
2 1+z
∴ dx = dz
Z x Z z
2 1+z
∴ dx = dz
x z
∴ 2 ln x = ln z + z + C
= ln xy + xy + C
Ndinodiva NUST others
First Order Differential Equation
Learning outcomes Introduction First order ODEs Solution of first order ODEs
The xy Transformation
Another way
y (1−xy )
Make dy
dx the subject of the formula, i.e.
dy
dx = x(1+xy ) and let
z = xy and y = xz so that
dz dy
= y +x
dx dx
y (1 − xy )
= y +x
x(1 + xy )
1−z
= y 1+
1+z
z 1 + z + 1 − z)
=
x 1+z
The xy Transformation
2z
=
x(1 + z)
2 1+z
∴ dx = dz which is the same as above.
x z
Now you try 2) and 3).