You are on page 1of 9

Module 1: First Order (Linear

and Nonlinear) ODE and


Applications

Preamble: Partial Differentiation


Before we tackle exact equations, we need to review (for those of you have
taken CalcIII) and explain (for those who have not yet) Partial Differentiation.
Given a function of two variables f (x, y), the derivative with respect to one
the two variables, say x, only (treating the other, say y, as constant) is called a
partial derivative of f with respect to x and is denoted
∂f (x, y)
fx (x, y) = .
∂x
For instance, if f (x, y) = x ln y, then fx (x, y) = ln y. It is as if we are taking the
derivative of x× constant, where constant= ln y.
Similarly, we can define the derivative with respect to the y variable, only
(treating the other, x, as constant) is called a partial derivative of f with respect
to y and is denoted
∂f (x, y)
fy (x, y) = .
∂y
And for the same example above where f (x, y) = x ln y, fy (x, y) = x y1 = xy . It
is as if we are taking the derivative of constant × ln y, where constant= x.

Exact Equations
Reading Assignment: Textbook Section 2.4
We will now present the third technique for solving first-order, nonlinear,
ordinary differential equations. This technique is a generalization of the one we
used for separable equations. To motivate it, let us consider first the equation

Ψ(x, y) = C(C = arbitrary constant ),


2

which determines ”implicitly” y as a function of x (instead of t, we will use x


as the independent variable in this section), because, at least in principle, we
should be able to solve this equation for y. On the other hand, we can also
associate with the equation a differential equation by regarding y as a function
of x and differentiating with respect to x (using the chain rule):
∂Ψ ∂Ψ dy
+ = 0.
∂x ∂y dx
Thus, to every algebraic relation of the form Ψ(x, y) = C, we have an asso-
ciated ODE given by the chain rule above, and the solutions y(x) of the ODE
will correspond to solutions of the original algebraic relation.
What we will attempt next is to try to reverse this procedure. That is to say,
we will try to solve differential equation of the same form by first identifying the
corresponding algebraic relation, and then solving (algebraically) for y.
The problem, however, is this: given a general nonlinear, first-order differ-
ential equation
M (x, y)dx + N (x, y)dy = 0
or, dividing by dx
dy
M (x, y) + N (x, y) = 0 similar to above-equation,
dx
how do we recognize that it is of the desired form, and more to the point, if it
is of that form, how do we identify the function Ψ that defines the correspond-
ing algebraic relation? It turns out that there is a rather simple criterion for
dy
checking if a differential equation of the form M (x, y) + N (x, y) dx = 0 can be
re-expressed in the desired form.

Theorem 1 Criterion for exact equation: Suppose that the functions M, N, My


and Nx are all continuous in a region R = {(x, y) : α < x < β, γ < y < δ}.
Then
dy From dy/dx=-M(x,y)/N(x,y)
M (x, y) + N (x, y) =0
dx
can be re-expressed in the form
∂Ψ ∂Ψ dy
+ = 0.
∂x ∂y dx
at each point in R if and only if
∂M ∂N
=
∂y ∂x
at each point in R.

In other words, there exists a function Ψ such that


∂Ψ ∂Ψ
= M (x, y) and = N (x, y).
∂x ∂y
3

if and only if the condition ∂M ∂N


∂y = ∂x is satisfied. And in that case, we say
that the differential equation is exact.
The proof is as follows: If M (x, y) = ∂Ψ ∂Ψ
∂x = Ψx and N (x, y) = ∂y = Ψy
then differentiating again (using Clairault’s theorem of calculus III which when
paraphrased says that) Ψxy = Ψyx or (Ψx )y = (Ψy )x giving

∂M ∂N
= .
∂y ∂x
.
Method of Solution To recapitulate, if ∂Ψ ∂x = M ∫ (x, y) and ∂Ψ
∂y = N (x, y),
we can find by integrating the M-term, that Ψ(x, y) = M (x, y)dx + g(y) where
the arbitrary function g(y) is the ”constant” of integration with respect to x (in-
dependent of x). Then differentiate that with respect to y gives

∂Ψ(x, y) ∂
= M (x, y)dx + g ′ (y) = N (x, y),
∂y ∂y

or g ′ (y) = N (x, y)− ∂y

M (x, y)dx. Then after integrating that again, we can fi-

nally find g(y) and subsitute it into M (x, y)dx+g(y). That leads to the solution
of the equation as Ψ(x, y) = c.
Please note:

• The expression N (x, y) − ∂y ∂
M (x, y)dx is independent of x, because
∫ ∫
∂ ∂ ∂N ∂ ∂
[N (x, y) − M (x, y)dx] = − ( M (x, y)dx)
∂x ∂y ∂x ∂y ∂x
∂N ∂M
= −
∂x ∂y
=0

• If the integration is too complicated, we can try



Ψ(x, y) = N (x, y)dy + h(x),

and use ∫

h′ (x) = M (x, y) − N (x, y)dy.
∂x
Example 2 Solve the differential equation
dy
(2x + 3) + (2y − 2) = 0.
dx
Solution M (x, y) = 2x + 3, N (x, y) = 2y − 2 satisfy the condition My = 0 =
Nx , so the equation is exact. We now try to find a function Ψ such that its partial
derivative with respect to x is M and its partial derivative with respect to y is N.
4

This step is the same as that of finding a potential function in Calculus III
as stated earlier. The most general function Ψ one can have such that

∂Ψ
= 2x + 3
∂x
will be of the form
Ψ = x2 + 3x + h1 (y).
Similarly, in order for
∂Ψ
= 2y − 2
∂y
we must have
Ψ = y 2 − 2y + h2 (x).
So, we now ask the question: is there any way we can make these two
forms compatible with one another? In fact, by setting h1 (y) = y 2 − 2y and
h2 (x) = x2 + 3x, we obtain Ψ = x2 + 3x + y 2 − 2y. Was that magic? No! We can

∂y = h1 (y) = 2y − 2 and integrate to get h1 (y) = y − 2y+
get those by setting ∂Ψ 2

∂Ψ ′
a constant of integration we can set to zero. Similarly, set ∂x = h2 (x) = 2x + 3
and integrate to get h2 (x) = x2 +3x+ a constant of integration we can set again
to zero.
The general solution of the original differential equation can then be con-
structed by solving
Ψ = x2 + 3x + y 2 − 2y = C1
for y, we have using the quadratic formula

y = 1 ± C2 − 3x − x2 with C2 = 1 + C1 .

Example 3 Solve the differential equation

dy ax − by
=( ).
dx bx − cy

Solution The equation does not seem to be exact. However, if we rewrite it


in the form
dy
−ax + by + (bx − cy) = 0,
dx
then it is exact since
∂M ∂ ∂ ∂N
= (−ax + by) = b = (bx − cy) = .
∂y ∂y ∂y ∂x

We therefore try to construct a function Ψ such that

∂Ψ ∂Ψ
= −ax + by and = bx − cy.
∂x ∂y
5

By solving for Ψ, we have

1 1
Ψ = − ax2 + bxy − cy 2 .
2 2
By setting Ψ = K(= a constant) and solving it for y, we have

bx ± b2 x2 − c(ax2 + 2K)
y= .
c

The Integrating Factor Method Revisited


dy
Even if the nonlinear, first-order differential equation M (x, y) + N (x, y) dx = 0 is
not exact, it is sometimes possible to multiply it by another function of x and/or
y to obtain an equivalent equation which is exact. In other words, one can
sometimes find a function µ(x, y) such that

dy
µ(x, y)M (x, y) + µ(x, y)N (x, y) =0
dx

is exact. That is, M̄ (x, y) = µ(x, y)M (x, y) and N̄ (x, y) = µ(x, y)N (x, y) satisfy
the condition
∂ M̄ ∂ N̄
= .
∂y ∂x
If such a function (called an integrating factor) can be found, then the origi-
dy
nal differential equation M (x, y) + N (x, y) dx = 0 can be solved by simply con-
structing a solution to the equivalent exact differential equation µ(x, y)M (x, y)+
dy
µ(x, y)N (x, y) dx = 0, since the integrating factor can be eliminated.

Example 4 Solve the differential equation

dy
x2 y 3 + x(1 + y 2 ) = 0.
dx

Solution The equation is not exact; for M (x, y) = x2 y 3 and N (x, y) =


x(1 + y 2 ),
∂M ∂N
= 3x2 y 2 and = 1 + y2 ,
∂y ∂x
and so My ̸= Nx . However, if we multiply both sides of the differential equation
by
1
µ(x, y) = 3 ,
xy
we have
1 + y 2 dy
x+ = 0,
y 3 dx
6

which is not only exact but also separable. Here we regard it as an exact
equation by M (x, y) = Ψx = x and N (x, y) = Ψy = y −3 + y −1 . By integration,
we can construct the function
x2 y −2
Ψ(x, y) = − + ln |y|.
2 2
Hence, the general solution y(x) of the original differential equation is (im-
plicitly) given by Ψ(x, y) = C, or
1 2 1 2
x − y + ln|y| = C, C an arbitrary constant .
2 2
Clearly, we know integrating factors are powerful tools for solving differential
equations. However, in general, the problem of finding an integrating factor
µ(x, y) for a given differential equation is very difficult. In certain cases, it is
rather easy to find an integrating factor. The most important cases in which
simple integrating factors can be found occur when µ is a function of only one
of the variables x or y, instead of both. We shall investigate the two cases in the
following, by determining necessary conditions on M and N so that M (x, y) +
dy
N (x, y) dx = 0 has an integrating factor µ that depends on x (resp. on y) only.

Case 1. Equations with integrating factors that depend only on x.


dy
Consider the general first-order differential equation M (x, y) + N (x, y) dx = 0.
Suppose that there exists an integrating factor which depends only on x: µ =
µ(x). Since µ is an integrating factor, by definition, for the equation
dy
µ(x)M (x, y) + µ(x)N (x, y) =0
dx
to be exact, the following condition must be satisfied:
∂ ∂
[µ(x)M (x, y)] = [µ(x)N (x, y)].
∂y ∂x
After differentiation, we have
∂M dµ ∂N
µ = N +µ ,
∂y dx ∂x
or
dµ 1 ∂M N
= ( − )µ.
dx N y x
Now, if µ depends only on x (and not on y), then necessarily µ′ (x) depends
only on x. Thus, the self- consistency of the previous equation requires its right
side to be a function of x alone. Thus, we can rewrite the equation as
dµ 1 ∂M ∂N
− p(x)µ = 0; where p(x) = ( − ).
dx N ∂y x
7

This is a first-order linear differential equation for µ that we can solve. Ac-
cording to previous submodules (regarding it as a separable equation), the
general solution is
∫ ∫
∂y − ∂x )dx
1
p(x)dx ( ∂M ∂N
µ(x) = Ae = Ae N , A is a constant .
dy
This formula thus gives an integrating factor for M (x, y) + N (x, y) dx = 0 so
long as
1 ∂M ∂N
( − )
N ∂y ∂x
depends only on x.

Case 2. Equations with integrating factors that depend only on y.


dy
Consider again the general first-order differential equation M (x, y)+N (x, y) dx =
0. Suppose that there exists an integrating factor which depends only on y:
µ = µ(y). Since µ is an integrating factor, by definition, for the equation
dy
µ(y)M (x, y) + µ(y)N (x, y) =0
dx
to be exact, the following condition must be satisfied:
∂ ∂
[µ(y)M (x, y)] = [µ(y)N (x, y)].
∂y ∂x
We have
dµ ∂M ∂N
M +µ =µ ,
dy ∂y ∂x
or
dµ 1 ∂N M
= ( − )µ.
dy M x y
Now, if µ depends only on y (and not on x), then necessarily µ′ (y) depends
only on y. Thus, the self- consistency of the previous equation requires its right
side to be a function of y alone. Thus, we can rewrite the equation as
dµ 1 ∂N ∂M
− p(y)µ = 0; where p(y) = ( − ).
dy M ∂x y
This is a first-order linear differential equation for µ that we can solve. Ac-
cording to previous submodules (regarding it as a separable equation), the
general solution is
∫ ∫
∂x − ∂y )dx
1
p(y)dy ( ∂N ∂M
µ(y) = Ae = Ae M , A is a constant .
dy
This formula thus gives an integrating factor for M (x, y) + N (x, y) dx = 0 so
long as
1 ∂N ∂M
( − )
M ∂x ∂y
depends only on y.
8

Definition 5 Finding integrating factors Suppose that

dy
M (x, y) + N (x, y) = 0.
dx
A. If
1 ∂M ∂N
F1 = ( − ) depends only on x,
N ∂y ∂x
then
∫ dy
F1 (x)dx
µ(x) = e = an integrating factor for M (x, y) + N (x, y) = 0.
dx
B. If
1 ∂N ∂M
F2 = ( − ) depends only on y,
M ∂x ∂y
then
∫ dy
F2 (y)dy
µ(y) = e = an integrating factor for M (x, y) + N (x, y) = 0.
dx
C. If neither A nor B is true, then there is little hope of constructing an integrat-
ing factor for
dy
M (x, y) + N (x, y) = 0.
dx
Example 6 Solve the differential equation

(3x2 y + 2xy + y 3 )dx + (x2 + y 2 )dy = 0.

Solution Here

M (x, y) = 3x2 y + 2xy + y 3 , N (x, y) = x2 + y 2 .

Since
∂M ∂N
= 3x2 + 2x + 3y 2 ̸= 2x = ,
∂y ∂x
the equation is not exact. Let us try to find a function µ such that

µ(x, y)(3x2 y + 2xy + y 3 )dx + µ(x, y)(x2 + y 2 )dy = 0

is exact. Now,

1 ∂M ∂N 3x2 + 2x + 3y 2 − 2x 3(x2 + y 2 )
F1 = ( − )= 2 2
= = 3,
N ∂y ∂x x +y x2 + y 2

and
1 ∂N ∂M 2x − 3x2 − 2x − 3y 2 −3(x2 + y 2 )
F2 = ( − )= 2 3
= 2 .
M ∂x ∂y 3x y + 2xy + y 3x y + 2xy + y 3
9

Since F2 depends on both x and y, we cannot construct an integrating factor


depending only on y from F2 . However, since F1 does not depend on y, we can
consistently construct an integrating factor which is a function of x alone. By
the formula presented in the previous Summary, we have
∫ ∫
F1 (x)dx 3dx
µ(x) = e =e = e3x .

We can now use this µ(x) as an integrating factor to construct the general
solution of
e3x (3x2 y + 2xy + y 3 )dx + e3x (x2 + y 2 )dy = 0,
which, by construction, must be exact. So we look for a function Ψ such that
{ ∂Ψ 3x 2 3
∂x = e (3x y + 2xy + y )
∂Ψ 3x 2 2
∂y = e (x + y )

Integrating the first equation with respect to x and the second equation with
respect to y yields
{
Ψ(x, y) = x2 ye3x + 13 y 3 e3x + h1 (y)
Ψ(x, y) = x2 ye3x + 13 y 3 e3x + h2 (x),

respectively. Please note the similarity with finding a potential function in Cal-
culus III (for thos who took it). Comparing these expressions for Ψ(x, y), we
see that we must take h1 (y) = h2 (x) = C, a constant. Thus, the function Ψ
must be of the form
1
Ψ(x, y) = e3x (x2 y + y 3 ) + C.
3
Therefore, the general solution y(x) of the original differential equation is
(implicitly) given by Ψ =constant, or
1
x2 y + y 3 = ce−3x , c is a constant.
3

You might also like