Math 350 Notes 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

DIFFERENTIAL EQUATIONS 1 (MATH 350) NOTES

Dr Chisara Peace Ogbogbo

Contents
Exact Equations 2

Non Exact Differential Equations and Integrating Factor 6

1
Exact Equations
We consider an equation of the form
M (x, y)dx + N (x, y)dy = 0
Recall a differential equation of the first order can be written in the form
dy
= f (x, y) (1)
dx
If we can express f (x, y) in the form

−M (x, y)
f (x, y) = then
N (x, y)
dy −M (x, y)
= from 1
dx N (x, y)

Then,
M (x, y)dx + N (x, y)dy = 0 (2)
Note that we must have + between M and N components, and the equation must be equal to zero on rhs.

Since a general solution of a first order D.E. is expected to contain one arbitrary constant, we can assume
that solution of equation 2 will be of the form U (x, y) = c where c is a constant.

∂U ∂U
dU = dx + dy = 0 (3)
∂x ∂y
Comparing equations 2 and 3
∂U ∂U
M (x, y) = and N (x, y) = (4)
∂x ∂y
From 4
∂2U
 
∂M ∂ ∂U
= =
∂y ∂y ∂x ∂y∂x
2
∂N ∂ ∂U ∂ U
= =
∂x ∂x ∂y ∂x∂y
If we assume continuity of U, and continuity of its first differential, then

∂2U ∂2U
=
∂x∂y ∂y∂x
∂M ∂N
∴ = (5)
∂y ∂x
Equation 5 is the necessary and sufficient condition for Equation 2 to be exact. We can now write

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

dU is an exact differential.
Generally, an equation is said to be exact if it can be written in the form

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

such that
∂M ∂N
=
∂y ∂x

2 Chisara P. Ogbogbo
Steps in solving exact DE

(i) Write equation in the form of an exact D.E.

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

So you can clearly identify


M (x, y) and N (x, y)
We obtain the derivatives
∂M ∂N
and
∂y ∂x

∂M ∂N
If = then the equation is exact
∂y ∂x

(iii) We assume the solution U (x, y) = C and write

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

(iv) We integrate this equation w.r.t the 2 variables taking one at a time
Z Z
dU = M (x, y)dx + f (y) = U (6)
Z Z
dU = N (x, y)dy + g(x) = U (7)

(v) Compare 6 and 7 to determine f (y) and g(x)

(vi) Union of 6 and 7 gives U .

U (x, y) = C is the desired solution

Alternative to (iv)

As we integrate w.r.t x, we ignore the arbitrary constant of integration. Also, as we integrate with respect
to y, we ignore the constant of integration. We construct the desired function U (x, y) = C. We ’merge’ the
two resulting expressions obtained from the separate integrations. To ’merge’ these two expressions, write down
each term exactly once, even if a particular term appears in both results.

Example 1

Solve the D.E.

(2xy − y 2 + 2x)dx + (x2 − 2xy + 2y)dy = 0


In the form M (x, y)dx + N (x, y)dy = 0

(i). M (x, y) = 2xy − y 2 + 2x


N (x, y) = x2 − 2xy + 2y
∂M
= 2x − 2y x held constant
∂y
∂N
= 2x − 2y y held constant
∂x

3 Chisara P. Ogbogbo
Since
∂M ∂N
= , the equation is exact
∂y ∂x
(ii). Let u(x, y) = c be a solution
M (x, y)dx + N (x, y)dy = du(x, y) = 0
(2xy − y + 2x)dx + (x2 − 2xy + 2y)dy = du(x, y) = 0
2

(iii). Next, we integrate M (x, y) w.r.t x (keeping y constant)


then, we integrate N (x, y) w.r.t y (keeping x constant)

Z
(2xy − y 2 + 2x)dx + f (y) = x2 y − xy 2 + x2 + f (y) (8)

Z
(x2 − 2xy + 2y)dy + g(x) = x2 y − xy 2 + y 2 + g(x) (9)

Comparing Equations 8 and 9

f (y) = y 2 and g(x) = x2


∴ u = x2 y − xy 2 + x2 + y 2
Solution: x2 y − xy 2 + x2 + y 2 = C

Example 2

Solve the following initial value D.E.

dy e−y − yex
= −y y(0) = 4
dx xe + ex
Solution

We rearrange, to obtain

(xe−y + ex )dy − (e−y − yex )dx = 0

Then

(yex − e−y )dx + (xe−y + ex )dy = 0


M (x, y) = yex − e−y
N (x, y) = xe−y + ex
∂M
= ex + e−y
∂y
∂N
= e−y + ex
∂x
∂M ∂N
= ; Equation is exact
∂y ∂x

Let U (x, y) = C be the solution. Then

(yex − e−y )dx + (xe−y + ex )dy = du

4 Chisara P. Ogbogbo
Integrating (M ) w.r.t x, we have
Z
(yex − e−y ) dx + f (y) = yex − e−y x + f (y) (10)

Integrating (N ) w.r.t y, we have


Z
(xe−y + ex ) dy + g(x) = −xe−y + yex + g(x) (11)

Comparing Equations10 and 11, we have


U (x, y) = yex − xe−y = C when x = 0 ; y = 4

y(1) − 0 = C
4=C
∴ U = yex − xe−y = 4
Example 3

Solve the exact D.E.


(y 2 − 2x)dx + (2xy + 1)dy = 0

M = y 2 − 2x
N = 2xy + 1
∂M ∂N
= 2y and = 2y
∂y ∂x
∂M ∂N
Since ∂y = ∂x , the D.E. is exact. We assume the solution to be U (x, y) = C

Z Z
M dx = (y 2 − 2x) dx = y 2 x − x2
Z Z
N dy = (2xy + 1) dy = xy 2 + y

∴ U = xy 2 − x2 + y = C
Example 4

Solve the D.E


x(1 − siny)dy = (cosx − cosy − y)dx
We rearrange to put the eqn in standard form
−(cosx − cosy − y)dx + x(1 − siny)dy = 0
(y + cosy − cosx)dx + (x − xsiny)dy = 0
M dx + N dy = 0
∂M ∂N
= 1 − siny = 1 − siny
∂y ∂x
∴ the D.E is exact
To construct the function U (x, y) such that Ux = M and Uy = N , we first integrate M w.r.t x and integrate N
w.r.t y
Z Z
M (x, y) dx = (y + cosy − cosx) dx = xy + xcosy − sinx (12)
Z Z
N (x, y) dy = (x − xsiny) dx = xy + xcosy (13)

5 Chisara P. Ogbogbo
Writing all terms that appear in both 12 and 13 without repeating terms, we have

U (x, y) = xy + xcosy − sinx = C


∴ General Solution is: xy + xcosy − sinx = C

Example 5

Solve the IVP

(3x2 y − 1)dx + (x3 + 6y − y 2 )dy = 0


y(0) = 3

Solution

M (x, y) = 3x2 y − 1
N (x, y) = x3 + 6y − y 2

To test for exactness, we obtain


∂M ∂N
= 3x2 = 3x2
∂y ∂x
∴ The D.E. is exact
Next, assume U (x, y)R= C to be the
R solution.
Then, we integrate : M dx and N dy
Z
(3x2 y − 1) dx = x3 y − x
Z
1
(x3 + 6y − y 2 ) dy = x3 y + 3y 2 − y 3
3
1
U (x, y) = x3 y − x + 3y 2 − y 3 = C
3
General Solution is
1
x3 y − x + 3y 2 − y 3 = C
3
Employing the IVP we can obtain C
Using y(0) = 3 ; y = 3 when x = 0
1
3(32 ) − 33 = C
3
1
27 − (27) = 27 − 9 = C
3
C = 18

∴ The solution of the IVP is


1
x3 y − x + 3y 2 − y 3 = 18
3

Non Exact Differential Equations and Integrating Factor


When a D.E isR not exact: Recall integrating factor and how it was used for linear D.E.s. We had y ′ + P (x)y =
Q(x). IF = e P (x)dx
Here, we define an integrating factor as a function that we use to multiply a D.E. to make it exact.The idea of

6 Chisara P. Ogbogbo
IF works sometimes for a non exact D.E. to make it exact and then solve it the usual way.
Let µ(x, y) be that IF when obtained is used to multiply the D.E. Then

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

becomes exact.
Recall criteria for exactness ∂M ∂N
∂y = ∂x
The differential equation 14 will be exact if

(µM )y = (µN )x (15)

i.e. differentiate coefficients of dx (first component) w.r.t y and coefficient of dy (second component) w.r.t x
By the product rule, equation 15 gives

µMy + µy M = µNx + µx N i.e. rearranging we have


µx N − µy M = µMy − µNx

µx N − µy M = (My − Nx )µ (16)
M, N, My and Nx are all functions of x and y. In that case, we need to solve a P.D.E to obtain µ. In order to
circumvent this, we do the following:
We suppose µ is a function of one variable.i.e. µ depends on x alone or µ depends on y alone.

Case where µ depends on x alone

Then µx = dµ
dx and µy = 0
Then equation 16 becomes
dµ M y − Nx
= µ (17)
dx N
If
M y − Nx
N
still depends on both x and y, then we have not resolved the issue. However, if we make all necessary algebraic
simplifications and
M y − Nx
N
now depends on x alone, then equation 17 is a first order D.E. which is linear.

My − Nx
Let = P (x)
N
Then µ′ − P (x)µ = Q(x)

Then R My −Nx
dx
IF = µ(x) = e N

Similarly from Equation 16 if µ depends only on y, then µx = 0 and


dµ Nx − M y
= µ (λ)
dy M
If
Nx − M y
M

7 Chisara P. Ogbogbo
is a function of only y, then equation λ can be solved for µ. We can have the IF as follows:
R Nx −My
dy
e M

Example 1

Consider the (non-linear) D.E. which is not exact

xydx + (2x2 + 3y 2 − 20)dy = 0


M = xy N = 2x2 + 3y 2 − 20
∂M
=x = My Nx = 4x
∂y
M y − Nx x − 4x
= 2 This is still a function of x and y
N 2x + 3y 2 − 20
We consider
Nx − M y 4x − x 3x 3
= = =
M xy xy y
This is a function of y alone hence IF is now
3 3
R
e y dy = e3lny = elny = y 3

Multiplying through by y 3 we have

xy 4 dx + (2x2 y 3 + 3y 5 − 20y 3 )dy = 0

By obtaining My and Nx for exactness of this new equation

My = 4xy 3 Nx = 4xy 3
∴ DE is now exact
We now solve as follows:
Z Z
Obtain M dx and N dy Merge to obtain U = C
Z
1
xy 4 dx = x2 y 4
2
x2 y 4 y6
Z
(2x2 y 3 + 3y 5 − 20y 3 )dy = + − 5y 4
2 2
1 1
∴ U = x2 y 4 + y 6 − 5y 4 = C
2 2

is the solution of the D.E.(by merging the two expressions without repeating terms)

Example 2

8 Chisara P. Ogbogbo
Consider the D.E

(3xy − y 2 )dx + x(x − y)dy = 0


Checking for exactness: M = 3xy − y 2
N = x(x − y) = x2 − xy
∂M
= My = 3x − 2y
∂y
∂N
= Nx = 2x − y
∂x
∴ DE is not exact

Check for the IF , check


M y − Nx
N
and
Nx − M y
M
(for the one that yields a function of one variable alone)
M y − Nx 3x − 2y − 2x + y x−y
= 2
= 2
N x − xy x − xy

x−y 1
=
x(x − y) x

1
R
∴ IF = µ = e x dx = elnx = x

Both sides of the DE are multiplied by x to obtain

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


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

Thus DE is now exact since My = 3x2 − 2xy and Nx = 3x2 − 2xy


R R
Solving this exact DE, we integrate M w.r.t x and N w.r.t y i.e. M dx and N dy

M = 3x2 y − xy 2 N = x3 − x2 y

3x3 x2
Z
1
(3x2 y − xy 2 )dx = y − y 2 = x3 y − x2 y 2
3 2 2
x2 y 2
Z
(x3 − x2 y)dy = x3 y −
2
Merging the two expressions without repeating terms, we have:
1
U = x3 y − x2 y 2 = C
2

Example 3
Students to try in class

Solve the DE

9 Chisara P. Ogbogbo
(x + y)sinydx + (xsiny + cosy)dy = 0
This DE is not exact since
My = (x + y)cosy + siny and Nx = siny
Notice that  
Nx − M y M y − Nx
=
M −M

And
M y − Nx
−M
is given as
(x + y)cosy cosy
=−
−(x + y)siny siny
cosy
− siny is used to obtain the IF
R cosy −1
− siny
IF = e dy
= e−ln(siny) = eln(siny) = (siny)−1

Multiplying through by (siny)−1 we have


   
siny xsiny + cosy
(x + y) dx + dy
siny siny
 
cosy
(x + y)dx + x + dy
siny
My = 1 Nx = 1
The DE is now exact

Z
1
(x + y)dx = x2 + xy
2
Z  
cosy
and x+ dy = xy + ln|siny|
siny
1
∴ U = x2 + xy + ln|siny| = C
2
Example 4

Solve the initial value problem


(3ex y + x)dx + ex dy = 0 y(0) = 1
My = 3ex Nx = e x
∴ DE is not exact
But
My − Nx 3ex − ex
= =2
N ex
R
2dx
For the IF we have e = e2x

10 Chisara P. Ogbogbo
We multiply both sides of the DE by e2x to obtain

(3e3x y + xe2x )dx + (e3x )dy


This is now exact
My = 3e3x Nx = 3e3x
Z Z
We now obtain M dx and N dy
Z Z Z
(3e3x y + xe2x )dx = 3e3x ydx + xe2x dx
1 1
= e3x y + xe2x − e2x
Z 2 4
and e3x dy = e3x y
Z
3e3x ydx = e3x y
Z
1 2x 1 2x
xe2x dx = xe − e
2 4
∴ Solution is
1 1
e3x y + xe2x − e2x = C
2 4
∴ the solution is now given as
1 1 3
e3x y + xe2x − e2x =
2 4 4
To obtain C, we use y(0) = 1

1 1
e0 (1) + (0)e0 − e0 = C
2 4
1
1− =C
4
3
C=
4

Students to try

Given that the non-exact DE


(5xy 2 − 2y)dx + (3x2 y − x)dy = 0
has an IF in the form µ(x, y) = xa y b for some positive integers a and b, find the general solution of the equation.

11 Chisara P. Ogbogbo

You might also like