You are on page 1of 8

University of Johannesburg

Faculty of Science
Department of Mathematics and Applied Mathematics
Lecturers: PG Dlamini, IK Letlhage & SM Simelane

First-order Ordinary Differential Equations

1. Homogeneous differential equations


We usually solve a differential equation by recognizing it as a certain kind of equation (say, separable) and then
carry out a procedure, consisting of equation specific mathematical steps, that yields a function that satisfies the
equation. In some instances, it is impossible to separate the variables in a given differential equation of the form
dy
= f (x, y),
dx
for instance in the DE
dy x + 4y
= .
dx 3x
For the DE above, we observe that the total degree of x and y is the same. In this case, the degree of x is one and
the degree of y is also one. Such differential equations are said to be homogeneous.

1.1. Definition
Definition 1. A first-order differential equation in the form
M(x, y) dx + N(x, y) dy = 0 (Standard Form) (1)
is said to be homogeneous if both coefficients M(x, y) and N(x, y) are homogeneous functions of the same degree. In
other words, equation 1 is homogeneous if
M(tx, ty) = ta M(x, y) and N(tx, ty) = ta N(x, y) (2)
Example 1: Determine if the differential equations are homogeneous.
1. (y2 − x2 ) dx − 2xy dy = 0

Solution: Let M(x, y) = y2 − x2 and N(x, y) = −2xy. Then


M(tx, ty) = (tx)2 − (ty)2 and N(tx, ty) = −2(tx)(ty)
=t y −t x
2 2 2 2
= − 2t2 xy
= t2 (y2 − x2 ) =t2 (−2xy)
= t2 M(x, y) =t2 N(x, y)
Thus, the DE is homogeneous because both M and N are homogeneous functions of degree a = 2.
dy
2. (2y − x) = 2x + y
dx
Solution: Write the DE in standard form as (2y − x) dy − (2x + y) dx = 0. Let M(x, y) = −(2x + y) and
N(x, y) = 2y − x. Then
M(tx, ty) = −(2(tx) + (ty)) and N(tx, ty) = 2(ty) − tx
= −t(2x + y) =t(2y − x)
= tM(x, y) =tN(x, y)
The DE is homogeneous because both M and N are homogeneous functions of degree a = 1.

1
1.2. Method of solution
For homogeneous differential equations, we make use of a substitution

y = vx, (3)

where v is a function of x. Making this substitution will reduce the original (inseparable) equation to a separable
equation. In general, if y = vx, then the derivative of y is
dy d
= (vx).
dx dx
Since v is a function of x, we need to use the product rule of differentiation to obtain
dy dv
= x + v. (4)
dx dx
Note: The word homogeneous as used here does not mean the same as it does in the classical sense when applied
to linear differential equations.

Example 2: Solve
dy x + 4y
=
dx 3x
Solution: Observe that the equation is not separable. The degree in x and y are the same, both of degree one.
Hence, the DE is homogeneous and we may use the substitution y = vx.
Let y = vx, then
dy dv x + 4vx
= x +v=
dx dx 3x
dv
Make the subject of the formula
dx
dv x + 4vx
x = −v
dx 3x
x + 4vx − 3xv
=
3x
x + vx
=
3x
x(1 + v)
=
3x
1+v
=
3
Separate the x factors from the v factors
3 1
dv = dx
1+v x
Integrate
3 ln |1 + v| = ln |x| + c
If we convert c to a logarithmic, say ln A = c, then

ln (1 + v)3 = ln |x| + ln |A| ←− (a ln b = ln ba )


= ln (Ax)
(1 + v) = Ax
3

2
y
Since y = vx, we substitute back v =
x  y 3
1+ = Ax
x

Example 3: Solve
dy
xy = 2y2 + 4x2
dx
Solution: Write DE in standard form
dy 2y 4x
= +
dx x y
Observe that the equation is not separable. The degree in x and y are the same, both of degree one. Hence, the DE
is homogeneous and we may use the substitution y = vx.
dy dv
Let y = vx, then = x + v so that
dx dx
dv 2y 4x 4
x +v= + = 2v +
dx x y v
dv
Make the subject of the formula
dx
dv 4
x =v+
dx v
v +4
2
=
v
Separate the x factors from the v factors
v 1
dv = dx
v2 + 4 x
Integrate
1
ln |v2 + 4| = ln x + c
2

ln v2 + 4 = ln (Ax)

v2 + 4 = Ax

y 1 x
Since y = vx, =⇒ v = and =
x v y s
y2
+ 4 = Ax
x2
Or
q
y2 + 4x2 = Ax2
y2 + 4x2 = Ax4

3
Exercises

Solve the following differential equations


1. (y2 − x2 ) dx − 2xy dy = 0
dy
2. (x3 + 3xy2 ) = y3 + 3x2 y if the solution curve passes the point (2,1)
dx
dy x 2 + y2
3. =
dx xy
dy 2xy + 3y2
4. = 2
dx x + 2xy
dy
5. (x − y) = x+y
dx
dy
q
6. First prove that x = x2 + y2 + y is homogeneous and solve.
dx
 y y y
7. x sin − y cos dx + x cos dy = 0
x x x
2 dy dy
8. x = y − xy
2
given that y(1) = 1
dx√ dx
9. (x + xy) dy − y dx = 0 given that y(1) = 1
10. Please see exercises in the prescribed textbook

2. Exact differential equations

The differential equation 2y dx+2x dy = 0 is variable separable. However, we can solve it in an alternative manner
by first establishing that the DE is exact. In this section, we discus exact differential equations and their method of
solution.

2.1. Definition
Definition 2. A differential equation of the form

M(x, y) dx + N(x, y) dy = 0 (Standard Form) (5)

is said to be an exact equation if the expression on the left side is an exact differential.

The necessary and sufficient condition that M(x, y) dx + N(x, y) dy = 0 be an exact differential equation is

∂M ∂N
= (6)
∂y ∂x

2.2. Method of solution


If given a DE of the form M(x, y) dx + N(x, y) dy = 0, first determine whether the DE is exact. If so, then there
exists a function f for which
∂f
= M(x, y). (7)
∂x
We can find f by integrating M(x, y) with respect to x while holding y constant
Z
f (x, y) = M(x, y) dx + g(y), (8)

4
where g(y) is an arbitrary function and is the “constant” of integration. Now differentiate equation 8 above with respect
to y and assume that ∂∂yf = N(x, y):

∂f ∂
Z
= M(x, y) dx + g0 (y) = N(x, y). (9)
∂y ∂y
This results in

Z
g0 (y) = N(x, y) − M(x, y) dx. (10)
∂y
Lastly, integrate equation 10 with respect to y and substitute the result in equation 8. The implicit solution of the DE
is f (x, y) = c.

Note: If you find integrating M(x, y) with respect to x difficult, then start the process by first integrating N(x, y)
with respect to y so that the analogues to equations 8 and 10, respectively, are

Z Z
f (x, y) = N(x, y) dy + h(x) and h0 (x) = M(x, y) − N(x, y) dy. (11)
∂x

Example 1: Solve the DE


(2xy + 4) dx + (x2 − 1) dy = 0
Solution:

Step 1: First check if the DE is written in the standard form

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

Note that it is already written in standard form with M = 2xy + 4 and N = x2 − 1.


∂M ∂N
Step 2: Test whether the equation is exact. That is check whether = :
∂y ∂x
∂M ∂N
= 2x and = 2x
∂y ∂x
∂M ∂N
Since = = 2x, we conclude that the differential equation is exact.
∂y ∂x
Step 3: Find the solution

Since the DE is exact, then there exists a function f (x, y) such that
∂f ∂f
= 2xy + 4 and = x2 − 1
∂x ∂y
Integrating 2xy + 4 with respect to x, we obtain

f (x, y) = x2 y + 4x + g(y)

Taking the partial derivative of the equation above with respect to y and setting the result to N(x, y) gives
∂f
= x2 + g0 (y) = x2 − 1 ←− N(x, y)
∂y
It then follows that
g0 (y) = −1 and g(y) = −y
5
Hence, f (x, y) = x2 y + 4x − y, and so the solution of the equation in implicit form is

x2 y + 4x − y = c

The explicit form of the solution is


c − 4x
y=
x2 − 1
and valid for x , 1 and x , −1.

Example 2: Solve the DE


e x sin y dx + (2y + e x cos y) dy = 0
Solution:

Step 1: First check if the DE is written in the standard form

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

Note that it is already written in standard form with M = e x sin y and N = 2y + e x cos y.
∂M ∂N
Step 2: Test whether the equation is exact. That is check whether = :
∂y ∂x
∂M ∂N
= e x cos y and = e x cos y
∂y ∂x
∂M ∂N
Since = = e x cos y, we conclude that the differential equation is exact.
∂y ∂x
Step 3: Find the solution

Since the DE is exact, then there exists a function f (x, y) such that
∂f ∂f
= e x sin y and = 2y + e x cos y
∂x ∂y
Integrating e x sin y with respect to x, we obtain

f (x, y) = e x sin y + g(y)

Taking the partial derivative of the equation above with respect to y and setting the result to N(x, y) gives
∂f
= e x cos y + g0 (y) = 2y + e x cos y ←− N(x, y)
∂y
It then follows that
g0 (y) = 2y and g(y) = y2
Hence, f (x, y) = e x sin y + y2 , and so the solution of the equation in implicit form is

e x sin y + y2 = c

Example 3: Solve the initial value problem


dy xy2 − cos x sin x
= ,
dx y(1 − x2 )
6
subject to y(0) = 2.

Solution:

Step 1: Write the DE in standard form

(xy2 − cos x sin x) dx − y(1 − x2 ) dy = 0.

Hence, M = xy2 − cos x sin x and N = −y(1 − x2 ).

Step 2: Test whether the equation is exact:

∂M ∂N
= 2xy and = 2xy
∂y ∂x
∂M ∂N
Since = = 2xy, we conclude that the differential equation is exact.
∂y ∂x
Step 3: Find the solution

Since the DE is exact, then there exists a function f (x, y) such that
∂f ∂f
= −y(1 − x2 ) and = xy2 − cos x sin x
∂y ∂x

Integrating −y(1 − x2 ) with respect to y, we obtain

y2
f (x, y) = − (1 − x2 ) + h(x)
2
Taking the partial derivative of the equation above with respect to x and setting the result to M(x, y) gives

∂f
= xy2 + h0 (x) = xy2 − cos x sin x ←− M(x, y)
∂x
It then follows that
h0 (x) = −cos x sin x and
Integrating yield
Z
h(x) = − cos x sin x dx
1
= cos2 x
2
2
Hence, the f (x, y) = − y2 (1 − x2 ) + 1
2 cos2 x, and so the solution of the equation in implicit form is

1 y2
cos2 x − (1 − x2 ) = c or cos2 x − y2 (1 − x2 ) = c1
2 2
Since y(0) = 2, c1 = −3. The implicit solution of the problem is

cos2 x − y2 (1 − x2 ) = −3

7
Exercises

Solve the following differential equations


1. (e2y − y cos xy) dx + (2xe2y − x cos xy + 2y) dy = 0
x y
2. 2 dx + 2 dy = 0
x +y 2 x + y2 !
1
3. + cos x − 2xy dy = y(y + sin x) dx subject to y(0) = 1.
1 + y2
4. y dx + x dy = 0
5. (y + e x ) dx + x dy = 0
6. sinh x !sinh y dx + cosh x cosh y dy = 0
1
7. + y dx + (3y2 + x) dy = 0
x
8. Please see exercises in the prescribed textbook

c Compiled by SM Simelane

You might also like