Chapter 1 Chapter 1 First-Order Differential First-Order Differential Equations Equations Shurong Sun University of Jinan Semester 1, 2010-2011
Chapter 1Chapter 1 First-Order Differential Equations First-Order Differential Equations
Shurong SunUniversity of Jinan
Semester 1, 2010-2011
1.2
2 5 4 0x x for the unknown variable x.
In this course one of our tasks will be to solve differential equations such as 2 0y y y
for the unknown function y=y(t).
Analogous to a course in algebra and trigonometry, where a good amount of time is spent solving equations such as
1.3
1.1 Separable Differential 1.1 Separable Differential EquationsEquations
• Many first order differential equations can be written as:
dxxfdyyg
xfdxdyygxfyyg
)()(
)()( or )()( '
cdxxfdyyg )()(
•We can solve these equations by integrating:
1.4
Separable Differential EquationSeparable Differential Equation
( ) ( )dyf x g y
dx
Set 1( )( )
h yg y
and multiply by dx to obtain
( ) ( ) .h y dy f x dx
( ) ( ) .h y dy f x dx c Integrating, we have
A first order differential equation of the formis called a separable differential equation.
( ) 0.g y I.
1.5
II. 0( ) 0,g then 0( )y x
is one solution to the equation ( ) ( ).dyf x g y
dx
1.6
Example Solve the equation .dy xdx y
Solution: Separate variables and rewrite the equation in the form
.ydy xdx
Integrating, we have ydy xdx or2 2
, ( 0).2 2y x
C C
Solving for y , we obtain the solution in explicit form as 2
1 .y C x
Separable Equation ExampleSeparable Equation Example
This is a separable equation.This is a separable equation.
1.7
Separable Equation ExampleSeparable Equation Example• Solve the differential equation:
' 21 y y
21dy
dxy
arctan tan( )y x c or y x c
21dyy
dx
Solution: We first rewrite the DE in fractional form
Separate variables and rewrite the equation in the form
Integrating, we get
1.8
Example Solve the IVP 1 , ( 1) 0.3
dy yy
dx x
Solution: Separate variables and rewrite the equation
in the form .1 3
dy dxy x
Integrating, we have 1 1
1 3dy dx
y x
or
ln | 1 | ln | 3 | .y x C
Solving for y , we obtain the solution in explicit form as
1 11 ( 3) 1 ( 3), 0.C Cy e x or y C x where C e
1.9
Note that y=1 is also a solution to the equation.
So the general solution to the equation is
1 ( 3),y K x where K is an arbitrary constant.
Applying the initial condition directly, we have 0 1 2K or 1 .
2K
Thus 1 11 ( 3) ( 1).2 2
y x x
1.10
Example Solve the equation56 2 1 .
cos y
dy x xdx y e
Solution: Separate variables and rewrite the equation
in the form
Integrating, we have
or
5(cos ) (6 2 1) .yy e dy x x dx
5(cos ) (6 2 1) ,yy e dy x x dx 6 2sin .yy e x x C
1.11
Example- Newton ’ s Law of CoolingExample- Newton ’ s Law of Cooling
A copper sphere is heated to o100 .cthen placed in water that is maintained at
At time t=0 it iso30 .c
Derive an equation for the temperature T of the ball as a function of time t.
After 3 minutes the sphere ’ s temperature is o70 .c
•Newton ’ s law of cooling implies:
)30( TkdtdT
1.12
Example- Newton ’ s Law of Example- Newton ’ s Law of CoolingCooling
• Step 1 - Separate variables
dtkT
dT
30
30)(
|30|ln
ktcetT
cktT
• Step 2 - Integrate
1.13
Example- Newton ’ s Law of Example- Newton ’ s Law of CoolingCooling
• Step 3 - Determine a particular solution
3070)(
10030)0(
kt
kt
etT
ceT
1865.070
3070ln31
703070)3( 3
k
eT k
•Step 4 - Determine k
1.15
1.2 Reduction to Separable Form1.2 Reduction to Separable Form
• Sometimes first order differential equations can be made separable by a simple change of variable. Consider equations of the form:
( , )dyf x y
dx
dy yg
dx x
(1) Homogeneous Equation
is homogeneous iff ( , ) ( , ).f tx ty f x y
Remark:
1.16
• Writing the differential equation in terms of u gives:
xyu
dy duy xu u x
dx dx
•This suggests we set:
( ) ( )dy dug u u x g u
dx dx
( )dux g u u
dx
1.17
• Separating variables gives:
xdx
uugdu
)(
( )dux g u u
dx
1.18
Example: Solve 2 2 2( ) 0.xy y x dx x dy
Solution: We express (6) in the derivative form
(6)
2 22
2 ( ) 1,dy xy y x y ydx x x x
then we see that the equation (6) is homogeneous.
Now let yu
x and recall that .dy du
u xdx dx
With these substitution, equation (6) becomes 2 1.du
x udx
1.19
The above equation is separable, and , on separating the
variables and integrating, we obtain
2
1 1 , arctan ln | | .1
dv dx u x Cu x
Hence, tan(ln | | ).u x C
Finally, we substitute for and solve for
to get tan(ln | | ).
yu y
xy x x C
Also note that x=0 is a solution.
1.20
(2) Equations of the Form ( )dyG ax by
dx
Set .z ax by Then the equation is transformedinto a separable one.
Example: Solve 11 ( 2) .dyy x x y
dx
Solution: .z x y Set
Then 1 ,dz dydx dx and so 1 .dy dz
dx dx
(8)
1.21
Substituting into (8) yields 1
21
1 1 ( 2) ,
( 2) 12 ( 2) .2
dzz z or
dxdz z
z zdx z
Solving this separable equation, we obtain
2
2 ,( 2) 1
zdz dx
z
21 ln | ( 2) 1 | ,
2z x C
from which it follows that 2 2( 2) 1.xz Ce
Finally, replacing z by x-y yields2 2( 2) 1.xx y Ce
1.22
1 1 1
2 2 2
a x b y cdy fdx a x b y c
where the ,i i ia s b s and c s are constants.
I. 1 1
2 2
0.a ba b
In this case, the equations can be reduced tothe form ( )dy
G ax bydx
(3)
1.23
1 1
2 2
0.a ba b
II.
Then the system of equations 1 1 1
2 2 2
00
a x b y ca x b y c
has a unique solution 0 0( , ).x y
The above DE can be written in the form
1 0 1 0
2 0 2 0
( ) ( )( ) ( )
a x x b y ydy fdx a x x b x x
1.24
which yields the DE
1 1
2 2
a u b vdy fdx a u b v
after the translation of axes of the form
0 0, .u x x v y y
Homogenous Equation
1.25
Example: Solve
( 3 6) ( 2) 0.x y dx x y dy
Solution: 3 14 0.
1 1
1, 3.u x v y
From 3 6 02 0
x yx y
we obtain 0 01, 3.x y
Hence, we let
1.26
The differential equation for v is
( 3 ) ( ) 0,u v du u v dv
or33 .1
vdv u v u
vdu u vu
The above equation is homogenous, so we let .vz
u
Then 3 ,1
dz zz u
du z
or
23 2 .1
dz z zu
du z
1.27
Separating variables gives
2
1 1 ,2 3
zdz du
z z u
21 ln | 2 3 | ln | | ,2
z z u C
from which it follows that 2 22 3 .z z Cu When we substitute back in for z, u, and v, we find
2 2 2 2( ) 2 3 , 2 3 ,v vcu v uv u C
u u
2 2( 3) 2( 1)( 3) 3( 1)y x y x C
1.28
1.2 Linear First-Order DE
(1) Definition Linear Equation
1 0( ) ( ) ( )dya x a x y h x
dx
A first-order differential equation of the form
is said to be linear equation.When ( ) 0,h x the linear equation is said
to be homogeneous;
(1)
or inhomogenous.
otherwise, it is non-homogenous
1.29
(2) Standard Form
( ) ( ).dyP x y q x
dx
By dividing both sides of (1) by the lead coefficient
1( ),a x we obtain a more useful form, the standform, of a linear equation:
We seek a solution of (2) on an interval I for which
(2)
both function P and f are continuous.
(3) Variation of parameters
1 0( ) ( ) ( )dya x a x y h x
dx
1.30
I. The Homogeneous Equation ( ) 0.dyP x y
dx
This is a separable equation.
(3)
Writing (3) as ( ) 0dyP x dx
y and integrating .
Solving for y gives ( ) .P x dx
y Ce
II. The Nonhomogeneous Equation ( ) ( ).dyP x y q x
dx (2)
Method of variation of constants
1.31
II. The Nonhomogeneous Equation
( ) ( ).dyP x y q x
dx (2)
Method of variation of constantsThe basic idea is the constant C in the general solution of the homogeneous equation (3) is replaced by a function C(x). The calculation of an appropriate choice of C(x) gives a solution of the nonhomogeneous equation (2) .
( )( ) P x dxy C x e
Substituting into (2) gives ( ) ( )( ( ) ( ) ( )) ( ) ( ) ( )P x dx P x dx
C x C x P x e P x C x e q x
1.32
so ( )( ) ( )P x dx
C x e q x
Hence
( )or ( ) ( )P x dxC x e q x
( )( ) ( ) ,
P x dxC x e q x C
Thus if (2) has a solution, it must be of form (4).
and ( ) ( ) ( )
( ) ( )
( )
( ( ) ).
P x dx P x dx P x dx
P x dx P x dx
y Ce e e q x dx
e e q x dx C
(4)
that is a general solution of equation (2).
Conversely, it is easy to verify that (4) constitutes one-parameter family of solutions of equation (2),
1.33
Example Finding the general solution to
The associated homogeneous equation is
1( 1) ( 1) .x ndyx ny e x
dx
Solution:We write the differential equation in standard form
( 1) .1
x ndy ny e x
dx x
0.1
dy ny
dx x
Separating variable, we find
1.34
substituting
0,1
dy ndx
y x
( 1) .ny C x So the general solution to the homogeneous equation is
By the method of variation of parameter,
( )( 1)ny C x x into the equation gives1( ) ( 1) ( 1) ( ) ( )( 1) ( 1) .
1n n n x ndc x n
x n x c x c x x e xdx x
So ( ) ,xdc x edx
1( ) .xc x e c
Thus the general solution to 1( 1) ( 1) .x ndyx ny e x
dx
1.35
is 1( 1) ( ).n xy x e c
1.41
Bernoulli Equations ( ) ndy P x y Q x ydx
Remark: when n=0,1, equation (9) is also a
(9)
linear equation.For 1,n dividing equation (9) by ny
yields 1( ) ( ).n ndyy P x y Q x
dx
Taking 1 ,nv y we find via the chain rule that
(10)
(1 ) ,ndv dyn y
dx dx
1.42
(1 ) ,ndv dyn y
dx dx
and so equation (10) becomes
1 ( ) ( ).1
dvP x v Q x
n dx
Linear
equation
Example : Solve 355 .2
dyy xy
dx
Solution: This is a Bernoulli equation with n=3, 5( ) 5, ( ) .
2x
P x and Q x
(11)
1( ) ( ).n ndyy P x y Q x
dx
1.43
We make the substitution 2 .v y
Since 32 ,dv dyy
dx dx the transformed equation is
1 55 ,2 2
dvv x
dx 10 5 .dv
v xdx
This is a linear equation, its solution is 10 10 10 10
10
( 5 ) ( 5 )
1 .2 20
dx dx x x
x
v e xe C e xe dx C
xCe
1.44
Substituting 2v y give the solution
2 101 .2 20
xxy Ce
0y Not included in the last equation is the solution
that was lost in the process of dividing
(11) by 3 .y
10 10 10 10
10
( 5 ) ( 5 )
1 .2 20
dx dx x x
x
v e xe C e xe dx C
xCe
1.3 Exact Differential Equations 1.3 Exact Differential Equations and Integrating factorsand Integrating factors
1.46
Exact Differential EquationsExact Differential Equations
• Recall that the total or exact differential of a function u(x,y) is:
dyyudx
xudu
0),(),( dyyxNdxyxM
• We will use the concept of exactness to study differential equations of the form:
1.47
1 2( , ) ( ),u x y C R
( , )du x y Mdx Ndy
(exact differential)u udx dy du
x y
• Compare the following
We say an ODE is exact if there exists a function
( , ) and ( , ) .u uM x y N x y
x y
Note this means that we can now write our ODE as:
That is
such that
( , ) ( , ) 0 (ODE)M x y dx N x y dy
1.48
In this case, its solution (in implicit form) is given by
( , )u x y C
NyuandM
xu
Remember we need:
Note this means that we can now write our ODE as:
( , ) 0du x y
1.49
Testing for ExactnessTesting for Exactness
• In practice we often don ’ t know about u, only about M and N and it is hard to check that
NyuandM
xu
• We want a technique of testing for exactness based on knowing M and N, not u
1.50
• Let ’ s check the derivatives of M and N:
yxu
yu
xxNand
xyu
xu
yyM
22
xN
yM
• A necessary and sufficient condition for exactness is:
If M(x,y) and N(x,y) are continuous functions and have continuous first partial derivatives on some simply connected region of xy-plane, then
1.51
Solving Exact EquationsSolving Exact Equations• Once we have checked the equation is exact
it can be readily solved by evaluating either:
( ) from uu Mdx g y M
x
( )=N from u uMdx g y N
y y y
1.52
( )=M from u uNdy h x M
x x x
or ( ) from uu Ndy h x N
y
1.53
Exact Equations: ExampleExact Equations: Example2 2(2 sec ) ( 2 ) 0.xy x dx x y dy
2 2( , ) 2 sec ( , ) 2 .Here M x y xy x and N x y x y
Since 2 ,M Nx
y x
Example Solve Solution
the equation given is exact.
From 22 sec ,uxy x
x
we have that2 2( , ) (2 sec ) ( ) tan ( ).u x y xy x dx g y x y x g y
1.54
Next we take the partial derivative of u with respectto y and substitute 2 2x y for N:
2 2( ) 2 .x g y x y 2Thus ( ) 2 , and ( ) .g y y g y y
Here we drop the constant of integration that technically should be present in g(y) since it will just get absorbed into the constant we pick up in the next step.
2 2( , ) tanu x y x y x y Hence So, the implicit solution to the differential equation is
2 2tan .x y x y C
1.55
Exact Equations: ExampleExact Equations: Example
3 2 2 33 3M x xy and N x y y
6 6 ( )M Nxy and xy exact
y x
3 2 2 3( 3 ) (3 ) 0x xy dx x y y dy
2 3
2 2 4
( ) (3 ) ( )
3 1 ( )2 4
u Ndy h x x y y dy h x
x y y h x
1.56
Exact Equations: ExampleExact Equations: Example• Solve for k(x) and then u:
2 3 23 3u dkM xy x xy
x dx
4
4 2 2 4
41 ( 6 )4
xh c
u x x y y c
1.57
Example Find the solution for the following IVP.
Solution
Let ’ s identify M and N and check that it ’ s exact.
So, it ’ s exact.
3 3 3 2 33 1 (2 3 ) 0.xy xy xyy e ye xy e y
3 3 2 3 3 3
3 2 3 2 3 3 3
3 1, 9 9
2 3 , 9 9
xy xy xyy
xy xy xy xyx
M y e M y e xy e
N ye xy e N y e xy e
(0) 1.y
1.58
With the proper simplification integrating the second one isn ’ t too bad. However, the first is already set up for easy integration so let ’ s do that one.
Differentiate with respect to y and compare to N.
So, we get
Recall that actually h(y) = k, but we drop the k because it will get absorbed in the next step. That gives us h(y) = 0.
3 3( , ) (3 1) ( )xyu x y y e dx h y 2 3 ( )xyy e x h y
3 2 3( , ) 2 3 ( )xy xyyu x y ye xy e h y N
3 2 32 3xy xyN ye xy e ( ) 0 ( ) 0h y h y
1.59
Therefore, we get
The implicit solution is then
Applying the initial condition gives 1 = CThe implicit solution is then
2 3( , ) .xyu x y y e x
2 3 xyy e x C
2 3 1.xyy e x
1.60
Remember Exact EquationsRemember Exact Equations
• Alternate method: we can often rearrange linear first order ODEs into the form:
( , ) ( , )
0
u uM x y dx N x y dy dx dy
x ydu
xN
yM
(Necessary and sufficient)
• We can check whether an equation in this form is exact by checking if
1.61
3 2 2 3( 3 ) (3 ) 0x xy dx x y y dy
Solve the following DE
Solution: Here 3 2 2 33 3M x xy and N x y y
6 6M Nxy and xy
y x
it ’ s exact.
We first check to see if we have an exact equation.
Since
1.62
3 2 2 3( 3 ) (3 )x xy dx x y y dy Note that
So the general solution is
4 2 2 41 ( 6 )4
x x y y C
3 2 2 3(3 3 )x dx xy dx x y dy y dy 3 2 2 2 2 33 3( )
2 2x dx y dx x dy y dy
4 2 2 41 3 1( )4 2 4
d x x y y
1.63
2 21 ( )2
xdx ydy d x y )( 22
22yxd
yx
ydyxdx
(xy)dxy
ydxxdy ln
)(2 xyd
xydxxdy
)](ln[xyd
xyydxxdy
)](tan[ 1
22 xyd
yxydxxdy
( )xdy ydx d xy ( )dx dy d x y
1.66
Example. Solve the homogeneous DE
Solution: This equation can be written in the form
( ) ( ) 0.y x dx x y dy which is an exact equation.In this case, the solution in implicit form is
i.e. ,
2 21 1 .2 2
xy x y C
2 22 .xy x y C
dy x ydx x y
1.67
Integrating FactorsIntegrating Factors• If the equation is not exact we can consider
( , ) ( , ) 0 ( , )
0
M x y dx N x y dyx y
Mdx Ndy
( , ) 0x y
such that the new equation is exact:multiplying it by a function
1.68
Finding Integrating FactorsFinding Integrating Factors• For exactness we require:
( )N MM N
y x x y
( ) ( ) M Ny x
M NM N
y y x x
This equation can be simplified in special cases, two.of which we treat next
1.69
where M Ny x
N
is just a function of x.
Let 1 ( ) M N
xN y x
d M NN
dx y x
( )x • If we choose
M N
d y xdx N
( )N MM N
y x x y
1.70
Now solve forNow solve for
1 ( )d x dx
1 ( )d x dx
1 1 1 ( )d M N dx
dx N y x dx
( )ln ( ) x dxx dx e
1.71
Conversely, ifM Ny x
N
is just a function of x.
Then
Let 1 ( ) M Nx
N y x
( )x dxe
is an integrating factor for Equation.
1.72
In a similar fashion, if equation has an integrating
M Ny x
M
is just a function of y.
Conversely, ifM Ny x
M
is just a function of y.
Let ( ) .
M Ny xy
M
( )y dye
is an integrating factor for Equation.
Then
factor that depends only y, then
1.73
Integrating Factors: ExampleIntegrating Factors: Example
2 22 , ,M x y N x y x
1 2 1 .M Nxy
y x
2 2(2 ) ( ) 0x y dx x y x dy Example: Solve
Solution:
The equation is not exact. We compute
2
1 (2 1) 2(1 ) 2 .(1 )
M Nxy xyy x
N x y x x xy x
1.74
So an integrating factor for the equation is given by 2
2 .dx
xe x
When we multiplying by2 ,x
we get the exact equation2 1(2 ) ( ) 0.yx dx y x dy
Solving this equation, we obtain the implicit
solution 212 .
2y
x yx C
1.75
Hence, 2
122y
x yx C and 0x are solutions to the given equation.
Note that the solution x=0 is lost in multiplying by
2 .x
1.76
Linear Differential EquationsLinear Differential Equations
• Recall a differential equation is linear if it can be written:
• If q(x)=0 the equation is homogeneous, otherwise the equation is nonhomogeneous.
' ( ) ( )y p x y q x
1.77
Homogeneous Linear CaseHomogeneous Linear Case
• Separating variables and integrating:
dxxp
cexy
cdxxpy
dxxpy
dyyxpy
)()(
~)(||ln
)(
0)('
1.78
Nonhomogeneous Linear CaseNonhomogeneous Linear Case
• Nonhomogeneous linear equations can be solved using the integrating factor method. First rewrite the differential equation as:
( ) 0py q dx dy , 1M py q N i.e.
1.79
Finding the integrating factorFinding the integrating factor• To find the integrating factor we first compute
1 ( ) (1)1
py qy x
1 ( , 1)M NM py q N
N y x
, where is a function of p p x
1.80
Nonhomogeneous Linear CaseNonhomogeneous Linear Case
• We can now find an integrating factor
( ) pdxx e
'
( ' )pdx pdx pdxe y py e y e q
• Now multiply the differential equation by the integrating factor:
1.81
Nonhomogeneous Linear Nonhomogeneous Linear CaseCase
pdx pdxe y e q dx c
( )pdx pdxy e e qdx c
( ) (Integrate both sides w.r.t. )pdx pdxe y e q x
1or ,
where ( ) .
( )( ( ) )pdx
y x x qdx c
x e
1.82
Integrating Factors: ExampleIntegrating Factors: Example
, 2 ,yM y N x ye
1 2 .M Ny x
(2 ) 0yydx x ye dy Example: Solve
Solution:
The equation is not exact. We compute
1 2 1 .
M Ny x
M y y
Here
1.83
So an integrating factor for is given by 1
.dy
ye y
When we multiplying by ,y we get the exact equation
Solving this equation, we obtain
2 2(2 ) 0yy dx xy y e dy
as the solution in implicit form.
2 2( 2 2) yxy y y e C
1.84
In general, integrating factors are difficult to uncover. If a differential equation does not have one of the forms given above, then a search for an integrating factor likely will not be successful, and other methods of solution are recommended.
1.85
Example : Solve 21 ( ) ( 0).dy x x
ydx y y
This differential equation is not exact, and no integrating factor is immediately apparent.
Note however, that if terms are strategically regrouped, the DE can be rewritten as
Solution: Rewriting this equation in differential form, we have 2 2( ) 0.x x y dx ydy
2 2( ) 0.xdx ydy x y dx
1.86
2 2( ) 0.xdx ydy x y dx
The first group of terms has many integrating factors (see Table 2). One of these factors, namely
2 2
1( , ) ,x yx y
is an integrating factor for the entire equation.
Multiplying (1) by
(1)
2 2
1( , ) ,x yx y
we find2 2
( ) 0.xdx ydydx
x y
(2)
1.87
Since (2) is exact, it can be solved using the steps described previously.
Alternatively, we note from Table 1,
2 2
2 2
( )xdx ydyd x y
x y
so that (2) can be rewrite as
2 2 0.d x y dx
Integrating both sides of this last equation, we find
1.88
2 2 .x y x c
or equivalently,
2 ( 2 ).y c c x
1.89
Solve ( ) 0.ydx y x dy
Solution: Here ,M y N y x
and, since 1, 1,M Ny x
The differential equation is not exact.
Since 2M Ny x
M y
is a function of y alone.
we have an integrating factor
1.90
2
2
1( , ) .yx y ey
Multiplying the given DE by 2
1( , ) ,x yy
we obtain the exact equation
2
1 ( ) 0,y xdx dy
y y
or equivalently, 2
1 0,ydx xdydy
y y
1.91
Integrating both sides of this last equation, we find
ln | | .xy c
y
(ii) Note that the differential equation can be rewritten as
( ) 0.ydx xdy ydy
The first group of terms has many integrating factors (see Table 1). One of these factors, namely
1.92
2
1( , ) ,x yy
is an integrating factor for the entire equation.
Multiplying (1) by
we find2
( ) 1 0.ydx xdydy
y y
2
1( , ) ,x yy
Integrating both sides of this last equation, we find
ln | | .xy c
y
1.93
Now let yv
x and recall that .dy dv
v xdx dx
With these substitution, equation (3) becomes
2
11
dv v v dxx v or x dv
dx v v x
(iii) Rewriting this equation in the derivative form,
.dy ydx x y
then we see that the equation (3) is homogeneous.
(3)
1.94
The above equation is separable, and , by separating the
variables and integrating, we obtain
1 ln | | ln | | .v x Cv
,
ln | | 0
yFinally we substitute for v to get
xx
y Cy
1.95
(iv) We rewrite the differential equation in the form
1,dx x y dx xor
dy y dy y
which is linear equation.Its solution is
1 1
( ) (ln | | ).dy dy
y yx e e dy c y y c
Also note that x=0 is a solution.
1.96
Table 1
1.97
Table 2
1.98
1.99
Exercise Solve 2( ) (1 ) 0.x y dx y x dy
1.100
1.101
1.102
1.103
1.104