Вы находитесь на странице: 1из 8

MATH168 - DIFFERENTIAL EQUATIONS I

1
solutions to first order odes - exact differential equations 1
This is the first part of lecture four
- A series of lecture notes primarily
Lecturer: Dr. Peter Amoako-Yirenkyi taken from the text book (Elementary
differential Equation and boundary
Recommended Textbook:Elementary differential Equation2 value problems by Boyce and Diprima.
After going through this lecture notes,
The laws of the universe are written largely in the language of math-
you should be able to:
ematics. Algebra is sufficient to solve many static problems, but the
• You should be able to understand
most interesting naturally phenomena involve change and are best de-
the principle behind Exactness of
scribed by equations that relate changing quantities. Many important differential Equations
and significant problems in engineering, the physical sciences, and the
• Find the solution to exact differen-
social sciences such as economics and business when formulated in tial equations
mathematical terms require the determination of a function satisfying
• Solve non-exact differential equa-
an equation containing the derivatives of unknown function. Such tions using method of integrating
equations are called differential equation. factors
2
W.W. Boyce & R.C. DiPrima. Elemen-
tary Differential Equations and Boundary
Exact Differential Equation Value Problems. John Wiley & Sons,
Inc., tenth edition, March 2012. ISBN
Through out the previous weeks we have been discussing first order 978-0-470-45832-7
differential equations and a number of methods that are applicable to various classes of problems. The
most important of these had been separable differential equations and linear coefficients of the differential
form of some differential equations(both homogeneous and non-homogeneous). Although these methods
can solve a number of differential equations, first order equations that can be solved by these methods are
rather special since most first order differential equations cannot be solved in this way. The next class of
equations we need to consider are known as exact differential equations which employs the idea of total
differential.
Given a function f ( x, y), its total differential, d f , is defined as:
∂f ∂f
df = dx + dy (1)
∂x ∂y
This shows that the family of curves (or general solution) f ( x, y) = c
satisfies the differential equation

df =0 (2)
∂f ∂f
=⇒ dx + dy =0 (3)
∂x ∂y
So if there exists a function f ( x, y) such that:
∂f
M( x, y) = and (4)
∂x
∂f
N ( x, y) = (5)
∂y
then M( x, y)dx + N ( x, y)dy is called an exact differential3 , and the 3
In order to establish that a differential
equation: equation is exact, recall that in partial
derivatives if f ( x, y) has continuous
M( x, y)dx + N ( x, y)dy = 0 (6) second order partial derivatives, then:

is said to be an exact equation, whose solution is the family of func- ∂2 f ∂2 f


=
tions f ( x, y) = c . ∂x∂y ∂y∂x
(that is, the order of differentiation does
∂f ∂f
not matter). So if ∂x = M and ∂y = N
∂2 f ∂2 f
then: ∂M ∂N
∂y = ∂x (which is ∂x∂y = ∂y∂x )
Not only is this condition necessary for
exactness, it also determines exactness.
math168 - solutions to odes - exact differential equations and integration factors 2

Example 1. Solve the following differential equation:

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

Solution
With ( M ( x, y) = 1 − 2xy) and N ( x, y) = 4y3 − x2 , we notice that:
∂y = −2x = ∂x So the given functions M ( x, y ) and N ( x, y ) passed
∂M ∂N

the test for exactness 4 . All that is left to do is to find the function 4

∂f ∂f
f ( x, y) such that: ∂x = M and ∂y = N. The way to accomplish this Example 2. Solve the differential equation
is to integrate M with respect to x, integrate N with respect to y, and
dy
then merge the results: (3x2 + 2xy) + ( x + y2 ) =0
dx
Solution
Z Z Here Mx = 2x, Nx = 1, the given
M( x, y)dx = (1 − 2xy)dx = x − x2 y + h(y) (10) equation is not exact. To see that it
Z Z cannot be solved by the procedure
above, let us suppose that there is a
M( x, y)dx = (4y3 − x2 )dy = y4 − x2 y + g( x ) (11)
function f ( x, y) such that:
f x = 3x2 + 2xy, f y = x + y2 (7)
These calculations imply that a function f ( x, y) which satisfies both:
Integrating the first of (7) gives:
∂f ∂f
= M = 1 − 2xy and = N = 4y3 − x2 is f ( x, y) = x2 y + y4 f ( x, y) = x3 + x2 y + ψ(y) (8)
∂x ∂y
where ψ(y) is an arbitrary function of y
Therefore, the exact equation we were given is satisfied by the family only. To try to satisfy the second of (7)
we compute f y from (8), obtaining:
of curves: x − x2 y + y4 = c

fy = x2 + = x + y2 or
Example 3. Solve the differential equation (y cos x + 2xey ) + (sin x + dy
dy
x2 ey + 2) dx = 0 dψ
= x + y2 − x 2 (9)
dy
Solution Since the right-hand side of (9) depends
M (( x, y) = y cos x + 2xey ), N ( x, y) = sin x + x2 ey + 2 on x as well as y, it is impossible to
∂M y ∂N y solve (9) for ψ(y). Thus there is no
∂y = cos x + 2xe , ∂x = cos x + 2xe Therefore, the differential f ( x, y) satisfying both of (7). So in the
∂f ∂f next section we will try to find a factor
equation is exact. We know that ∂x = M( x, y); ∂y = N ( x, y). Thus
to make the equation exact and have a
there is an f ( x, y) such that function satisfying both (7) - the factor
is called integrating factor.
∂f ∂f
= y cos x + 2xey and = sin x + x2 ey + 2 (12)
∂x ∂x
dy = (y cos x + 2xey )dx,
5 Integrating the first of these equations:
R R
5
Note that either of equations (10)
keeping y constant gives: having h(y) as a function of y alone or
(11) with g( x ) as a function of x alone
may be chosen conveniently
f ( x, y) = y sin x + x2 ey + ψ(y) (13)

and hence differentiating the new function w.r.t y keeping x constant:


∂f 2 y dψ 2 y
∂y = sin x + x e dy = sin x + x e + 2 i.e. the differential is equal to
dψ R R
the second equation in (12). Thus dy = 2 =⇒ dψ = 2dy and
ψ = 2y the constant of integration can be omitted; we do not require
the most general one. Substituting for ψ(y) in (13) gives f ( x, y) =
y sin x + x2 ey + 2y. Before f ( x.y) = c, constant. Hence c = y sin x +
x2 ey + 2y
math168 - solutions to odes - exact differential equations and integration factors 3

Using Integrating factors for Non-Exact Equations

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

is not exact, sometimes we can turn it into 6 an exact differential


equation by multiplying the whole equation by an appropriate factor,
called an integrating factor, let say µ = µ( x, y), which is a function of
x, y . For which we obtain: 6
Remark: Finding the integrating
factor for a given equation can be very
µM( x, y)dx + µN ( x, y)dy = 0 (15) difficult. Some of the important rules
and procedures follow.

and expect it to be exact. Then for (15) to be exact then: Theorem 1. 1. Assume µ = µ( x ) =⇒
∂µ
∂y = µy = 0, then: µ x =
∂(µM ) ∂(µN ) dµ M −N
= yN x , which is a function of
= dx
∂y ∂x x alone, call
R
this function ξ ( x ). Then
µ( x ) = e ξ ( x)dx is an integrating factor
Applying product rule we get: of (14)
∂µ
2. Assume µ = µ(y) =⇒ =
∂M ∂µ ∂N ∂µ ∂x
My − Nx
µ +M =µ +N 0, then: µy =

dy= −M , which is
∂y ∂y ∂x ∂x
a function of y alone, call
R
this function
ψ(y). Then µ(y) = e ψ(y)dy is an
∂µ ∂µ integrating factor of (14)
=⇒ M −N = µ (∂N∂x − ∂M∂y) (16)
∂y ∂x 3. If ∂x + ∂y 6 = 0, then: µ ( x, y ) =
∂M ∂N

1
Simply put Mµy − Nµ x = µ( Nx − My ), µ( My − Nx ) ∂M + ∂N , is the integrating factor of (14)
∂x ∂y

Sometimes an integrating factor may be found by inspection, after 4. If M ( x, y)dx + N ( x, y)dy = 0 can
be written in the form yg( x, y)dx +
grouping the terms in the equation, and recognizing a certain group xh( x, y)dy = 0 where h( x, y) 6=
as being a part of an exact differential. 7 The following tabulates g( x, y), then µ( x, y) = xM−1
yN
possible terms and their respective Integrating factors and the exact
7
The following observations are often
equations they produce: helpful in finding integrating factors:
1. If a first-order differential equation
contains the combination xdy +
Group of Terms Integrating factor Exact differential d f ( x, y) ydy = 21 d( x2 + y2 ) try some function
xdy−ydx x2 + y2 as a multiplier.
− x12 = d yx 

ydx − xdy x2 2. If a first-order differential equation
ydx − xdy
ydx − xdy 1
y2 y2
= d yx contains the combination xdy +
xdy−ydx ydx = d( xy), try some function xy as
1
= d ln yx

ydx − xdy − xy xy a multiplier.
xdy−ydx
− x2 +1 y2 = d arctan yx

ydx − xdy x 2 + y2
3. If a first-order differential equation
1 ydx + xdy contains the combination xdy − ydx,
ydx + xdy xy xy = d (ln( xy)) try x12 or y12 as a multiplier. If
h i
1 ydx + xdy −1 1
ydx + xdy ( xy)n
, n>1 ( xy)n
= d neither of these works, try xy or
h (n−1)( xy)n−1 i 1
or some function of these
1 ydy+ xdx
ydx + xdy x 2 + y2 x 2 + y2
= d 21 ln( x2 + y2 ) x 2 + y2
h i expressions, as an integrating factor,
1 ydy+ xdx −1 remember that d tan−1 x =
y
ydx + xdy ( x 2 + y2 ) n
, n> 1 ( x 2 + y2 ) n
= d 2(n−1)( x2 +y2 )n−1 xdy−ydx y xdy−ydx
− − and tan−1 x = x2 +y2
aydx + bxdy a
x y 1 1 b x a−1 yb−1 ( aydx + bxdy) = d( x a yb ) xy

NOTE: If a non-exact equation has a solution, then an integrating


factor is guaranteed to exist, but that does not mean it is easy to find.
math168 - solutions to odes - exact differential equations and integration factors 4

Example 4. Solve the differential equation 8 8

dy Example 5. Solve (y2 − y)dx + xdy = 0


(3xy + y2 ) + ( x2 + xy) =0
dx Solution
Solution
M ( x, y) = 3xy + y2 , N ( x, y) = x2 + xy M ( x, y) = y2 − y, N ( x, y) = x

My = 3x + 2y and Nx = 2x + y Clearly, ∂M ∂y 6 = ∂x , therefore the


∂N My = 2y − 1, Nx = 1
differential equation is not exact. Involve (16): Mµy − Nµ x = µ( Nx − Hence the differential equal is not
exact and no integrating factor is
My ). Let µ be a function of x alone, that is, µ = µ( x ). Applying 1 immediately apparent. Note, however,
that if terms are strategically regrouped,
My − Nx 3x + 2y − (2x + y) 1 the differential equation can be written
ξ (x) = = =
N x2 + xy x as:
−(ydx − xdy) + ydx (17)
1 dx
R R
ξ ( x )dx
µ( x ) = e =e x = eln x = x The group of terms in parenthesis
has many integrating factors in table
. Multiplying µ( x ) = x through the differential equation we obtain: (above). Trying each integrating factor
separately, we find that the only one
dy that makes the entire equating exact is:
(3x2 y + xy2 ) + ( x3 + x2 y) =0
dx 1
µ( x, y) = ,
y2
which is a new equation in same form i.e.: M ( x, y) + N ( x, y)y0 = 0
Using this integrating factor we can
2 2 3 2 rewrite (17) as:
M ( x, y) = (3x y + xy ); N ( x, y) = ( x + x y)
ydx − xdy
− + 1dx = 0 (18)
2
My = 3x + 2xy; Nx = 3x + 2xy 2 y2
Since (18) is exact, it can now be solved.
which is exact. Let f x = 3x2 y + xy2 . Integrating: Alternatively, we note from table(above)
that (18) can be rewritten as −d( x/y) +
1
Z 
f ( x, y) = (3x2 y + xy2 )dx = x3 y + x2 y2 + ψ(y) 1dx = 0 or as d yx = 1dx. Integrating,
2 we obtain the solution:
x x
Find the derivative w.r.t y and equating with N ( x, y) we obtain = x + c or y =
y x+c

=⇒ f y = x3 + x2 yψ0 (y) = x3 + x2 y

ψ0 (y) = 0 =⇒ ψ(y) = c.
Finally x3 y + 12 x2 y2 = c

Linear Equations and those Reducible to the form

A first-order linear equation is defined as a differential of the form:

A( x )y0 + B( x )y = C ( x ) (19)

where A( x ) 6= 0 such that the derivative of the dependent variable


exist otherwise it is not a differential equation. Then (16) in the stan-
dard form is written as

y0 + p( x )y = q( x ) (20)

B( x ) C(x)
p( x ) = and q( x ) =
A( x ) A( x )
math168 - solutions to odes - exact differential equations and integration factors 5

To divide by A( x ) would violate the fundamental principles of math-


ematics, if A( x ) = 0, which prohibits division by zero. We recognize
(20) as an inexact differential equation which requires an integrating
dµ( x )
factor µ( x ), that is: dy = 0 Multiplying through (20) by µ( x ) to
obtain the following:

µ( x )y0 ( x ) + µ[ p( x )y( x ) − q( x )] = 0 (21)

M( x, y) = µ( x )[ p( x )y − q( x )] and N ( x, y) = µ( x )
∂M ∂N
If (21) is exact, then ∂y = ∂x . Then,

∂ ∂ dµ( x )
[µpy − µq] = µ( x ) =
∂y ∂x dx


=⇒ µp = (22)
dx
Separating variables:


Z Z Z
= pdx =⇒ ln µ = pdx
µ

R
pdx
µ=e (23)
Without loss of operation, the constant of integration
R
of (23) is unity.
Consider (20) and multiply through by: µ( x ) = e pdx , then we have
the exact equation 9 : 9
The differential equation which has
q( x ) = 0 is called Homogeneous
µy0 + µpy = µq differential equation. The other term on
the R.H.S of the solution is dependent
0 0
= µq by (22) that is µp = µ0 on q( x ), that µ−1 µqdx is called the
R
µy + µ y
particular integral and it satisfies
d (with the complementary function)
(µp) = µp
dx the differential equation: y0 + p( x )y =
q( x ), called the Non-Homogeneous
Integrating both sides: differential equation. Notice that the
Z particular integral contains no constant.
µp = µqdx + c
Z
=⇒ y = µ−1 µqdx + µ−1 c
R Z R R
=⇒ y = e− p( x )dx
e p( x )dx
q( x )dx + ce− p( x )dx
(24)

The solution is in
R
two parts in the R.H.S.
The term ce− p( x)dx = µ−1 , which is called the complementary
function is the solution of the reduced equation: y0 + p( x )y = 0
obtained by setting

q( x ) = 0 in equation (20)

Let’s work a couple of examples.


math168 - solutions to odes - exact differential equations and integration factors 6

dy 3y
Example 6. Find the solution 10 of dx = 5x − x such that y(1) = 2 10

Solution
ALGORITHM
First, we rearrange the equation to put it in the standard form (20)
The solution process for a first order
of a linear equation:
differential equation is as follows:
dy 3
+ y = 5x 1. Put the differential equation in the
dx x correct initial form (20)
Multiply both sides of this by the integrating factor: 2. Find the integrating factor, µ( x )
using (23)
( 3x )dx
R R
p( x )dx
µ( x ) = e =e = e3 log x = x3 3. Multiply everything in the differen-
dy tial equation by µ( x ) and verify that
To give the equivalent equation; + 3x2 y = 5x4 . Notice that the
x3 dx the left side becomes the product
d 3
left hand side of dx ( x y), so by integrating both sides, we get: rule (µy)0 and write it as such.
Z 4. Integrate both sides; make sure you
x3 y = (5x4 )dx = x5 + c =⇒ y = x5 + cx −3 properly deal with the constant of
integration
5. Solve for the solution y
Now, to satisfy the initial condition, y(1) = 2, the value of c must be
1. Therefore, the solution to the IVP is: y = x5 + x −3

Example 7. Solve the differential equation xy0 + 2y = 4x2

Solution

2
y0 + y = 4x (25)
x
2 dx
R
Integrating factor, µ( x ) = e x = e2 ln x = x2 . Multiply (25) through
by x2 :
Z
x2 y0 + 2xy = 4x3 =⇒ ( x2 y)0 = 4x3 =⇒ x2 y = 4x3 dx = x4 + c

Equations Reducible to Linear Form

Other first order equations in first degree which are not linear may
be reduced 11 to the linear form by means of appropriate transfor- 11

mations. No general rule can be stated; in each instance, the proper Example 8. Solve the differential equation
transformation is suggested by the form of the equation. Examples (3x − 4y3 )y0 + y = 0
of such equations are Bernoulli’s equation, Ricatti’s equation and the Solution
one considered below. Consider Clearly the coefficient of y0 is linear in
x and further more x appears nowhere
{ xs(y) + t(y)}y0 = µ(y) (26) again. Therefore we multiply through
by dx
dy to obtain:

in which the coefficient of y0 is a linear function of x and No other dx dx


(3x − 4y3 ) + y = 0 =⇒ y + 3x = 4y3
x appears anywhere again. Thus (26) can be expressed as a linear dy dy
differential equation with x as the dependent variable and y the Whose standard form is: dx
dy + 3y x = 4y2
independent variable. To be able to do this, multiply (26) through by Integrating factor: µ(y) = e y =
3
R dy

dx dx dx
dy to obtain: µ ( y ) dy = xs ( y ) + t ( y ) or µ ( y ) dy − s ( y ) x = t ( y ) Thus this
3
eln y = y3 =⇒ y3 dx 2
dy + 3y x = 4y
5

is a linear differential equation of x as a function of the independent Z Z


d( xy3 ) = 4y5 =⇒ xy3 = (4/6)y6 + c
variable y.
=⇒ 3xy3 = 2y6 + c
math168 - solutions to odes - exact differential equations and integration factors 7

BERNOULLI’S EQUATION

A Bernoulli equation12 is a first order differential of the form: 12

Example 9. Solve the differential equation


y0 + p( x )y = q( x )yn (28) dy
x2 y − x3 dx = y4 cos x

in which n is any real number. You would notice that the equation Solution
differs from a standardized first order linear differential equation in Write it in the form y0 + p( x )y =
q( x )yn that is:
first degree at the right side of the equation. Here there is a multipli-
y cos x
cation of yn , n 6= 0, n 6= 1, at the right hand side (RHS) Then divide y0 − = − 3 y4 (27)
x x
(28) through by yn and substitute z = y1−n . y −3
Divide through by y3 : y−4 y0 − x =
− cos x
, Let z = y−3 and z0 = −3y−4 y0 ,
y 0 y − n + p ( x ) y 1− n = q ( x ) x3
which is linear first order in first degree
0 3 dx
R R
p( x )dx
Let z = y1−n =⇒ z0 = (1 − n)y−n y0 =⇒ 1− z n 0 =⇒ µ( x ) = e =e x = e3 ln x = x3
n =y y
0
The equation becomes: z + (1 − n) p( x )z = (1 − n)q( x ) The Therefore, z · x3 = 3 cos x 3
R
x dx =
x3
3
R
solution is obtained using first order linear equation in first degree 3 cos xdx =⇒ zx = sin x + c
x3
But z = y−3 =⇒ = 3 sin x + c
solution techniques. y3
x3
Hence, y3 = 3 sin x +c

RICCATI’S EQUATION

The equation13 13

dy
= P ( x ) + Q ( x ) y + R ( x ) y2 (29) Example 10. Solve the equation dx =
dy
dx −2 − y + y2 where y1 = 2 is a particular
is non-linear and needs a particular solution before one can have the solution
chance to solve it. Consider the new function z defined by: z = y−1y , Solution
1
where y1 is the particular solution. Then easy calculations give: First we verify that y1 = 2 is a
solution, otherwise our calculation is
1 1
dz fruitless. Let z = y− 2 =⇒ y = 2 + z
= −[ Q( x ) + 2y1 R( x )]z − R( x ) (30)
dx z0
y0 = −
z2
which is a linear equation satisfied by new function z. Once it is
Hence, from the equation satisfied by y,
solved, we go back to via the relation: y = y1 1z . we get
Note: If one remembers the equation satisfied by z, then the linear
z0 1 2
   
1
equation satisfied by the function z is − 2 = −2 − 2 + + 2+
z z z

dz z0 3 1
= −[ Q( x ) + 2y1 R( x )]z − R( x ) = −(1 + 4)z − 1 = −3z − 1 =⇒ − = + 2
dz z2 z z
Hence z0 = −3z − 1. This is a linear
, since P( x ) = −2, Q( x ) = −1 and R( x ) = 1 equation. The general solution is given
by:
dy 2 cos2 x −sin2 x +y2
Exercise 1. 1. Verify that y1 = sin x is a solution to dx = 2 cos x

1

1
z = e−3x − e3x + c = − + ce−3x
and solve the differential equation using the initial condition y(0) = −1 3 3
1
Therefore, we have y = 2 +
2. Solve − 13 +ce−3x

(a) y0 = (1 − x )y2 + (2x − 1)y − x: given solution y = 1


(b) y0 = −y2 + xy + 1; given solution y = x
(c) y0 = −8xy2 + 4x (4x + 1)y − (8x3 + 4x2 − 1); given solution y = x
math168 - solutions to odes - exact differential equations and integration factors 8

References

W.W. Boyce & R.C. DiPrima. Elementary Differential Equations and


Boundary Value Problems. John Wiley & Sons, Inc., tenth edition,
March 2012. ISBN 978-0-470-45832-7.

Вам также может понравиться